Commit b611ac06 authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL

Factory timezone is supposed "For companies who don't want to put time zone
specification in their installation procedures. When users run date, they'll get
the message. Also useful for the "comp.sources" version."

This "message" is exposed as timezone abbreviation, which is supposed to be
short and thus may cause generated INSERT statements to fail.

Do not attempt to load Factory timezone.
parent af2256ff
......@@ -60,3 +60,12 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset,
#
TRUNCATE TABLE time_zone_leap_second;
ALTER TABLE time_zone_leap_second ORDER BY Transition_time;
#
# MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL
#
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
TRUNCATE TABLE time_zone_transition;
TRUNCATE TABLE time_zone_transition_type;
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;
......@@ -37,3 +37,14 @@
#
--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo
--echo #
--echo # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL
--echo #
--exec mkdir $MYSQLTEST_VARDIR/zoneinfo
--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/Factory
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1
--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo
......@@ -2521,7 +2521,8 @@ scan_tz_dir(char * name_end, uint symlink_recursion_level, uint verbose)
for (i= 0; i < cur_dir->number_off_files; i++)
{
if (cur_dir->dir_entry[i].name[0] != '.')
if (cur_dir->dir_entry[i].name[0] != '.' &&
strcmp(cur_dir->dir_entry[i].name, "Factory"))
{
name_end_tmp= strmake(name_end, cur_dir->dir_entry[i].name,
FN_REFLEN - (name_end - fullname));
......
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