-
Dmitry Shulga authored
On some unix platforms there are timezone information files with junk content. Such files begin with correct magic string 'TZif' but almost all of other fields in such files have zero values and timezone abbreviation string in the file has the value "Local time zone must be set--see zic manual page". Loading data from such file leads to generating of the following INSERT statement: INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (@time_zone_id, 0, 0, 0, 'Local time zone must be set--see zic manual page') The column time_zone_transition_type.Abbreviation is declared as CHAR(8) so execution of the statement above is failed since column constraint is violated. To fix this bug timezone information files that contains the magic string 'Local time zone must be set--see zic manual page' as the value of timezone abbreviation string will be either skipped or an error will be returned depends on arguments specified to the program mysql_tzinfo_to_sql. In case when directory is specified as its argument such file will be skipped, for other case an error will be returned. This patch also changes the function print_tz_as_sql() a bit. Since the column time_zone_transition_type.Abbreviation is declared as CHAR(8) the width of value for the column abbreviation is limited by 8 chars when values for the statement INSERT INTO time_zone_transition_type is generated.
Dmitry Shulga authoredOn some unix platforms there are timezone information files with junk content. Such files begin with correct magic string 'TZif' but almost all of other fields in such files have zero values and timezone abbreviation string in the file has the value "Local time zone must be set--see zic manual page". Loading data from such file leads to generating of the following INSERT statement: INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (@time_zone_id, 0, 0, 0, 'Local time zone must be set--see zic manual page') The column time_zone_transition_type.Abbreviation is declared as CHAR(8) so execution of the statement above is failed since column constraint is violated. To fix this bug timezone information files that contains the magic string 'Local time zone must be set--see zic manual page' as the value of timezone abbreviation string will be either skipped or an error will be returned depends on arguments specified to the program mysql_tzinfo_to_sql. In case when directory is specified as its argument such file will be skipped, for other case an error will be returned. This patch also changes the function print_tz_as_sql() a bit. Since the column time_zone_transition_type.Abbreviation is declared as CHAR(8) the width of value for the column abbreviation is limited by 8 chars when values for the statement INSERT INTO time_zone_transition_type is generated.
Loading