summaryrefslogtreecommitdiff
path: root/sql/tztime.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2019-12-05 12:39:04 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2019-12-05 12:41:13 +0200
commit2b7e461cc06ea5ca167e16ff643f0b597aba118d (patch)
tree087c5e8c2d20d04086f7bdf92c54963ee59010c2 /sql/tztime.cc
parentf00198e09f37814529caba8cda818bfb11402188 (diff)
downloadmariadb-git-2b7e461cc06ea5ca167e16ff643f0b597aba118d.tar.gz
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.
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r--sql/tztime.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 8f66dfa0c9e..960dde38237 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -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"