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

Wrong timestamps on restore from mysqldump --compact

    XMLWordPrintable

Details

    Description

      Reproduce

      1. Set system timezone to UTC+3
      2.

      create or replace table d (t timestamp);
      insert into d values ('2000-01-01 00:00');
      

      3.

      mysqldump --compact test d > /tmp/dump.sql
      

      4.

      drop table d;
      source /tmp/dump.sql
      select * from d;
      

      Result

      Data is different from original:

      +---------------------+
      | t                   |
      +---------------------+
      | 1999-12-31 22:00:00 |
      +---------------------+
      

      Expected

      mysqldump and subsequent restore should be idempotent without any additional manipulations.

      Fix

      mysqldump must insert correct SET time_zone directive regardless --compact setting. In case when opt_tz_utc is 0 it must detect server timezone as well.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              midenok Aleksey Midenkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.