diff options
Diffstat (limited to 'mysql-test')
10 files changed, 833 insertions, 297 deletions
diff --git a/mysql-test/include/not_psprotocol.inc b/mysql-test/include/not_psprotocol.inc new file mode 100644 index 00000000000..21601cf6310 --- /dev/null +++ b/mysql-test/include/not_psprotocol.inc @@ -0,0 +1,14 @@ +# Disable in mtr --ps-protocol +--disable_abort_on_error +--disable_result_log +--disable_query_log +/*M!100202 execute immediate 'select 1' */; +--enable_query_log +--enable_result_log +--enable_abort_on_error +let $error = $mysql_errno; +# ER_UNSUPPORTED_PS +if ($error == 1295) +{ +--skip Test is not supported in the prepared statement protocol yet +} diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result index 568a280158a..7c5387b4f17 100644 --- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result @@ -1,37 +1,32 @@ -use mysql; -RENAME TABLE time_zone TO time_zone_orig, -time_zone_name TO time_zone_name_orig, -time_zone_transition TO time_zone_transition_orig, -time_zone_transition_type TO time_zone_transition_type_orig, -time_zone_leap_second TO time_zone_leap_second_orig; -CREATE TABLE time_zone LIKE time_zone_orig; -CREATE TABLE time_zone_name LIKE time_zone_name_orig; -CREATE TABLE time_zone_transition LIKE time_zone_transition_orig; -CREATE TABLE time_zone_transition_type LIKE time_zone_transition_type_orig; -CREATE TABLE time_zone_leap_second LIKE time_zone_leap_second_orig; +CREATE TABLE time_zone LIKE mysql.time_zone; +CREATE TABLE time_zone_name LIKE mysql.time_zone_name; +CREATE TABLE time_zone_transition LIKE mysql.time_zone_transition; +CREATE TABLE time_zone_transition_type LIKE mysql.time_zone_transition_type; +CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second; # # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above # # Verbose run -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=InnoDB; -ALTER TABLE time_zone_name ENGINE=InnoDB; -ALTER TABLE time_zone_transition ENGINE=InnoDB; -ALTER TABLE time_zone_transition_type ENGINE=InnoDB; +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; -START TRANSACTION; -ELSE -TRUNCATE TABLE time_zone; -TRUNCATE TABLE time_zone_name; -TRUNCATE TABLE time_zone_transition; -TRUNCATE TABLE time_zone_transition_type; -END IF| -\d ; +/*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE')*/; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -53,50 +48,34 @@ UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=Aria; -ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; -ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; -END IF| -\d ; -SELECT COUNT(*) FROM time_zone; -COUNT(*) -0 -SELECT COUNT(*) FROM time_zone_name; -COUNT(*) -0 -SELECT COUNT(*) FROM time_zone_transition; -COUNT(*) -0 -SELECT COUNT(*) FROM time_zone_transition_type; -COUNT(*) -0 -SELECT COUNT(*) FROM time_zone_leap_second; -COUNT(*) -0 +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone ENGINE=', @time_zone_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); +# +# MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases +# # Run on zoneinfo directory -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=InnoDB; -ALTER TABLE time_zone_name ENGINE=InnoDB; -ALTER TABLE time_zone_transition ENGINE=InnoDB; -ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -TRUNCATE TABLE time_zone; -TRUNCATE TABLE time_zone_name; -TRUNCATE TABLE time_zone_transition; -TRUNCATE TABLE time_zone_transition_type; -START TRANSACTION; -ELSE +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; -END IF| -\d ; +/*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE')*/; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('GMT', @time_zone_id); @@ -115,15 +94,10 @@ UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=Aria; -ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; -ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; -END IF| -\d ; +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone ENGINE=', @time_zone_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); SELECT COUNT(*) FROM time_zone; COUNT(*) 2 @@ -142,9 +116,12 @@ COUNT(*) # # Run on zoneinfo directory --skip-write-binlog # -set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); -prepare set_wsrep_write_binlog from @prep1; -set @toggle=0; execute set_wsrep_write_binlog using @toggle; +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0'); +SET @save_sql_log_bin=@@SQL_LOG_BIN; +SET SESSION SQL_LOG_BIN=0; TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -172,6 +149,8 @@ UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; +SET SESSION SQL_LOG_BIN=@save_sql_log_bin; +execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0'); SELECT COUNT(*) FROM time_zone; COUNT(*) 2 @@ -187,6 +166,19 @@ COUNT(*) SELECT COUNT(*) FROM time_zone_leap_second; COUNT(*) 0 +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@SQL_LOG_BIN +0 0 NULL 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 2 +COM_BEGIN 0 +COM_INSERT 6 +COM_LOCK_TABLES 1 +COM_TRUNCATE 4 TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -195,19 +187,22 @@ TRUNCATE TABLE time_zone_leap_second; # # Testing with explicit timezonefile # -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=InnoDB; -ALTER TABLE time_zone_name ENGINE=InnoDB; -ALTER TABLE time_zone_transition ENGINE=InnoDB; -ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -SELECT 'skip truncate tables'; -START TRANSACTION; -ELSE -SELECT 'skip truncate tables'; -END IF| -\d ; +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); +/*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE')*/; INSERT INTO time_zone (Use_leap_seconds) VALUES ('N'); SET @time_zone_id= LAST_INSERT_ID(); INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id); @@ -216,17 +211,10 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset ; UNLOCK TABLES; COMMIT; -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=Aria; -ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; -ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; -END IF| -\d ; -skip truncate tables -skip truncate tables +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone ENGINE=', @time_zone_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); SELECT COUNT(*) FROM time_zone; COUNT(*) 1 @@ -242,6 +230,19 @@ COUNT(*) SELECT COUNT(*) FROM time_zone_leap_second; COUNT(*) 0 +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@SQL_LOG_BIN +0 0 NULL 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 0 +COM_BEGIN 0 +COM_INSERT 3 +COM_LOCK_TABLES 1 +COM_TRUNCATE 0 TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -250,10 +251,12 @@ TRUNCATE TABLE time_zone_leap_second; # # Testing with explicit timezonefile --skip-write-binlog # -set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); -prepare set_wsrep_write_binlog from @prep1; -set @toggle=0; execute set_wsrep_write_binlog using @toggle; -SELECT 'skip truncate tables'; +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0'); +SET @save_sql_log_bin=@@SQL_LOG_BIN; +SET SESSION SQL_LOG_BIN=0; LOCK TABLES time_zone WRITE, time_zone_leap_second WRITE, time_zone_name WRITE, @@ -267,21 +270,36 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, `Offset ; UNLOCK TABLES; COMMIT; +SET SESSION SQL_LOG_BIN=@save_sql_log_bin; +execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0'); SELECT COUNT(*) FROM time_zone; COUNT(*) -0 +1 SELECT COUNT(*) FROM time_zone_name; COUNT(*) -0 +1 SELECT COUNT(*) FROM time_zone_transition; COUNT(*) 0 SELECT COUNT(*) FROM time_zone_transition_type; COUNT(*) -0 +1 SELECT COUNT(*) FROM time_zone_leap_second; COUNT(*) 0 +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@SQL_LOG_BIN +0 0 NULL 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 0 +COM_BEGIN 0 +COM_INSERT 3 +COM_LOCK_TABLES 1 +COM_TRUNCATE 0 TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -290,46 +308,33 @@ TRUNCATE TABLE time_zone_leap_second; # # Testing --leap # -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=InnoDB; -ALTER TABLE time_zone_name ENGINE=InnoDB; -ALTER TABLE time_zone_transition ENGINE=InnoDB; -ALTER TABLE time_zone_transition_type ENGINE=InnoDB; -SELECT 'skip truncate tables'; -START TRANSACTION; -ELSE -SELECT 'skip truncate tables'; -END IF| -\d ; -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone_leap_second ENGINE=InnoDB; -END IF| -\d ; +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); +/*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE')*/; +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_leap_second_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_leap_second'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_leap_second ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone_leap_second; -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone_leap_second ENGINE=Aria; -END IF| -\d ; +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_leap_second ENGINE=', @time_zone_leap_second_engine), 'do 0'); ALTER TABLE time_zone_leap_second ORDER BY Transition_time; UNLOCK TABLES; COMMIT; -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=Aria; -ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; -ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; -END IF| -\d ; -skip truncate tables -skip truncate tables +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone ENGINE=', @time_zone_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); SELECT COUNT(*) FROM time_zone; COUNT(*) 0 @@ -345,6 +350,19 @@ COUNT(*) SELECT COUNT(*) FROM time_zone_leap_second; COUNT(*) 0 +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@SQL_LOG_BIN +0 0 NULL 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 1 +COM_BEGIN 0 +COM_INSERT 0 +COM_LOCK_TABLES 1 +COM_TRUNCATE 1 TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -353,10 +371,12 @@ TRUNCATE TABLE time_zone_leap_second; # # Testing --skip-write-binlog --leap # -set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on' and variable_value='ON'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?'); -prepare set_wsrep_write_binlog from @prep1; -set @toggle=0; execute set_wsrep_write_binlog using @toggle; -SELECT 'skip truncate tables'; +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0'); +SET @save_sql_log_bin=@@SQL_LOG_BIN; +SET SESSION SQL_LOG_BIN=0; LOCK TABLES time_zone WRITE, time_zone_leap_second WRITE, time_zone_name WRITE, @@ -366,8 +386,8 @@ TRUNCATE TABLE time_zone_leap_second; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; UNLOCK TABLES; COMMIT; -skip truncate tables -skip truncate tables +SET SESSION SQL_LOG_BIN=@save_sql_log_bin; +execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0'); SELECT COUNT(*) FROM time_zone; COUNT(*) 0 @@ -383,48 +403,56 @@ COUNT(*) SELECT COUNT(*) FROM time_zone_leap_second; COUNT(*) 0 +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@SQL_LOG_BIN +0 0 NULL 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 1 +COM_BEGIN 0 +COM_INSERT 0 +COM_LOCK_TABLES 1 +COM_TRUNCATE 1 # # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL # -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=InnoDB; -ALTER TABLE time_zone_name ENGINE=InnoDB; -ALTER TABLE time_zone_transition ENGINE=InnoDB; -ALTER TABLE time_zone_transition_type ENGINE=InnoDB; +set @wsrep_is_on=(select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES); +SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; +set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; TRUNCATE TABLE time_zone_transition_type; -START TRANSACTION; -ELSE -TRUNCATE TABLE time_zone; -TRUNCATE TABLE time_zone_name; -TRUNCATE TABLE time_zone_transition; -TRUNCATE TABLE time_zone_transition_type; -END IF| -\d ; +/*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE, + time_zone_leap_second WRITE, + time_zone_name WRITE, + time_zone_transition WRITE, + time_zone_transition_type WRITE')*/; UNLOCK TABLES; COMMIT; ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; -\d | -IF (select count(*) from information_schema.global_variables where -variable_name='wsrep_on' and variable_value='ON') = 1 THEN -ALTER TABLE time_zone ENGINE=Aria; -ALTER TABLE time_zone_name ENGINE=Aria; -ALTER TABLE time_zone_transition ENGINE=Aria, ORDER BY Time_zone_id, Transition_time; -ALTER TABLE time_zone_transition_type ENGINE=Aria, ORDER BY Time_zone_id, Transition_type_id; -END IF| -\d ; +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone ENGINE=', @time_zone_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_name ENGINE=', @time_zone_name_engine), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition ENGINE=', @time_zone_transition_engine, ', ORDER BY Time_zone_id, Transition_time'), 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_transition_type ENGINE=', @time_zone_transition_type_engine, ', ORDER BY Time_zone_id, Transition_type_id'), 'do 0'); +DROP TABLE baseline; DROP TABLE time_zone; DROP TABLE time_zone_name; DROP TABLE time_zone_transition; DROP TABLE time_zone_transition_type; DROP TABLE time_zone_leap_second; -RENAME TABLE time_zone_orig TO time_zone, -time_zone_name_orig TO time_zone_name, -time_zone_transition_orig TO time_zone_transition, -time_zone_transition_type_orig TO time_zone_transition_type, -time_zone_leap_second_orig TO time_zone_leap_second; +# +# End of 10.6 tests +# diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.test b/mysql-test/main/mysql_tzinfo_to_sql_symlink.test index fe7275294d5..2b9c22b7e58 100644 --- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.test +++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.test @@ -1,18 +1,13 @@ +--source include/have_innodb.inc --source include/have_symlink.inc --source include/not_windows.inc ---source include/not_embedded.inc +--source include/not_psprotocol.inc -use mysql; -RENAME TABLE time_zone TO time_zone_orig, - time_zone_name TO time_zone_name_orig, - time_zone_transition TO time_zone_transition_orig, - time_zone_transition_type TO time_zone_transition_type_orig, - time_zone_leap_second TO time_zone_leap_second_orig; -CREATE TABLE time_zone LIKE time_zone_orig; -CREATE TABLE time_zone_name LIKE time_zone_name_orig; -CREATE TABLE time_zone_transition LIKE time_zone_transition_orig; -CREATE TABLE time_zone_transition_type LIKE time_zone_transition_type_orig; -CREATE TABLE time_zone_leap_second LIKE time_zone_leap_second_orig; +CREATE TABLE time_zone LIKE mysql.time_zone; +CREATE TABLE time_zone_name LIKE mysql.time_zone_name; +CREATE TABLE time_zone_transition LIKE mysql.time_zone_transition; +CREATE TABLE time_zone_transition_type LIKE mysql.time_zone_transition_type; +CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second; --echo # --echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above @@ -27,16 +22,18 @@ CREATE TABLE time_zone_leap_second LIKE time_zone_leap_second_orig; --echo # Verbose run --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL --verbose $MYSQLTEST_VARDIR/zoneinfo 2>&1 -SELECT COUNT(*) FROM time_zone; -SELECT COUNT(*) FROM time_zone_name; -SELECT COUNT(*) FROM time_zone_transition; -SELECT COUNT(*) FROM time_zone_transition_type; -SELECT COUNT(*) FROM time_zone_leap_second; + +--echo # +--echo # MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases +--echo # --echo # Run on zoneinfo directory --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 ---exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo > $MYSQL_TMP_DIR/tz.sql +--disable_query_log +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone_name; SELECT COUNT(*) FROM time_zone_transition; @@ -49,13 +46,27 @@ SELECT COUNT(*) FROM time_zone_leap_second; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>&1 ---exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null > $MYSQL_TMP_DIR/tz.sql +--disable_query_log +CREATE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log + SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone_name; SELECT COUNT(*) FROM time_zone_transition; SELECT COUNT(*) FROM time_zone_transition_type; SELECT COUNT(*) FROM time_zone_leap_second; +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + # Below tests don't include TRUNCATE TABLE so clear them. TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; @@ -69,13 +80,27 @@ TRUNCATE TABLE time_zone_leap_second; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1 ---exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>/dev/null > $MYSQL_TMP_DIR/tz.sql +--disable_query_log +CREATE OR REPLACE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log + SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone_name; SELECT COUNT(*) FROM time_zone_transition; SELECT COUNT(*) FROM time_zone_transition_type; SELECT COUNT(*) FROM time_zone_leap_second; +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -87,13 +112,27 @@ TRUNCATE TABLE time_zone_leap_second; --echo # --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1 ---exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>/dev/null > $MYSQL_TMP_DIR/tz.sql +--disable_query_log +CREATE OR REPLACE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log + SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone_name; SELECT COUNT(*) FROM time_zone_transition; SELECT COUNT(*) FROM time_zone_transition_type; SELECT COUNT(*) FROM time_zone_leap_second; +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -105,13 +144,27 @@ TRUNCATE TABLE time_zone_leap_second; --echo # --exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1 ---exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +--exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null > $MYSQL_TMP_DIR/tz.sql +--disable_query_log +CREATE OR REPLACE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log + SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone_name; SELECT COUNT(*) FROM time_zone_transition; SELECT COUNT(*) FROM time_zone_transition_type; SELECT COUNT(*) FROM time_zone_leap_second; +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; TRUNCATE TABLE time_zone_transition; @@ -123,37 +176,51 @@ TRUNCATE TABLE time_zone_leap_second; --echo # --exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1 ---exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>/dev/null | $MYSQL -S $MASTER_MYSOCK -u root mysql +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog --leap $MYSQLTEST_VARDIR/zoneinfo/GMT > $MYSQL_TMP_DIR/tz.sql +--disable_query_log +CREATE OR REPLACE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log + SELECT COUNT(*) FROM time_zone; SELECT COUNT(*) FROM time_zone_name; SELECT COUNT(*) FROM time_zone_transition; SELECT COUNT(*) FROM time_zone_transition_type; SELECT COUNT(*) FROM time_zone_leap_second; -# -# -# Cleanup -# - ---exec rm -rf $MYSQLTEST_VARDIR/zoneinfo +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; --echo # --echo # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL --echo # +--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo --exec mkdir $MYSQLTEST_VARDIR/zoneinfo --copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/Factory --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 +# +# +# Cleanup +# + +--remove_file $MYSQL_TMP_DIR/tz.sql --exec rm -rf $MYSQLTEST_VARDIR/zoneinfo +DROP TABLE baseline; DROP TABLE time_zone; DROP TABLE time_zone_name; DROP TABLE time_zone_transition; DROP TABLE time_zone_transition_type; DROP TABLE time_zone_leap_second; -RENAME TABLE time_zone_orig TO time_zone, - time_zone_name_orig TO time_zone_name, - time_zone_transition_orig TO time_zone_transition, - time_zone_transition_type_orig TO time_zone_transition_type, - time_zone_leap_second_orig TO time_zone_leap_second; + +--echo # +--echo # End of 10.6 tests +--echo # diff --git a/mysql-test/suite/galera/r/mariadb_tzinfo_to_sql.result b/mysql-test/suite/galera/r/mariadb_tzinfo_to_sql.result new file mode 100644 index 00000000000..087b3174006 --- /dev/null +++ b/mysql-test/suite/galera/r/mariadb_tzinfo_to_sql.result @@ -0,0 +1,275 @@ +connection node_2; +connection node_1; +# +# MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases +# + +# On node_1 +connection node_1; +CREATE TABLE time_zone LIKE mysql.time_zone; +CREATE TABLE time_zone_name LIKE mysql.time_zone_name; +CREATE TABLE time_zone_transition LIKE mysql.time_zone_transition; +CREATE TABLE time_zone_transition_type LIKE mysql.time_zone_transition_type; +CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second; +ALTER TABLE time_zone_name ENGINE=MyISAM; +Warnings: +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +ALTER TABLE time_zone_transition_type ENGINE=MyISAM; +Warnings: +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +SET @save_wsrep_mode=@@WSREP_MODE; +# +# Run on zoneinfo directory --skip-write-binlog +# + +# Apply on node_1 + +Warnings: +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +'binlog stationary as expected' +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN +1 1 1 1 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 2 +COM_BEGIN 0 +COM_INSERT 6 +COM_LOCK_TABLES 1 +COM_TRUNCATE 4 +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 + +# On node_2 (not replicated) + +connection node_2; +SELECT COUNT(*) FROM time_zone; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 + +# Apply on node_1 + +connection node_1; +SET GLOBAL WSREP_MODE='REPLICATE_ARIA,REPLICATE_MYISAM'; +Warnings: +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +'binlog stationary as expected' +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN +1 0 1 1 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 2 +COM_BEGIN 0 +COM_INSERT 6 +COM_LOCK_TABLES 1 +COM_TRUNCATE 4 +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 + +# On node_2 (not replicated) + +connection node_2; +SELECT COUNT(*) FROM time_zone; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +# +# Run on zoneinfo directory without --skip-write-binlog +# + +# Apply on node_1 + +connection node_1; +Warnings: +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +'binlog advanced as expected' +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN +1 0 1 1 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 2 +COM_BEGIN 0 +COM_INSERT 6 +COM_LOCK_TABLES 1 +COM_TRUNCATE 4 +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 + +# On node_2 (replicated via ARIA) + +connection node_2; +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; + +# Apply on node_1 + +connection node_1; +SET GLOBAL WSREP_MODE=''; +Warnings: +Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 'time_zone_transition' +Warnings: +Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 'time_zone_transition_type' +Warnings: +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +Warnings: +Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TRANSACTIONAL=1' +'binlog advanced as expected' +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +@wsrep_is_on @wsrep_cannot_replicate_tz @save_wsrep_on @save_sql_log_bin @@WSREP_ON @@SQL_LOG_BIN +1 1 1 1 1 1 +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff +FROM information_schema.global_status g +JOIN baseline b USING (VARIABLE_NAME) +ORDER BY g.VARIABLE_NAME; +VARIABLE_NAME diff +COM_ALTER_TABLE 10 +COM_BEGIN 1 +COM_INSERT 6 +COM_LOCK_TABLES 0 +COM_TRUNCATE 4 +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES +WHERE +TABLE_SCHEMA = DATABASE() +AND TABLE_NAME LIKE 'time_zone%' ORDER BY TABLE_NAME; +TABLE_NAME ENGINE +time_zone Aria +time_zone_leap_second Aria +time_zone_name MyISAM +time_zone_transition Aria +time_zone_transition_type MyISAM + +# On node_2 (replicated via InnoDB) + +connection node_2; +SELECT COUNT(*) FROM time_zone; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_name; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_transition; +COUNT(*) +0 +SELECT COUNT(*) FROM time_zone_transition_type; +COUNT(*) +2 +SELECT COUNT(*) FROM time_zone_leap_second; +COUNT(*) +0 +connection node_1; +SET GLOBAL WSREP_MODE=@save_wsrep_mode; +DROP TABLE baseline; +DROP TABLE time_zone; +DROP TABLE time_zone_name; +DROP TABLE time_zone_transition; +DROP TABLE time_zone_transition_type; +DROP TABLE time_zone_leap_second; +# +# End of 10.6 tests +# diff --git a/mysql-test/suite/galera/t/mariadb_tzinfo_to_sql.opt b/mysql-test/suite/galera/t/mariadb_tzinfo_to_sql.opt new file mode 100644 index 00000000000..beae84b3862 --- /dev/null +++ b/mysql-test/suite/galera/t/mariadb_tzinfo_to_sql.opt @@ -0,0 +1 @@ +--log-bin diff --git a/mysql-test/suite/galera/t/mariadb_tzinfo_to_sql.test b/mysql-test/suite/galera/t/mariadb_tzinfo_to_sql.test new file mode 100644 index 00000000000..7fd454651e9 --- /dev/null +++ b/mysql-test/suite/galera/t/mariadb_tzinfo_to_sql.test @@ -0,0 +1,235 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/not_psprotocol.inc + +--echo # +--echo # MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases +--echo # + +--exec mkdir $MYSQLTEST_VARDIR/zoneinfo +--exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix +--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT + +--echo +--echo # On node_1 +--connection node_1 + +CREATE TABLE time_zone LIKE mysql.time_zone; +CREATE TABLE time_zone_name LIKE mysql.time_zone_name; +CREATE TABLE time_zone_transition LIKE mysql.time_zone_transition; +CREATE TABLE time_zone_transition_type LIKE mysql.time_zone_transition_type; +CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second; +ALTER TABLE time_zone_name ENGINE=MyISAM; +ALTER TABLE time_zone_transition_type ENGINE=MyISAM; + +SET @save_wsrep_mode=@@WSREP_MODE; + +--echo # +--echo # Run on zoneinfo directory --skip-write-binlog +--echo # + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null > $MYSQL_TMP_DIR/tz.sql + +--echo +--echo # Apply on node_1 +--echo +--let $snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1) +--disable_query_log +CREATE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log +--let $new_snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1) + +if ($snap_pos == $new_snap_pos) +{ +--echo 'binlog stationary as expected' +} +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +--echo +--echo # On node_2 (not replicated) +--echo +--connection node_2 + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +--echo +--echo # Apply on node_1 +--echo +--connection node_1 + +SET GLOBAL WSREP_MODE='REPLICATE_ARIA,REPLICATE_MYISAM'; +--disable_query_log +CREATE OR REPLACE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log +--let $new_snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1) + +if ($snap_pos == $new_snap_pos) +{ +--echo 'binlog stationary as expected' +} +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +--echo +--echo # On node_2 (not replicated) +--echo +--connection node_2 + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +--echo # +--echo # Run on zoneinfo directory without --skip-write-binlog +--echo # + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>/dev/null > $MYSQL_TMP_DIR/tz.sql + +--echo +--echo # Apply on node_1 +--echo +--connection node_1 + +--disable_query_log +CREATE OR REPLACE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log +--let $new_snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1) + +if ($snap_pos < $new_snap_pos) +{ +--echo 'binlog advanced as expected' +} +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +--echo +--echo # On node_2 (replicated via ARIA) +--echo +--connection node_2 + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +TRUNCATE TABLE time_zone_leap_second; + +--echo +--echo # Apply on node_1 +--echo +--connection node_1 + +SET GLOBAL WSREP_MODE=''; +--let $snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1) +--disable_query_log +CREATE OR REPLACE TEMPORARY TABLE baseline AS + SELECT VARIABLE_NAME,VARIABLE_VALUE + FROM information_schema.global_status + WHERE VARIABLE_NAME IN ('COM_BEGIN', 'COM_INSERT', 'COM_LOCK_TABLES', 'COM_ALTER_TABLE', 'COM_TRUNCATE'); +--source $MYSQL_TMP_DIR/tz.sql +--enable_query_log +--let $new_snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1) + +if ($snap_pos < $new_snap_pos) +{ +--echo 'binlog advanced as expected' +} +SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@WSREP_ON, @@SQL_LOG_BIN; +SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff + FROM information_schema.global_status g + JOIN baseline b USING (VARIABLE_NAME) + ORDER BY g.VARIABLE_NAME; + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES +WHERE + TABLE_SCHEMA = DATABASE() + AND TABLE_NAME LIKE 'time_zone%' ORDER BY TABLE_NAME; + +--echo +--echo # On node_2 (replicated via InnoDB) +--echo +--connection node_2 + +SELECT COUNT(*) FROM time_zone; +SELECT COUNT(*) FROM time_zone_name; +SELECT COUNT(*) FROM time_zone_transition; +SELECT COUNT(*) FROM time_zone_transition_type; +SELECT COUNT(*) FROM time_zone_leap_second; + +# +# Cleanup +# + +--connection node_1 +--remove_file $MYSQL_TMP_DIR/tz.sql +--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo +SET GLOBAL WSREP_MODE=@save_wsrep_mode; +DROP TABLE baseline; +DROP TABLE time_zone; +DROP TABLE time_zone_name; +DROP TABLE time_zone_transition; +DROP TABLE time_zone_transition_type; +DROP TABLE time_zone_leap_second; + +--echo # +--echo # End of 10.6 tests +--echo # diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt deleted file mode 100644 index a8b72174076..00000000000 --- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_on=1 --binlog_format=ROW diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test deleted file mode 100644 index 87554635666..00000000000 --- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink.test +++ /dev/null @@ -1,41 +0,0 @@ ---source include/have_wsrep.inc ---source include/have_symlink.inc ---source include/not_windows.inc ---source include/have_innodb.inc - ---echo # ---echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above ---echo # - ---exec mkdir $MYSQLTEST_VARDIR/zoneinfo ---exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix ---copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT ---copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/garbage ---copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/ignored.tab - ---echo # Verbose run ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_TZINFO_TO_SQL --verbose $MYSQLTEST_VARDIR/zoneinfo 2>&1 - ---echo # Silent run ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 - ---echo # ---echo # Testing with explicit timezonefile ---echo # - ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1 - ---echo # ---echo # Testing --leap ---echo # - ---exec $MYSQL_TZINFO_TO_SQL --leap $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1 - -# -# Cleanup -# - ---exec rm -rf $MYSQLTEST_VARDIR/zoneinfo diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt deleted file mode 100644 index a8b72174076..00000000000 --- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_on=1 --binlog_format=ROW diff --git a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test b/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test deleted file mode 100644 index ab1f94cc1cf..00000000000 --- a/mysql-test/suite/wsrep/t/mysql_tzinfo_to_sql_symlink_skip.test +++ /dev/null @@ -1,41 +0,0 @@ ---source include/have_wsrep.inc ---source include/have_symlink.inc ---source include/not_windows.inc ---source include/have_innodb.inc - ---echo # ---echo # MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above ---echo # - ---exec mkdir $MYSQLTEST_VARDIR/zoneinfo ---exec ln -s $MYSQLTEST_VARDIR/zoneinfo $MYSQLTEST_VARDIR/zoneinfo/posix ---copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/GMT ---copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/garbage ---copy_file std_data/words.dat $MYSQLTEST_VARDIR/zoneinfo/ignored.tab - ---echo # Verbose run ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_TZINFO_TO_SQL --verbose --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>&1 - ---echo # Silent run ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo 2>&1 - ---echo # ---echo # Testing with explicit timezonefile ---echo # - ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT XXX 2>&1 - ---echo # ---echo # Testing --leap ---echo # - ---exec $MYSQL_TZINFO_TO_SQL --leap --skip-write-binlog $MYSQLTEST_VARDIR/zoneinfo/GMT 2>&1 - -# -# Cleanup -# - ---exec rm -rf $MYSQLTEST_VARDIR/zoneinfo |