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

10.2+ Integer DEFAULT values missing quotes

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.2(EOL)
    • N/A
    • Documentation
    • None
    • GNU/Linux

    Description

      SHOW CREATE TABLE test\G;
      

      MariaDB server 10.0:

        `link` tinyint(1) NOT NULL DEFAULT '1',
      

      MariaDB server 10.2:

        `link` tinyint(1) NOT NULL DEFAULT 1,
      

      I believe this change was intentional - not to quote integers. But both MySQL and MariaDB (prior to 10.2) had been behaving opposite on this - e.g. always quoted DEFAULT values. And now if some app relies on those outputs - it produces bad results across older vs. latest MariaDB server versions. I agree that it is bad to rely on such statements at first place in your app - but in our legacy app that was exactly the case.

      I doubt there is a flag to get back the old behavior?

      Note that this https://mariadb.com/kb/en/library/show-create-table/ is totally unrelated - that's for column names quotes, not DEFAULT values.

      Attachments

        Issue Links

          Activity

            The change was intentional, introduced by this commit:

            commit 6820bf9ca9c5992a7e9d382aa8aaabff6751fd46
            Author: Sergei Golubchik <serg@mariadb.org>
            Date:   Tue Jul 19 11:18:58 2016 +0200
             
                do not quote numbers in the DEFAULT clause in SHOW CREATE
            

            There is no flag to revert to the old behavior.

            Maybe the change deserves mentioning in documentation, assigning to greenman to decide.

            elenst Elena Stepanova added a comment - The change was intentional, introduced by this commit: commit 6820bf9ca9c5992a7e9d382aa8aaabff6751fd46 Author: Sergei Golubchik <serg@mariadb.org> Date: Tue Jul 19 11:18:58 2016 +0200   do not quote numbers in the DEFAULT clause in SHOW CREATE There is no flag to revert to the old behavior. Maybe the change deserves mentioning in documentation, assigning to greenman to decide.

            Thanks for clarification. Kind of expected Documentation at least must cover this indeed.

            stamster Nemanja Stambolic added a comment - Thanks for clarification. Kind of expected Documentation at least must cover this indeed.
            greenman Ian Gilfillan added a comment - Added in https://mariadb.com/kb/en/library/show-create-table/ and in https://mariadb.com/kb/en/library/incompatibilities-and-feature-differences-between-mariadb-102-and-mysql-57/

            Thanks.

            stamster Nemanja Stambolic added a comment - Thanks.

            People

              greenman Ian Gilfillan
              stamster Nemanja Stambolic
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.