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

mysqldump --skip-opt does not work with MySQL 8

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.4.34, 11.7.0
    • N/A
    • Scripts & Clients
    • None

    Description

      mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)]
      

      This bug has already been reported and fixed by MySQL.

      Attachments

        Activity

          juanrgm Juanra GM created issue -
          juanrgm Juanra GM made changes -
          Field Original Value New Value
          Description
          ```
          mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)]
          ```

          This bug has already been reported by MySQL and fixed.
          This was reported in MySQL here:

          https://bugs.mysql.com/bug.php?id=91714

          And fixed here:

          https://github.com/mysql/mysql-server/commit/0da8170c5007b947183ba8b78708c36e73245a2f
          ```
          mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)]
          ```

          This bug has already been [reported|https://bugs.mysql.com/bug.php?id=91714] by MySQL and [fixed|https://github.com/mysql/mysql-server/commit/0da8170c5007b947183ba8b78708c36e73245a2f].

          juanrgm Juanra GM made changes -
          Description ```
          mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)]
          ```

          This bug has already been [reported|https://bugs.mysql.com/bug.php?id=91714] by MySQL and [fixed|https://github.com/mysql/mysql-server/commit/0da8170c5007b947183ba8b78708c36e73245a2f].


          {noformat}
          mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)]
          {noformat}


          This bug has already been [reported|https://bugs.mysql.com/bug.php?id=91714] by MySQL and [fixed|https://github.com/mysql/mysql-server/commit/0da8170c5007b947183ba8b78708c36e73245a2f].

          juanrgm Juanra GM made changes -
          Description
          {noformat}
          mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)]
          {noformat}


          This bug has already been [reported|https://bugs.mysql.com/bug.php?id=91714] by MySQL and [fixed|https://github.com/mysql/mysql-server/commit/0da8170c5007b947183ba8b78708c36e73245a2f].

          {noformat}
          mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1/*!40102 ,SQL_MODE=concat(@@sql_mode, _utf8 ',NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS') */': Variable 'sql_mode' can't be set to the value of 'NO_KEY_OPTIONS' (1231)]
          {noformat}


          This bug has already been [reported|https://bugs.mysql.com/bug.php?id=91714] and [fixed|https://github.com/mysql/mysql-server/commit/0da8170c5007b947183ba8b78708c36e73245a2f] by MySQL.

          I'm not sure it's a bug. You use --skip-opt which, besides other things, means that mariadb-dump should not include table/field/index options into the table definition. MySQL has removed those sql_mode values, meaning, when you dump from MySQL, mariadb-dump is unable to do what you requested, the dump from MySQL will always include table/field/index options.

          MySQL "fix" was to ignore user's explicit request, see their commit, the test uses --skip-create-options and the dump contains create options regardless. This looks more like a bug "mysqldump ignores --skip-create-options", than the fix,

          I think an error is quite appropriate here, you asked mariadb-dump to do something that it cannot do.

          serg Sergei Golubchik added a comment - I'm not sure it's a bug. You use --skip-opt which, besides other things, means that mariadb-dump should not include table/field/index options into the table definition. MySQL has removed those sql_mode values, meaning, when you dump from MySQL, mariadb-dump is unable to do what you requested, the dump from MySQL will always include table/field/index options. MySQL "fix" was to ignore user's explicit request, see their commit, the test uses --skip-create-options and the dump contains create options regardless. This looks more like a bug "mysqldump ignores --skip-create-options", than the fix, I think an error is quite appropriate here, you asked mariadb-dump to do something that it cannot do.
          serg Sergei Golubchik made changes -
          Status Open [ 1 ] Needs Feedback [ 10501 ]
          serg Sergei Golubchik made changes -
          Status Needs Feedback [ 10501 ] Open [ 1 ]
          serg Sergei Golubchik made changes -
          Fix Version/s N/A [ 14700 ]
          Assignee Sergei Golubchik [ serg ]
          Resolution Not a Bug [ 6 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Component/s Scripts & Clients [ 11002 ]
          Component/s Backup [ 13902 ]

          People

            serg Sergei Golubchik
            juanrgm Juanra GM
            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.