summaryrefslogtreecommitdiff
path: root/sql/tztime.cc
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2020-08-10 18:23:25 +1000
committerDaniel Black <daniel@mariadb.org>2020-08-15 14:02:05 +1000
commitb970363acfae02be4667825501316b412ef6486a (patch)
treeeacf020d7892340f1a9bb867db220fc6e11b096e /sql/tztime.cc
parent7c2aad6be2bc94e022b39cdffe218604d91d410a (diff)
downloadmariadb-git-b970363acfae02be4667825501316b412ef6486a.tar.gz
MDEV-23440: mysql_tzinfo_to_sql to use transactions
Since MDEV-18778, timezone tables get changed to innodb to allow them to be replicated to other galera nodes. Even without galera, timezone tables could be declared innodb. With the standalone innodb tables, the mysql_tzinfo_to_sql takes approximately 27 seconds. With the transactions enabled in this patch, 1.2 seconds is the approximate load time. While explicit checks for the engine of the time zone tables could be done, or checks against !opt_skip_write_binlog, non-transactional storage engines will just ignore the transactional state without even a warning so its safe to enact globally. Leap seconds are pretty much ignored as they are a single insert statement and have gone out of favour as they have caused MariaDB stalls in the past.
Diffstat (limited to 'sql/tztime.cc')
-rw-r--r--sql/tztime.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 960dde38237..fa5a24d3c8a 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -2748,9 +2748,11 @@ main(int argc, char **argv)
printf("TRUNCATE TABLE time_zone_name;\n");
printf("TRUNCATE TABLE time_zone_transition;\n");
printf("TRUNCATE TABLE time_zone_transition_type;\n");
+ printf("START TRANSACTION;\n");
if (scan_tz_dir(root_name_end, 0, opt_verbose))
{
+ printf("ROLLBACK;\n");
fflush(stdout);
fprintf(stderr,
"There were fatal errors during processing "
@@ -2758,6 +2760,7 @@ main(int argc, char **argv)
return 1;
}
+ printf("COMMIT;\n");
printf("ALTER TABLE time_zone_transition "
"ORDER BY Time_zone_id, Transition_time;\n");
printf("ALTER TABLE time_zone_transition_type "