mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-22626: mysql_tzinfo_to_sql not replicates timezone to galeranodes if only 1 timezone will be loaded.
Move alter to InnoDB earlier to more correct place to handle also if only a one timezone file is loaded.
This commit is contained in:
@ -85,6 +85,15 @@ END IF|
|
|||||||
#
|
#
|
||||||
# Testing with explicit timezonefile
|
# 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;
|
||||||
|
END IF|
|
||||||
|
\d ;
|
||||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||||
SET @time_zone_id= LAST_INSERT_ID();
|
SET @time_zone_id= LAST_INSERT_ID();
|
||||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
|
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
|
||||||
@ -106,6 +115,15 @@ END IF|
|
|||||||
\d |
|
\d |
|
||||||
IF (select count(*) from information_schema.global_variables where
|
IF (select count(*) from information_schema.global_variables where
|
||||||
variable_name='wsrep_on' and variable_value='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;
|
||||||
|
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
|
||||||
|
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;
|
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
|
||||||
END IF|
|
END IF|
|
||||||
\d ;
|
\d ;
|
||||||
|
@ -85,6 +85,15 @@ END IF|
|
|||||||
#
|
#
|
||||||
# Testing with explicit timezonefile
|
# 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;
|
||||||
|
END IF|
|
||||||
|
\d ;
|
||||||
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
|
||||||
SET @time_zone_id= LAST_INSERT_ID();
|
SET @time_zone_id= LAST_INSERT_ID();
|
||||||
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
|
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
|
||||||
@ -106,6 +115,15 @@ END IF|
|
|||||||
\d |
|
\d |
|
||||||
IF (select count(*) from information_schema.global_variables where
|
IF (select count(*) from information_schema.global_variables where
|
||||||
variable_name='wsrep_on' and variable_value='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;
|
||||||
|
ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
|
||||||
|
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;
|
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
|
||||||
END IF|
|
END IF|
|
||||||
\d ;
|
\d ;
|
||||||
|
@ -2713,6 +2713,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opt_skip_write_binlog)
|
if (opt_skip_write_binlog)
|
||||||
|
{
|
||||||
/* If skip_write_binlog is set and wsrep is compiled in we disable
|
/* If skip_write_binlog is set and wsrep is compiled in we disable
|
||||||
sql_log_bin and wsrep_on to avoid Galera replicating below
|
sql_log_bin and wsrep_on to avoid Galera replicating below
|
||||||
truncate table clauses. This will allow user to set different
|
truncate table clauses. This will allow user to set different
|
||||||
@ -2720,14 +2721,8 @@ main(int argc, char **argv)
|
|||||||
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"
|
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"
|
"prepare set_wsrep_write_binlog from @prep1;\n"
|
||||||
"set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n");
|
"set @toggle=0; execute set_wsrep_write_binlog using @toggle;\n");
|
||||||
|
}
|
||||||
if (argc == 1 && !opt_leap)
|
else
|
||||||
{
|
|
||||||
/* Argument is timezonedir */
|
|
||||||
|
|
||||||
root_name_end= strmake_buf(fullname, argv[0]);
|
|
||||||
|
|
||||||
if(!opt_skip_write_binlog)
|
|
||||||
{
|
{
|
||||||
// Alter time zone tables to InnoDB if wsrep_on is enabled
|
// Alter time zone tables to InnoDB if wsrep_on is enabled
|
||||||
// to allow changes to them to replicate with Galera
|
// to allow changes to them to replicate with Galera
|
||||||
@ -2742,6 +2737,12 @@ main(int argc, char **argv)
|
|||||||
"\\d ;\n");
|
"\\d ;\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc == 1 && !opt_leap)
|
||||||
|
{
|
||||||
|
/* Argument is timezonedir */
|
||||||
|
|
||||||
|
root_name_end= strmake_buf(fullname, argv[0]);
|
||||||
|
|
||||||
printf("TRUNCATE TABLE time_zone;\n");
|
printf("TRUNCATE TABLE time_zone;\n");
|
||||||
printf("TRUNCATE TABLE time_zone_name;\n");
|
printf("TRUNCATE TABLE time_zone_name;\n");
|
||||||
printf("TRUNCATE TABLE time_zone_transition;\n");
|
printf("TRUNCATE TABLE time_zone_transition;\n");
|
||||||
|
Reference in New Issue
Block a user