Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6236

[PATCH] mysql_tzinfo_to_sql may produce invalid SQL

    Details

    • Sprint:
      5.5.44

      Description

      /usr/share/zoneinfo may contain some files where a warning like

      Local time zone must be set--see zic manual page

      may be given instead of a time zone abbreviation for time_zone_transition_type.

      This leads to output like:

        INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
        SET @time_zone_id= LAST_INSERT_ID();
        INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('Factory', @time_zone_id);
        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')
        ;
      

      which will fail if sql_mode=STRICT_ALL_TABLES is set as the "Local time zone ..." string is much longer than the 8 characters reserved for "Abbreviation" in the time_zone_transition_type table

      Suggestion: filter out these time zones completely and don't get INSERT statements for them at all as they contain no useful information anyway ...

      See also http://bugs.mysql.com/bug.php?id=68861

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              hholzgra Hartmut Holzgraefe added a comment -

              proposed patch to ignore invalid entries

              Show
              hholzgra Hartmut Holzgraefe added a comment - proposed patch to ignore invalid entries
              Hide
              elenst Elena Stepanova added a comment -

              Fixed in MySQL 5.7.5

              Show
              elenst Elena Stepanova added a comment - Fixed in MySQL 5.7.5
              Hide
              svoj Sergey Vojtovich added a comment -

              Sergei Golubchik, please review fix for this bug.

              Show
              svoj Sergey Vojtovich added a comment - Sergei Golubchik , please review fix for this bug.

                People

                • Assignee:
                  svoj Sergey Vojtovich
                  Reporter:
                  hholzgra Hartmut Holzgraefe
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 10 minutes
                    10m

                      Agile