Skip to content

Commit

Permalink
Merge branch '10.0' into 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Nov 19, 2015
2 parents af71da5 + 2553f14 commit beded7d
Show file tree
Hide file tree
Showing 186 changed files with 2,825 additions and 963 deletions.
2 changes: 1 addition & 1 deletion client/mysql.cc
Expand Up @@ -1106,7 +1106,7 @@ inline int get_command_index(char cmd_char)
All client-specific commands are in the first part of commands array
and have a function to implement it.
*/
for (uint i= 0; *commands[i].func; i++)
for (uint i= 0; commands[i].func; i++)
if (commands[i].cmd_char == cmd_char)
return i;
return -1;
Expand Down
1 change: 1 addition & 0 deletions client/mysql_upgrade.c
Expand Up @@ -879,6 +879,7 @@ static const char *expected_errors[]=
"ERROR 1060", /* Duplicate column name */
"ERROR 1061", /* Duplicate key name */
"ERROR 1054", /* Unknown column */
"ERROR 1290", /* RR_OPTION_PREVENTS_STATEMENT */
0
};

Expand Down
2 changes: 1 addition & 1 deletion client/mysqltest.cc
Expand Up @@ -5101,7 +5101,7 @@ static st_error global_error_names[] =
#include <my_base.h>
static st_error handler_error_names[] =
{
{ "<No error>", -1U, "" },
{ "<No error>", UINT_MAX, "" },
#include <handler_ername.h>
{ 0, 0, 0 }
};
Expand Down
11 changes: 7 additions & 4 deletions cmake/os/Windows.cmake
Expand Up @@ -95,8 +95,11 @@ IF(MSVC)
STRING(REGEX REPLACE "/STACK:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS}")
STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
STRING(REGEX REPLACE "/INCREMENTAL$" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_DEBUG "${CMAKE_${type}_LINKER_FLAGS_DEBUG}")
STRING(REGEX REPLACE "/INCREMENTAL$" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_DEBUG "${CMAKE_${type}_LINKER_FLAGS_DEBUG}")
SET(CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO} /OPT:REF /release")
ENDFOREACH()


# Mark 32 bit executables large address aware so they can
# use > 2GB address space
Expand All @@ -112,7 +115,7 @@ IF(MSVC)

#TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /we4099")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /we4099")

IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
# _WIN64 is defined by the compiler itself.
Expand Down Expand Up @@ -180,14 +183,14 @@ CHECK_SYMBOL_REPLACEMENT(S_IROTH _S_IREAD sys/stat.h)
CHECK_SYMBOL_REPLACEMENT(S_IFIFO _S_IFIFO sys/stat.h)
CHECK_SYMBOL_REPLACEMENT(SIGQUIT SIGTERM signal.h)
CHECK_SYMBOL_REPLACEMENT(SIGPIPE SIGINT signal.h)
CHECK_SYMBOL_REPLACEMENT(isnan _isnan float.h)
CHECK_SYMBOL_REPLACEMENT(finite _finite float.h)
CHECK_SYMBOL_REPLACEMENT(isnan _isnan "math.h;float.h")
CHECK_SYMBOL_REPLACEMENT(finite _finite "math;float.h")
CHECK_FUNCTION_REPLACEMENT(popen _popen)
CHECK_FUNCTION_REPLACEMENT(pclose _pclose)
CHECK_FUNCTION_REPLACEMENT(access _access)
CHECK_FUNCTION_REPLACEMENT(strcasecmp _stricmp)
CHECK_FUNCTION_REPLACEMENT(strncasecmp _strnicmp)
CHECK_FUNCTION_REPLACEMENT(snprintf _snprintf)
CHECK_SYMBOL_REPLACEMENT(snprintf _snprintf stdio.h)
CHECK_FUNCTION_REPLACEMENT(strtok_r strtok_s)
CHECK_FUNCTION_REPLACEMENT(strtoll _strtoi64)
CHECK_FUNCTION_REPLACEMENT(strtoull _strtoui64)
Expand Down
4 changes: 0 additions & 4 deletions cmake/os/WindowsCache.cmake
Expand Up @@ -102,7 +102,6 @@ SET(HAVE_IPPROTO_IPV6 CACHE INTERNAL "")
SET(HAVE_IPV6 TRUE CACHE INTERNAL "")
SET(HAVE_IPV6_V6ONLY 1 CACHE INTERNAL "")
SET(HAVE_ISINF CACHE INTERNAL "")
SET(HAVE_ISNAN CACHE INTERNAL "")
SET(HAVE_ISSETUGID CACHE INTERNAL "")
SET(HAVE_GETUID CACHE INTERNAL "")
SET(HAVE_GETEUID CACHE INTERNAL "")
Expand Down Expand Up @@ -232,7 +231,6 @@ SET(HAVE_SIZEOF_ULONG FALSE CACHE INTERNAL "")
SET(HAVE_SIZEOF_U_INT32_T FALSE CACHE INTERNAL "")
SET(HAVE_SIZE_OF_SSIZE_T FALSE CACHE INTERNAL "")
SET(HAVE_SLEEP CACHE INTERNAL "")
SET(HAVE_SNPRINTF CACHE INTERNAL "")
SET(HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 CACHE INTERNAL "")
SET(HAVE_SOLARIS_STYLE_GETHOST CACHE INTERNAL "")
SET(STACK_DIRECTION -1 CACHE INTERNAL "")
Expand Down Expand Up @@ -326,10 +324,8 @@ SET(WORDS_BIGENDIAN CACHE INTERNAL "")
SET(HAVE__S_IFIFO 1 CACHE INTERNAL "")
SET(HAVE__S_IREAD 1 CACHE INTERNAL "")
SET(HAVE__finite 1 CACHE INTERNAL "")
SET(HAVE__isnan 1 CACHE INTERNAL "")
SET(HAVE__pclose 1 CACHE INTERNAL "")
SET(HAVE__popen 1 CACHE INTERNAL "")
SET(HAVE__snprintf 1 CACHE INTERNAL "")
SET(HAVE__stricmp 1 CACHE INTERNAL "")
SET(HAVE__strnicmp 1 CACHE INTERNAL "")
SET(HAVE__strtoi64 1 CACHE INTERNAL "")
Expand Down
9 changes: 8 additions & 1 deletion config.h.cmake
Expand Up @@ -325,6 +325,8 @@
#cmakedefine HAVE_TIMESPEC_TS_SEC 1
#cmakedefine STRUCT_DIRENT_HAS_D_INO 1
#cmakedefine STRUCT_DIRENT_HAS_D_NAMLEN 1
#cmakedefine STRUCT_TIMESPEC_HAS_TV_SEC 1
#cmakedefine STRUCT_TIMESPEC_HAS_TV_NSEC 1
#cmakedefine SPRINTF_RETURNS_INT 1

#define USE_MB 1
Expand Down Expand Up @@ -496,6 +498,7 @@

#define SYSTEM_TYPE "@SYSTEM_TYPE@"
#define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@"
#define DEFAULT_MACHINE "@DEFAULT_MACHINE@"
#cmakedefine HAVE_DTRACE 1

#cmakedefine SIGNAL_WITH_VIO_CLOSE 1
Expand All @@ -521,6 +524,10 @@
#cmakedefine strtoll @strtoll@
#cmakedefine strtoull @strtoull@
#cmakedefine vsnprintf @vsnprintf@
#if (_MSC_VER > 1800)
#define tzname _tzname
#define P_tmpdir "C:\\TEMP"
#endif
#if (_MSC_VER > 1310)
# define HAVE_SETENV
#define setenv(a,b,c) _putenv_s(a,b)
Expand All @@ -529,7 +536,7 @@

/* We don't want the min/max macros */
#ifdef __WIN__
#define NOMINMAX
#define NOMINMAX 1
#endif

