Commit 0e4cf497 authored by Daniel Black's avatar Daniel Black

MDEV-28782 mariadb-tzinfo-to-sql to work in bootstrap mode

Work around MDEV-28718 for now, but also optimize the interation
of information_schema.SYSTEM_VARIABLES.

Add test case to show that tzinfo data into bootstrap is
desired functionality.

Bug report thanks to Dan Lenski of AWS.
parent 5bb90cb2
......@@ -34,4 +34,10 @@ name dl
EXAMPLE ha_example.so
truncate table mysql.plugin;
# Kill the server
#
# MDEV-28782 mariadb-tzinfo-to-sql to work in bootstrap mode
#
#
# End of 10.6 tests
#
# restart
......@@ -133,4 +133,30 @@ EOF
--exec $MYSQLD_BOOTSTRAP_CMD --default-time-zone=Europe/Moscow < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
--echo #
--echo # MDEV-28782 mariadb-tzinfo-to-sql to work in bootstrap mode
--echo #
--write_file $MYSQLTEST_VARDIR/tmp/tz.sql
use test;
create table time_zone like mysql.time_zone;
create table time_zone_leap_second like mysql.time_zone_leap_second;
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;
EOF
--exec $MYSQL_TZINFO_TO_SQL --skip-write-binlog std_data/zoneinfo/GMT GMT 2>/dev/null >> $MYSQLTEST_VARDIR/tmp/tz.sql
--append_file $MYSQLTEST_VARDIR/tmp/tz.sql
DROP TABLE time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type;
EOF
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/tz.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/tz.sql
--echo #
--echo # End of 10.6 tests
--echo #
# restore
--source include/start_mysqld.inc
......@@ -2726,11 +2726,11 @@ static const char *trunc_tables_const=
"TRUNCATE TABLE time_zone_transition;\n"
"TRUNCATE TABLE time_zone_transition_type;\n";
static const char *wsrep_is_on=
"select sum(VARIABLE_NAME='wsrep_on' AND SESSION_VALUE='ON')"
" from information_schema.SYSTEM_VARIABLES";
"select sum(SESSION_VALUE='ON')"
" from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on'";
static const char *wsrep_cannot_replicate_tz=
"select sum(VARIABLE_NAME='wsrep_mode' and GLOBAL_VALUE NOT LIKE @replicate_opt)"
" from information_schema.SYSTEM_VARIABLES";
"select sum(GLOBAL_VALUE NOT LIKE @replicate_opt)"
" from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode'";
int
main(int argc, char **argv)
......
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