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

[PATCH] mysql_tzinfo_to_sql may produce invalid SQL

Details

    • 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

      Attachments

        Issue Links

          Activity

            hholzgra Hartmut Holzgraefe created issue -
            hholzgra Hartmut Holzgraefe made changes -
            Field Original Value New Value
            Attachment patch [ 29802 ]
            serg Sergei Golubchik made changes -
            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
            /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:
            {code:sql}
              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')
              ;
            {code}
            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
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Affects Version/s 5.5.37 [ 15000 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.0.13 [ 16000 ]
            Fix Version/s 5.5.39 [ 15800 ]
            serg Sergei Golubchik made changes -
            Workflow defaullt [ 40706 ] MariaDB v2 [ 43322 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 43322 ] MariaDB v3 [ 62408 ]
            elenst Elena Stepanova made changes -
            Component/s Scripts & Clients [ 11002 ]
            Labels upstream-fixed
            elenst Elena Stepanova made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            Summary mysql_tzinfo_to_sql may produce invalid SQL [PATCH] mysql_tzinfo_to_sql may produce invalid SQL
            elenst Elena Stepanova made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            serg Sergei Golubchik made changes -
            Assignee Sergey Vojtovich [ svoj ]
            serg Sergei Golubchik made changes -
            Sprint Sprint 1 [ 4 ]
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Sergei Golubchik [ serg ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Sergey Vojtovich [ svoj ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            Fix Version/s 10.0.20 [ 19201 ]
            Fix Version/s 10.1.6 [ 19401 ]
            Fix Version/s 5.5.44 [ 19100 ]
            Fix Version/s 5.5 [ 15800 ]
            Fix Version/s 10.0 [ 16000 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 62408 ] MariaDB v4 [ 147888 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.