/*
Expand Down
3 changes: 3 additions & 0 deletions configure.cmake
Expand Up @@ -1067,6 +1067,9 @@ CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D
SET(SPRINTF_RETURNS_INT 1)
CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H)

CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_sec "time.h" STRUCT_TIMESPEC_HAS_TV_SEC)
CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_nsec "time.h" STRUCT_TIMESPEC_HAS_TV_NSEC)

IF(NOT MSVC)
CHECK_C_SOURCE_RUNS(
"
Expand Down
8 changes: 8 additions & 0 deletions include/decimal.h
Expand Up @@ -16,6 +16,10 @@
#ifndef _decimal_h
#define _decimal_h

#ifdef __cplusplus
extern "C" {
#endif

typedef enum
{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
decimal_round_mode;
Expand Down Expand Up @@ -112,5 +116,9 @@ void max_decimal(int precision, int frac, decimal_t *to);
#define E_DEC_ERROR 31
#define E_DEC_FATAL_ERROR 30

#ifdef __cplusplus
}
#endif

#endif

2 changes: 2 additions & 0 deletions include/my_pthread.h
Expand Up @@ -86,10 +86,12 @@ typedef volatile LONG my_pthread_once_t;
#define MY_PTHREAD_ONCE_INPROGRESS 1
#define MY_PTHREAD_ONCE_DONE 2

#if !STRUCT_TIMESPEC_HAS_TV_SEC || !STRUCT_TIMESPEC_HAS_TV_NSEC
struct timespec {
time_t tv_sec;
long tv_nsec;
};
#endif

int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
Expand Down
2 changes: 1 addition & 1 deletion libmysql/errmsg.c
Expand Up @@ -90,7 +90,7 @@ const char *client_errors[]=
""
};

const char** get_client_errmsgs()
const char** get_client_errmsgs(void)
{
return client_errors;
}
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/extra/binlog_tests/database.test
Expand Up @@ -52,7 +52,7 @@ eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix';

# Use '/' instead of '\' in the error message. On windows platform, dir is
# formed with '\'.
--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/
--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ /17/39/ /File exists/Directory not empty/
--error 1010
DROP DATABASE testing_1;
let $wait_binlog_event= DROP TABLE IF EXIST;
Expand Down
4 changes: 3 additions & 1 deletion mysql-test/include/default_mysqld.cnf
Expand Up @@ -33,7 +33,6 @@ debug-no-sync

# Retry bind as this may fail on busy server
port-open-timeout=10
bind-address=127.0.0.1

log-bin-trust-function-creators=1
key_buffer_size= 1M
Expand All @@ -42,6 +41,9 @@ max_heap_table_size= 1M
loose-aria-pagecache-buffer-size=8M

loose-feedback-user-info= mysql-test
loose-feedback-debug-startup-interval=20
loose-feedback-debug-first-interval=60
loose-feedback-debug-interval=60

loose-innodb_data_file_path= ibdata1:12M:autoextend
loose-innodb_buffer_pool_size= 8M
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/include/show_binlog_events2.inc
Expand Up @@ -10,7 +10,8 @@ if ($binlog_file)
{
--let $_in_binlog_file=in '$binlog_file'
}
--replace_result $_binlog_start <binlog_start> $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--let $_from_binlog_start=from $_binlog_start
--replace_result "$_from_binlog_start" "from <binlog_start>" $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_column 2 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/
--eval show binlog events $_in_binlog_file from $_binlog_start
8 changes: 8 additions & 0 deletions mysql-test/lib/My/ConfigFactory.pm
Expand Up @@ -169,6 +169,13 @@ sub fix_log {
return "$dir/mysqld.log";
}

sub fix_bind_address {
if (IS_WINDOWS) {
return "*";
} else {
return "127.0.0.1";
}
}
sub fix_log_slow_queries {
my ($self, $config, $group_name, $group)= @_;
my $dir= dirname($group->value('datadir'));
Expand Down Expand Up @@ -251,6 +258,7 @@ my @mysqld_rules=
{ 'ssl-ca' => \&fix_ssl_ca },
{ 'ssl-cert' => \&fix_ssl_server_cert },
{ 'ssl-key' => \&fix_ssl_server_key },
{ 'bind-address' => \&fix_bind_address },
);

if (IS_WINDOWS)
Expand Down
12 changes: 9 additions & 3 deletions mysql-test/r/alter_table.result
Expand Up @@ -2021,6 +2021,15 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `idx` (`i`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (
`event_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`market_id` bigint(20) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`event_id`,`market_id`)
);
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
Warnings:
Note 1061 Multiple primary key defined
DROP TABLE t1;
#
# MDEV-7374 : Losing connection to MySQL while running ALTER TABLE
#
Expand All @@ -2045,6 +2054,3 @@ t1 CREATE TABLE `t1` (
KEY `i1` (`a`) COMMENT 'comment2'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# Start of 10.1 tests
#
15 changes: 15 additions & 0 deletions mysql-test/r/dyncol.result
Expand Up @@ -1805,5 +1805,20 @@ set impressions = column_add(impressions,
);
drop table t1;
#
# MDEV-8565: COLUMN_CHECK fails on valid data
#
SELECT COLUMN_CHECK(COLUMN_CREATE('a',0,'b','1'));
COLUMN_CHECK(COLUMN_CREATE('a',0,'b','1'))
1
SELECT COLUMN_CHECK(COLUMN_CREATE('a',1,'b','1'));
COLUMN_CHECK(COLUMN_CREATE('a',1,'b','1'))
1
SELECT COLUMN_JSON(COLUMN_CREATE('a',0,'b','1'));
COLUMN_JSON(COLUMN_CREATE('a',0,'b','1'))
{"a":0,"b":"1"}
SELECT COLUMN_JSON(COLUMN_CREATE('a',1,'b','1'));
COLUMN_JSON(COLUMN_CREATE('a',1,'b','1'))
{"a":1,"b":"1"}
#
# end of 10.0 tests
#
24 changes: 20 additions & 4 deletions mysql-test/r/events_restart.result
Expand Up @@ -18,7 +18,7 @@ change column body body longtext character set utf8 collate utf8_bin;
use events_test;
select @@event_scheduler;
@@event_scheduler
DISABLED
OFF
show events;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
select event_name from information_schema.events;
Expand All @@ -40,12 +40,12 @@ ERROR HY000: Cannot proceed because system tables used by Event Scheduler were f
drop event intact_check;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
set global event_scheduler=on;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
set global event_scheduler=off;
ERROR HY000: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
ERROR HY000: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
show variables like 'event_scheduler';
Variable_name Value
event_scheduler DISABLED
event_scheduler OFF
Make sure that we still can create and drop databases,
and no warnings are produced.
drop database if exists mysqltest_database_not_exists;
Expand All @@ -58,6 +58,22 @@ Error 1545 Failed to open mysql.event
Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
check that we can now enable events without restart
set global event_scheduler=original;
Warnings:
Note 1408 Event Scheduler: Loaded 3 events
select @@global.event_scheduler;
@@global.event_scheduler
ON
set global event_scheduler=on;
select @@global.event_scheduler;
@@global.event_scheduler
ON
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test abc1 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
events_test abc2 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
events_test abc3 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
Now let's restart the server again
use events_test;
select @@event_scheduler;
Expand Down
8 changes: 8 additions & 0 deletions mysql-test/r/init_file_set_password-7656.result
@@ -0,0 +1,8 @@
create user foo@localhost;
select user,host,password from mysql.user where user='foo';
user host password
foo localhost
select user,host,password from mysql.user where user='foo';
user host password
foo localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
drop user foo@localhost;
5 changes: 5 additions & 0 deletions mysql-test/r/lowercase_fs_off.result
Expand Up @@ -65,4 +65,9 @@ CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1;
RENAME TABLE t1 TO T1;
ALTER TABLE T1 RENAME t1;
DROP TABLE t1;
create table t1 (a int);
create trigger t1_bi before insert on t1 for each row set new.a= 1;
show triggers like '%T1%';
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
drop table t1;
set GLOBAL sql_mode=default;
1 change: 1 addition & 0 deletions mysql-test/r/mysql_upgrade-6984.result
Expand Up @@ -57,3 +57,4 @@ Phase 6/6: Running 'FLUSH PRIVILEGES'
OK
update mysql.user set password='' where user='root';
flush privileges;
set global event_scheduler=OFF;
34 changes: 34 additions & 0 deletions mysql-test/r/partition_innodb.result
Expand Up @@ -767,3 +767,37 @@ f1 f2 f3 f4 f5 f6
INSERT INTO t3 SELECT * FROM t2 WHERE f3 = 'm' AND f2 ='c';
DROP TABLE t1,t2,t3;
set global default_storage_engine=default;
#
# Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT
# Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE
#
CREATE TABLE t1
(a INT,
b INT,
PRIMARY KEY (a))
ENGINE = InnoDB
PARTITION BY HASH (a) PARTITIONS 3;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
# con1
ALTER TABLE t1 ADD INDEX idx1 (b);
# con default
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
DROP TABLE t1;
# Same test without partitioning
CREATE TABLE t1
(a INT,
b INT,
PRIMARY KEY (a))
ENGINE = InnoDB;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
# con1
ALTER TABLE t1 ADD INDEX idx1 (b);
# con default
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
DROP TABLE t1;

0 comments on commit beded7d

Please sign in to comment.