diff options
author | Monty <monty@mariadb.org> | 2016-04-28 16:59:33 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2016-04-28 16:59:33 +0300 |
commit | 9c846373f02d6431d83add639e7560a69ba885a2 (patch) | |
tree | 101d110d3ec9a4796b4050779fb052120fd6d516 /mysql-test | |
parent | fabeab781920dfcaf8e606708ba2c6812f6ae5d8 (diff) | |
parent | d5822a3ad0657040114cdc185c6387b9eb3a12b2 (diff) | |
download | mariadb-git-9c846373f02d6431d83add639e7560a69ba885a2.tar.gz |
Merge commit 'd5822a3ad0657040114cdc185c6387b9eb3a12b2' into 10.2
Diffstat (limited to 'mysql-test')
20 files changed, 589 insertions, 0 deletions
diff --git a/mysql-test/include/crash_mysqld.inc b/mysql-test/include/crash_mysqld.inc new file mode 100644 index 00000000000..4190d24d801 --- /dev/null +++ b/mysql-test/include/crash_mysqld.inc @@ -0,0 +1,18 @@ +# Crash mysqld hard and wait until it's restarted + +--source include/have_debug_sync.inc +--source include/not_embedded.inc + +# Write file to make mysql-test-run.pl expect crash and restart +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Setup the mysqld to crash at shutdown +SET debug_dbug="d,crash_shutdown"; +--error 2013 +shutdown; + +# Turn on reconnect +--enable_reconnect + +# Call script that will poll the server waiting for it to be back online again +--source include/wait_until_connected_again.inc diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 80b99115055..d54fa40f2da 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -476,3 +476,37 @@ connection con1; disconnect con1; connection default; drop tables tm, t1, t2; +# +# MDEV-9621 INSERT DELAYED fails on insert for tables with many columns +# +CREATE TABLE t1 ( +a int,b int,c int,d int,e int,f int,g int,h int,i int,j int,k int,l int,m int,n int,o int,p int,q int,r int,s int,t int,u int,v int,x int,y int,z int +) ENGINE=MyISAM; +INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z) +values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z) +values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +drop table t1; +# +# INSERT DELAYED hangs if table was crashed +# +create table t1 (a int, b int) engine=myisam; +insert into t1 values (1,1); +SET debug_dbug="d,crash_shutdown"; +shutdown; +ERROR HY000: Lost connection to MySQL server during query +call mtr.add_suppression(" marked as crashed and should be repaired"); +call mtr.add_suppression("Checking table"); +insert delayed into t1 values (2,2); +Warnings: +Error 145 Table './test/t1' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 1 client is using or hasn't closed the table properly +insert delayed into t1 values (3,3); +flush tables t1; +select * from t1; +a b +1 1 +2 2 +3 3 +drop table t1; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 40d72db8ab3..f27ae67adff 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2709,3 +2709,17 @@ NULL 100098 100099 drop table t0,t1,t2; +# +# MDEV-9602 crash in st_key::actual_rec_per_key when group by constant +# +create table t1 (a date not null,unique (a)) engine=innodb; +Warnings: +Warning 1286 Unknown storage engine 'innodb' +Warning 1266 Using storage engine MyISAM for table 't1' +select distinct a from t1 group by 'a'; +a +insert into t1 values("2001-02-02"),("2001-02-03"); +select distinct a from t1 group by 'a'; +a +2001-02-02 +drop table t1; diff --git a/mysql-test/std_data/bad2_master.info b/mysql-test/std_data/bad2_master.info new file mode 100644 index 00000000000..61722562748 --- /dev/null +++ b/mysql-test/std_data/bad2_master.info @@ -0,0 +1,35 @@ +33 +mysql-bin.000001 +4 +127.0.0.1 +root + +3310 +60 +0 + + + + + +0 +1800.000 + +0 + +0 + + + + + + + + + + + + + +using_gtid=1 +=0 diff --git a/mysql-test/std_data/bad3_master.info b/mysql-test/std_data/bad3_master.info new file mode 100644 index 00000000000..6e632cd9a49 --- /dev/null +++ b/mysql-test/std_data/bad3_master.info @@ -0,0 +1,37 @@ +33 +mysql-bin.000001 +4 +127.0.0.1 +root + +3310 +60 +0 + + + + + +0 +1800.000 + +0 + +0 + + + + + + + + + + + + + +using_gtid=1 + + +0 diff --git a/mysql-test/std_data/bad4_master.info b/mysql-test/std_data/bad4_master.info new file mode 100644 index 00000000000..87572efc8a4 --- /dev/null +++ b/mysql-test/std_data/bad4_master.info @@ -0,0 +1,35 @@ +33 +mysql-bin.000001 +4 +127.0.0.1 +root + +3310 +60 +0 + + + + + +0 +1800.000 + +0 + +0 + + + + + + + + + + + + + +using_gtid=1 +d=1 diff --git a/mysql-test/std_data/bad5_master.info b/mysql-test/std_data/bad5_master.info new file mode 100644 index 00000000000..4ea8113250b --- /dev/null +++ b/mysql-test/std_data/bad5_master.info @@ -0,0 +1,35 @@ +33 +mysql-bin.000001 +4 +127.0.0.1 +root + +3310 +60 +0 + + + + + +0 +1800.000 + +0 + +0 + + + + + + + + + + + + + +using_gtid=1 +using_gtid diff --git a/mysql-test/std_data/bad6_master.info b/mysql-test/std_data/bad6_master.info new file mode 100644 index 00000000000..0f48f4871f0 --- /dev/null +++ b/mysql-test/std_data/bad6_master.info @@ -0,0 +1,36 @@ +33 +mysql-bin.000001 +4 +127.0.0.1 +root + +3310 +60 +0 + + + + + +0 +1800.000 + +0 + +0 + + + + + + + + + + + + + +using_gtid=1 +END_MARKER +do_domain_ids=20 Hulubulu!!?! diff --git a/mysql-test/std_data/bad_master.info b/mysql-test/std_data/bad_master.info new file mode 100644 index 00000000000..1541fdf2c61 --- /dev/null +++ b/mysql-test/std_data/bad_master.info @@ -0,0 +1,35 @@ +33 +mysql-bin.000001 +4 +127.0.0.1 +root + +3310 +60 +0 + + + + + +0 +1800.000 + +0 + +0 + + + + + + + + + + + + + +using_gtid=1 + diff --git a/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc b/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc index 5f87d23dcc1..cbd2c1c817a 100644 --- a/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc +++ b/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc @@ -6,6 +6,7 @@ --connection node_1 # We need a user with a password to perform SST, otherwise we hit LP #1378253 +CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; --let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth` diff --git a/mysql-test/suite/galera/r/galera_ist_mysqldump.result b/mysql-test/suite/galera/r/galera_ist_mysqldump.result index 9a5b4e8a76f..788d60051b5 100644 --- a/mysql-test/suite/galera/r/galera_ist_mysqldump.result +++ b/mysql-test/suite/galera/r/galera_ist_mysqldump.result @@ -1,4 +1,5 @@ Setting SST method to mysqldump ... +CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; SET GLOBAL wsrep_sst_auth = 'sst:'; SET GLOBAL wsrep_sst_method = 'mysqldump'; diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result index e35c4055f45..5c0d9a45d41 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump.result +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result @@ -1,4 +1,5 @@ Setting SST method to mysqldump ... +CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; SET GLOBAL wsrep_sst_auth = 'sst:'; SET GLOBAL wsrep_sst_method = 'mysqldump'; diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result index 7d30b356aa9..227e1c15444 100644 --- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result +++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result @@ -1,4 +1,5 @@ Setting SST method to mysqldump ... +CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; SET GLOBAL wsrep_sst_auth = 'sst:'; SET GLOBAL wsrep_sst_method = 'mysqldump'; diff --git a/mysql-test/suite/galera/r/mysql-wsrep#237.result b/mysql-test/suite/galera/r/mysql-wsrep#237.result index 3fd9aed1480..1889a8feca0 100644 --- a/mysql-test/suite/galera/r/mysql-wsrep#237.result +++ b/mysql-test/suite/galera/r/mysql-wsrep#237.result @@ -8,3 +8,4 @@ SLEEP(1) 0 SET DEBUG_SYNC= 'now SIGNAL continue'; DROP TABLE t; +SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/galera/r/mysql-wsrep#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result index 62af519ad32..fc647a2000d 100644 --- a/mysql-test/suite/galera/r/mysql-wsrep#33.result +++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result @@ -1,4 +1,5 @@ Setting SST method to mysqldump ... +CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; SET GLOBAL wsrep_sst_auth = 'sst:'; SET GLOBAL wsrep_sst_method = 'mysqldump'; diff --git a/mysql-test/suite/galera/t/mysql-wsrep#237.test b/mysql-test/suite/galera/t/mysql-wsrep#237.test index 7a65cb52ae9..f2dd6bce711 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#237.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#237.test @@ -29,3 +29,5 @@ SET DEBUG_SYNC= 'now SIGNAL continue'; --reap DROP TABLE t; +--connection node_1a +SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result new file mode 100644 index 00000000000..f966f18964b --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result @@ -0,0 +1,88 @@ +include/master-slave.inc +[connection master] +*** MDEV-9383: Server fails to read master.info after upgrade 10.0 -> 10.1 *** +include/stop_slave.inc +CHANGE MASTER TO master_use_gtid=CURRENT_POS; +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2] +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (1); +include/save_master_gtid.inc +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1; +a +1 +include/stop_slave.inc +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2] +INSERT INTO t1 VALUES (2); +include/save_master_gtid.inc +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +include/stop_slave.inc +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2] +INSERT INTO t1 VALUES (3); +include/save_master_gtid.inc +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +include/stop_slave.inc +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2] +INSERT INTO t1 VALUES (4); +include/save_master_gtid.inc +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +include/stop_slave.inc +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2] +INSERT INTO t1 VALUES (5); +include/save_master_gtid.inc +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +include/stop_slave.inc +include/rpl_stop_server.inc [server_number=2] +include/rpl_start_server.inc [server_number=2] +INSERT INTO t1 VALUES (6); +include/save_master_gtid.inc +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1; +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +3 +4 +5 +6 +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test new file mode 100644 index 00000000000..e81e7c0d714 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test @@ -0,0 +1,163 @@ +--source include/master-slave.inc + +--echo *** MDEV-9383: Server fails to read master.info after upgrade 10.0 -> 10.1 *** + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO master_use_gtid=CURRENT_POS; +--let $datadir= `SELECT @@datadir` + +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master.info +--copy_file $MYSQL_TEST_DIR/std_data/bad_master.info $datadir/master.info + +--let $rpl_server_number= 2 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc + +--connection master +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES (1); +--source include/save_master_gtid.inc + +--connection slave +# Fix the port after we replaced master.info. +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1; + +--source include/stop_slave.inc + +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master.info +--copy_file $MYSQL_TEST_DIR/std_data/bad2_master.info $datadir/master.info + +--let $rpl_server_number= 2 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc + +--connection master +INSERT INTO t1 VALUES (2); +--source include/save_master_gtid.inc + +--connection slave +# Fix the port after we replaced master.info. +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; + +--source include/stop_slave.inc + +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master.info +--copy_file $MYSQL_TEST_DIR/std_data/bad3_master.info $datadir/master.info + +--let $rpl_server_number= 2 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc + +--connection master +INSERT INTO t1 VALUES (3); +--source include/save_master_gtid.inc + +--connection slave +# Fix the port after we replaced master.info. +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; + +--source include/stop_slave.inc + +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master.info +--copy_file $MYSQL_TEST_DIR/std_data/bad4_master.info $datadir/master.info + +--let $rpl_server_number= 2 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc + +--connection master +INSERT INTO t1 VALUES (4); +--source include/save_master_gtid.inc + +--connection slave +# Fix the port after we replaced master.info. +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; + +--source include/stop_slave.inc + +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master.info +--copy_file $MYSQL_TEST_DIR/std_data/bad5_master.info $datadir/master.info + +--let $rpl_server_number= 2 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc + +--connection master +INSERT INTO t1 VALUES (5); +--source include/save_master_gtid.inc + +--connection slave +# Fix the port after we replaced master.info. +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; + +--source include/stop_slave.inc + +--let $rpl_server_number= 2 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master.info +--copy_file $MYSQL_TEST_DIR/std_data/bad6_master.info $datadir/master.info + +--let $rpl_server_number= 2 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc + +--connection master +INSERT INTO t1 VALUES (6); +--source include/save_master_gtid.inc + +--connection slave +# Fix the port after we replaced master.info. +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; + + +# Cleanup +--connection master +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 85f28de128b..dea16c84a51 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -1,5 +1,12 @@ # delayed works differently in embedded server --source include/not_embedded.inc +# Don't test this under valgrind, memory leaks will occur +--source include/not_valgrind.inc +# Avoid CrashReporter popup on Mac +--source include/not_crashrep.inc +# Binary must be compiled with debug for crash to occur +--source include/have_debug_sync.inc + # # test of DELAYED insert and timestamps # (Can't be tested with purify :( ) @@ -601,3 +608,37 @@ disconnect con1; --source include/wait_until_disconnected.inc connection default; drop tables tm, t1, t2; + +--echo # +--echo # MDEV-9621 INSERT DELAYED fails on insert for tables with many columns +--echo # + +CREATE TABLE t1 ( + a int,b int,c int,d int,e int,f int,g int,h int,i int,j int,k int,l int,m int,n int,o int,p int,q int,r int,s int,t int,u int,v int,x int,y int,z int +) ENGINE=MyISAM; + +INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z) +values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +INSERT DELAYED INTO t1 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z) +values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +drop table t1; + +--echo # +--echo # INSERT DELAYED hangs if table was crashed +--echo # + +create table t1 (a int, b int) engine=myisam; +insert into t1 values (1,1); + +# Will come back with t1 crashed. +--source include/crash_mysqld.inc + +call mtr.add_suppression(" marked as crashed and should be repaired"); +call mtr.add_suppression("Checking table"); + +--replace_result '\\' '/' +insert delayed into t1 values (2,2); +insert delayed into t1 values (3,3); +flush tables t1; +select * from t1; +drop table t1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 318166e6896..f0007186ab2 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1818,3 +1818,13 @@ from t1 group by t1.b; drop table t0,t1,t2; + +--echo # +--echo # MDEV-9602 crash in st_key::actual_rec_per_key when group by constant +--echo # + +create table t1 (a date not null,unique (a)) engine=innodb; +select distinct a from t1 group by 'a'; +insert into t1 values("2001-02-02"),("2001-02-03"); +select distinct a from t1 group by 'a'; +drop table t1; |