summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2017-01-13 13:53:59 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2017-01-13 13:53:59 -0500
commitee8b5c305a2334d06fe999b2db441d0436f9f423 (patch)
treefb613fed64234c3e211d2ae01272e1f31ca19138 /mysql-test/suite
parent11544334a277508fb984c0a5bba8faa6b97a2762 (diff)
parent4f5338467807f099b67f07d0bfb415358222a2b1 (diff)
downloadmariadb-git-ee8b5c305a2334d06fe999b2db441d0436f9f423.tar.gz
Merge tag 'mariadb-10.0.29' into 10.0-galera
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/archive/discover.result7
-rw-r--r--mysql-test/suite/archive/discover.test10
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result6
-rw-r--r--mysql-test/suite/binlog/t/binlog_index.test6
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_decimal.result1
-rw-r--r--mysql-test/suite/funcs_2/t/innodb_charset.test1
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug51378.result2
-rw-r--r--mysql-test/suite/innodb/r/table_index_statistics.result48
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test4
-rw-r--r--mysql-test/suite/innodb/t/table_index_statistics.test8
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_misc.result2
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result10
-rw-r--r--mysql-test/suite/maria/icp.result4
-rw-r--r--mysql-test/suite/maria/maria.result6
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result8
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.result16
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.test12
-rw-r--r--mysql-test/suite/roles/role_case_sensitive-10744.result58
-rw-r--r--mysql-test/suite/roles/role_case_sensitive-10744.test54
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_errors.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev10863.result39
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result37
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_special_charset.result2
-rw-r--r--mysql-test/suite/rpl/r/sec_behind_master-5114.result3
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev10863.test104
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test120
-rw-r--r--mysql-test/suite/rpl/t/rpl_special_charset.test2
-rw-r--r--mysql-test/suite/rpl/t/sec_behind_master-5114.test42
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_do_db_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_do_table_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_ignore_db_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_wild_do_table_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_do_db_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_do_table_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_ignore_db_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_wild_do_table_basic.test3
-rw-r--r--mysql-test/suite/sys_vars/t/replicate_wild_ignore_table_basic.test3
45 files changed, 518 insertions, 157 deletions
diff --git a/mysql-test/suite/archive/discover.result b/mysql-test/suite/archive/discover.result
index e1ca9cb6a65..0619ca2051a 100644
--- a/mysql-test/suite/archive/discover.result
+++ b/mysql-test/suite/archive/discover.result
@@ -139,3 +139,10 @@ flush tables;
create table t1 (a int) engine=archive;
ERROR 42S01: Table 't1' already exists
drop table t1;
+CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
+CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
+SELECT * FROM t1;
+pk
+DROP TABLE t1;
diff --git a/mysql-test/suite/archive/discover.test b/mysql-test/suite/archive/discover.test
index 20cb69efa00..4ab35cf1115 100644
--- a/mysql-test/suite/archive/discover.test
+++ b/mysql-test/suite/archive/discover.test
@@ -132,3 +132,13 @@ flush tables;
create table t1 (a int) engine=archive;
drop table t1;
+#
+# MDEV-11317: Error in deleting non existing .frm for tables with disocvery
+#
+
+CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
+CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
+DROP TABLE t1;
+CREATE OR REPLACE TABLE t1 ( pk INT AUTO_INCREMENT PRIMARY KEY ) ENGINE = ARCHIVE;
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index 8cdca861737..bb5d9ff74f1 100644
--- a/mysql-test/suite/binlog/r/binlog_index.result
+++ b/mysql-test/suite/binlog/r/binlog_index.result
@@ -1,9 +1,9 @@
call mtr.add_suppression('Attempting backtrace');
-call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
-call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
+call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
call mtr.add_suppression('Could not open .*');
-call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
RESET MASTER;
flush logs;
diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test
index a264549ce17..09e817c0469 100644
--- a/mysql-test/suite/binlog/t/binlog_index.test
+++ b/mysql-test/suite/binlog/t/binlog_index.test
@@ -9,11 +9,11 @@ source include/have_debug.inc;
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
call mtr.add_suppression('Attempting backtrace');
-call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
-call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
+call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
call mtr.add_suppression('Could not open .*');
-call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
+call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
let $old=`select @@debug`;
diff --git a/mysql-test/suite/engines/iuds/r/insert_decimal.result b/mysql-test/suite/engines/iuds/r/insert_decimal.result
index 50fde80d81d..eab8592c4ee 100644
--- a/mysql-test/suite/engines/iuds/r/insert_decimal.result
+++ b/mysql-test/suite/engines/iuds/r/insert_decimal.result
@@ -48,7 +48,6 @@ Warning 1264 Out of range value for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
insert into t2 values ("0.0","0.0","0.0",7),("-0.0","-0.0","-0.0",8),("+0.0","+0.0","+0.0",9),("01.0","01.0","01.0",10),("+01.0","+01.0","+01.0",11),("-01.0","-01.0","-01.0",12);
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
Warning 1264 Out of range value for column 'c2' at row 6
insert into t2 values ("-.1","-.1","-.1",13),("+.1","+.1","+.1",14),(".1",".1",".1",15);
Warnings:
diff --git a/mysql-test/suite/funcs_2/t/innodb_charset.test b/mysql-test/suite/funcs_2/t/innodb_charset.test
index b77bacfc01c..da4dea44ad7 100644
--- a/mysql-test/suite/funcs_2/t/innodb_charset.test
+++ b/mysql-test/suite/funcs_2/t/innodb_charset.test
@@ -6,6 +6,7 @@
# Checking of other prerequisites is in charset_master.test #
################################################################################
+--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc
let $engine_type= InnoDB;
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index 996bc45f7e2..3d5a0f840c1 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -64,7 +64,7 @@ alter table t1 add unique index (c), add index (d);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
-Note 1831 Duplicate index 'd' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `d`. This is deprecated and will be disallowed in a future release.
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result
index 0e863f5849e..3ce55ef0409 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug-zip.result
@@ -1,3 +1,6 @@
+call mtr.add_suppression("InnoDB: Page for tablespace .* ");
+call mtr.add_suppression("InnoSB: Warning: database page corruption or a failed .*");
+FLUSH TABLES;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index f8020e080e6..cded1f98fb3 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -405,7 +405,7 @@ drop table t1;
CREATE TABLE t1 (a int not null, b int not null,c int not null,
key(a),primary key(a,b), unique(c),key(a),unique(b));
Warnings:
-Note 1831 Duplicate index 'a_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release.
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 a A # NULL NULL BTREE
@@ -1445,7 +1445,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
create index id2 on t2 (id);
Warnings:
-Note 1831 Duplicate index 'id2' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `id2`. This is deprecated and will be disallowed in a future release.
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -1851,7 +1851,7 @@ alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 'v_2'
alter table t1 add key(v);
Warnings:
-Note 1831 Duplicate index 'v_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `v_2`. This is deprecated and will be disallowed in a future release.
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
qq
*a*a*a*
diff --git a/mysql-test/suite/innodb/r/innodb_bug51378.result b/mysql-test/suite/innodb/r/innodb_bug51378.result
index a2a9bcad564..08b6b656085 100644
--- a/mysql-test/suite/innodb/r/innodb_bug51378.result
+++ b/mysql-test/suite/innodb/r/innodb_bug51378.result
@@ -5,7 +5,7 @@ col3 time not null) engine = innodb;
create unique index idx on bug51378(col1, col2(31));
alter table bug51378 add unique index idx2(col1, col2(31));
Warnings:
-Note 1831 Duplicate index 'idx2' defined on the table 'test.bug51378'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release.
create unique index idx3 on bug51378(col1, col3);
SHOW CREATE TABLE bug51378;
Table Create Table
diff --git a/mysql-test/suite/innodb/r/table_index_statistics.result b/mysql-test/suite/innodb/r/table_index_statistics.result
new file mode 100644
index 00000000000..286c5f9325f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/table_index_statistics.result
@@ -0,0 +1,48 @@
+SET @default_storage_engine_old = @@session.default_storage_engine;
+SET SESSION default_storage_engine = INNODB;
+FLUSH INDEX_STATISTICS;
+FLUSH TABLE_STATISTICS;
+SET @userstat_old= @@userstat;
+SET GLOBAL userstat=ON;
+CREATE TABLE t1 (id int(10), PRIMARY KEY (id));
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+10
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
+ROWS_READ
+10
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+ROWS_READ
+10
+FLUSH TABLE_STATISTICS;
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
+ROWS_READ
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+ROWS_READ
+10
+FLUSH INDEX_STATISTICS;
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+ROWS_READ
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+10
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
+ROWS_READ
+10
+SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
+ROWS_READ
+10
+DROP TABLE t1;
+CREATE TABLE t2 (c1 INT UNSIGNED);
+ALTER TABLE t2 MODIFY c1 FLOAT;
+SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
+TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
+DROP TABLE t2;
+CREATE TABLE t2 (c1 INT UNSIGNED);
+ALTER TABLE t2 MODIFY c1 FLOAT;
+SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';
+TABLE_SCHEMA TABLE_NAME ROWS_READ ROWS_CHANGED ROWS_CHANGED_X_INDEXES
+DROP TABLE t2;
+SET GLOBAL userstat= @userstat_old;
+SET SESSION default_storage_engine = @default_storage_engine_old;
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test
index 4b03ac008d2..37b630ad47b 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug-zip.test
@@ -17,6 +17,10 @@
# allow test to run only when innodb-page-size=16
--source include/have_innodb_16k.inc
+# Test intentionally crashes the server, corrupted pages possible
+call mtr.add_suppression("InnoDB: Page for tablespace .* ");
+call mtr.add_suppression("InnoSB: Warning: database page corruption or a failed .*");
+FLUSH TABLES;
let MYSQLD_DATADIR =`SELECT @@datadir`;
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
diff --git a/mysql-test/suite/innodb/t/table_index_statistics.test b/mysql-test/suite/innodb/t/table_index_statistics.test
new file mode 100644
index 00000000000..af6f1946486
--- /dev/null
+++ b/mysql-test/suite/innodb/t/table_index_statistics.test
@@ -0,0 +1,8 @@
+--source include/have_innodb.inc
+
+SET @default_storage_engine_old = @@session.default_storage_engine;
+SET SESSION default_storage_engine = INNODB;
+
+--source extra/table_index_statistics.inc
+
+SET SESSION default_storage_engine = @default_storage_engine_old;
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result
index f6be36a24ef..628fe8519ed 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result
@@ -1018,7 +1018,7 @@ CREATE TABLE `t21` (`a` text, `b` int not null,
fulltext key (`a`), fulltext key (`a`)
) ENGINE=INNODB DEFAULT CHARSET=LATIN1;
Warnings:
-Note 1831 Duplicate index 'a_2' defined on the table 'test.t21'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release.
ALTER TABLE `t21` ADD UNIQUE INDEX (`b`), ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: InnoDB presently supports one FULLTEXT index creation at a time. Try ALGORITHM=COPY.
ALTER TABLE `t21` ADD UNIQUE INDEX (`b`);
diff --git a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
index b610d1ed7b8..a02a4acb740 100644
--- a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
@@ -193,10 +193,10 @@ Level Code Message
Warning 1071 Specified key was too long; max key length is 3072 bytes
create index idx3 on worklog5743_8(a2(3072));
Warnings:
-Note 1831 Duplicate index 'idx3' defined on the table 'test.worklog5743_8'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release.
show warnings;
Level Code Message
-Note 1831 Duplicate index 'idx3' defined on the table 'test.worklog5743_8'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release.
create index idx4 on worklog5743_8(a1, a2(3069));
ERROR 42000: Specified key was too long; max key length is 3072 bytes
show warnings;
@@ -229,10 +229,10 @@ Level Code Message
Warning 1071 Specified key was too long; max key length is 3072 bytes
create index idx3 on worklog5743_16(a2(3072));
Warnings:
-Note 1831 Duplicate index 'idx3' defined on the table 'test.worklog5743_16'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release.
show warnings;
Level Code Message
-Note 1831 Duplicate index 'idx3' defined on the table 'test.worklog5743_16'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release.
create index idx4 on worklog5743_16(a1, a2(3069));
ERROR 42000: Specified key was too long; max key length is 3072 bytes
show warnings;
@@ -462,7 +462,7 @@ Warnings:
Warning 1071 Specified key was too long; max key length is 3072 bytes
create index idx2 on worklog5743(a(3072));
Warnings:
-Note 1831 Duplicate index 'idx2' defined on the table 'test.worklog5743'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release.
show create table worklog5743;
Table Create Table
worklog5743 CREATE TABLE `worklog5743` (
diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result
index 85a21ada47d..1c11072cbde 100644
--- a/mysql-test/suite/maria/icp.result
+++ b/mysql-test/suite/maria/icp.result
@@ -718,8 +718,8 @@ b INT, c INT, d DATE NOT NULL, e VARCHAR(1),
KEY (c), KEY (d), KEY k2(b), KEY k3(b), KEY k4(b)
);
Warnings:
-Note 1831 Duplicate index 'k3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index 'k4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `k3`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `k4`. This is deprecated and will be disallowed in a future release.
INSERT INTO t1 (b,c,d,e) VALUES
(6,5,'2006-05-25','y'),(1,5,'2008-01-23','t'),
(6,5,'2007-06-18','d'),(4,5,'1900-01-01','r'),
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index 952cdc09c90..d410944ddb2 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -1139,7 +1139,7 @@ alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 'v_2'
alter table t1 add key(v);
Warnings:
-Note 1831 Duplicate index 'v_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `v_2`. This is deprecated and will be disallowed in a future release.
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
qq
*a*a*a*
@@ -2696,8 +2696,8 @@ SET aria_repair_threads=2;
SET aria_sort_buffer_size=8192;
CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a));
Warnings:
-Note 1831 Duplicate index 'a_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
-Note 1831 Duplicate index 'a_3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a_3`. This is deprecated and will be disallowed in a future release.
INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3);
REPAIR TABLE t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result
index 470d06c341d..92918959cda 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result
@@ -8,7 +8,7 @@ KEY `int_key` (`int_key`),
KEY `varchar_key` (`int_key`)
) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
Warnings:
-Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `varchar_key`. This is deprecated and will be disallowed in a future release.
INSERT INTO `t2` VALUES (10,8,NULL,'2002-02-26 06:14:37'),(11,9,'2006-06-14','1900-01-01 00:00:00'),(12,9,'2002-09-12','2006-12-03 09:37:26'),(13,186,'2005-02-15','2008-05-26 12:27:10'),(14,NULL,NULL,'2004-12-14 16:37:30'),(15,2,'2008-11-04','2003-02-11 21:19:41'),(16,3,'2004-09-04','2009-10-18 02:27:49'),(17,0,'2006-06-05','2000-09-26 07:45:57'),(18,133,'1900-01-01',NULL),(19,1,'1900-01-01','2005-11-10 12:40:29'),(20,8,'1900-01-01','2009-04-25 00:00:00'),(21,5,'2005-01-13','2002-11-27 00:00:00'),(22,5,'2006-05-21','2004-01-26 20:32:32'),(23,8,'2003-09-08','2007-10-26 11:41:40'),(24,6,'2006-12-23','2005-10-07 00:00:00'),(25,51,'2006-10-15','2000-07-15 05:00:34'),(26,4,'2005-04-06','2000-04-03 16:33:32'),(27,7,'2008-04-07',NULL),(28,6,'2006-10-10','2001-04-25 01:26:12'),(29,4,'1900-01-01','2000-12-27 00:00:00');
CREATE TABLE t1 (
`pk` int(11) NOT NULL AUTO_INCREMENT,
@@ -20,7 +20,7 @@ KEY `int_key` (`int_key`),
KEY `varchar_key` (`int_key`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
Warnings:
-Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `varchar_key`. This is deprecated and will be disallowed in a future release.
INSERT INTO t1 VALUES (1,2,NULL,'2004-10-11 18:13:16'),(2,9,'2001-09-19',NULL),(3,3,'2004-09-12','1900-01-01 00:00:00'),(4,9,NULL,'2009-07-25 00:00:00'),(5,NULL,'2002-07-19',NULL),(6,9,'2002-12-16','2008-07-27 00:00:00'),(7,3,'2006-02-08','2002-11-13 16:37:31'),(8,8,'2006-08-28','1900-01-01 00:00:00'),(9,8,'2001-04-14','2003-12-10 00:00:00'),(10,53,'2000-01-05','2001-12-21 22:38:22'),(11,0,'2003-12-06','2008-12-13 23:16:44'),(12,5,'1900-01-01','2005-08-15 12:39:41'),(13,166,'2002-11-27',NULL),(14,3,NULL,'2006-09-11 12:06:14'),(15,0,'2003-05-27','2007-12-15 12:39:34'),(16,1,'2005-05-03','2005-08-09 00:00:00'),(17,9,'2001-04-18','2001-09-02 22:50:02'),(18,5,'2005-12-27','2005-12-16 22:58:11'),(19,6,'2004-08-20','2007-04-19 00:19:53'),(20,2,'1900-01-01','1900-01-01 00:00:00');
SELECT `pk`
FROM t1 OUTR
@@ -77,7 +77,7 @@ KEY `datetime_key` (`datetime_key`),
KEY `varchar_key` (`int_key`)
) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
Warnings:
-Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `varchar_key`. This is deprecated and will be disallowed in a future release.
INSERT INTO `t2` VALUES (10,7,8,NULL,'2002-02-26 06:14:37','2002-02-26 06:14:37'),(11,1,9,'2006-06-14','1900-01-01 00:00:00','1900-01-01 00:00:00'),(12,5,9,'2002-09-12','2006-12-03 09:37:26','2006-12-03 09:37:26'),(13,3,186,'2005-02-15','2008-05-26 12:27:10','2008-05-26 12:27:10'),(14,6,NULL,NULL,'2004-12-14 16:37:30','2004-12-14 16:37:30'),(15,92,2,'2008-11-04','2003-02-11 21:19:41','2003-02-11 21:19:41'),(16,7,3,'2004-09-04','2009-10-18 02:27:49','2009-10-18 02:27:49'),(17,NULL,0,'2006-06-05','2000-09-26 07:45:57','2000-09-26 07:45:57'),(18,3,133,'1900-01-01',NULL,NULL),(19,5,1,'1900-01-01','2005-11-10 12:40:29','2005-11-10 12:40:29'),(20,1,8,'1900-01-01','2009-04-25 00:00:00','2009-04-25 00:00:00'),(21,2,5,'2005-01-13','2002-11-27 00:00:00','2002-11-27 00:00:00'),(22,NULL,5,'2006-05-21','2004-01-26 20:32:32','2004-01-26 20:32:32'),(23,1,8,'2003-09-08','2007-10-26 11:41:40','2007-10-26 11:41:40'),(24,0,6,'2006-12-23','2005-10-07 00:00:00','2005-10-07 00:00:00'),(25,210,51,'2006-10-15','2000-07-15 05:00:34','2000-07-15 05:00:34'),(26,8,4,'2005-04-06','2000-04-03 16:33:32','2000-04-03 16:33:32'),(27,7,7,'2008-04-07',NULL,NULL),(28,5,6,'2006-10-10','2001-04-25 01:26:12','2001-04-25 01:26:12'),(29,NULL,4,'1900-01-01','2000-12-27 00:00:00','2000-12-27 00:00:00');
CREATE TABLE t1 (
`pk` int(11) NOT NULL AUTO_INCREMENT,
@@ -92,7 +92,7 @@ KEY `datetime_key` (`datetime_key`),
KEY `varchar_key` (`int_key`)
) ENGINE=MyISAM AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
Warnings:
-Note 1831 Duplicate index 'varchar_key' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `varchar_key`. This is deprecated and will be disallowed in a future release.
INSERT INTO t1 VALUES (1,NULL,2,NULL,'2004-10-11 18:13:16','2004-10-11 18:13:16'),(2,7,9,'2001-09-19',NULL,NULL),(3,9,3,'2004-09-12','1900-01-01 00:00:00','1900-01-01 00:00:00'),(4,7,9,NULL,'2009-07-25 00:00:00','2009-07-25 00:00:00'),(5,4,NULL,'2002-07-19',NULL,NULL),(6,2,9,'2002-12-16','2008-07-27 00:00:00','2008-07-27 00:00:00'),(7,6,3,'2006-02-08','2002-11-13 16:37:31','2002-11-13 16:37:31'),(8,8,8,'2006-08-28','1900-01-01 00:00:00','1900-01-01 00:00:00'),(9,NULL,8,'2001-04-14','2003-12-10 00:00:00','2003-12-10 00:00:00'),(10,5,53,'2000-01-05','2001-12-21 22:38:22','2001-12-21 22:38:22'),(11,NULL,0,'2003-12-06','2008-12-13 23:16:44','2008-12-13 23:16:44'),(12,6,5,'1900-01-01','2005-08-15 12:39:41','2005-08-15 12:39:41'),(13,188,166,'2002-11-27',NULL,NULL),(14,2,3,NULL,'2006-09-11 12:06:14','2006-09-11 12:06:14'),(15,1,0,'2003-05-27','2007-12-15 12:39:34','2007-12-15 12:39:34'),(16,1,1,'2005-05-03','2005-08-09 00:00:00','2005-08-09 00:00:00'),(17,0,9,'2001-04-18','2001-09-02 22:50:02','2001-09-02 22:50:02'),(18,9,5,'2005-12-27','2005-12-16 22:58:11','2005-12-16 22:58:11'),(19,NULL,6,'2004-08-20','2007-04-19 00:19:53','2007-04-19 00:19:53'),(20,4,2,'1900-01-01','1900-01-01 00:00:00','1900-01-01 00:00:00');
SELECT OUTR . `pk` AS X
FROM t1 AS OUTR
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result
index d565b888c5f..13631f935bf 100644
--- a/mysql-test/suite/roles/create_and_drop_role.result
+++ b/mysql-test/suite/roles/create_and_drop_role.result
@@ -68,3 +68,19 @@ GRANT USAGE ON *.* TO 'r1'@'localhost'
DROP USER u1;
DROP ROLE r2;
DROP USER r1@localhost;
+create role 'foo ';
+select concat(user, '__'), is_role from mysql.user where user like 'foo%';
+concat(user, '__') is_role
+foo__ Y
+select * from mysql.roles_mapping;
+Host User Role Admin_option
+localhost root foo Y
+drop role foo;
+select concat(user, '__'), is_role from mysql.user where user like 'foo%';
+concat(user, '__') is_role
+select * from mysql.roles_mapping;
+Host User Role Admin_option
+show grants;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
diff --git a/mysql-test/suite/roles/create_and_drop_role.test b/mysql-test/suite/roles/create_and_drop_role.test
index 71d6de7053f..b6e5bd2b297 100644
--- a/mysql-test/suite/roles/create_and_drop_role.test
+++ b/mysql-test/suite/roles/create_and_drop_role.test
@@ -95,3 +95,15 @@ SHOW GRANTS FOR r1@localhost; # Related to MDEV-7774, also caused a crash, by
DROP USER u1;
DROP ROLE r2;
DROP USER r1@localhost;
+
+#
+# MDEV-11533: Roles with trailing white spaces are not cleared correctly
+#
+create role 'foo ';
+select concat(user, '__'), is_role from mysql.user where user like 'foo%';
+select * from mysql.roles_mapping;
+drop role foo;
+select concat(user, '__'), is_role from mysql.user where user like 'foo%';
+select * from mysql.roles_mapping;
+--sorted_result
+show grants;
diff --git a/mysql-test/suite/roles/role_case_sensitive-10744.result b/mysql-test/suite/roles/role_case_sensitive-10744.result
new file mode 100644
index 00000000000..e9b498eff26
--- /dev/null
+++ b/mysql-test/suite/roles/role_case_sensitive-10744.result
@@ -0,0 +1,58 @@
+#
+# MDEV-10744 Roles are not fully case-sensitive
+#
+#
+# Test creating two case-different roles.
+#
+create user test_user@'%';
+create role test_ROLE;
+create role test_role;
+#
+# Test if mysql.user has the roles created.
+#
+select user, host from mysql.user where is_role='y' and user like 'test%';
+user host
+test_ROLE
+test_role
+create database secret_db;
+create table secret_db.t1 (secret varchar(100));
+insert into secret_db.t1 values ("Some Secret P4ssw0rd");
+grant select on secret_db.* to test_role;
+grant test_role to test_user;
+show grants for test_user;
+Grants for test_user@%
+GRANT test_role TO 'test_user'@'%'
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Now test the UPPER case role.
+#
+grant test_ROLE to test_user;
+grant insert on secret_db.t1 to test_ROLE;
+show grants for test_user;
+Grants for test_user@%
+GRANT test_role TO 'test_user'@'%'
+GRANT test_ROLE TO 'test_user'@'%'
+GRANT USAGE ON *.* TO 'test_user'@'%'
+#
+# Test users privileges when interacting with those roles;
+#
+show tables from secret_db;
+ERROR 42000: Access denied for user 'test_user'@'%' to database 'secret_db'
+set role test_ROLE;
+show tables from secret_db;
+Tables_in_secret_db
+t1
+select * from secret_db.t1;
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 't1'
+insert into secret_db.t1 values ("|-|4><");
+set role test_role;
+select * from secret_db.t1 order by secret;
+secret
+Some Secret P4ssw0rd
+|-|4><
+insert into secret_db.t1 values ("|_33T|-|4><");
+ERROR 42000: INSERT command denied to user 'test_user'@'localhost' for table 't1'
+drop role test_ROLE;
+drop role test_role;
+drop user test_user;
+drop database secret_db;
diff --git a/mysql-test/suite/roles/role_case_sensitive-10744.test b/mysql-test/suite/roles/role_case_sensitive-10744.test
new file mode 100644
index 00000000000..281d61bce00
--- /dev/null
+++ b/mysql-test/suite/roles/role_case_sensitive-10744.test
@@ -0,0 +1,54 @@
+--source include/not_embedded.inc
+--echo #
+--echo # MDEV-10744 Roles are not fully case-sensitive
+--echo #
+
+--echo #
+--echo # Test creating two case-different roles.
+--echo #
+create user test_user@'%';
+create role test_ROLE;
+create role test_role;
+--echo #
+--echo # Test if mysql.user has the roles created.
+--echo #
+--sorted_result
+select user, host from mysql.user where is_role='y' and user like 'test%';
+
+create database secret_db;
+create table secret_db.t1 (secret varchar(100));
+insert into secret_db.t1 values ("Some Secret P4ssw0rd");
+
+grant select on secret_db.* to test_role;
+grant test_role to test_user;
+show grants for test_user;
+--echo #
+--echo # Now test the UPPER case role.
+--echo #
+grant test_ROLE to test_user;
+grant insert on secret_db.t1 to test_ROLE;
+show grants for test_user;
+connect (test_user,localhost,test_user);
+
+--echo #
+--echo # Test users privileges when interacting with those roles;
+--echo #
+--error ER_DBACCESS_DENIED_ERROR
+show tables from secret_db;
+set role test_ROLE;
+show tables from secret_db;
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from secret_db.t1;
+insert into secret_db.t1 values ("|-|4><");
+set role test_role;
+select * from secret_db.t1 order by secret;
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into secret_db.t1 values ("|_33T|-|4><");
+
+connection default;
+
+
+drop role test_ROLE;
+drop role test_role;
+drop user test_user;
+drop database secret_db;
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
index 6234e953cdd..db642f21950 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
@@ -169,7 +169,7 @@ count(*)
SET SQL_LOG_BIN=1;
SET GLOBAL debug_dbug="-d,error_unique_log_filename";
###################### TEST #10
-call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Could not open .*");
RESET MASTER;
SHOW WARNINGS;
@@ -226,7 +226,7 @@ include/rpl_reset.inc
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
call mtr.add_suppression("Error writing file .*");
call mtr.add_suppression("Could not open .*");
-call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
###################### TEST #13
SET @old_debug=@@global.debug;
diff --git a/mysql-test/suite/rpl/r/rpl_mdev10863.result b/mysql-test/suite/rpl/r/rpl_mdev10863.result
new file mode 100644
index 00000000000..475057d4c29
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_mdev10863.result
@@ -0,0 +1,39 @@
+include/rpl_init.inc [topology=1->2]
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+SET @old_max_relay= @@GLOBAL.max_relay_log_size;
+SET GLOBAL max_relay_log_size = 4096;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+include/start_slave.inc
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b VARCHAR(100)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "a");
+*** Create a long transaction that will span a relay log file. ***
+SET @old_domain= @@gtid_domain_id;
+SET gtid_domain_id=10;
+INSERT INTO t1 VALUES (10000, "domain 10");
+SET gtid_domain_id=20;
+INSERT INTO t1 VALUES (20000, "domain 20");
+SET gtid_domain_id=@old_domain;
+BEGIN;
+[lots of inserts omitted]
+COMMIT;
+BEGIN;
+[lots of inserts omitted]
+COMMIT;
+include/stop_slave_sql.inc
+START SLAVE SQL_THREAD;
+include/wait_for_slave_to_start.inc
+INSERT INTO t1 VALUES (100000, "More stuffs.");
+INSERT INTO t1 VALUES (100001, "And even more");
+SELECT * FROM t1 WHERE a >= 100000 ORDER BY a;
+a b
+100000 More stuffs.
+100001 And even more
+include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+SET GLOBAL max_relay_log_size= @old_max_relay;
+include/start_slave.inc
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 1489af830cc..19611ac52b5 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -1,14 +1,21 @@
include/master-slave.inc
[connection master]
-
---Setup Section --
set timestamp=1000000000;
-DROP TABLE IF EXISTS t1,t2,t3;
CREATE TABLE t1(word VARCHAR(20));
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
-
----Test1 check table load --
+INSERT INTO t1 VALUES ("abirvalg");
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+set @d1 = 'dd1';
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
+---Test 1 check table load --
SELECT COUNT(*) from t1;
COUNT(*)
351
@@ -71,9 +78,7 @@ c1 c3 c4 c5
5 2006-02-22 00:00:00 Tested in Texas 11
insert into t1 values ("Alas");
flush logs;
-
--- Test 1 Dump binlog to file --
-
--- Test 1 delete tables, clean master and slave --
DROP TABLE t1;
DROP TABLE t2;
@@ -84,9 +89,7 @@ reset master;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
-
--- Test 1 Load from Dump binlog file --
-
--- Test 1 Check Load Results --
SELECT COUNT(*) from t1;
COUNT(*)
@@ -148,7 +151,6 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
-
--- Test 2 position test --
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
@@ -172,7 +174,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
-
--- Test 3 First Remote test --
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
@@ -189,9 +190,6 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */
-/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t1(word VARCHAR(20))
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -205,7 +203,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
-
--- Test 4 Second Remote test --
DROP TABLE t1;
DROP TABLE t2;
@@ -276,7 +273,6 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
-
--- Test 5 LOAD DATA --
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
@@ -287,7 +283,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
-
--- Test 6 reading stdin --
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
@@ -304,9 +299,6 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */
-/*!*/;
-SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t1(word VARCHAR(20))
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
@@ -320,7 +312,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
-
--- Test 7 reading stdin w/position --
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
@@ -344,7 +335,6 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
-
--- Test 8 switch internal charset --
stop slave;
include/wait_for_slave_to_stop.inc
@@ -380,14 +370,13 @@ HEX(f)
select HEX(f) from t5;
HEX(f)
835C
-
--- Test cleanup --
-DROP TABLE IF EXISTS t1;
+DROP TABLE t1, t2, t3, t04, t05, t4, t5;
CREATE TABLE t1 (a INT NOT NULL KEY, b INT);
INSERT INTO t1 VALUES(1,1);
SELECT * FROM t1;
a b
1 1
FLUSH LOGS;
-DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
+DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 8ca72672073..b7b90cd1594 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -253,7 +253,7 @@ end
delete from t2;
alter table t2 add unique (a);
Warnings:
-Note 1831 Duplicate index 'a_2' defined on the table 'mysqltest1.t2'. This is deprecated and will be disallowed in a future release.
+Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release.
drop function fn1;
create function fn1(x int)
returns int
diff --git a/mysql-test/suite/rpl/r/rpl_special_charset.result b/mysql-test/suite/rpl/r/rpl_special_charset.result
index 99b8d3a21d1..6efe81bf6cb 100644
--- a/mysql-test/suite/rpl/r/rpl_special_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_special_charset.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-call mtr.add_suppression("Cannot use utf16 as character_set_client");
+call mtr.add_suppression("'utf16' can not be used as client character set");
CREATE TABLE t1(i VARCHAR(20));
INSERT INTO t1 VALUES (0xFFFF);
include/diff_tables.inc [master:t1, slave:t1]
diff --git a/mysql-test/suite/rpl/r/sec_behind_master-5114.result b/mysql-test/suite/rpl/r/sec_behind_master-5114.result
index 5554b17347d..17f50f0b612 100644
--- a/mysql-test/suite/rpl/r/sec_behind_master-5114.result
+++ b/mysql-test/suite/rpl/r/sec_behind_master-5114.result
@@ -3,7 +3,8 @@ include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log");
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES(SLEEP(2));
-Seconds_Behind_Master: 1
+Seconds_Behind_Master_is_less_than_100
+1
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
drop table t1;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
index 9e4a106a5b5..fb3b39fac9d 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -256,7 +256,7 @@ SET GLOBAL debug_dbug="-d,error_unique_log_filename";
### while registering the index file and the binary log
### file or failure to write the rotate event.
-call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Could not open .*");
RESET MASTER;
@@ -362,7 +362,7 @@ RESET MASTER;
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
call mtr.add_suppression("Error writing file .*");
call mtr.add_suppression("Could not open .*");
-call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
-- echo ###################### TEST #13
diff --git a/mysql-test/suite/rpl/t/rpl_mdev10863.test b/mysql-test/suite/rpl/t/rpl_mdev10863.test
new file mode 100644
index 00000000000..796e770672d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_mdev10863.test
@@ -0,0 +1,104 @@
+--source include/have_innodb.inc
+--let $rpl_topology=1->2
+--source include/rpl_init.inc
+
+# Test various aspects of parallel replication.
+
+--connection server_2
+SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=10;
+SET @old_max_relay= @@GLOBAL.max_relay_log_size;
+SET GLOBAL max_relay_log_size = 4096;
+CHANGE MASTER TO master_use_gtid=slave_pos;
+--source include/start_slave.inc
+
+--connection server_1
+ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
+CREATE TABLE t1 (a int PRIMARY KEY, b VARCHAR(100)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, "a");
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--echo *** Create a long transaction that will span a relay log file. ***
+--connection server_1
+
+# Add some transactions in separate domains, that will cause the need to
+# have a multi-valued restart position in the relay log for the SQL thread.
+SET @old_domain= @@gtid_domain_id;
+SET gtid_domain_id=10;
+INSERT INTO t1 VALUES (10000, "domain 10");
+SET gtid_domain_id=20;
+INSERT INTO t1 VALUES (20000, "domain 20");
+SET gtid_domain_id=@old_domain;
+
+BEGIN;
+--echo [lots of inserts omitted]
+--disable_query_log
+--let $count = 500
+while ($count) {
+ eval INSERT INTO t1 VALUES (1000+$count, REPEAT("hulubulu??!?", 8));
+ dec $count;
+}
+--enable_query_log
+COMMIT;
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+--connection server_1
+# Now do another one, to make the inuse_relaylog proceed to somewhere inside
+# the first large transaction.
+
+BEGIN;
+--echo [lots of inserts omitted]
+--disable_query_log
+--let $count = 500
+while ($count) {
+ eval INSERT INTO t1 VALUES (2000+$count, REPEAT("hulubulu??!?", 8));
+ dec $count;
+}
+--enable_query_log
+COMMIT;
+
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+
+
+# Stop and restart the SQL thread only.
+# The bug was that the SQL thread would restart at the start
+# of a relay log file, which could be in the middle of an event group.
+# This way, part of that event group could be wrongly re-applied.
+
+--source include/stop_slave_sql.inc
+START SLAVE SQL_THREAD;
+--source include/wait_for_slave_to_start.inc
+
+
+--connection server_1
+INSERT INTO t1 VALUES (100000, "More stuffs.");
+INSERT INTO t1 VALUES (100001, "And even more");
+--save_master_pos
+
+--connection server_2
+--sync_with_master
+SELECT * FROM t1 WHERE a >= 100000 ORDER BY a;
+
+
+# Clean up.
+--connection server_2
+--source include/stop_slave.inc
+SET GLOBAL slave_parallel_threads=@old_parallel_threads;
+SET GLOBAL max_relay_log_size= @old_max_relay;
+--source include/start_slave.inc
+
+--connection server_1
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index ed0f31b75be..678679f0cf1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -4,43 +4,27 @@
# Purpose: To test changes to mysqlbinlog for row based bin logs #
# We are using .opt file since we need small binlog size #
##################################################################
-# Include Section
-# Make sure that we have row based bin log
-- source include/have_binlog_format_row.inc
-# Embedded server doesn't support binlogging
-- source include/not_embedded.inc
-# This test requires the cp932 charset compiled in
-- source include/have_cp932.inc
-# Slow test, don't run during staging part
--- source include/not_staging.inc
-
-- source include/master-slave.inc
-# Setup Section
-# we need this for getting fixed timestamps inside of this test
-
---disable_query_log
-select "---Setup Section --" as "";
---enable_query_log
+--echo ---Setup Section --
+# we need this for getting fixed timestamps inside of this test
set timestamp=1000000000;
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3;
---enable_warnings
-
-connection master;
CREATE TABLE t1(word VARCHAR(20));
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
---let $position= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let position= query_get_value(SHOW MASTER STATUS, Position, 1)
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
---let $stop_position=query_get_value(SHOW MASTER STATUS, Position, 1)
---let $stop_position1=`select $stop_position - 1`
---let $binlog_start_pos=query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1)
+--let stop_position=query_get_value(SHOW MASTER STATUS, Position, 1)
+--let stop_position1=`select $stop_position - 1`
+--let binlog_start_pos=query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1)
+
# Test Section
# Lets start by putting some data into the tables.
---disable_query_log
INSERT INTO t1 VALUES ("abirvalg");
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
@@ -54,7 +38,8 @@ set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
-let $count=500;
+--disable_query_log
+let count=500;
while ($count)
{
INSERT INTO t2 VALUES (NULL);
@@ -63,10 +48,7 @@ while ($count)
}
--enable_query_log
-
---disable_query_log
-select "---Test1 check table load --" as "";
---enable_query_log
+--echo ---Test 1 check table load --
# Lets Check the tables on the Master
SELECT COUNT(*) from t1;
@@ -95,34 +77,26 @@ insert into t1 values ("Alas");
flush logs;
# delimiters are for easier debugging in future
---disable_query_log
-select "--- Test 1 Dump binlog to file --" as "";
---enable_query_log
+--echo --- Test 1 Dump binlog to file --
#
# Prepare local temporary file to recreate what we have currently.
-let $MYSQLD_DATADIR= `select @@datadir;`;
+let MYSQLD_DATADIR= `select @@datadir;`;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/master.sql
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/master.sql
# Now that we have our file, lets get rid of the current database.
# Cleanup the master and the slave and try to recreate.
---disable_query_log
-select "--- Test 1 delete tables, clean master and slave --" as "";
---enable_query_log
+--echo --- Test 1 delete tables, clean master and slave --
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
sync_slave_with_master;
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
---disable_warnings
stop slave;
--source include/wait_for_slave_to_stop.inc
---enable_warnings
connection master;
reset master;
connection slave;
@@ -132,15 +106,11 @@ start slave;
connection master;
# We should be clean at this point, now we will run in the file from above.
---disable_query_log
-select "--- Test 1 Load from Dump binlog file --" as "";
---enable_query_log
+--echo --- Test 1 Load from Dump binlog file --
--exec $MYSQL -e "source $MYSQLTEST_VARDIR/tmp/master.sql"
---disable_query_log
-select "--- Test 1 Check Load Results --" as "";
---enable_query_log
+--echo --- Test 1 Check Load Results --
# Lets Check the tables on the Master
SELECT COUNT(*) from t1;
@@ -168,28 +138,20 @@ remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
# this test for start-position option
# By setting this position to 416, we should only get the create of t3
---disable_query_log
-select "--- Test 2 position test --" as "";
---enable_query_log
-let $MYSQLD_DATADIR= `select @@datadir;`;
+--echo --- Test 2 position test --
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --start-position=$position --stop-position=$stop_position $MYSQLD_DATADIR/master-bin.000001
# These are tests for remote binlog.
# They should return the same as previous test.
---disable_query_log
-select "--- Test 3 First Remote test --" as "";
---enable_query_log
+--echo --- Test 3 First Remote test --
# This is broken now
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=$stop_position --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
---disable_query_log
-select "--- Test 4 Second Remote test --" as "";
---enable_query_log
+--echo --- Test 4 Second Remote test --
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
-
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 >> $MYSQLTEST_VARDIR/tmp/remote.sql
# Now that we have our file, lets get rid of the current database.
@@ -201,13 +163,8 @@ DROP TABLE t3;
sync_slave_with_master;
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
-
---disable_warnings
stop slave;
--source include/wait_for_slave_to_stop.inc
---enable_warnings
connection master;
reset master;
connection slave;
@@ -251,40 +208,26 @@ connection master;
# transactions. /Matz
# LOAD DATA
---disable_query_log
-select "--- Test 5 LOAD DATA --" as "";
---enable_query_log
+--echo --- Test 5 LOAD DATA --
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=$binlog_start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 (mysqlbinlog does not accept input from stdin)
---disable_query_log
-select "--- Test 6 reading stdin --" as "";
---enable_query_log
-let $MYSQLD_DATADIR= `select @@datadir;`;
+--echo --- Test 6 reading stdin --
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_position1 - < $MYSQLD_DATADIR/master-bin.000001
---disable_query_log
-select "--- Test 7 reading stdin w/position --" as "";
---enable_query_log
+--echo --- Test 7 reading stdin w/position --
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --start-position=$position --stop-position=$stop_position - < $MYSQLD_DATADIR/master-bin.000001
# Bug#16217 (mysql client did not know how not switch its internal charset)
---disable_query_log
-select "--- Test 8 switch internal charset --" as "";
---enable_query_log
+--echo --- Test 8 switch internal charset --
sync_slave_with_master;
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
-
---disable_warnings
stop slave;
--source include/wait_for_slave_to_stop.inc
---enable_warnings
connection master;
reset master;
connection slave;
@@ -297,7 +240,6 @@ create table t4 (f text character set utf8);
create table t5 (f text character set cp932);
--exec $MYSQL --default-character-set=utf8 test -e "insert into t4 values(_utf8'ソ')"
--exec $MYSQL --default-character-set=cp932 test -e "insert into t5 values(_cp932'ƒ\');"
-let $MYSQLD_DATADIR= `select @@datadir;`;
flush logs;
rename table t4 to t04, t5 to t05;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL --default-character-set=utf8
@@ -314,42 +256,30 @@ select HEX(f) from t4;
select HEX(f) from t05;
select HEX(f) from t5;
---disable_query_log
-select "--- Test cleanup --" as "";
---enable_query_log
+--echo --- Test cleanup --
# clean up
connection master;
sync_slave_with_master;
connection master;
+DROP TABLE t1, t2, t3, t04, t05, t4, t5;
# BUG#17654 also test mysqlbinlog to ensure it can read the binlog from a remote server
# and ensure that the results are the same as if read from a file (the same file).
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
CREATE TABLE t1 (a INT NOT NULL KEY, b INT);
-
INSERT INTO t1 VALUES(1,1);
-
SELECT * FROM t1;
-
-let $MYSQLD_DATADIR= `select @@datadir;`;
-
FLUSH LOGS;
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/remote.sql
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/local.sql
--diff_files $MYSQLTEST_VARDIR/tmp/local.sql $MYSQLTEST_VARDIR/tmp/remote.sql
-
--remove_file $MYSQLTEST_VARDIR/tmp/remote.sql
-
--remove_file $MYSQLTEST_VARDIR/tmp/local.sql
+DROP TABLE t1;
-DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
sync_slave_with_master;
# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test
index 8ccb1b4183f..3a947d413bb 100644
--- a/mysql-test/suite/rpl/t/rpl_special_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_special_charset.test
@@ -14,7 +14,7 @@
# then set default's client character set(latin1) as client's character set.
###############################################################################
--source include/master-slave.inc
-call mtr.add_suppression("Cannot use utf16 as character_set_client");
+call mtr.add_suppression("'utf16' can not be used as client character set");
CREATE TABLE t1(i VARCHAR(20));
INSERT INTO t1 VALUES (0xFFFF);
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/sec_behind_master-5114.test b/mysql-test/suite/rpl/t/sec_behind_master-5114.test
index 8c70da4f0a8..ff8cab54c4f 100644
--- a/mysql-test/suite/rpl/t/sec_behind_master-5114.test
+++ b/mysql-test/suite/rpl/t/sec_behind_master-5114.test
@@ -3,24 +3,60 @@ source include/have_binlog_format_statement.inc;
call mtr.add_suppression("Unsafe statement written to the binary log");
+
+# Make sure that the start time of the first event is certainly different
+# from the next event
+--let $timestamp= `SELECT @@timestamp`
+--disable_query_log
+eval SET TIMESTAMP= $timestamp-100;
+--enable_query_log
CREATE TABLE t1 (a int);
+
+# Make sure that the slave is done with the first event, and all checks
+# that we'll perform later will be really against the second event
+sync_slave_with_master;
+
+connection master;
+
+# Restore the timestamp now. It doesn't matter that it's not precise,
+# it just needs to be very different from the earlier event
+--disable_query_log
+eval SET TIMESTAMP= $timestamp;
+--enable_query_log
+
send INSERT INTO t1 VALUES(SLEEP(2));
connection slave;
-let $run = 10;
+
+# When the slave starts executing the event, Seconds_Behind_Master
+# should start growing steadilly. The bugfix ensures that they are
+# calculated based on the start time of the current event, rather
+# than the start time of the previous event. To check it, we only need
+# the first non-zero value
+
+let $run = 20;
while ($run)
{
dec $run;
let $sbm=query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1);
# for debugging uncomment echo and remove the if()
- #echo Seconds_Behind_Master: $sbm;
+# echo Seconds_Behind_Master: $sbm;
if ($sbm)
{
let $run = 0;
}
sleep 0.5;
}
-echo Seconds_Behind_Master: $sbm;
+
+# Normally the first non-zero value should be 1. However, due to race
+# conditions on slow servers, sometimes the check might miss the value 1,
+# and only catch a higher one. It does not matter, we just need to make
+# sure it didn't start with 100+, as it would have with bug MDEV-5114
+
+--disable_query_log
+eval SELECT $sbm > 0 and $sbm < 99 AS Seconds_Behind_Master_is_less_than_100;
+--enable_query_log
+
connection master;
reap;
drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result
index b964d3d14a1..a05b85a9bfd 100644
--- a/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_do_db_basic.result
@@ -33,5 +33,9 @@ SET @@GLOBAL.replicate_do_db="";
SELECT @@GLOBAL.replicate_do_db;
@@GLOBAL.replicate_do_db
+SET @@GLOBAL.replicate_do_db=null;
+SELECT @@GLOBAL.replicate_do_db;
+@@GLOBAL.replicate_do_db
+
# Cleanup.
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;
diff --git a/mysql-test/suite/sys_vars/r/replicate_do_table_basic.result b/mysql-test/suite/sys_vars/r/replicate_do_table_basic.result
index fac237228ac..e67b1eeca01 100644
--- a/mysql-test/suite/sys_vars/r/replicate_do_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_do_table_basic.result
@@ -40,5 +40,9 @@ SET @@GLOBAL.replicate_do_table="";
SELECT @@GLOBAL.replicate_do_table;
@@GLOBAL.replicate_do_table
+SET @@GLOBAL.replicate_do_table=null;
+SELECT @@GLOBAL.replicate_do_table;
+@@GLOBAL.replicate_do_table
+
# Cleanup.
SET @@GLOBAL.replicate_do_table = @save_replicate_do_table;
diff --git a/mysql-test/suite/sys_vars/r/replicate_ignore_db_basic.result b/mysql-test/suite/sys_vars/r/replicate_ignore_db_basic.result
index c4d7a37321e..c7ff697b34f 100644
--- a/mysql-test/suite/sys_vars/r/replicate_ignore_db_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_ignore_db_basic.result
@@ -33,5 +33,9 @@ SET @@GLOBAL.replicate_ignore_db="";
SELECT @@GLOBAL.replicate_ignore_db;
@@GLOBAL.replicate_ignore_db
+SET @@GLOBAL.replicate_ignore_db=null;
+SELECT @@GLOBAL.replicate_ignore_db;
+@@GLOBAL.replicate_ignore_db
+
# Cleanup.
SET @@GLOBAL.replicate_ignore_db = @save_replicate_ignore_db;
diff --git a/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result b/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result
index bc463d07319..db97ce14c93 100644
--- a/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_ignore_table_basic.result
@@ -40,5 +40,9 @@ SET @@GLOBAL.replicate_ignore_table="";
SELECT @@GLOBAL.replicate_ignore_table;
@@GLOBAL.replicate_ignore_table
+SET @@GLOBAL.replicate_ignore_table=null;
+SELECT @@GLOBAL.replicate_ignore_table;
+@@GLOBAL.replicate_ignore_table
+
# Cleanup.
SET @@GLOBAL.replicate_ignore_table = @save_replicate_ignore_table;
diff --git a/mysql-test/suite/sys_vars/r/replicate_wild_do_table_basic.result b/mysql-test/suite/sys_vars/r/replicate_wild_do_table_basic.result
index 5647cc964fb..8c55103080f 100644
--- a/mysql-test/suite/sys_vars/r/replicate_wild_do_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_wild_do_table_basic.result
@@ -40,5 +40,9 @@ SET @@GLOBAL.replicate_wild_do_table="";
SELECT @@GLOBAL.replicate_wild_do_table;
@@GLOBAL.replicate_wild_do_table
+SET @@GLOBAL.replicate_wild_do_table=null;
+SELECT @@GLOBAL.replicate_wild_do_table;
+@@GLOBAL.replicate_wild_do_table
+
# Cleanup.
SET @@GLOBAL.replicate_wild_do_table = @save_replicate_wild_do_table;
diff --git a/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_basic.result b/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_basic.result
index c6829b792a4..0f46ce38805 100644
--- a/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_basic.result
@@ -40,5 +40,9 @@ SET @@GLOBAL.replicate_wild_ignore_table="";
SELECT @@GLOBAL.replicate_wild_ignore_table;
@@GLOBAL.replicate_wild_ignore_table
+SET @@GLOBAL.replicate_wild_ignore_table=null;
+SELECT @@GLOBAL.replicate_wild_ignore_table;
+@@GLOBAL.replicate_wild_ignore_table
+
# Cleanup.
SET @@GLOBAL.replicate_wild_ignore_table = @save_replicate_wild_ignore_table;
diff --git a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test
index ccf50b1d6ab..59d0176add2 100644
--- a/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_do_db_basic.test
@@ -35,5 +35,8 @@ SELECT @@GLOBAL.replicate_do_db;
SET @@GLOBAL.replicate_do_db="";
SELECT @@GLOBAL.replicate_do_db;
+SET @@GLOBAL.replicate_do_db=null;
+SELECT @@GLOBAL.replicate_do_db;
+
--echo # Cleanup.
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;
diff --git a/mysql-test/suite/sys_vars/t/replicate_do_table_basic.test b/mysql-test/suite/sys_vars/t/replicate_do_table_basic.test
index f3b1585613e..346bdf3b038 100644
--- a/mysql-test/suite/sys_vars/t/replicate_do_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_do_table_basic.test
@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_do_table;
SET @@GLOBAL.replicate_do_table="";
SELECT @@GLOBAL.replicate_do_table;
+SET @@GLOBAL.replicate_do_table=null;
+SELECT @@GLOBAL.replicate_do_table;
+
--echo # Cleanup.
SET @@GLOBAL.replicate_do_table = @save_replicate_do_table;
diff --git a/mysql-test/suite/sys_vars/t/replicate_ignore_db_basic.test b/mysql-test/suite/sys_vars/t/replicate_ignore_db_basic.test
index 3a0bc88109a..376397d1635 100644
--- a/mysql-test/suite/sys_vars/t/replicate_ignore_db_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_ignore_db_basic.test
@@ -35,5 +35,8 @@ SELECT @@GLOBAL.replicate_ignore_db;
SET @@GLOBAL.replicate_ignore_db="";
SELECT @@GLOBAL.replicate_ignore_db;
+SET @@GLOBAL.replicate_ignore_db=null;
+SELECT @@GLOBAL.replicate_ignore_db;
+
--echo # Cleanup.
SET @@GLOBAL.replicate_ignore_db = @save_replicate_ignore_db;
diff --git a/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test b/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test
index aebe90732d2..56cf7f17c7f 100644
--- a/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_ignore_table_basic.test
@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_ignore_table;
SET @@GLOBAL.replicate_ignore_table="";
SELECT @@GLOBAL.replicate_ignore_table;
+SET @@GLOBAL.replicate_ignore_table=null;
+SELECT @@GLOBAL.replicate_ignore_table;
+
--echo # Cleanup.
SET @@GLOBAL.replicate_ignore_table = @save_replicate_ignore_table;
diff --git a/mysql-test/suite/sys_vars/t/replicate_wild_do_table_basic.test b/mysql-test/suite/sys_vars/t/replicate_wild_do_table_basic.test
index b96a62f8dd1..832d3397f89 100644
--- a/mysql-test/suite/sys_vars/t/replicate_wild_do_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_wild_do_table_basic.test
@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_wild_do_table;
SET @@GLOBAL.replicate_wild_do_table="";
SELECT @@GLOBAL.replicate_wild_do_table;
+SET @@GLOBAL.replicate_wild_do_table=null;
+SELECT @@GLOBAL.replicate_wild_do_table;
+
--echo # Cleanup.
SET @@GLOBAL.replicate_wild_do_table = @save_replicate_wild_do_table;
diff --git a/mysql-test/suite/sys_vars/t/replicate_wild_ignore_table_basic.test b/mysql-test/suite/sys_vars/t/replicate_wild_ignore_table_basic.test
index 2900deab4d1..5cb1ff6c820 100644
--- a/mysql-test/suite/sys_vars/t/replicate_wild_ignore_table_basic.test
+++ b/mysql-test/suite/sys_vars/t/replicate_wild_ignore_table_basic.test
@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_wild_ignore_table;
SET @@GLOBAL.replicate_wild_ignore_table="";
SELECT @@GLOBAL.replicate_wild_ignore_table;
+SET @@GLOBAL.replicate_wild_ignore_table=null;
+SELECT @@GLOBAL.replicate_wild_ignore_table;
+
--echo # Cleanup.
SET @@GLOBAL.replicate_wild_ignore_table = @save_replicate_wild_ignore_table;