diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-24 16:14:12 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-24 16:14:12 +0200 |
commit | 947b6b849d907dc0793f076aec7e553869db744f (patch) | |
tree | 50e7d87866ed50b8510336ce33d515ed32386754 /mysql-test | |
parent | 55be043c13d45581a0cecbae85d1f7de2708d891 (diff) | |
parent | fab531a150ec588f87e8a636d2ba1ecbfffdb08e (diff) | |
download | mariadb-git-947b6b849d907dc0793f076aec7e553869db744f.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test')
28 files changed, 510 insertions, 57 deletions
diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result index b05d0ea9fea..92584d5d11d 100644 --- a/mysql-test/main/connect.result +++ b/mysql-test/main/connect.result @@ -100,8 +100,20 @@ ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET); connect fail_con,localhost,test,zorro,; ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) +select user,host,password,plugin,authentication_string from mysql.user where user='test'; +user host password plugin authentication_string +test localhost *5FDFF3268A50F41C5D18D2CA2F754D7BDB9B3E59 +test 127.0.0.1 *5FDFF3268A50F41C5D18D2CA2F754D7BDB9B3E59 update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; +show grants for test@localhost; +Grants for test@localhost +GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573' +update mysql.user set plugin='mysql_old_password' where user='test'; +flush privileges; +show grants for test@localhost; +Grants for test@localhost +GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573' connect con10,localhost,test,gambling2,; connect con5,localhost,test,gambling2,mysql; connection con5; diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test index 3a38ad88462..560f29e840d 100644 --- a/mysql-test/main/connect.test +++ b/mysql-test/main/connect.test @@ -66,8 +66,13 @@ connect (fail_con,localhost,test,zorro,test2); connect (fail_con,localhost,test,zorro,); # check if old password version also works +select user,host,password,plugin,authentication_string from mysql.user where user='test'; update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; +show grants for test@localhost; +update mysql.user set plugin='mysql_old_password' where user='test'; +flush privileges; +show grants for test@localhost; connect (con10,localhost,test,gambling2,); connect (con5,localhost,test,gambling2,mysql); diff --git a/mysql-test/main/huge_frm-6224.result b/mysql-test/main/huge_frm-6224.result index 3772317c04d..bbb650bc5b4 100644 --- a/mysql-test/main/huge_frm-6224.result +++ b/mysql-test/main/huge_frm-6224.result @@ -1 +1,6 @@ +set global max_allowed_packet=1024*1024*10; +connect con1,localhost,root; ERROR HY000: The definition for table `t1` is too big +connection default; +disconnect con1; +set global max_allowed_packet=default; diff --git a/mysql-test/main/huge_frm-6224.test b/mysql-test/main/huge_frm-6224.test index 418722a7b51..322abd01738 100644 --- a/mysql-test/main/huge_frm-6224.test +++ b/mysql-test/main/huge_frm-6224.test @@ -4,17 +4,24 @@ # verify that huge frms are rejected during creation, not on opening # --source include/have_partition.inc +set global max_allowed_packet=1024*1024*10; +connect con1,localhost,root; -let $n=5646; +let $n=8164; let $a=create table t1 (a int) engine=myisam partition by hash(a) partitions $n (; dec $n; while ($n) { - let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n,; + let $a=$a partition p01234567890123456789012345678901234567890123456789012345678$n COMMENT 'partition p01234567890123456789012345678901234567890123456789012345678$n',; dec $n; } --disable_query_log --error ER_TABLE_DEFINITION_TOO_BIG eval $a partition foo); +--enable_query_log + +connection default; +disconnect con1; +set global max_allowed_packet=default; diff --git a/mysql-test/main/mysqlbinlog_row_compressed.result b/mysql-test/main/mysqlbinlog_row_compressed.result index cbea1cf9def..8cf52f5b826 100644 --- a/mysql-test/main/mysqlbinlog_row_compressed.result +++ b/mysql-test/main/mysqlbinlog_row_compressed.result @@ -61,7 +61,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "") #<date> server id 1 end_log_pos 899 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 899 -#<date> server id 1 end_log_pos 967 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 967 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -90,7 +90,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL) #<date> server id 1 end_log_pos 1214 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 1214 -#<date> server id 1 end_log_pos 1281 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 1281 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=11 /* INT meta=0 nullable=0 is_null=0 */ @@ -119,7 +119,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A") #<date> server id 1 end_log_pos 1530 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 1530 -#<date> server id 1 end_log_pos 1596 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 1596 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=12 /* INT meta=0 nullable=0 is_null=0 */ @@ -148,7 +148,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A") #<date> server id 1 end_log_pos 1842 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 1842 -#<date> server id 1 end_log_pos 1909 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 1909 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ @@ -177,7 +177,7 @@ BEGIN #Q> INSERT INTO t2 SELECT * FROM t1 #<date> server id 1 end_log_pos 2134 CRC32 XXX Table_map: `test`.`t2` mapped to number num # at 2134 -#<date> server id 1 end_log_pos 2225 CRC32 XXX Write_compressed_rows: table id 32 flags: STMT_END_F +#<date> server id 1 end_log_pos 2225 CRC32 XXX Write_compressed_rows: table id 33 flags: STMT_END_F ### INSERT INTO `test`.`t2` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -239,7 +239,7 @@ BEGIN #Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL #<date> server id 1 end_log_pos 2462 CRC32 XXX Table_map: `test`.`t2` mapped to number num # at 2462 -#<date> server id 1 end_log_pos 2561 CRC32 XXX Update_compressed_rows: table id 32 flags: STMT_END_F +#<date> server id 1 end_log_pos 2561 CRC32 XXX Update_compressed_rows: table id 33 flags: STMT_END_F ### UPDATE `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -320,7 +320,7 @@ BEGIN #Q> DELETE FROM t1 #<date> server id 1 end_log_pos 2769 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 2769 -#<date> server id 1 end_log_pos 2861 CRC32 XXX Delete_compressed_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 2861 CRC32 XXX Delete_compressed_rows: table id 32 flags: STMT_END_F ### DELETE FROM `test`.`t1` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -382,7 +382,7 @@ BEGIN #Q> DELETE FROM t2 #<date> server id 1 end_log_pos 3069 CRC32 XXX Table_map: `test`.`t2` mapped to number num # at 3069 -#<date> server id 1 end_log_pos 3154 CRC32 XXX Delete_compressed_rows: table id 32 flags: STMT_END_F +#<date> server id 1 end_log_pos 3154 CRC32 XXX Delete_compressed_rows: table id 33 flags: STMT_END_F ### DELETE FROM `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ diff --git a/mysql-test/main/mysqlbinlog_row_minimal.result b/mysql-test/main/mysqlbinlog_row_minimal.result index 6417a528638..680fd8196a8 100644 --- a/mysql-test/main/mysqlbinlog_row_minimal.result +++ b/mysql-test/main/mysqlbinlog_row_minimal.result @@ -59,7 +59,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "") #<date> server id 1 end_log_pos 946 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 946 -#<date> server id 1 end_log_pos 1015 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 1015 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -88,7 +88,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL) #<date> server id 1 end_log_pos 1262 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 1262 -#<date> server id 1 end_log_pos 1330 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 1330 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=11 /* INT meta=0 nullable=0 is_null=0 */ @@ -117,7 +117,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A") #<date> server id 1 end_log_pos 1579 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 1579 -#<date> server id 1 end_log_pos 1646 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 1646 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=12 /* INT meta=0 nullable=0 is_null=0 */ @@ -146,7 +146,7 @@ BEGIN #Q> INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A") #<date> server id 1 end_log_pos 1892 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 1892 -#<date> server id 1 end_log_pos 1962 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 1962 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ @@ -175,7 +175,7 @@ BEGIN #Q> INSERT INTO t2 SELECT * FROM t1 #<date> server id 1 end_log_pos 2187 CRC32 XXX Table_map: `test`.`t2` mapped to number num # at 2187 -#<date> server id 1 end_log_pos 2354 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F +#<date> server id 1 end_log_pos 2354 CRC32 XXX Write_rows: table id 33 flags: STMT_END_F ### INSERT INTO `test`.`t2` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -237,7 +237,7 @@ BEGIN #Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL #<date> server id 1 end_log_pos 2591 CRC32 XXX Table_map: `test`.`t2` mapped to number num # at 2591 -#<date> server id 1 end_log_pos 2665 CRC32 XXX Update_rows: table id 32 flags: STMT_END_F +#<date> server id 1 end_log_pos 2665 CRC32 XXX Update_rows: table id 33 flags: STMT_END_F ### UPDATE `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -273,7 +273,7 @@ BEGIN #Q> DELETE FROM t1 #<date> server id 1 end_log_pos 2873 CRC32 XXX Table_map: `test`.`t1` mapped to number num # at 2873 -#<date> server id 1 end_log_pos 2927 CRC32 XXX Delete_rows: table id 31 flags: STMT_END_F +#<date> server id 1 end_log_pos 2927 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F ### DELETE FROM `test`.`t1` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -303,7 +303,7 @@ BEGIN #Q> DELETE FROM t2 #<date> server id 1 end_log_pos 3135 CRC32 XXX Table_map: `test`.`t2` mapped to number num # at 3135 -#<date> server id 1 end_log_pos 3189 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F +#<date> server id 1 end_log_pos 3189 CRC32 XXX Delete_rows: table id 33 flags: STMT_END_F ### DELETE FROM `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ diff --git a/mysql-test/main/mysqld_option_err.test b/mysql-test/main/mysqld_option_err.test index 0c38eba7ca9..e9655fd4bfe 100644 --- a/mysql-test/main/mysqld_option_err.test +++ b/mysql-test/main/mysqld_option_err.test @@ -56,4 +56,6 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err; --error 2 --exec $MYSQLD_BOOTSTRAP_CMD --not-known-option --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1 +rmdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err; + --echo Done. diff --git a/mysql-test/main/range_innodb.result b/mysql-test/main/range_innodb.result index 8bb1c833a56..6572b248911 100644 --- a/mysql-test/main/range_innodb.result +++ b/mysql-test/main/range_innodb.result @@ -55,3 +55,27 @@ pk f1 f2 f3 pk f1 f2 f3 f4 f5 2 6 v NULL 14 1 q NULL 4 q 3 7 c NULL 14 1 q NULL 4 q drop table t1,t2; +# +# MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND' +# failed in handler::ha_rnd_end upon SELECT from partitioned table +# +set @optimizer_switch_save= @@optimizer_switch; +set optimizer_switch='index_merge_sort_intersection=off'; +create table t0 (a int)engine=innodb; +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 ( +a int, b int, c int, +key(a),key(b),key(c) +)engine=innodb; +insert into t1 +select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a +from t0 A, t0 B, t0 C, t0 D where D.a<5; +set @@global.debug_dbug="+d,ha_index_init_fail"; +explain select * from t1 where a=10 and b=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 1 Using intersect(a,b); Using where +select * from t1 where a=10 and b=10; +ERROR HY000: Table definition has changed, please retry transaction +DROP TABLE t0,t1; +set @@global.debug_dbug="-d"; +set @@optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test index 605006587cc..a17ef3f1146 100644 --- a/mysql-test/main/range_innodb.test +++ b/mysql-test/main/range_innodb.test @@ -3,6 +3,7 @@ --echo # --source include/have_innodb.inc +--source include/have_debug.inc --disable_warnings drop table if exists t0, t1, t2; @@ -62,3 +63,27 @@ INSERT INTO t2 VALUES (4,'q'),(NULL,'j'); SELECT * FROM t1 AS t1_1, t1 AS t1_2, t2 WHERE f5 = t1_2.f2 AND ( t1_1.f1 = 103 AND t1_1.f2 = 'o' OR t1_1.pk < f4 ); drop table t1,t2; + +--echo # +--echo # MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND' +--echo # failed in handler::ha_rnd_end upon SELECT from partitioned table +--echo # + +set @optimizer_switch_save= @@optimizer_switch; +set optimizer_switch='index_merge_sort_intersection=off'; +create table t0 (a int)engine=innodb; +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 ( + a int, b int, c int, + key(a),key(b),key(c) +)engine=innodb; +insert into t1 +select A.a+10*B.a, A.a+10*B.a, A.a+10*B.a+100*C.a +from t0 A, t0 B, t0 C, t0 D where D.a<5; +set @@global.debug_dbug="+d,ha_index_init_fail"; +explain select * from t1 where a=10 and b=10; +--error ER_TABLE_DEF_CHANGED +select * from t1 where a=10 and b=10; +DROP TABLE t0,t1; +set @@global.debug_dbug="-d"; +set @@optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 349cba26b75..9e394cebfff 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5289,6 +5289,7 @@ sub server_need_restart { { delete $server->{'restart_opts'}; my $use_dynamic_option_switch= 0; + delete $server->{'restart_opts'}; if (!$use_dynamic_option_switch) { mtr_verbose_restart($server, "running with different options '" . diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 180f28401ee..64ab02cd946 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -26,7 +26,6 @@ MW-416 : MDEV-13549 Galera test failures MW-388 : MDEV-13549 Galera test failures MW-44 : MDEV-15809 Test failure on galera.MW-44 galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb -galera_drop_database : MDEV-17421 mtr does not restart the server whose parameters were changed galera_kill_applier : race condition at the start of the test galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status pxc-421: Lock timeout exceeded diff --git a/mysql-test/suite/galera/r/galera_drop_database.result b/mysql-test/suite/galera/r/galera_drop_database.result index 79789da5a11..86135625a71 100644 --- a/mysql-test/suite/galera/r/galera_drop_database.result +++ b/mysql-test/suite/galera/r/galera_drop_database.result @@ -1,3 +1,5 @@ +connection node_1; +connection node_2; CREATE DATABASE fts; USE fts; CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; @@ -9,6 +11,10 @@ INSERT INTO fts_t2 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; DROP TABLE ten; UPDATE fts_t1 SET f2 = 'abcd'; UPDATE fts_t2 SET f2 = 'efjh'; +connection node_2; +connection node_1; +connection node_2; +connection node_1; USE fts; DROP TABLE fts_t1; DROP TABLE fts_t2; diff --git a/mysql-test/suite/galera/t/galera_drop_database.test b/mysql-test/suite/galera/t/galera_drop_database.test index 47fe8315198..12d9efea2f9 100644 --- a/mysql-test/suite/galera/t/galera_drop_database.test +++ b/mysql-test/suite/galera/t/galera_drop_database.test @@ -9,6 +9,7 @@ --let $node_2=node_2 --source include/auto_increment_offset_save.inc +# Create test database with two sets of the FTS indexes: CREATE DATABASE fts; USE fts; CREATE TABLE fts_t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; @@ -23,34 +24,19 @@ DROP TABLE ten; UPDATE fts_t1 SET f2 = 'abcd'; UPDATE fts_t2 SET f2 = 'efjh'; +# Restart the second node: --connection node_2 -let $wsrep_cluster_address = `SELECT @@global.wsrep_node_incoming_address`; --source include/restart_mysqld.inc --connection node_1 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --source include/wait_condition.inc ---let $galera_connection_name = node_2a ---let $galera_server_number = 2 ---source include/galera_connect.inc ---connection node_2a +--connection node_2 --source include/wait_until_ready.inc +# Drop the tables and database after nodes restarted: --connection node_1 ---let $restart_parameters = --wsrep-cluster-address=gcomm://$wsrep_cluster_address ---source include/restart_mysqld.inc - ---connection node_2a ---let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; ---source include/wait_condition.inc - ---let $galera_connection_name = node_1a ---let $galera_server_number = 1 ---source include/galera_connect.inc ---connection node_1a ---source include/wait_until_ready.inc - USE fts; DROP TABLE fts_t1; DROP TABLE fts_t2; @@ -58,8 +44,4 @@ SHOW TABLES; DROP DATABASE fts; # Restore original auto_increment_offset values. ---let $node_1=node_1a ---let $node_2=node_2a --source include/auto_increment_offset_restore.inc - ---source include/galera_end.inc diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result index 25faeaf4e84..1d4766eab19 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_fk_restart.result @@ -7,9 +7,18 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, fld3 INT AS (fld2) VIRTUAL, KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb; +CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB; +CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb), +FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB; +INSERT INTO u1 SET a=1; +INSERT INTO u2 SET b=1; INSERT INTO t1(fld1) VALUES(1); INSERT INTO t2(fld1, fld2) VALUES(1, 2); UPDATE t1 SET fld1= 2; +DELETE FROM u1; +SELECT * FROM u2; +b vb +DROP TABLE u2,u1; SELECT fld3, fld1 FROM t2; fld3 fld1 2 2 diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result index bde9f086eac..6913ec698b4 100644 --- a/mysql-test/suite/gcol/r/innodb_virtual_index.result +++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result @@ -239,3 +239,23 @@ KEY (a(1)) INSERT INTO t1(b) VALUES(REPEAT('b',1000)); DELETE FROM t1; DROP TABLE t1; +# +# Bug #22990029 GCOLS: INCORRECT BEHAVIOR +# AFTER DATA INSERTED WITH IGNORE KEYWORD +# +CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb)) +ENGINE=InnoDB; +INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132); +Warnings: +Warning 1265 Data truncated for column 'vb' at row 1 +BEGIN; +DELETE FROM t1; +INSERT INTO t1 (a,b) VALUES(1,20190123); +ERROR 22007: Incorrect date value: '20190132' for column `test`.`t1`.`vb` at row 1 +SELECT * FROM t1; +a b vb +ROLLBACK; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test index 61d330036ea..45d1c1295a5 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_fk_restart.test @@ -11,10 +11,19 @@ CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY) engine=innodb; CREATE TABLE t2(fld1 INT NOT NULL, fld2 INT NOT NULL, fld3 INT AS (fld2) VIRTUAL, KEY(fld1), FOREIGN KEY(fld1) REFERENCES t1(fld1) ON UPDATE CASCADE) engine=innodb; +CREATE TABLE u1(a INT, KEY(a)) ENGINE=InnoDB; +CREATE TABLE u2(b INT, vb INT GENERATED ALWAYS AS(b) VIRTUAL, KEY(vb), + FOREIGN KEY(b) REFERENCES u1(a)ON DELETE CASCADE)ENGINE=InnoDB; + +INSERT INTO u1 SET a=1; +INSERT INTO u2 SET b=1; INSERT INTO t1(fld1) VALUES(1); INSERT INTO t2(fld1, fld2) VALUES(1, 2); --source include/restart_mysqld.inc UPDATE t1 SET fld1= 2; +DELETE FROM u1; +SELECT * FROM u2; +DROP TABLE u2,u1; SELECT fld3, fld1 FROM t2; alter TABLE t2 ADD INDEX vk(fld3, fld1), ALGORITHM=INPLACE; UPDATE t1 SET fld1=3; diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test index 8f4e09fdf31..a89ae813b05 100644 --- a/mysql-test/suite/gcol/t/innodb_virtual_index.test +++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test @@ -263,3 +263,22 @@ CREATE TABLE t1( INSERT INTO t1(b) VALUES(REPEAT('b',1000)); DELETE FROM t1; DROP TABLE t1; + +--echo # +--echo # Bug #22990029 GCOLS: INCORRECT BEHAVIOR +--echo # AFTER DATA INSERTED WITH IGNORE KEYWORD +--echo # + +CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb)) +ENGINE=InnoDB; +INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132); +BEGIN; +DELETE FROM t1; +--error ER_TRUNCATED_WRONG_VALUE +INSERT INTO t1 (a,b) VALUES(1,20190123); +SELECT * FROM t1; +ROLLBACK; +# MDEV-18366 FIXME: fix the crash and enable this +# SELECT * FROM t1; +CHECK TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/alter_candidate_key.result b/mysql-test/suite/innodb/r/alter_candidate_key.result new file mode 100644 index 00000000000..23989e0da5f --- /dev/null +++ b/mysql-test/suite/innodb/r/alter_candidate_key.result @@ -0,0 +1,114 @@ +CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL, +UNIQUE KEY uidx2(f1,f2), +UNIQUE KEY uidx1(f2)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1, 1); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL, + UNIQUE KEY `uidx2` (`f1`,`f2`), + UNIQUE KEY `uidx1` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter + SIGNAL conc_dml WAIT_FOR go_ahead'; +ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE; +connect con1,localhost,root,,; +SET DEBUG_SYNC = 'now WAIT_FOR conc_dml'; +DELETE FROM t1; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f11` int(11) DEFAULT NULL, + `f2` int(11) NOT NULL, + UNIQUE KEY `uidx1` (`f2`), + UNIQUE KEY `uidx2` (`f11`,`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +CREATE TABLE t1(f1 INT, f2 INT, +PRIMARY KEY(f1, f2), +UNIQUE INDEX uidx2 (f1, f2), +UNIQUE INDEX uidx1 (f2))ENGINE=InnoDB; +ALTER TABLE t1 DROP PRIMARY KEY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL, + UNIQUE KEY `uidx2` (`f1`,`f2`), + UNIQUE KEY `uidx1` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter + SIGNAL conc_dml WAIT_FOR go_ahead'; +ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE; +connection con1; +SET DEBUG_SYNC = 'now WAIT_FOR conc_dml'; +INSERT INTO t1 VALUES(1, 1), (1, 1); +ERROR 23000: Duplicate entry '1-1' for key 'uidx2' +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f11` int(11) DEFAULT NULL, + `f2` int(11) NOT NULL, + UNIQUE KEY `uidx1` (`f2`), + UNIQUE KEY `uidx2` (`f11`,`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +SET SQL_MODE= strict_trans_tables; +CREATE TABLE t1(a INT UNIQUE) ENGINE=InnoDB; +SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done'; +ALTER TABLE t1 MODIFY COLUMN a INT NOT NULL; +connection con1; +SET DEBUG_SYNC='now WAIT_FOR dml'; +BEGIN; +INSERT INTO t1 SET a=NULL; +ROLLBACK; +set DEBUG_SYNC='now SIGNAL dml_done'; +connection default; +ERROR 22004: Invalid use of NULL value +DROP TABLE t1; +disconnect con1; +SET DEBUG_SYNC="RESET"; +SET SQL_MODE=DEFAULT; +CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY(f1, f2), +UNIQUE KEY(f2))ENGINE=InnoDB; +ALTER TABLE t1 DROP PRIMARY KEY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL, + UNIQUE KEY `f2` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, +UNIQUE KEY(f2), UNIQUE KEY(f2))ENGINE=InnoDB; +Warnings: +Note 1831 Duplicate index `f2_2`. This is deprecated and will be disallowed in a future release +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL, + UNIQUE KEY `f2` (`f2`), + UNIQUE KEY `f2_2` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL, + UNIQUE KEY `f2_2` (`f2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index 734cc41a8ea..5f4efbfe6f5 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -1567,6 +1567,7 @@ create table t1(f1 int not null, f2 int not null, primary key (f1), unique key(f1, f2))engine=innodb; insert into t1 values(1,3), (2,2); alter table t1 drop primary key, lock=none; +alter table t1 drop index f1, lock=none; ERROR 0A000: LOCK=NONE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try LOCK=SHARED drop table t1; # diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result index 5b5c4d6b9e1..ce2b81242db 100644 --- a/mysql-test/suite/innodb/r/innodb-table-online.result +++ b/mysql-test/suite/innodb/r/innodb-table-online.result @@ -99,17 +99,6 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `c2` (`c2`), UNIQUE KEY `c2_2` (`c2`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT -ALTER TABLE t1 DROP INDEX c2, ALGORITHM = INPLACE; -ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `c1` int(11) NOT NULL, - `c2` int(11) NOT NULL, - `c3` char(255) NOT NULL, - UNIQUE KEY `c2` (`c2`), - UNIQUE KEY `c2_2` (`c2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT ALTER TABLE t1 DROP INDEX c2, ADD PRIMARY KEY(c1); # session default connection default; diff --git a/mysql-test/suite/innodb/r/innodb_28867993.result b/mysql-test/suite/innodb/r/innodb_28867993.result new file mode 100644 index 00000000000..acc6734eaee --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_28867993.result @@ -0,0 +1,9 @@ +create table t1 (a int) engine=innodb; +insert t1 values (1),(2); +create database ib_logfile2; +select * from t1; +a +1 +2 +drop table t1; +drop database ib_logfile2; diff --git a/mysql-test/suite/innodb/t/alter_candidate_key.test b/mysql-test/suite/innodb/t/alter_candidate_key.test new file mode 100644 index 00000000000..7429cd89a1a --- /dev/null +++ b/mysql-test/suite/innodb/t/alter_candidate_key.test @@ -0,0 +1,72 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL, + UNIQUE KEY uidx2(f1,f2), + UNIQUE KEY uidx1(f2)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1, 1); +SHOW CREATE TABLE t1; +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter + SIGNAL conc_dml WAIT_FOR go_ahead'; +--send ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE +connect (con1,localhost,root,,); +SET DEBUG_SYNC = 'now WAIT_FOR conc_dml'; +DELETE FROM t1; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +reap; +SHOW CREATE TABLE t1; +CHECK TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1(f1 INT, f2 INT, + PRIMARY KEY(f1, f2), + UNIQUE INDEX uidx2 (f1, f2), + UNIQUE INDEX uidx1 (f2))ENGINE=InnoDB; +ALTER TABLE t1 DROP PRIMARY KEY; +SHOW CREATE TABLE t1; +SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter + SIGNAL conc_dml WAIT_FOR go_ahead'; +--send ALTER TABLE t1 CHANGE COLUMN f1 f11 INT, ALGORITHM=INPLACE +connection con1; +SET DEBUG_SYNC = 'now WAIT_FOR conc_dml'; +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES(1, 1), (1, 1); +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +connection default; +reap; +SHOW CREATE TABLE t1; +CHECK TABLE t1; +DROP TABLE t1; + +SET SQL_MODE= strict_trans_tables; +CREATE TABLE t1(a INT UNIQUE) ENGINE=InnoDB; +SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL dml WAIT_FOR dml_done'; +--send ALTER TABLE t1 MODIFY COLUMN a INT NOT NULL +connection con1; +SET DEBUG_SYNC='now WAIT_FOR dml'; +BEGIN; +INSERT INTO t1 SET a=NULL; +ROLLBACK; +set DEBUG_SYNC='now SIGNAL dml_done'; +connection default; +--error ER_INVALID_USE_OF_NULL +reap; +DROP TABLE t1; +disconnect con1; +SET DEBUG_SYNC="RESET"; +SET SQL_MODE=DEFAULT; + +CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY(f1, f2), + UNIQUE KEY(f2))ENGINE=InnoDB; +ALTER TABLE t1 DROP PRIMARY KEY; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL, + UNIQUE KEY(f2), UNIQUE KEY(f2))ENGINE=InnoDB; +SHOW CREATE TABLE t1; +ALTER TABLE t1 DROP INDEX f2, ALGORITHM=INPLACE; +SHOW CREATE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index 53f87cb78d5..bfbe62699fd 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -905,8 +905,9 @@ drop table t1; create table t1(f1 int not null, f2 int not null, primary key (f1), unique key(f1, f2))engine=innodb; insert into t1 values(1,3), (2,2); ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t1 drop primary key, lock=none; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +alter table t1 drop index f1, lock=none; drop table t1; --echo # diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test index edf83247142..2b3879bc707 100644 --- a/mysql-test/suite/innodb/t/innodb-table-online.test +++ b/mysql-test/suite/innodb/t/innodb-table-online.test @@ -102,10 +102,6 @@ ALTER TABLE t1 ADD UNIQUE INDEX(c2), LOCK = EXCLUSIVE, ALGORITHM = INPLACE; SHOW CREATE TABLE t1; -# We do not support plain DROP_PK_INDEX without ADD_PK_INDEX. ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON -ALTER TABLE t1 DROP INDEX c2, ALGORITHM = INPLACE; -SHOW CREATE TABLE t1; # Now the previous DEBUG_SYNC should kick in. --send ALTER TABLE t1 DROP INDEX c2, ADD PRIMARY KEY(c1); diff --git a/mysql-test/suite/innodb/t/innodb_28867993.test b/mysql-test/suite/innodb/t/innodb_28867993.test new file mode 100644 index 00000000000..61e9578df7b --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_28867993.test @@ -0,0 +1,12 @@ +# +# Bug#28867993: POSSIBLE ISSUE WITH MYSQL SERVER RESTART +# + +source include/have_innodb.inc; +create table t1 (a int) engine=innodb; +insert t1 values (1),(2); +create database ib_logfile2; +source include/restart_mysqld.inc; +select * from t1; +drop table t1; +drop database ib_logfile2; diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff new file mode 100644 index 00000000000..0849c5dcf64 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff @@ -0,0 +1,31 @@ +--- r/rpl_row_big_table_id.result 2019-01-23 19:58:07.204914873 +0200 ++++ r/rpl_row_big_table_id_32bit.result 2019-01-23 19:43:54.590640934 +0200 +@@ -22,22 +22,22 @@ + master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' + master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# + master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 1 +-master-bin.000002 # Table_map 1 # table_id: 4294967295 (test.t) +-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967295 flags: STMT_END_F ++master-bin.000002 # Table_map 1 # table_id: 1 (test.t) ++master-bin.000002 # Write_rows_v1 1 # table_id: 1 flags: STMT_END_F + master-bin.000002 # Query 1 # COMMIT + master-bin.000002 # Gtid 1 # GTID #-#-# + master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' + master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# + master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 2 +-master-bin.000002 # Table_map 1 # table_id: 4294967296 (test.t) +-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967296 flags: STMT_END_F ++master-bin.000002 # Table_map 1 # table_id: 2 (test.t) ++master-bin.000002 # Write_rows_v1 1 # table_id: 2 flags: STMT_END_F + master-bin.000002 # Query 1 # COMMIT + master-bin.000002 # Gtid 1 # GTID #-#-# + master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' + master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# + master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 3 +-master-bin.000002 # Table_map 1 # table_id: 4294967297 (test.t) +-master-bin.000002 # Write_rows_v1 1 # table_id: 4294967297 flags: STMT_END_F ++master-bin.000002 # Table_map 1 # table_id: 3 (test.t) ++master-bin.000002 # Write_rows_v1 1 # table_id: 3 flags: STMT_END_F + master-bin.000002 # Query 1 # COMMIT + connection slave; + connection master; diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id.result b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result new file mode 100644 index 00000000000..6fece52dda3 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id.result @@ -0,0 +1,46 @@ +include/master-slave.inc +[connection master] +connection master; +include/rpl_restart_server.inc [server_number=1] +SET @@debug_dbug="d,simulate_big_table_id"; +CREATE TABLE t (a int); +INSERT INTO t SET a= 0; +ALTER TABLE t comment ''; +INSERT INTO t SET a= 1; +ALTER TABLE t comment ''; +INSERT INTO t SET a= 2; +ALTER TABLE t comment ''; +INSERT INTO t SET a= 3; +show binlog events in <file> from <pos>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# +master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 0 +master-bin.000002 # Table_map 1 # table_id: 4294967294 (test.t) +master-bin.000002 # Write_rows_v1 1 # table_id: 4294967294 flags: STMT_END_F +master-bin.000002 # Query 1 # COMMIT +master-bin.000002 # Gtid 1 # GTID #-#-# +master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' +master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# +master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 1 +master-bin.000002 # Table_map 1 # table_id: 4294967295 (test.t) +master-bin.000002 # Write_rows_v1 1 # table_id: 4294967295 flags: STMT_END_F +master-bin.000002 # Query 1 # COMMIT +master-bin.000002 # Gtid 1 # GTID #-#-# +master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' +master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# +master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 2 +master-bin.000002 # Table_map 1 # table_id: 4294967296 (test.t) +master-bin.000002 # Write_rows_v1 1 # table_id: 4294967296 flags: STMT_END_F +master-bin.000002 # Query 1 # COMMIT +master-bin.000002 # Gtid 1 # GTID #-#-# +master-bin.000002 # Query 1 # use `test`; ALTER TABLE t comment '' +master-bin.000002 # Gtid 1 # BEGIN GTID #-#-# +master-bin.000002 # Annotate_rows 1 # INSERT INTO t SET a= 3 +master-bin.000002 # Table_map 1 # table_id: 4294967297 (test.t) +master-bin.000002 # Write_rows_v1 1 # table_id: 4294967297 flags: STMT_END_F +master-bin.000002 # Query 1 # COMMIT +connection slave; +connection master; +DROP TABLE t; +connection slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_big_table_id.test b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test new file mode 100644 index 00000000000..0c6f9d5e862 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test @@ -0,0 +1,57 @@ +################################################################## +# rpl_row_big_table_id +# +# MDEV-17803 Row-based event is not applied when +# table map id is greater 32 bit int +# +# Verify row-based events applying when table map id value is about and greater +# than 1 << 32. +################################################################## +--source include/word_size.inc +--source include/have_debug.inc +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +--connection master +# To reset last table id +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +SET @@debug_dbug="d,simulate_big_table_id"; +CREATE TABLE t (a int); + +--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) +--let $binlog_pos= query_get_value(SHOW MASTER STATUS, Position, 1) +INSERT INTO t SET a= 0; +ALTER TABLE t comment ''; +INSERT INTO t SET a= 1; +ALTER TABLE t comment ''; +INSERT INTO t SET a= 2; +ALTER TABLE t comment ''; +INSERT INTO t SET a= 3; + +# display simulated big table_id +--let $_in_from=in '$binlog_file' from $binlog_pos +--replace_result "$_in_from" "in <file> from <pos>" +--replace_column 2 # 5 # +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /GTID [0-9]+-[0-9]+-[0-9]+/GTID #-#-#/ +--eval show binlog events in '$binlog_file' from $binlog_pos + + +--sync_slave_with_master + +if (`SELECT sum(a) != 6 FROM t`) +{ + --echo *** unexpected result; check slave applier *** + --die +} + + +# Cleanup + +--connection master +DROP TABLE t; + +--sync_slave_with_master + +--source include/rpl_end.inc |