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

mysqldump against MYSQL server 8 creates invalid dump

    XMLWordPrintable

Details

    Description

      Running the following command against MYSQL Server v8.0.32

      mysqldump -h ... -u ... -p --opt --single-transaction --no-tablespaces the_database > dump.sql
      

      creates a dump without error messages, which look like this:

      CREATE TABLE foo (
        uid INT ...,
        tstamp INT ...,
        something VARCHAR(22) ...,
        ...
        PRIMARY KEY uid
      );
       
      INSERT INTO foo VALUES ('',153246345,1),('',1567246333,2),...;
      

      As one can see the VALUES part uses an incorrect order of columns. Trying to import such a dump, obviously, fails directly with "DUPLICATE KEY".

      Observation: The order of the VALUES is the alphabetical order of the column names not the one specified in the CREATE TABLE statement.

      (Note: Running the same command using mysqldump from mysql works flawlessly)

      Attachments

        Activity

          People

            serg Sergei Golubchik
            liayn1 M
            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.