Commit 2b7e461c authored by Jan Lindström's avatar Jan Lindström

MDEV-21209 : mysql_tzinfo_to_sql's Galera checks do not work

wsrep_on parameter can be visible even when wsrep_on is set OFF
so we need to check variable_value from I_S also.
parent f00198e0
......@@ -4,7 +4,7 @@
# Verbose run
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
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;
......@@ -36,7 +36,7 @@ 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') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......@@ -46,7 +46,7 @@ END IF|
# Silent run
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
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;
......@@ -75,7 +75,7 @@ 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') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......@@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
;
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......@@ -105,21 +105,21 @@ END IF|
#
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
END IF|
\d ;
TRUNCATE TABLE time_zone_leap_second;
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=MyISAM;
END IF|
\d ;
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......@@ -131,7 +131,7 @@ END IF|
#
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
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;
......@@ -146,7 +146,7 @@ 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') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......
......@@ -4,7 +4,7 @@
# Verbose run
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
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;
......@@ -36,7 +36,7 @@ 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') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......@@ -46,7 +46,7 @@ END IF|
# Silent run
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
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;
......@@ -75,7 +75,7 @@ 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') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......@@ -93,7 +93,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
;
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......@@ -105,21 +105,21 @@ END IF|
#
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
END IF|
\d ;
TRUNCATE TABLE time_zone_leap_second;
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=MyISAM;
END IF|
\d ;
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on') = 1 THEN
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone ENGINE=MyISAM;
ALTER TABLE time_zone_name ENGINE=MyISAM;
ALTER TABLE time_zone_transition ENGINE=MyISAM;
......
......@@ -2,7 +2,7 @@
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
#
# Verbose run
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
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;
TRUNCATE TABLE time_zone;
......@@ -29,7 +29,7 @@ Warning: Skipping directory 'MYSQLTEST_VARDIR/zoneinfo/posix/posix': to avoid in
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;
# Silent run
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
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;
TRUNCATE TABLE time_zone;
......@@ -55,7 +55,7 @@ ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id;
#
# Testing with explicit timezonefile
#
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
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;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
......@@ -67,7 +67,7 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
#
# Testing --leap
#
set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');
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;
TRUNCATE TABLE time_zone_leap_second;
......
--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --binlog_format=ROW
--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
......
--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --binlog_format=ROW
--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
......
......@@ -2443,7 +2443,7 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp)
if (!opt_skip_write_binlog)
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
"variable_name='wsrep_on') = 1 THEN\n"
"variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone_leap_second ENGINE=InnoDB;\n"
"END IF|\n"
"\\d ;\n");
......@@ -2463,7 +2463,7 @@ print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp)
if (!opt_skip_write_binlog)
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
"variable_name='wsrep_on') = 1 THEN\n"
"variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone_leap_second ENGINE=MyISAM;\n"
"END IF|\n"
"\\d ;\n");
......@@ -2719,7 +2719,7 @@ main(int argc, char **argv)
sql_log_bin and wsrep_on to avoid Galera replicating below
truncate table clauses. This will allow user to set different
time zones to nodes in Galera cluster. */
printf("set @prep1=if((select count(*) from information_schema.global_variables where variable_name='wsrep_on'), 'SET SESSION SQL_LOG_BIN=?, WSREP_ON=OFF;', 'do ?');\n"
printf("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 ?');\n"
"prepare set_wsrep_write_binlog from @prep1;\n"
"set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n");
......@@ -2735,7 +2735,7 @@ main(int argc, char **argv)
// to allow changes to them to replicate with Galera
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
"variable_name='wsrep_on') = 1 THEN\n"
"variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone ENGINE=InnoDB;\n"
"ALTER TABLE time_zone_name ENGINE=InnoDB;\n"
"ALTER TABLE time_zone_transition ENGINE=InnoDB;\n"
......@@ -2790,7 +2790,7 @@ main(int argc, char **argv)
// Fall back to MyISAM
printf("\\d |\n"
"IF (select count(*) from information_schema.global_variables where\n"
"variable_name='wsrep_on') = 1 THEN\n"
"variable_name='wsrep_on' and variable_value='ON') = 1 THEN\n"
"ALTER TABLE time_zone ENGINE=MyISAM;\n"
"ALTER TABLE time_zone_name ENGINE=MyISAM;\n"
"ALTER TABLE time_zone_transition ENGINE=MyISAM;\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment