diff options
Diffstat (limited to 'mysql-test/suite')
86 files changed, 1663 insertions, 289 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_mdev717.result b/mysql-test/suite/binlog/r/binlog_mdev717.result new file mode 100644 index 00000000000..82f8e5a6e3f --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_mdev717.result @@ -0,0 +1,40 @@ +RESET MASTER; +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +DROP DATABASE mysqltest;; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +CREATE FUNCTION mysqltest.f1() RETURNS INT RETURN 1; +ERROR 42000: Unknown database 'mysqltest' +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +DROP DATABASE mysqltest;; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +ERROR 42000: Unknown database 'mysqltest' +CREATE DATABASE mysqltest; +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +DROP DATABASE mysqltest;; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +ALTER EVENT mysqltest.e1 ON SCHEDULE EVERY 20 MINUTE DO BEGIN END; +ERROR 42000: Unknown database 'mysqltest' +SET DEBUG_SYNC= "RESET"; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # CREATE DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # CREATE DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # CREATE DATABASE mysqltest +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP DATABASE mysqltest diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 710c95546fd..25b6e7351a2 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -681,7 +681,7 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F diff --git a/mysql-test/suite/binlog/t/binlog_mdev717.test b/mysql-test/suite/binlog/t/binlog_mdev717.test new file mode 100644 index 00000000000..61d3aa715d2 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_mdev717.test @@ -0,0 +1,46 @@ +# MDEV-717 LP:1003679 - Wrong binlog order on concurrent DROP schema and CREATE function. + +--source include/have_debug_sync.inc +--source include/have_log_bin.inc +RESET MASTER; + +connect(con1,localhost,root); +connection default; + +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +--send DROP DATABASE mysqltest; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +--error ER_BAD_DB_ERROR +CREATE FUNCTION mysqltest.f1() RETURNS INT RETURN 1; +connection default; +--reap + +CREATE DATABASE mysqltest; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +--send DROP DATABASE mysqltest; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +--error ER_BAD_DB_ERROR +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +connection default; +--reap + +CREATE DATABASE mysqltest; +CREATE EVENT mysqltest.e1 ON SCHEDULE EVERY 15 MINUTE DO BEGIN END; +SET DEBUG_SYNC= "after_wait_locked_schema_name SIGNAL locked WAIT_FOR release"; +--send DROP DATABASE mysqltest; +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR locked"; +SET DEBUG_SYNC= "before_wait_locked_pname SIGNAL release"; +--error ER_BAD_DB_ERROR +ALTER EVENT mysqltest.e1 ON SCHEDULE EVERY 20 MINUTE DO BEGIN END; +connection default; +--reap + +SET DEBUG_SYNC= "RESET"; +--source include/show_binlog_events.inc + diff --git a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test index 8bb5f9f2c49..cb9a69d036b 100644 --- a/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test +++ b/mysql-test/suite/encryption/t/innodb-log-encrypt-crash.test @@ -1,5 +1,8 @@ -- source include/have_innodb.inc -- source include/not_embedded.inc +# test takes very long time on debug build +-- source include/not_debug.inc +-- source include/big_test.inc -- source filekeys_plugin.inc call mtr.add_suppression("InnoDB: New log files created, LSN=.*"); diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result index 02805c41cf7..ee127d76bcc 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result @@ -84,6 +84,7 @@ utf8_vietnamese_ci utf8 215 # # utf8_general_mysql500_ci utf8 223 # # utf8_croatian_ci utf8 576 # # utf8_myanmar_ci utf8 577 # # +utf8_thai_520_w2 utf8 578 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # ucs2_unicode_ci ucs2 128 # # @@ -113,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # # ucs2_general_mysql500_ci ucs2 159 # # ucs2_croatian_ci ucs2 640 # # ucs2_myanmar_ci ucs2 641 # # +ucs2_thai_520_w2 ucs2 642 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # keybcs2_general_ci keybcs2 37 Yes # # @@ -155,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # # utf8mb4_vietnamese_ci utf8mb4 247 # # utf8mb4_croatian_ci utf8mb4 608 # # utf8mb4_myanmar_ci utf8mb4 609 # # +utf8mb4_thai_520_w2 utf8mb4 610 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -188,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # # utf16_vietnamese_ci utf16 124 # # utf16_croatian_ci utf16 672 # # utf16_myanmar_ci utf16 673 # # +utf16_thai_520_w2 utf16 674 # # utf16le_general_ci utf16le 56 Yes # # utf16le_bin utf16le 62 # # cp1256_general_ci cp1256 57 Yes # # @@ -223,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # # utf32_vietnamese_ci utf32 183 # # utf32_croatian_ci utf32 736 # # utf32_myanmar_ci utf32 737 # # +utf32_thai_520_w2 utf32 738 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result index 501bd95cf55..46921fcaa8c 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result @@ -84,6 +84,7 @@ utf8_vietnamese_ci utf8 215 # # utf8_general_mysql500_ci utf8 223 # # utf8_croatian_ci utf8 576 # # utf8_myanmar_ci utf8 577 # # +utf8_thai_520_w2 utf8 578 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # ucs2_unicode_ci ucs2 128 # # @@ -113,6 +114,7 @@ ucs2_vietnamese_ci ucs2 151 # # ucs2_general_mysql500_ci ucs2 159 # # ucs2_croatian_ci ucs2 640 # # ucs2_myanmar_ci ucs2 641 # # +ucs2_thai_520_w2 ucs2 642 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # keybcs2_general_ci keybcs2 37 Yes # # @@ -155,6 +157,7 @@ utf8mb4_unicode_520_ci utf8mb4 246 # # utf8mb4_vietnamese_ci utf8mb4 247 # # utf8mb4_croatian_ci utf8mb4 608 # # utf8mb4_myanmar_ci utf8mb4 609 # # +utf8mb4_thai_520_w2 utf8mb4 610 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -188,6 +191,7 @@ utf16_unicode_520_ci utf16 123 # # utf16_vietnamese_ci utf16 124 # # utf16_croatian_ci utf16 672 # # utf16_myanmar_ci utf16 673 # # +utf16_thai_520_w2 utf16 674 # # utf16le_general_ci utf16le 56 Yes # # utf16le_bin utf16le 62 # # cp1256_general_ci cp1256 57 Yes # # @@ -223,6 +227,7 @@ utf32_unicode_520_ci utf32 182 # # utf32_vietnamese_ci utf32 183 # # utf32_croatian_ci utf32 736 # # utf32_myanmar_ci utf32 737 # # +utf32_thai_520_w2 utf32 738 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf index 1dbaad4f699..b8c61bc814d 100644 --- a/mysql-test/suite/galera/galera_2nodes.cnf +++ b/mysql-test/suite/galera/galera_2nodes.cnf @@ -9,7 +9,6 @@ default-storage-engine=innodb wsrep-provider=@ENV.WSREP_PROVIDER wsrep_node_address=127.0.0.1 # enforce read-committed characteristics across the cluster -wsrep-causal-reads=ON wsrep-sync-wait=7 [mysqld.1] diff --git a/mysql-test/suite/galera/r/MW-284.result b/mysql-test/suite/galera/r/MW-284.result new file mode 100644 index 00000000000..8b5119663ce --- /dev/null +++ b/mysql-test/suite/galera/r/MW-284.result @@ -0,0 +1,13 @@ +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +SET SESSION wsrep_on = OFF; +SET SESSION wsrep_on = ON; +START SLAVE; +include/wait_for_slave_param.inc [Slave_IO_Running] +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +include/wait_for_slave_to_start.inc +INSERT INTO t1 VALUES (1); +DROP TABLE t1; +STOP SLAVE; +RESET SLAVE ALL; +CALL mtr.add_suppression('failed registering on master'); diff --git a/mysql-test/suite/galera/r/create.result b/mysql-test/suite/galera/r/create.result index 20bc9a3958e..b93cd7b9496 100644 --- a/mysql-test/suite/galera/r/create.result +++ b/mysql-test/suite/galera/r/create.result @@ -62,4 +62,27 @@ t2 CREATE TABLE `t2` ( KEY `idx` (`i`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t1, t2; +# +# MDEV-9853: WSREP says it cannot get fake InnoDB transaction ID +# followed by segmentation fault +# +CREATE TABLE `t1`(`c1` INT) ENGINE=INNODB; +SET autocommit=0; +CREATE TABLE `t2` (`c1` INT) ENGINE=INNODB SELECT * FROM t1; +COMMIT; +SET autocommit=1; +DROP TABLE t1, t2; +# +# MDEV-10235: Deadlock in CREATE TABLE ... AS SELECT .. if result set +# is empty in Galera +# +CREATE TABLE t1(c1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TABLE t2 AS SELECT * FROM t1 WHERE c1=2; +SELECT * FROM t1; +c1 +1 +SELECT * FROM t2; +c1 +DROP TABLE t1, t2; # End of tests diff --git a/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-test/suite/galera/r/galera_var_sync_wait.result index 40a6290374f..7f3afa77ecd 100644 --- a/mysql-test/suite/galera/r/galera_var_sync_wait.result +++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result @@ -1,3 +1,12 @@ +# +# MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file +# +SELECT @@global.wsrep_sync_wait; +@@global.wsrep_sync_wait +7 +SELECT @@global.wsrep_causal_reads; +@@global.wsrep_causal_reads +1 connection node_1; CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; connection node_2; diff --git a/mysql-test/suite/galera/t/MW-284.cnf b/mysql-test/suite/galera/t/MW-284.cnf new file mode 100644 index 00000000000..52fd3093931 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-284.cnf @@ -0,0 +1 @@ +!include ../galera_2nodes_as_master.cnf diff --git a/mysql-test/suite/galera/t/MW-284.test b/mysql-test/suite/galera/t/MW-284.test new file mode 100644 index 00000000000..5998e22ed1e --- /dev/null +++ b/mysql-test/suite/galera/t/MW-284.test @@ -0,0 +1,57 @@ +# +# MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--disable_query_log +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root', MASTER_CONNECT_RETRY=1; +--enable_query_log + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +SET SESSION wsrep_on = OFF; +--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status' +--source include/wait_condition.inc +SET SESSION wsrep_on = ON; + +--connection node_3 +START SLAVE; +--sleep 1 +--let $slave_param= Slave_IO_Running +--let $slave_param_value= Connecting +--source include/wait_for_slave_param.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +# We expect the slave to reconnect and resume replication + +--connection node_3 +--source include/wait_for_slave_to_start.inc + +--connection node_1 +INSERT INTO t1 VALUES (1); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) > 0 FROM t1 +--source include/wait_condition.inc + +# Cleanup + +--connection node_1 +DROP TABLE t1; + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc + +STOP SLAVE; +RESET SLAVE ALL; + +CALL mtr.add_suppression('failed registering on master'); diff --git a/mysql-test/suite/galera/t/create.test b/mysql-test/suite/galera/t/create.test index fb9b0935288..96a6640c21f 100644 --- a/mysql-test/suite/galera/t/create.test +++ b/mysql-test/suite/galera/t/create.test @@ -54,5 +54,36 @@ SHOW CREATE TABLE t2; # Cleanup DROP TABLE t1, t2; +--echo # +--echo # MDEV-9853: WSREP says it cannot get fake InnoDB transaction ID +--echo # followed by segmentation fault +--echo # +CREATE TABLE `t1`(`c1` INT) ENGINE=INNODB; + +SET autocommit=0; +CREATE TABLE `t2` (`c1` INT) ENGINE=INNODB SELECT * FROM t1; +COMMIT; +SET autocommit=1; + +# Cleanup +DROP TABLE t1, t2; + + +--echo # +--echo # MDEV-10235: Deadlock in CREATE TABLE ... AS SELECT .. if result set +--echo # is empty in Galera +--echo # +--connection node_1 +CREATE TABLE t1(c1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +CREATE TABLE t2 AS SELECT * FROM t1 WHERE c1=2; + +--connection node_2 +SELECT * FROM t1; +SELECT * FROM t2; +# Cleanup +DROP TABLE t1, t2; + +--source include/galera_end.inc --echo # End of tests diff --git a/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-test/suite/galera/t/galera_var_sync_wait.test index 935c271a4d6..288ad62226f 100644 --- a/mysql-test/suite/galera/t/galera_var_sync_wait.test +++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test @@ -5,6 +5,13 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--echo # +--echo # MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file +--echo # +# galera_2nodes.cnf sets wsrep_sync_wait to 7 +SELECT @@global.wsrep_sync_wait; +SELECT @@global.wsrep_causal_reads; + --let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait` --connection node_1 diff --git a/mysql-test/suite/galera/t/mysql-wsrep#237.test b/mysql-test/suite/galera/t/mysql-wsrep#237.test index f2dd6bce711..cba8dfeb275 100644 --- a/mysql-test/suite/galera/t/mysql-wsrep#237.test +++ b/mysql-test/suite/galera/t/mysql-wsrep#237.test @@ -28,6 +28,7 @@ SET DEBUG_SYNC= 'now SIGNAL continue'; --connection node_1 --reap +# Cleanup DROP TABLE t; --connection node_1a SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result index f3c0f798902..102237617fd 100644 --- a/mysql-test/suite/handler/innodb.result +++ b/mysql-test/suite/handler/innodb.result @@ -545,7 +545,6 @@ optimize table t1; connection default; handler t1 read next; c1 -1 handler t1 close; connection con2; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/innodb/r/create_isl_with_direct.result b/mysql-test/suite/innodb/r/create_isl_with_direct.result new file mode 100644 index 00000000000..87544e6dcdf --- /dev/null +++ b/mysql-test/suite/innodb/r/create_isl_with_direct.result @@ -0,0 +1,10 @@ +SHOW VARIABLES LIKE 'innodb_flush_method'; +Variable_name Value +innodb_flush_method O_DIRECT +CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='MYSQL_TMP_DIR'; +# Contents of tmp/test directory containing .ibd file +t1.ibd +# Contents of the 'test' database directory containing .isl and .frm files +t1.frm +t1.isl +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/defrag_mdl-9155.result b/mysql-test/suite/innodb/r/defrag_mdl-9155.result new file mode 100644 index 00000000000..36cafd305ba --- /dev/null +++ b/mysql-test/suite/innodb/r/defrag_mdl-9155.result @@ -0,0 +1,15 @@ +set global innodb_defragment=1; +create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb; +insert t1 select null, repeat('a', 256) from seq_1_to_100; +select count(*) from t1; +count(*) +100 +start transaction; +select count(*) from t1; +count(*) +100 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +drop table t1; +set global innodb_defragment=default; diff --git a/mysql-test/suite/innodb/r/innodb-corrupted-table.result b/mysql-test/suite/innodb/r/innodb-corrupted-table.result new file mode 100644 index 00000000000..94203a794f8 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-corrupted-table.result @@ -0,0 +1,49 @@ +call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*"); +call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*"); +create table t1 (pk int, i int, key(i)) engine=InnoDB; +insert into t1 values (1,1),(2,2); +flush tables; +# Save the .frm file without the PK +alter table t1 add primary key (pk); +# Stop the server, replace the frm with the old one and restart the server +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) DEFAULT NULL, + `i` int(11) DEFAULT NULL, + KEY `i` (`i`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +Warnings: +Warning 1082 InnoDB: Table test/t1 has a primary key in InnoDB data dictionary, but not in MySQL! +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +select * from t1; +pk i +1 1 +2 2 +alter table t1 add j int; +Warnings: +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +show warnings; +Level Code Message +Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) DEFAULT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + KEY `i` (`i`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t1 add primary key (pk); +show warnings; +Level Code Message +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + `j` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`), + KEY `i` (`i`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result index c916d665bf0..2eb19764769 100644 --- a/mysql-test/suite/innodb/r/innodb-fk.result +++ b/mysql-test/suite/innodb/r/innodb-fk.result @@ -70,6 +70,50 @@ Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key c Warning 1215 Cannot add foreign key constraint drop table t2; drop table t1; +CREATE DATABASE kg_test1; +CREATE DATABASE kg_test2; +CREATE TABLE `kg_test1`.`group` ( +Id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE `kg_test1`.`person` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +show create table `kg_test1`.`person`; +Table Create Table +person CREATE TABLE `person` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(50) NOT NULL, + PRIMARY KEY (`Id`), + CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +ERROR HY000: Can't create table `kg_test2`.`person2` (errno: 150 "Foreign key constraint is incorrectly formed") +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +show create table `kg_test2`.`person2`; +Table Create Table +person2 CREATE TABLE `person2` ( + `Id` int(11) NOT NULL AUTO_INCREMENT, + `Name` varchar(50) NOT NULL, + PRIMARY KEY (`Id`), + CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW WARNINGS; +Level Code Message +DROP DATABASE kg_test2; +DROP DATABASE kg_test1; CREATE TABLE `#departaments` ( `id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id_depart`) diff --git a/mysql-test/suite/innodb/r/innodb-fkcheck.result b/mysql-test/suite/innodb/r/innodb-fkcheck.result new file mode 100644 index 00000000000..c6beabb0f50 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-fkcheck.result @@ -0,0 +1,89 @@ +set global innodb_file_per_table = 1; +drop table if exists b; +drop database if exists bug_fk; +create database bug_fk; +use bug_fk; +CREATE TABLE b ( +b int unsigned NOT NULL, +d1 datetime NOT NULL, +PRIMARY KEY (b,d1) +) ENGINE=InnoDB; +CREATE TABLE c ( +b int unsigned NOT NULL, +d1 datetime NOT NULL, +d2 datetime NOT NULL, +PRIMARY KEY (b,d1), +CONSTRAINT b_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; +show warnings; +Level Code Message +set foreign_key_checks = 0; +DROP TABLE IF EXISTS b; +show create table c; +Table Create Table +c CREATE TABLE `c` ( + `b` int(10) unsigned NOT NULL, + `d1` datetime NOT NULL, + `d2` datetime NOT NULL, + PRIMARY KEY (`b`,`d1`), + CONSTRAINT `b_fk` FOREIGN KEY (`b`) REFERENCES `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CREATE TABLE b ( +b bigint unsigned NOT NULL, +d1 date NOT NULL, +PRIMARY KEY (b,d1) +) ENGINE=InnoDB; +ERROR HY000: Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +show warnings; +Level Code Message +Error 1005 Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +Warning 1215 Cannot add foreign key constraint +DROP TABLE IF EXISTS d; +Warnings: +Note 1051 Unknown table 'bug_fk.d' +CREATE TABLE d ( +b bigint unsigned NOT NULL, +d1 date NOT NULL, +PRIMARY KEY (b,d1), +CONSTRAINT bd_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; +show warnings; +Level Code Message +set foreign_key_checks = 1; +show create table c; +Table Create Table +c CREATE TABLE `c` ( + `b` int(10) unsigned NOT NULL, + `d1` datetime NOT NULL, + `d2` datetime NOT NULL, + PRIMARY KEY (`b`,`d1`), + CONSTRAINT `b_fk` FOREIGN KEY (`b`) REFERENCES `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table d; +Table Create Table +d CREATE TABLE `d` ( + `b` bigint(20) unsigned NOT NULL, + `d1` date NOT NULL, + PRIMARY KEY (`b`,`d1`), + CONSTRAINT `bd_fk` FOREIGN KEY (`b`) REFERENCES `b` (`b`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CREATE TABLE b ( +b bigint unsigned NOT NULL, +d1 date NOT NULL, +PRIMARY KEY (b,d1) +) ENGINE=InnoDB; +ERROR HY000: Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +show warnings; +Level Code Message +Error 1005 Can't create table `bug_fk`.`b` (errno: 150 "Foreign key constraint is incorrectly formed") +Warning 1215 Cannot add foreign key constraint +set foreign_key_checks=0; +drop table c; +drop table d; +create table b(id int) engine=innodb; +show warnings; +Level Code Message +b.frm +b.ibd +drop table if exists b; +drop database if exists bug_fk; diff --git a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result index 353303825e5..0ef6f65d0ff 100644 --- a/mysql-test/suite/innodb/r/innodb_corrupt_bit.result +++ b/mysql-test/suite/innodb/r/innodb_corrupt_bit.result @@ -1,82 +1,48 @@ -set names utf8; -CREATE TABLE corrupt_bit_test_ā( -a INT AUTO_INCREMENT PRIMARY KEY, -b CHAR(100), -c INT, -z INT, -INDEX(b)) -ENGINE=InnoDB; -INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1); -CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b); -CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b); -SELECT * FROM corrupt_bit_test_ā; a b c z 1 x 1 1 -select @@unique_checks; -@@unique_checks -0 -select @@innodb_change_buffering_debug; -@@innodb_change_buffering_debug -1 -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā; -select count(*) from corrupt_bit_test_ā; count(*) -1024 -CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c); -INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1); -CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z); -check table corrupt_bit_test_ā; +2 Table Op Msg_type Msg_text -test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxā" is corrupted. -test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxē" is corrupted. +test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted +test.corrupt_bit_test_ā check Warning InnoDB: Index "idxā" is marked as corrupted +test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted test.corrupt_bit_test_ā check error Corrupt -select c from corrupt_bit_test_ā; +ERROR HY000: Index "idx" is corrupted +ERROR HY000: Index "idx" is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted -select z from corrupt_bit_test_ā; ERROR HY000: Index corrupt_bit_test_ā is corrupted -show warnings; Level Code Message Warning 180 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted Error 1712 Index corrupt_bit_test_ā is corrupted -insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001); -select * from corrupt_bit_test_ā use index(primary) where a = 10001; a b c z 10001 a 20001 20001 -begin; -insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002); -delete from corrupt_bit_test_ā where a = 10001; -insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001); -rollback; -drop index idxā on corrupt_bit_test_ā; -check table corrupt_bit_test_ā; Table Op Msg_type Msg_text +test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted test.corrupt_bit_test_ā check error Corrupt -set names utf8; -select z from corrupt_bit_test_ā; ERROR HY000: Index corrupt_bit_test_ā is corrupted -drop index idxē on corrupt_bit_test_ā; -select z from corrupt_bit_test_ā limit 10; +Table Create Table +corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` char(100) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `z` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `idxē` (`z`,`b`), + KEY `idx` (`b`) +) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 +ERROR HY000: Index "idx" is corrupted +ERROR HY000: Index "idx" is corrupted +Table Create Table +corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` char(100) DEFAULT NULL, + `c` int(11) DEFAULT NULL, + `z` int(11) DEFAULT NULL, + PRIMARY KEY (`a`), + KEY `idx` (`b`) +) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 z 20001 1 -1 2 -11 -12 -21 -22 -31 -32 -drop table corrupt_bit_test_ā; -DROP DATABASE pad; -SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result index 0008de141dc..fefadb2ecb0 100644 --- a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result +++ b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result @@ -396,6 +396,7 @@ utf8mb4_test_400_ci utf8mb4 328 8 latin1_test2 latin1 332 1 utf8_bengali_standard_ci utf8 336 8 utf8_bengali_traditional_ci utf8 337 8 +utf8_implicit_weights_ci utf8 338 8 utf8_phone_ci utf8 352 8 utf8_test_ci utf8 353 8 utf8_5624_1 utf8 354 8 diff --git a/mysql-test/suite/innodb/r/innodb_uninstall.result b/mysql-test/suite/innodb/r/innodb_uninstall.result index f3b166c5736..40c76b4131c 100644 --- a/mysql-test/suite/innodb/r/innodb_uninstall.result +++ b/mysql-test/suite/innodb/r/innodb_uninstall.result @@ -1,6 +1,4 @@ install plugin innodb soname 'ha_innodb'; -Warnings: -Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled create table t1(a int not null primary key) engine=innodb; connect con1, localhost, root; connection con1; @@ -20,8 +18,6 @@ Warning 1620 Plugin is busy and will be uninstalled on shutdown connect con1, localhost, root; connection con1; install plugin innodb soname 'ha_innodb'; -Warnings: -Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled drop table t1; create table t2(a int not null primary key) engine=innodb; insert into t2 values(1); diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.opt b/mysql-test/suite/innodb/t/create_isl_with_direct.opt new file mode 100644 index 00000000000..8f80f02e359 --- /dev/null +++ b/mysql-test/suite/innodb/t/create_isl_with_direct.opt @@ -0,0 +1 @@ +--innodb_flush_method=O_DIRECT diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.test b/mysql-test/suite/innodb/t/create_isl_with_direct.test new file mode 100644 index 00000000000..34ea9c77703 --- /dev/null +++ b/mysql-test/suite/innodb/t/create_isl_with_direct.test @@ -0,0 +1,28 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/not_windows.inc + +--disable_query_log +CALL mtr.add_suppression("\\[Warning\\] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662."); + +# The below mtr suppression to avoid failure in solaris platform. +CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to set DIRECTIO_ON on file.*"); +--enable_query_log + +SHOW VARIABLES LIKE 'innodb_flush_method'; + +let MYSQLD_DATADIR=`SELECT @@datadir`; + +--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR + +# Create a table with explicit data directory option. +EVAL CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='$MYSQL_TMP_DIR'; + +--echo # Contents of tmp/test directory containing .ibd file +--list_files $MYSQL_TMP_DIR/test + +--echo # Contents of the 'test' database directory containing .isl and .frm files +--list_files $MYSQLD_DATADIR/test + +DROP TABLE t1; +
\ No newline at end of file diff --git a/mysql-test/suite/innodb/t/defrag_mdl-9155.test b/mysql-test/suite/innodb/t/defrag_mdl-9155.test new file mode 100644 index 00000000000..1e1efb9c4c6 --- /dev/null +++ b/mysql-test/suite/innodb/t/defrag_mdl-9155.test @@ -0,0 +1,22 @@ +# +# MDEV-9155 Enabling Defragmenting in 10.1.8 still causes OPTIMIZE TABLE to take metadatalocks +# +source include/have_innodb.inc; +source include/have_sequence.inc; + +set global innodb_defragment=1; +create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb; +insert t1 select null, repeat('a', 256) from seq_1_to_100; +select count(*) from t1; + +connect (con1,localhost,root); +start transaction; +select count(*) from t1; + +connection default; +optimize table t1; + +connection con1; +drop table t1; + +set global innodb_defragment=default; diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test new file mode 100644 index 00000000000..94c5454429f --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test @@ -0,0 +1,46 @@ +--source include/have_innodb.inc +--source include/not_embedded.inc + +# +# MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE `name` COLUMN ADD +# + +call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*"); +call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*"); + +create table t1 (pk int, i int, key(i)) engine=InnoDB; +insert into t1 values (1,1),(2,2); + +--let $datadir= `select @@datadir` + +flush tables; + +--echo # Save the .frm file without the PK + +--copy_file $datadir/test/t1.frm $MYSQLTEST_VARDIR/tmp/t1.frm + +alter table t1 add primary key (pk); + +--echo # Stop the server, replace the frm with the old one and restart the server + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server 10 +--source include/wait_until_disconnected.inc + +--remove_file $datadir/test/t1.frm +--copy_file $MYSQLTEST_VARDIR/tmp/t1.frm $datadir/test/t1.frm + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +show create table t1; +select * from t1; +alter table t1 add j int; +show warnings; +show create table t1; +alter table t1 add primary key (pk); +show warnings; +show create table t1; +# Cleanup +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-fk.test b/mysql-test/suite/innodb/t/innodb-fk.test index f7bcbe238dd..17e926e8647 100644 --- a/mysql-test/suite/innodb/t/innodb-fk.test +++ b/mysql-test/suite/innodb/t/innodb-fk.test @@ -126,6 +126,47 @@ drop table t2; drop table t1; # +# MDEV-9142 :Adding Constraint with no database reference +# results in ERROR 1046 (3D000) at line 13: No database selected +# +CREATE DATABASE kg_test1; +CREATE DATABASE kg_test2; + +CREATE TABLE `kg_test1`.`group` ( + Id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `kg_test1`.`person` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +show create table `kg_test1`.`person`; + +--error 1005 +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +CREATE TABLE `kg_test2`.`person2` ( +`Id` INT(11) NOT NULL AUTO_INCREMENT, +`Name` VARCHAR(50) NOT NULL, +PRIMARY KEY (`Id`), +CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +show create table `kg_test2`.`person2`; + +SHOW WARNINGS; +DROP DATABASE kg_test2; +DROP DATABASE kg_test1; + +# # MDEV-7627: Some symbols in table name can cause to Error Code: 1050 when created FK # diff --git a/mysql-test/suite/innodb/t/innodb-fkcheck.test b/mysql-test/suite/innodb/t/innodb-fkcheck.test new file mode 100644 index 00000000000..51e36ae6984 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-fkcheck.test @@ -0,0 +1,115 @@ +--source include/have_innodb.inc + +# +# MDEV-10083: Orphan ibd file when playing with foreign keys +# +--disable_query_log +SET @start_global_fpt = @@global.innodb_file_per_table; +SET @start_global_fkc = @@global.foreign_key_checks; +--enable_query_log + +set global innodb_file_per_table = 1; + +--disable_warnings +drop table if exists b; +drop database if exists bug_fk; +--enable_warnings + +let $MYSQLD_DATADIR = `select @@datadir`; + +create database bug_fk; +use bug_fk; + +CREATE TABLE b ( + b int unsigned NOT NULL, + d1 datetime NOT NULL, + PRIMARY KEY (b,d1) +) ENGINE=InnoDB; + +CREATE TABLE c ( + b int unsigned NOT NULL, + d1 datetime NOT NULL, + d2 datetime NOT NULL, + PRIMARY KEY (b,d1), + CONSTRAINT b_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; + +show warnings; + +set foreign_key_checks = 0; + +DROP TABLE IF EXISTS b; + +show create table c; + +# +# Note that column b has different type in parent table +# +--error 1005 +CREATE TABLE b ( + b bigint unsigned NOT NULL, + d1 date NOT NULL, + PRIMARY KEY (b,d1) +) ENGINE=InnoDB; + +show warnings; + +DROP TABLE IF EXISTS d; + +CREATE TABLE d ( + b bigint unsigned NOT NULL, + d1 date NOT NULL, + PRIMARY KEY (b,d1), + CONSTRAINT bd_fk FOREIGN KEY (b) REFERENCES b (b) +) ENGINE=InnoDB; + +show warnings; + +set foreign_key_checks = 1; + +show create table c; +show create table d; + +# +# Table c column b used on foreign key has different type +# compared referenced column b in table b, but this +# create still produced b.ibd file. This is because +# we row_drop_table_for_mysql was called and referenced +# table is not allowed to be dropped even in case +# when actual create is not successfull. +# +--error 1005 +CREATE TABLE b ( + b bigint unsigned NOT NULL, + d1 date NOT NULL, + PRIMARY KEY (b,d1) +) ENGINE=InnoDB; + +show warnings; + +--list_files $MYSQLD_DATADIR/bug_fk b* + +set foreign_key_checks=0; + +drop table c; +drop table d; + +--list_files $MYSQLD_DATADIR/bug_fk b* + +create table b(id int) engine=innodb; +show warnings; + +--list_files $MYSQLD_DATADIR/bug_fk b* + +# +# Cleanup +# +--disable_query_log +SET @@global.innodb_file_per_table = @start_global_fpt; +SET @@global.foreign_key_checks = @start_global_fkc; +--enable_query_log + +--disable_warnings +drop table if exists b; +drop database if exists bug_fk; +--enable_warnings diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test index d6d77076b83..ee04e8d66fc 100644 --- a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test +++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test @@ -2,46 +2,24 @@ # Test for persistent corrupt bit for corrupted index and table # -- source include/have_innodb.inc --- source include/have_innodb_16k.inc - -# Issues with innodb_change_buffering_debug on Windows, so the test scenario -# cannot be created on windows ---source include/not_windows.inc - +#-- source include/have_innodb_16k.inc +-- source include/not_embedded.inc # This test needs debug server ---source include/have_debug.inc +-- source include/have_debug.inc -- disable_query_log -call mtr.add_suppression("Flagged corruption of idx.*in CHECK TABLE"); -# This test setup is extracted from bug56680.test: -# The flag innodb_change_buffering_debug is only available in debug builds. -# It instructs InnoDB to try to evict pages from the buffer pool when -# change buffering is possible, so that the change buffer will be used -# whenever possible. -SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug; -SET GLOBAL innodb_change_buffering_debug = 1; - -# Turn off Unique Check to create corrupted index with dup key -SET UNIQUE_CHECKS=0; - -CREATE DATABASE pad; -let $i=338; -while ($i) -{ ---eval CREATE TABLE pad.t$i(a INT PRIMARY KEY)ENGINE=InnoDB; - dec $i; -} - --- enable_query_log +call mtr.add_suppression("Flagged corruption of idx.*in"); set names utf8; +SET UNIQUE_CHECKS=0; + CREATE TABLE corrupt_bit_test_ā( a INT AUTO_INCREMENT PRIMARY KEY, b CHAR(100), c INT, z INT, - INDEX(b)) + INDEX idx(b)) ENGINE=InnoDB; INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1); @@ -54,38 +32,21 @@ CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b); SELECT * FROM corrupt_bit_test_ā; -select @@unique_checks; -select @@innodb_change_buffering_debug; - -# Create enough rows for the table, so that the insert buffer will be -# used for modifying the secondary index page. There must be multiple -# index pages, because changes to the root page are never buffered. - INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā; -INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā; select count(*) from corrupt_bit_test_ā; -CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c); - -# Create a dup key error on index "idxē" and "idxā" by inserting a dup value -INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1); +# This will flag all secondary indexes corrupted +SET SESSION debug_dbug="+d,dict_set_index_corrupted"; +check table corrupt_bit_test_ā; +SET SESSION debug_dbug=""; -# creating an index should succeed even if other secondary indexes are corrupted +# Cannot create new indexes while corrupted indexes exist +--error ER_INDEX_CORRUPT +CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c); +--error ER_INDEX_CORRUPT CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z); -# Check table will find the unique indexes corrupted -# with dup key -check table corrupt_bit_test_ā; - # This selection intend to use the corrupted index. Expect to fail -- error ER_INDEX_CORRUPT select c from corrupt_bit_test_ā; @@ -109,7 +70,6 @@ delete from corrupt_bit_test_ā where a = 10001; insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001); rollback; -# Drop one corrupted index before reboot drop index idxā on corrupt_bit_test_ā; check table corrupt_bit_test_ā; @@ -119,14 +79,26 @@ set names utf8; -- error ER_INDEX_CORRUPT select z from corrupt_bit_test_ā; +show create table corrupt_bit_test_ā; + # Drop the corrupted index drop index idxē on corrupt_bit_test_ā; +# Cannot create new indexes while a corrupt index exists. +--error ER_INDEX_CORRUPT +CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c); +--error ER_INDEX_CORRUPT +CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z); + +show create table corrupt_bit_test_ā; +drop index idx on corrupt_bit_test_ā; + +# Now that there exist no corrupted indexes, we can create new indexes. +CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c); +CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z); + # Now select back to normal select z from corrupt_bit_test_ā limit 10; # Drop table drop table corrupt_bit_test_ā; -DROP DATABASE pad; - -SET GLOBAL innodb_change_buffering_debug = 0; diff --git a/mysql-test/suite/innodb/t/innodb_uninstall.test b/mysql-test/suite/innodb/t/innodb_uninstall.test index 3cd02b23d8c..1b65db8a28d 100644 --- a/mysql-test/suite/innodb/t/innodb_uninstall.test +++ b/mysql-test/suite/innodb/t/innodb_uninstall.test @@ -9,7 +9,13 @@ if (!$HA_INNODB_SO) { # MDEV-8474: InnoDB sets per-connection data unsafely # Below test caused hang # +# When mysqld is built with wsrep patch (WITH_WSREP=ON), +# the following install command emits a warning about +# server unable to enable tc-log at runtime. +disable_warnings; install plugin innodb soname 'ha_innodb'; +enable_warnings; + create table t1(a int not null primary key) engine=innodb; connect (con1, localhost, root); @@ -36,7 +42,9 @@ reap; connect (con1, localhost, root); connection con1; +disable_warnings; install plugin innodb soname 'ha_innodb'; +enable_warnings; drop table t1; create table t2(a int not null primary key) engine=innodb; diff --git a/mysql-test/suite/perfschema/r/sizing_low.result b/mysql-test/suite/perfschema/r/sizing_low.result index dce5a994099..a698f55aa07 100644 --- a/mysql-test/suite/perfschema/r/sizing_low.result +++ b/mysql-test/suite/perfschema/r/sizing_low.result @@ -67,3 +67,4 @@ Performance_schema_table_instances_lost 0 Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 +CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit."); diff --git a/mysql-test/suite/perfschema/r/table_name.result b/mysql-test/suite/perfschema/r/table_name.result new file mode 100644 index 00000000000..d6369ffc79e --- /dev/null +++ b/mysql-test/suite/perfschema/r/table_name.result @@ -0,0 +1,156 @@ + +# +# TEST 1: Normal tables prefixed with "#sql" and "sql". +# +USE test; +CREATE TABLE `#sql_1` (a int, b text); +INSERT INTO `#sql_1` VALUES(1,'one'); + +CREATE TABLE `sql_1` (a int, b text); +INSERT INTO `sql_1` VALUES(1,'one'); + +# Verify that the tables are treated as normal tables . + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name +TABLE test #sql_1 +TABLE test sql_1 + +# Drop the tables, verify that the table objects are removed. + +DROP TABLE `#sql_1`; +DROP TABLE `sql_1`; + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 2: Temporary tables, no special prefix. +# +CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM; +INSERT INTO sql_temp2_myisam VALUES(1,'one'); + +CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB; +INSERT INTO sql_temp2_innodb VALUES(1,'one'); + +# Confirm that the temporary tables are ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the tables, verify that the table objects are not created. + +DROP TABLE sql_temp2_myisam; +DROP TABLE sql_temp2_innodb; + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 3: Temporary tables with the "#sql" prefix. +# +CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM; +CHECK TABLE `#sql_temp3_myisam`; +Table Op Msg_type Msg_text +test.#sql_temp3_myisam check status OK +INSERT INTO `#sql_temp3_myisam` VALUES(1,'one'); + +CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB; +CHECK TABLE `#sql_temp3_innodb`; +Table Op Msg_type Msg_text +test.#sql_temp3_innodb check status OK +INSERT INTO `#sql_temp3_innodb` VALUES(1,'one'); + +# Confirm that the temporary tables are ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the temporary tables. + +DROP TABLE `#sql_temp3_myisam`; +DROP TABLE `#sql_temp3_innodb`; + +# Confirm that the temporary tables are still ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary +# when they are truncated. +# +CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `sql_temp4_myisam` VALUES(1,'one'); + +CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `#sql_temp4_myisam` VALUES(1,'one'); + +# Confirm that the MyISAM temporary tables are ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary. + +TRUNCATE TABLE `sql_temp4_myisam`; +TRUNCATE TABLE `#sql_temp4_myisam`; + +# Confirm that the recreated MyISAM tables are still regarded as temporary and ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the recreated MyISAM tables; + +DROP TABLE `sql_temp4_myisam`; +DROP TABLE `#sql_temp4_myisam`; + +# Confirm that the recreated temporary tables are still ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# +# TEST 5: Generate temporary tables with ALTER MyISAM table. +# +USE test; +CREATE TABLE t1 (a int) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1), (2), (3); +ALTER TABLE t1 ADD COLUMN (b int); + +# Confirm that the recreated temporary tables are still ignored. + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name + +# Drop the MyISAM table + +DROP TABLE t1; + +# Confirm that no tables remain; + +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +object_type object_schema object_name diff --git a/mysql-test/suite/perfschema/t/sizing_low.test b/mysql-test/suite/perfschema/t/sizing_low.test index 4d02d41aecd..56446fd6973 100644 --- a/mysql-test/suite/perfschema/t/sizing_low.test +++ b/mysql-test/suite/perfschema/t/sizing_low.test @@ -7,3 +7,4 @@ --source ../include/sizing_auto.inc +CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit."); diff --git a/mysql-test/suite/perfschema/t/table_name.test b/mysql-test/suite/perfschema/t/table_name.test new file mode 100644 index 00000000000..a8179f2d1f8 --- /dev/null +++ b/mysql-test/suite/perfschema/t/table_name.test @@ -0,0 +1,165 @@ +# +# Performance Schema +# +# Verify that the Performance Schema correctly identifies normal and temporary +# tables with non-standard names. + +# The server uses the table name prefix "#sql" for temporary and intermediate +# tables, however user-defined tables having the "#sql" prefix are also permitted. +# Independent of the table name, temporary or intermediate tables always have the +# "#sql" prefix in the filename. (For non-temporary tables starting with "#", +# the "#" is encoded to @0023 in the filename.) +# +# Given the ambiguity with temporary table names, the Performance Schema identifies +# temporary tables tables either by the table category or by the filename. +# +--source include/have_perfschema.inc +--source include/have_innodb.inc +--source include/not_embedded.inc + +--echo +--echo # +--echo # TEST 1: Normal tables prefixed with "#sql" and "sql". +--echo # +USE test; +CREATE TABLE `#sql_1` (a int, b text); +# INSERT forces path through get_table_share() +INSERT INTO `#sql_1` VALUES(1,'one'); +--echo +CREATE TABLE `sql_1` (a int, b text); +INSERT INTO `sql_1` VALUES(1,'one'); +--echo +--echo # Verify that the tables are treated as normal tables . +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the tables, verify that the table objects are removed. +--echo +DROP TABLE `#sql_1`; +DROP TABLE `sql_1`; +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 2: Temporary tables, no special prefix. +--echo # +CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM; +INSERT INTO sql_temp2_myisam VALUES(1,'one'); +--echo +CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB; +INSERT INTO sql_temp2_innodb VALUES(1,'one'); +--echo +--echo # Confirm that the temporary tables are ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the tables, verify that the table objects are not created. +--echo +DROP TABLE sql_temp2_myisam; +DROP TABLE sql_temp2_innodb; +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 3: Temporary tables with the "#sql" prefix. +--echo # +CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM; +CHECK TABLE `#sql_temp3_myisam`; +INSERT INTO `#sql_temp3_myisam` VALUES(1,'one'); +--echo +CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB; +CHECK TABLE `#sql_temp3_innodb`; +INSERT INTO `#sql_temp3_innodb` VALUES(1,'one'); +--echo +--echo # Confirm that the temporary tables are ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the temporary tables. +--echo +DROP TABLE `#sql_temp3_myisam`; +DROP TABLE `#sql_temp3_innodb`; +--echo +--echo # Confirm that the temporary tables are still ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary +--echo # when they are truncated. +--echo # +CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `sql_temp4_myisam` VALUES(1,'one'); +--echo +CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM; +INSERT INTO `#sql_temp4_myisam` VALUES(1,'one'); +--echo +--echo # Confirm that the MyISAM temporary tables are ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary. +--echo +TRUNCATE TABLE `sql_temp4_myisam`; +TRUNCATE TABLE `#sql_temp4_myisam`; +--echo +--echo # Confirm that the recreated MyISAM tables are still regarded as temporary and ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the recreated MyISAM tables; +--echo +DROP TABLE `sql_temp4_myisam`; +DROP TABLE `#sql_temp4_myisam`; +--echo +--echo # Confirm that the recreated temporary tables are still ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; + +--echo +--echo # +--echo # TEST 5: Generate temporary tables with ALTER MyISAM table. +--echo # +USE test; +CREATE TABLE t1 (a int) ENGINE=MYISAM; +INSERT INTO t1 VALUES (1), (2), (3); +# Force a path throug mysql_alter_table() and ha_create_table(). +ALTER TABLE t1 ADD COLUMN (b int); +--echo +--echo # Confirm that the recreated temporary tables are still ignored. +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; +--echo +--echo # Drop the MyISAM table +--echo +DROP TABLE t1; + +--echo +--echo # Confirm that no tables remain; +--echo +SELECT object_type, object_schema, object_name +FROM performance_schema.objects_summary_global_by_type +WHERE object_schema="test"; diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result index 638f138b986..dc31cb6d044 100644 --- a/mysql-test/suite/plugins/r/cracklib_password_check.result +++ b/mysql-test/suite/plugins/r/cracklib_password_check.result @@ -39,6 +39,12 @@ Warning 1819 cracklib: it is based on a dictionary word Error 1819 Your password does not satisfy the current policy requirements grant select on *.* to foobar identified by 'q$%^&*rty'; drop user foobar; +# +# MDEV-9851: CREATE USER w/o IDENTIFIED BY clause causes crash +# when using cracklib plugin +# +create user 'newuser'@'localhost'; +ERROR HY000: Your password does not satisfy the current policy requirements uninstall plugin cracklib_password_check; create user foo1 identified by 'pwd'; drop user foo1; diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index 26a7d1b872c..9c7dc1490b1 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -174,7 +174,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); SET PASSWORD FOR u1=<secret>; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=<secret>' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<secret>' at line 1 CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result index a0b43a94137..bbb96bb8c38 100644 --- a/mysql-test/suite/plugins/r/simple_password_check.result +++ b/mysql-test/suite/plugins/r/simple_password_check.result @@ -72,6 +72,8 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED create user foo1 identified by 'pwd'; ERROR HY000: Your password does not satisfy the current policy requirements +create user foo1; +ERROR HY000: Your password does not satisfy the current policy requirements grant select on *.* to foo1 identified by 'pwd'; ERROR HY000: Your password does not satisfy the current policy requirements grant select on *.* to `FooBar1!` identified by 'FooBar1!'; @@ -147,6 +149,8 @@ grant select on *.* to foo2 identified with mysql_old_password using '2222222222 drop user foo2; set global strict_password_validation=1; drop user foo1; +create role r1; +drop role r1; uninstall plugin simple_password_check; create user foo1 identified by 'pwd'; drop user foo1; diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result index 26a7d1b872c..9c7dc1490b1 100644 --- a/mysql-test/suite/plugins/r/thread_pool_server_audit.result +++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result @@ -174,7 +174,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123'; GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; SET PASSWORD FOR u1 = PASSWORD('pwd 098'); SET PASSWORD FOR u1=<secret>; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=<secret>' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<secret>' at line 1 CREATE USER u3 IDENTIFIED BY ''; drop user u1, u2, u3; select 2; diff --git a/mysql-test/suite/plugins/r/unix_socket.result b/mysql-test/suite/plugins/r/unix_socket.result index 45bf608cc93..0e08794fbe6 100644 --- a/mysql-test/suite/plugins/r/unix_socket.result +++ b/mysql-test/suite/plugins/r/unix_socket.result @@ -27,4 +27,5 @@ USER@localhost @% test # name does not match = failure # delete from mysql.user where user=''; +FLUSH PRIVILEGES; uninstall plugin unix_socket; diff --git a/mysql-test/suite/plugins/t/cracklib_password_check.test b/mysql-test/suite/plugins/t/cracklib_password_check.test index d0e05fed926..89b53b656d6 100644 --- a/mysql-test/suite/plugins/t/cracklib_password_check.test +++ b/mysql-test/suite/plugins/t/cracklib_password_check.test @@ -30,6 +30,14 @@ show warnings; grant select on *.* to foobar identified by 'q$%^&*rty'; drop user foobar; +--echo # +--echo # MDEV-9851: CREATE USER w/o IDENTIFIED BY clause causes crash +--echo # when using cracklib plugin +--echo # + +--error ER_NOT_VALID_PASSWORD +create user 'newuser'@'localhost'; + uninstall plugin cracklib_password_check; create user foo1 identified by 'pwd'; diff --git a/mysql-test/suite/plugins/t/simple_password_check.test b/mysql-test/suite/plugins/t/simple_password_check.test index 9854f93efe8..4965ee492d2 100644 --- a/mysql-test/suite/plugins/t/simple_password_check.test +++ b/mysql-test/suite/plugins/t/simple_password_check.test @@ -16,6 +16,10 @@ select * from information_schema.system_variables where variable_name like 'simp --error ER_NOT_VALID_PASSWORD create user foo1 identified by 'pwd'; +# Create user with no password. +--error ER_NOT_VALID_PASSWORD +create user foo1; + --error ER_NOT_VALID_PASSWORD grant select on *.* to foo1 identified by 'pwd'; @@ -103,6 +107,12 @@ drop user foo2; set global strict_password_validation=1; drop user foo1; +# +# MDEV-9940 CREATE ROLE blocked by password validation plugin +# +create role r1; +drop role r1; + uninstall plugin simple_password_check; create user foo1 identified by 'pwd'; diff --git a/mysql-test/suite/plugins/t/unix_socket.test b/mysql-test/suite/plugins/t/unix_socket.test index 1522c9b7cbe..bd0323c0274 100644 --- a/mysql-test/suite/plugins/t/unix_socket.test +++ b/mysql-test/suite/plugins/t/unix_socket.test @@ -55,6 +55,6 @@ grant SELECT ON test.* TO '' identified via unix_socket; # restoring mysql.user to the original state. delete from mysql.user where user=''; +FLUSH PRIVILEGES; uninstall plugin unix_socket; --remove_file $MYSQLTEST_VARDIR/tmp/peercred_test.txt - diff --git a/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.result b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.result new file mode 100644 index 00000000000..67af4a068d6 --- /dev/null +++ b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.result @@ -0,0 +1,21 @@ +include/master-slave.inc +[connection master] +create role r1; +set role r1; +grant select on db.* to current_role; +revoke all privileges, grant option from current_role; +drop role r1; +include/rpl_end.inc +connection server_2; +connection server_2; +connection server_2; +connection server_2; +connection server_1; +connection server_1; +connection server_1; +connection server_2; +connection server_1; +connection server_2; +connection server_2; +connection server_1; +connection server_1; diff --git a/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.test b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.test new file mode 100644 index 00000000000..6a6c4f2a756 --- /dev/null +++ b/mysql-test/suite/roles/rpl_grant_revoke_current_role-8638.test @@ -0,0 +1,12 @@ +--source include/master-slave.inc +--source include/have_binlog_format_mixed.inc + +--enable_connect_log + +create role r1; +set role r1; +grant select on db.* to current_role; +revoke all privileges, grant option from current_role; +drop role r1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/roles/set_role-9614.result b/mysql-test/suite/roles/set_role-9614.result new file mode 100644 index 00000000000..37f6db070c0 --- /dev/null +++ b/mysql-test/suite/roles/set_role-9614.result @@ -0,0 +1,99 @@ +# +# MDEV-9614 Roles and Users Longer than 6 characters +# +# This test case checks the edge case presented in the MDEV. The +# real issue is actually apparent when the username is longer than the +# rolename. +# +# We need a separate database not including test or test_% names. Due to +# default privileges given on these databases. +# +DROP DATABASE IF EXISTS `bug_db`; +Warnings: +Note 1008 Can't drop database 'bug_db'; database doesn't exist +# +# The first user did not show the bug as john's length is smaller +# than client. The bug is apparent most of the time for usertestjohn. +# +CREATE USER `john`@`%`; +CREATE USER `usertestjohn`@`%`; +CREATE ROLE `client`; +# +# Setup the required tables. +# +CREATE DATABASE `bug_db`; +CREATE TABLE `bug_db`.`t0`(`c0` INT); +# +# Setup select privileges only on the role. Setting the role should give +# select access to bug_db.t0. +# +GRANT SELECT ON `bug_db`.`t0` TO `client`; +GRANT `client` TO `john`@`%`; +GRANT `client` TO `usertestjohn`@`%`; +# +# Check to see grants are set. +# +SHOW GRANTS FOR `john`@`%`; +Grants for john@% +GRANT client TO 'john'@'%' +GRANT USAGE ON *.* TO 'john'@'%' +SHOW GRANTS FOR `usertestjohn`@`%`; +Grants for usertestjohn@% +GRANT client TO 'usertestjohn'@'%' +GRANT USAGE ON *.* TO 'usertestjohn'@'%' +SHOW GRANTS FOR `client`; +Grants for client +GRANT USAGE ON *.* TO 'client' +GRANT SELECT ON `bug_db`.`t0` TO 'client' +show databases; +Database +bug_db +information_schema +mtr +mysql +performance_schema +test +# +# Try using the database as john. +# +connect john, localhost, john,,information_schema; +show databases; +Database +information_schema +test +set role client; +show databases; +Database +bug_db +information_schema +test +use bug_db; +# +# Try using the database as usertestjohn. +# +connect usertestjohn, localhost, usertestjohn,,information_schema; +show databases; +Database +information_schema +test +set role client; +show databases; +Database +bug_db +information_schema +test +show grants; +Grants for usertestjohn@% +GRANT client TO 'usertestjohn'@'%' +GRANT USAGE ON *.* TO 'usertestjohn'@'%' +GRANT USAGE ON *.* TO 'client' +GRANT SELECT ON `bug_db`.`t0` TO 'client' +use bug_db; +# +# Cleanup +# +connection default; +drop user john; +drop user usertestjohn; +drop role client; +drop database bug_db; diff --git a/mysql-test/suite/roles/set_role-9614.test b/mysql-test/suite/roles/set_role-9614.test new file mode 100644 index 00000000000..5e9f7dacf19 --- /dev/null +++ b/mysql-test/suite/roles/set_role-9614.test @@ -0,0 +1,79 @@ +--source include/not_embedded.inc + +--echo # +--echo # MDEV-9614 Roles and Users Longer than 6 characters +--echo # +--echo # This test case checks the edge case presented in the MDEV. The +--echo # real issue is actually apparent when the username is longer than the +--echo # rolename. + +--enable_connect_log +--echo # +--echo # We need a separate database not including test or test_% names. Due to +--echo # default privileges given on these databases. +--echo # +DROP DATABASE IF EXISTS `bug_db`; + +--echo # +--echo # The first user did not show the bug as john's length is smaller +--echo # than client. The bug is apparent most of the time for usertestjohn. +--echo # +CREATE USER `john`@`%`; +CREATE USER `usertestjohn`@`%`; +CREATE ROLE `client`; + +--echo # +--echo # Setup the required tables. +--echo # +CREATE DATABASE `bug_db`; +CREATE TABLE `bug_db`.`t0`(`c0` INT); + +--echo # +--echo # Setup select privileges only on the role. Setting the role should give +--echo # select access to bug_db.t0. +--echo # +GRANT SELECT ON `bug_db`.`t0` TO `client`; +GRANT `client` TO `john`@`%`; +GRANT `client` TO `usertestjohn`@`%`; + +--echo # +--echo # Check to see grants are set. +--echo # +SHOW GRANTS FOR `john`@`%`; +SHOW GRANTS FOR `usertestjohn`@`%`; +SHOW GRANTS FOR `client`; + +show databases; + +--echo # +--echo # Try using the database as john. +--echo # +connect (john, localhost, john,,information_schema); + +show databases; +set role client; +show databases; +use bug_db; + +--echo # +--echo # Try using the database as usertestjohn. +--echo # +connect (usertestjohn, localhost, usertestjohn,,information_schema); + +show databases; +set role client; +show databases; + +show grants; +use bug_db; + + +--echo # +--echo # Cleanup +--echo # +connection default; +drop user john; +drop user usertestjohn; +drop role client; +drop database bug_db; +--disable_connect_log diff --git a/mysql-test/suite/roles/set_role-simple.result b/mysql-test/suite/roles/set_role-simple.result index 3ce6d5c054b..4fb705368b7 100644 --- a/mysql-test/suite/roles/set_role-simple.result +++ b/mysql-test/suite/roles/set_role-simple.result @@ -45,3 +45,12 @@ delete from mysql.user where user='test_role1'; delete from mysql.roles_mapping where Role='test_role1'; flush privileges; drop user 'test_user'@'localhost'; +create user user1; +select current_user; +current_user +user1@% +show grants; +Grants for user1@% +GRANT USAGE ON *.* TO 'user1'@'%' +set role none; +drop user user1; diff --git a/mysql-test/suite/roles/set_role-simple.test b/mysql-test/suite/roles/set_role-simple.test index 152a1d0eb25..ed884fa2407 100644 --- a/mysql-test/suite/roles/set_role-simple.test +++ b/mysql-test/suite/roles/set_role-simple.test @@ -37,3 +37,18 @@ delete from mysql.user where user='test_role1'; delete from mysql.roles_mapping where Role='test_role1'; flush privileges; drop user 'test_user'@'localhost'; + +# +# MDEV-9898 SET ROLE NONE can crash mysqld. +# + +create user user1; + +--connect (con1,localhost,user1,,) +select current_user; +show grants; +set role none; + +connection default; +drop user user1; + diff --git a/mysql-test/suite/rpl/r/create_or_replace_mix.result b/mysql-test/suite/rpl/r/create_or_replace_mix.result index e90021f78fc..9029156c625 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_mix.result +++ b/mysql-test/suite/rpl/r/create_or_replace_mix.result @@ -163,7 +163,7 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` ( `a` int(11) DEFAULT NULL diff --git a/mysql-test/suite/rpl/r/create_or_replace_row.result b/mysql-test/suite/rpl/r/create_or_replace_row.result index 2f29b1c125b..78477ca4c73 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_row.result +++ b/mysql-test/suite/rpl/r/create_or_replace_row.result @@ -41,7 +41,7 @@ master-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t2 master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( `a_in_temporary` int(11) DEFAULT NULL -) +) ENGINE=MyISAM master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ connection server_2; @@ -75,7 +75,7 @@ slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t2 slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( `a_in_temporary` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ connection server_1; @@ -185,7 +185,7 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` ( `a` int(11) DEFAULT NULL diff --git a/mysql-test/suite/rpl/r/create_or_replace_statement.result b/mysql-test/suite/rpl/r/create_or_replace_statement.result index 3b4525f82b6..69206cc861f 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_statement.result +++ b/mysql-test/suite/rpl/r/create_or_replace_statement.result @@ -166,7 +166,7 @@ slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL -) +) ENGINE=MyISAM slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` ( `a` int(11) DEFAULT NULL diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result index 3102c06352f..15370dff39a 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result @@ -101,13 +101,11 @@ f5 DOUBLE DEFAULT '2.00', f6 ENUM('a', 'b', 'c') default 'a', f7 DECIMAL(17,9) default '1000.00', f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', +f9 NUMERIC(6,2) default '2000.00', f10 VARCHAR(1024), f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -124,13 +122,11 @@ CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), f5 DOUBLE DEFAULT '2.00', f6 DECIMAL(17,9) default '1000.00', f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', +f8 NUMERIC(6,2) default '2000.00', f9 VARCHAR(1024), f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f11 CHAR(255)) ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -191,9 +187,6 @@ INSERT into t2 values (2, 2, 2, 'second', (3, 3, 3, 'third', 3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', '01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: binary data'; diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result index cfec03b45d0..d04d91be6d1 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result @@ -101,13 +101,11 @@ f5 DOUBLE DEFAULT '2.00', f6 ENUM('a', 'b', 'c') default 'a', f7 DECIMAL(17,9) default '1000.00', f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', +f9 NUMERIC(6,2) default '2000.00', f10 VARCHAR(1024), f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -124,13 +122,11 @@ CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), f5 DOUBLE DEFAULT '2.00', f6 DECIMAL(17,9) default '1000.00', f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', +f8 NUMERIC(6,2) default '2000.00', f9 VARCHAR(1024), f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f11 CHAR(255)) ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -191,9 +187,6 @@ INSERT into t2 values (2, 2, 2, 'second', (3, 3, 3, 'third', 3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', '01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: binary data'; diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index 732d1746dbd..4eeb333d10c 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -157,5 +157,6 @@ SELECT * FROM tmptbl504451f4258$1; ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist connection master; DROP TABLE t5; +flush privileges; connection slave; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result index b5b302bc3eb..bb264a12af3 100644 --- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result @@ -61,6 +61,13 @@ connection master; include/rpl_diff.inc connection master; connection master1; +ALTER DATABASE d1 +DEFAULT CHARACTER SET = 'utf8'; +source include/kill_query.inc; +connection master; +include/rpl_diff.inc +connection master; +connection master1; DROP DATABASE d1; source include/kill_query.inc; connection master; @@ -112,6 +119,12 @@ connection master; include/rpl_diff.inc connection master; connection master1; +DROP FUNCTION IF EXISTS f2; +source include/kill_query.inc; +connection master; +include/rpl_diff.inc +connection master; +connection master1; CREATE PROCEDURE p2 (OUT rows INT) BEGIN SELECT COUNT(*) INTO rows FROM t2; @@ -134,6 +147,12 @@ connection master; include/rpl_diff.inc connection master; connection master1; +DROP PROCEDURE IF EXISTS p2; +source include/kill_query.inc; +connection master; +include/rpl_diff.inc +connection master; +connection master1; CREATE TABLE t2 (b int); source include/kill_query.inc; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index 22ddf2e58f8..9ba89b2fc15 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -201,7 +201,7 @@ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL -) +) ENGINE=MyISAM connection slave; SHOW CREATE TABLE t8; Table t8 @@ -214,7 +214,7 @@ Table t9 Create Table CREATE TABLE `t9` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 connection master; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9; connection slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result index 8039527b099..ecc0e6d6d18 100644 --- a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result +++ b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result @@ -5,8 +5,9 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM; CREATE TABLE t2 (a int) ENGINE=MyISAM; INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t2 VALUES (4), (5), (6); -CREATE TABLE IF NOT EXISTS t1_merge LIKE t1; -ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1; +ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TABLE t1_merge LIKE tt1_merge; connection slave; include/diff_tables.inc [master:test.t1, slave:test.t1] include/diff_tables.inc [master:test.t2, slave:test.t2] diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result new file mode 100644 index 00000000000..4a5bc3b76e5 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result @@ -0,0 +1,13 @@ +include/master-slave.inc +[connection master] +CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=InnoDB; +CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=MyISAM; +CREATE TABLE t1 LIKE temp_t1; +CREATE TABLE t2 LIKE temp_t2; +include/assert.inc ["t1 on master and temp_t1 have the same storage engine"] +include/assert.inc ["t2 on master and temp_t2 have the same storage engine"] +include/assert.inc ["t1 on slave and temp_t1 have the same storage engine"] +include/assert.inc ["t2 on slave and temp_t2 have the same storage engine"] +DROP TEMPORARY TABLE temp_t1, temp_t2; +DROP TABLE t1, t2; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index a5f7b608174..3360b789475 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -1,6 +1,6 @@ -source include/master-slave.inc; let collation=utf8_unicode_ci; ---source include/have_collation.inc +source include/have_collation.inc; +source include/master-slave.inc; call mtr.add_suppression("Can't find record in 't.'"); call mtr.add_suppression("Can't find record in 'user'"); @@ -179,6 +179,7 @@ SELECT HEX(word) FROM t5; SELECT * FROM tmptbl504451f4258$1; connection master; DROP TABLE t5; +flush privileges; sync_slave_with_master; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test index dcd3ec3625b..593051700a7 100644 --- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test +++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test @@ -26,10 +26,8 @@ # # There are some part of the test are temporarily disabled because of # the following bugs, please enable then once they get fixed: -# - BUG#44041 -# - BUG#43353 -# - BUG#25705 -# - BUG#44171 +# - BUG#22473427 +# - Bug#22587377 # Temporarily disabled on Windows due to bug #47638 --source include/not_windows.inc @@ -146,11 +144,9 @@ let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata send CREATE DATABASE d2; source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the -# collation of other database on slave -#send ALTER DATABASE d1 -# DEFAULT CHARACTER SET = 'utf8'; -#source include/kill_query_and_diff_master_slave.inc; +send ALTER DATABASE d1 + DEFAULT CHARACTER SET = 'utf8'; +source include/kill_query_and_diff_master_slave.inc; send DROP DATABASE d1; source include/kill_query_and_diff_master_slave.inc; @@ -169,8 +165,8 @@ send CREATE EVENT e2 DO INSERT INTO test.t1 VALUES (2); source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled because of BUG#44171, killing ALTER EVENT can -# crash the server +# Temporarily disabled,see Bug#22587377-RPL.RPL_KILLED_DDL +# FAILS SPORADICALLY ON PB2 IN 5.5 AND 5.6 #send ALTER EVENT e1 # ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY; #source include/kill_query_and_diff_master_slave.inc; @@ -199,16 +195,8 @@ source include/kill_query_and_diff_master_slave.inc; # function f2 probably does not exist because the CREATE query was # killed -# -# Temporarily disabled. Because of BUG#43353, KILL the query may -# result in function not found, and for 5.1, DROP statements will be -# logged if the function is not found on master, so the following DROP -# FUNCTION statement may be interrupted and not drop the function on -# master, but still get logged and executed on slave and cause -# inconsistence. Also disable the following DROP PROCEDURE IF EXITS -# below. -#send DROP FUNCTION IF EXISTS f2; -#source include/kill_query_and_diff_master_slave.inc; +send DROP FUNCTION IF EXISTS f2; +source include/kill_query_and_diff_master_slave.inc; ######## PROCEDURE ######## @@ -229,9 +217,8 @@ source include/kill_query_and_diff_master_slave.inc; send DROP PROCEDURE p1; source include/kill_query_and_diff_master_slave.inc; -# Temporarily disabled because of bug#43353, see comment above for DROP FUNCTION IF EXISTS -#send DROP PROCEDURE IF EXISTS p2; -#source include/kill_query_and_diff_master_slave.inc; +send DROP PROCEDURE IF EXISTS p2; +source include/kill_query_and_diff_master_slave.inc; ######## TABLE ######## @@ -259,9 +246,10 @@ source include/kill_query_and_diff_master_slave.inc; ######## SERVER ######## -# Tempoarily disabled, see bug#25705 +# Temporarily disabled, see Bug #22473427 - DROP SERVER FAILS +# AFTER ALTER SERVER+KILL QUERY -# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\' +# --let $rpl_diff_statement= SELECT * FROM mysql.servers WHERE Server_name like \'s%\' # send CREATE SERVER s2 # FOREIGN DATA WRAPPER mysql diff --git a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test index 5add8dc1cda..dcbb8b891d8 100644 --- a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test +++ b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test @@ -20,8 +20,10 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM; CREATE TABLE t2 (a int) ENGINE=MyISAM; INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t2 VALUES (4), (5), (6); -CREATE TABLE IF NOT EXISTS t1_merge LIKE t1; -ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1); +# Changed a little to check also an issue reported on BUG#20574550 +CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1; +ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1); +CREATE TABLE t1_merge LIKE tt1_merge; --sync_slave_with_master diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test new file mode 100644 index 00000000000..1a09b685249 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test @@ -0,0 +1,55 @@ +source include/have_innodb.inc; +source include/have_binlog_format_row.inc; +source include/master-slave.inc; +# +# BUG#20574550 +# CREATE TABLE LIKE <TEMP_TABLE> does not preserve original table storage +# engine when using row based replication +# +--connection master + +# Define temp_t1 and temp_t2 storage engines +--let $engine_temp_t1= InnoDB +--let $engine_temp_t2= MyISAM + +# Create the two temporary tables +--eval CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=$engine_temp_t1 +--eval CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=$engine_temp_t2 + +# Create t1 and t2 based on temporary tables +CREATE TABLE t1 LIKE temp_t1; +CREATE TABLE t2 LIKE temp_t2; +--sync_slave_with_master + +# On master +--connection master +# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2 +--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1) +--let $assert_cond= "$engine_t1" = "$engine_temp_t1" +--let $assert_text= "t1 on master and temp_t1 have the same storage engine" +--source include/assert.inc + +--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) +--let $assert_cond= "$engine_t2" = "$engine_temp_t2" +--let $assert_text= "t2 on master and temp_t2 have the same storage engine" +--source include/assert.inc + +# On slave +--connection slave +# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2 +--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1) +--let $assert_cond= "$engine_t1" = "$engine_temp_t1" +--let $assert_text= "t1 on slave and temp_t1 have the same storage engine" +--source include/assert.inc + +--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1) +--let $assert_cond= "$engine_t2" = "$engine_temp_t2" +--let $assert_text= "t2 on slave and temp_t2 have the same storage engine" +--source include/assert.inc + +# Cleanup +--connection master +DROP TEMPORARY TABLE temp_t1, temp_t2; +DROP TABLE t1, t2; +--source include/rpl_end.inc + diff --git a/mysql-test/suite/sys_vars/inc/collation_basic.inc b/mysql-test/suite/sys_vars/inc/collation_basic.inc index be8ae36eeb8..14b9ae4af2a 100644 --- a/mysql-test/suite/sys_vars/inc/collation_basic.inc +++ b/mysql-test/suite/sys_vars/inc/collation_basic.inc @@ -152,6 +152,8 @@ eval SET $collation_variable = utf8_esperanto_ci; eval SELECT $collation_variable; eval SET $collation_variable = utf8_hungarian_ci; eval SELECT $collation_variable; +eval SET $collation_variable = utf8_thai_520_w2; +eval SELECT $collation_variable; eval SET $collation_variable = ucs2_general_ci; eval SELECT $collation_variable; eval SET $collation_variable = ucs2_bin; diff --git a/mysql-test/suite/sys_vars/r/collation_connection_basic.result b/mysql-test/suite/sys_vars/r/collation_connection_basic.result index c8ce41cfe88..5f8d64e8fa3 100644 --- a/mysql-test/suite/sys_vars/r/collation_connection_basic.result +++ b/mysql-test/suite/sys_vars/r/collation_connection_basic.result @@ -374,6 +374,10 @@ SET @@session.collation_connection = utf8_hungarian_ci; SELECT @@session.collation_connection; @@session.collation_connection utf8_hungarian_ci +SET @@session.collation_connection = utf8_thai_520_w2; +SELECT @@session.collation_connection; +@@session.collation_connection +utf8_thai_520_w2 SET @@session.collation_connection = ucs2_general_ci; SELECT @@session.collation_connection; @@session.collation_connection @@ -883,6 +887,10 @@ SET @@global.collation_connection = utf8_hungarian_ci; SELECT @@global.collation_connection; @@global.collation_connection utf8_hungarian_ci +SET @@global.collation_connection = utf8_thai_520_w2; +SELECT @@global.collation_connection; +@@global.collation_connection +utf8_thai_520_w2 SET @@global.collation_connection = ucs2_general_ci; SELECT @@global.collation_connection; @@global.collation_connection diff --git a/mysql-test/suite/sys_vars/r/collation_database_basic.result b/mysql-test/suite/sys_vars/r/collation_database_basic.result index efe9638c5f6..5a218167bdb 100644 --- a/mysql-test/suite/sys_vars/r/collation_database_basic.result +++ b/mysql-test/suite/sys_vars/r/collation_database_basic.result @@ -376,6 +376,10 @@ SET @@session.collation_database = utf8_hungarian_ci; SELECT @@session.collation_database; @@session.collation_database utf8_hungarian_ci +SET @@session.collation_database = utf8_thai_520_w2; +SELECT @@session.collation_database; +@@session.collation_database +utf8_thai_520_w2 SET @@session.collation_database = ucs2_general_ci; SELECT @@session.collation_database; @@session.collation_database @@ -885,6 +889,10 @@ SET @@global.collation_database = utf8_hungarian_ci; SELECT @@global.collation_database; @@global.collation_database utf8_hungarian_ci +SET @@global.collation_database = utf8_thai_520_w2; +SELECT @@global.collation_database; +@@global.collation_database +utf8_thai_520_w2 SET @@global.collation_database = ucs2_general_ci; SELECT @@global.collation_database; @@global.collation_database diff --git a/mysql-test/suite/sys_vars/r/collation_server_basic.result b/mysql-test/suite/sys_vars/r/collation_server_basic.result index e60f3a3041a..352aeb9ce15 100644 --- a/mysql-test/suite/sys_vars/r/collation_server_basic.result +++ b/mysql-test/suite/sys_vars/r/collation_server_basic.result @@ -373,6 +373,10 @@ SET @@session.collation_server = utf8_hungarian_ci; SELECT @@session.collation_server; @@session.collation_server utf8_hungarian_ci +SET @@session.collation_server = utf8_thai_520_w2; +SELECT @@session.collation_server; +@@session.collation_server +utf8_thai_520_w2 SET @@session.collation_server = ucs2_general_ci; SELECT @@session.collation_server; @@session.collation_server @@ -882,6 +886,10 @@ SET @@global.collation_server = utf8_hungarian_ci; SELECT @@global.collation_server; @@global.collation_server utf8_hungarian_ci +SET @@global.collation_server = utf8_thai_520_w2; +SELECT @@global.collation_server; +@@global.collation_server +utf8_thai_520_w2 SET @@global.collation_server = ucs2_general_ci; SELECT @@global.collation_server; @@global.collation_server diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index 3160fd7c4fb..97fe3957264 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -1,63 +1,63 @@ SET @start_global_value = @@global.optimizer_switch; SELECT @start_global_value; @start_global_value -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off set global optimizer_switch=10; set session optimizer_switch=5; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off set global optimizer_switch="index_merge_sort_union=on"; set session optimizer_switch="index_merge=off"; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off set session optimizer_switch="default"; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off set optimizer_switch = replace(@@optimizer_switch, '=off', '=on'); Warnings: Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release. select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on set global optimizer_switch=1.1; ERROR 42000: Incorrect argument type to variable 'optimizer_switch' set global optimizer_switch=1e1; @@ -69,4 +69,4 @@ ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar' SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff index cad46e36f42..4d507126872 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff @@ -1,5 +1,5 @@ ---- suite/sys_vars/r/sysvars_innodb.result -+++ suite/sys_vars/r/sysvars_innodb,32bit,xtradb.reject +--- suite/sys_vars/r/sysvars_innodb.result 2016-05-06 14:03:16.000000000 +0300 ++++ suite/sys_vars/r/sysvars_innodb,32bit.reject 2016-05-08 13:28:44.312418574 +0300 @@ -47,13 +47,27 @@ ENUM_VALUE_LIST NULL READ_ONLY NO @@ -313,7 +313,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM +SESSION_VALUE NULL -+GLOBAL_VALUE BACKOFF ++GLOBAL_VALUE LEGACY +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE BACKOFF +VARIABLE_SCOPE GLOBAL @@ -1119,21 +1119,14 @@ VARIABLE_COMMENT Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000000 -@@ -2203,14 +2637,28 @@ +@@ -2217,6 +2651,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO - COMMAND_LINE_ARGUMENT REQUIRED --VARIABLE_NAME INNODB_TMPDIR --SESSION_VALUE --GLOBAL_VALUE + COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES +SESSION_VALUE NULL +GLOBAL_VALUE OFF - GLOBAL_VALUE_ORIGIN COMPILE-TIME --DEFAULT_VALUE --VARIABLE_SCOPE SESSION --VARIABLE_TYPE VARCHAR --VARIABLE_COMMENT Directory for temporary non-tablespace files. ++GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE OFF +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN @@ -1152,10 +1145,16 @@ +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Force log tracker to catch up with checkpoint now - NUMERIC_MIN_VALUE NULL - NUMERIC_MAX_VALUE NULL - NUMERIC_BLOCK_SIZE NULL -@@ -2265,7 +2713,7 @@ ++NUMERIC_MIN_VALUE NULL ++NUMERIC_MAX_VALUE NULL ++NUMERIC_BLOCK_SIZE NULL ++ENUM_VALUE_LIST NULL ++READ_ONLY NO ++COMMAND_LINE_ARGUMENT OPTIONAL + VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG + SESSION_VALUE NULL + GLOBAL_VALUE OFF +@@ -2265,7 +2727,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL @@ -1164,7 +1163,7 @@ VARIABLE_COMMENT Number of undo logs to use. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 128 -@@ -2279,7 +2727,7 @@ +@@ -2279,7 +2741,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1173,7 +1172,7 @@ VARIABLE_COMMENT Number of undo tablespaces to use. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 126 -@@ -2294,7 +2742,7 @@ +@@ -2294,7 +2756,7 @@ DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -1182,7 +1181,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2315,6 +2763,20 @@ +@@ -2315,6 +2777,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -1203,7 +1202,7 @@ VARIABLE_NAME INNODB_USE_MTFLUSH SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2329,6 +2791,20 @@ +@@ -2329,6 +2805,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -1224,12 +1223,12 @@ VARIABLE_NAME INNODB_USE_SYS_MALLOC SESSION_VALUE NULL GLOBAL_VALUE ON -@@ -2359,12 +2835,12 @@ +@@ -2359,12 +2849,12 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.29 -+GLOBAL_VALUE 5.6.28-76.1 +-GLOBAL_VALUE 5.6.31 ++GLOBAL_VALUE 5.6.30-76.3 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL @@ -1239,7 +1238,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2377,7 +2853,7 @@ +@@ -2377,7 +2867,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 4 VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff index a9e975313db..6d95a517b33 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff @@ -183,7 +183,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM +SESSION_VALUE NULL -+GLOBAL_VALUE BACKOFF ++GLOBAL_VALUE LEGACY +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE BACKOFF +VARIABLE_SCOPE GLOBAL @@ -571,21 +571,14 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2203,14 +2637,28 @@ +@@ -2217,6 +2651,34 @@ ENUM_VALUE_LIST NULL READ_ONLY NO - COMMAND_LINE_ARGUMENT REQUIRED --VARIABLE_NAME INNODB_TMPDIR --SESSION_VALUE --GLOBAL_VALUE + COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES +SESSION_VALUE NULL +GLOBAL_VALUE OFF - GLOBAL_VALUE_ORIGIN COMPILE-TIME --DEFAULT_VALUE --VARIABLE_SCOPE SESSION --VARIABLE_TYPE VARCHAR --VARIABLE_COMMENT Directory for temporary non-tablespace files. ++GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE OFF +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN @@ -604,10 +597,16 @@ +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Force log tracker to catch up with checkpoint now - NUMERIC_MIN_VALUE NULL - NUMERIC_MAX_VALUE NULL - NUMERIC_BLOCK_SIZE NULL -@@ -2294,7 +2742,7 @@ ++NUMERIC_MIN_VALUE NULL ++NUMERIC_MAX_VALUE NULL ++NUMERIC_BLOCK_SIZE NULL ++ENUM_VALUE_LIST NULL ++READ_ONLY NO ++COMMAND_LINE_ARGUMENT OPTIONAL + VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG + SESSION_VALUE NULL + GLOBAL_VALUE OFF +@@ -2294,7 +2756,7 @@ DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN @@ -616,7 +615,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -@@ -2315,6 +2763,20 @@ +@@ -2315,6 +2777,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -637,7 +636,7 @@ VARIABLE_NAME INNODB_USE_MTFLUSH SESSION_VALUE NULL GLOBAL_VALUE OFF -@@ -2329,6 +2791,20 @@ +@@ -2329,6 +2805,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NONE @@ -658,12 +657,12 @@ VARIABLE_NAME INNODB_USE_SYS_MALLOC SESSION_VALUE NULL GLOBAL_VALUE ON -@@ -2359,12 +2835,12 @@ +@@ -2359,12 +2849,12 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.29 -+GLOBAL_VALUE 5.6.28-76.1 +-GLOBAL_VALUE 5.6.31 ++GLOBAL_VALUE 5.6.30-76.3 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 0ddc401e618..9f92ea99437 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -2359,7 +2359,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL -GLOBAL_VALUE 5.6.29 +GLOBAL_VALUE 5.6.31 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 7d7c10cf82a..5e9cefde669 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -2460,17 +2460,17 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SWITCH -SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on -GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off +GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off VARIABLE_SCOPE SESSION VARIABLE_TYPE FLAGSET VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index d8c38e216ea..ebee8cd22e4 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -2656,17 +2656,17 @@ ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SWITCH -SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on -GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +SESSION_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off +GLOBAL_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on +DEFAULT_VALUE index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off VARIABLE_SCOPE SESSION VARIABLE_TYPE FLAGSET VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_USE_CONDITION_SELECTIVITY diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result index 4d7b03690af..f1745a1ad34 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result +++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result @@ -311,9 +311,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME WSREP_NODE_NAME SESSION_VALUE NULL -GLOBAL_VALUE +GLOBAL_VALUE HOSTNAME GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE +DEFAULT_VALUE HOSTNAME VARIABLE_SCOPE GLOBAL VARIABLE_TYPE VARCHAR VARIABLE_COMMENT Node name diff --git a/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result index 9657e6bf428..763d0612a1b 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result @@ -4,10 +4,10 @@ call mtr.add_suppression("WSREP: Failed to get provider options"); # save the initial value SET @wsrep_node_name_global_saved = @@global.wsrep_node_name; -# default -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +# default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 # scope SELECT @@session.wsrep_node_name; @@ -27,21 +27,34 @@ SELECT @@global.wsrep_node_name; @@global.wsrep_node_name hyphenated-node-name SET @@global.wsrep_node_name=default; -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +# default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 # invalid values SET @@global.wsrep_node_name=NULL; ERROR 42000: Variable 'wsrep_node_name' can't be set to the value of 'NULL' -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 SET @@global.wsrep_node_name=1; ERROR 42000: Incorrect argument type to variable 'wsrep_node_name' -SELECT @@global.wsrep_node_name; -@@global.wsrep_node_name - +SELECT COUNT(@@global.wsrep_node_name); +COUNT(@@global.wsrep_node_name) +1 +# +# MDEV-6699 : wsrep_node_name not automaticly set to hostname +# +SET @@global.wsrep_node_name=default; +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname'; +@@GLOBAL.wsrep_node_name = VARIABLE_VALUE +1 +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name'; +@@GLOBAL.wsrep_node_name = VARIABLE_VALUE +1 # restore the initial value SET @@global.wsrep_node_name = @wsrep_node_name_global_saved; diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test index 160b3ba52cc..a0409901865 100644 --- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test @@ -13,11 +13,19 @@ let $old_status= `SELECT variable_value FROM information_schema.global_status # A previous test could have run buffer pool dump already; # in this case we want to make sure that the current time is different -# from the timestamp in the status variable - -let $wait_condition = - SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s'); --- source include/wait_condition.inc +# from the timestamp in the status variable. +# We should have had a smart wait condition here, like the commented one below, +# but we can't because of MDEV-9867, so there will be just sleep instead. +# And it might be not enough to sleep one second, so we'll have to sleep two. +# let $wait_condition = +# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s'); +# -- source include/wait_condition.inc + +if (`SELECT variable_value LIKE '%dump completed at%' FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`) +{ + -- sleep 2 +} # Do the dump SET GLOBAL innodb_buffer_pool_dump_now = ON; diff --git a/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt new file mode 100644 index 00000000000..c788dc76ac7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt @@ -0,0 +1 @@ +--loose-innodb-buffer-pool-size=20M diff --git a/mysql-test/suite/sys_vars/t/sysvars_wsrep.test b/mysql-test/suite/sys_vars/t/sysvars_wsrep.test index 32af7d3a5ca..25454191e2e 100644 --- a/mysql-test/suite/sys_vars/t/sysvars_wsrep.test +++ b/mysql-test/suite/sys_vars/t/sysvars_wsrep.test @@ -1,8 +1,9 @@ --source include/have_wsrep.inc --source include/word_size.inc --let $datadir = `SELECT @@datadir` +--let $hostname = `SELECT @@hostname` ---replace_result $datadir DATADIR +--replace_result $datadir DATADIR $hostname HOSTNAME --vertical_results select * from information_schema.system_variables where variable_name like 'wsrep%' diff --git a/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test index 1f3ccc0de2c..7bc9bec8b95 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test +++ b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test @@ -9,8 +9,8 @@ call mtr.add_suppression("WSREP: Failed to get provider options"); --echo # save the initial value SET @wsrep_node_name_global_saved = @@global.wsrep_node_name; ---echo # default -SELECT @@global.wsrep_node_name; +--echo # default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); --echo --echo # scope @@ -26,16 +26,26 @@ SELECT @@global.wsrep_node_name; SET @@global.wsrep_node_name='hyphenated-node-name'; SELECT @@global.wsrep_node_name; SET @@global.wsrep_node_name=default; -SELECT @@global.wsrep_node_name; +--echo # default (expect 1) +SELECT COUNT(@@global.wsrep_node_name); --echo --echo # invalid values --error ER_WRONG_VALUE_FOR_VAR SET @@global.wsrep_node_name=NULL; -SELECT @@global.wsrep_node_name; +SELECT COUNT(@@global.wsrep_node_name); --error ER_WRONG_TYPE_FOR_VAR SET @@global.wsrep_node_name=1; -SELECT @@global.wsrep_node_name; +SELECT COUNT(@@global.wsrep_node_name); + +--echo # +--echo # MDEV-6699 : wsrep_node_name not automaticly set to hostname +--echo # +SET @@global.wsrep_node_name=default; +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='hostname'; +SELECT @@GLOBAL.wsrep_node_name = VARIABLE_VALUE FROM +INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='wsrep_node_name'; --echo --echo # restore the initial value diff --git a/mysql-test/suite/wsrep/r/binlog_format.result b/mysql-test/suite/wsrep/r/binlog_format.result index d996371c056..1ca90bd626d 100644 --- a/mysql-test/suite/wsrep/r/binlog_format.result +++ b/mysql-test/suite/wsrep/r/binlog_format.result @@ -1,5 +1,5 @@ call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*"); -call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID"); +call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine."); # # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT # diff --git a/mysql-test/suite/wsrep/r/mdev_10186.result b/mysql-test/suite/wsrep/r/mdev_10186.result new file mode 100644 index 00000000000..f966c443569 --- /dev/null +++ b/mysql-test/suite/wsrep/r/mdev_10186.result @@ -0,0 +1,11 @@ +# +# MDEV-10186: mysqld crash when runtime setting +# wsrep_cluster_address without wsrep_on=ON +# +SELECT @@wsrep_on; +@@wsrep_on +0 +SELECT @@GLOBAL.wsrep_provider; +@@GLOBAL.wsrep_provider +/usr/lib/galera/libgalera_smm.so +SET @@GLOBAL.wsrep_cluster_address='gcomm://'; diff --git a/mysql-test/suite/wsrep/suite.pm b/mysql-test/suite/wsrep/suite.pm index a7939c2e333..b6c5bf15ca1 100644 --- a/mysql-test/suite/wsrep/suite.pm +++ b/mysql-test/suite/wsrep/suite.pm @@ -26,8 +26,6 @@ push @::global_suppressions, ( qr(WSREP: Could not open saved state file for reading: .*), qr(WSREP: Could not open state file for reading: .*), - qr(WSREP: option --wsrep-causal-reads is deprecated), - qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0), qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|, ); diff --git a/mysql-test/suite/wsrep/t/binlog_format.test b/mysql-test/suite/wsrep/t/binlog_format.test index a2dc8542322..85864256862 100644 --- a/mysql-test/suite/wsrep/t/binlog_format.test +++ b/mysql-test/suite/wsrep/t/binlog_format.test @@ -2,7 +2,7 @@ --source include/have_binlog_format_row.inc call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format.*"); -call mtr.add_suppression("WSREP: cannot get fake InnoDB transaction ID"); +call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine."); --echo # --echo # MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT diff --git a/mysql-test/suite/wsrep/t/mdev_10186.opt b/mysql-test/suite/wsrep/t/mdev_10186.opt new file mode 100644 index 00000000000..e2655959c62 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_10186.opt @@ -0,0 +1 @@ +--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=0 diff --git a/mysql-test/suite/wsrep/t/mdev_10186.test b/mysql-test/suite/wsrep/t/mdev_10186.test new file mode 100644 index 00000000000..ec5e9462821 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_10186.test @@ -0,0 +1,12 @@ +--source include/have_wsrep_provider.inc +--source include/have_binlog_format_row.inc + +--echo # +--echo # MDEV-10186: mysqld crash when runtime setting +--echo # wsrep_cluster_address without wsrep_on=ON +--echo # + +SELECT @@wsrep_on; +SELECT @@GLOBAL.wsrep_provider; +SET @@GLOBAL.wsrep_cluster_address='gcomm://'; + |