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

Multiple conflicting column COLLATE clauses are not rejected

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
    • 10.9.0
    • Character Sets, Data types
    • None

    Description

      If I specify mutiple conflicting COLLATE clauses on the column level, no error is raised:

      CREATE OR REPLACE TABLE t1 (a CHAR(10) COLLATE latin1_swedish_ci NOT NULL COLLATE latin1_bin);
      SHOW CREATE TABLE t1;
      

      +-------+----------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                               |
      +-------+----------------------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+----------------------------------------------------------------------------------------------------------------------------+
      

      Notice, the first COLLATE was ignored, the last COLLATE was used.

      The same problem is repeatable on the table level. See MDEV-28117.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Summary Multiple conflicting COLLATE clauses are not rejected Multiple conflicting column COLLATE clauses are not rejected
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Description If I specify mutiple conflicting COLLATE clauses on the column level, no error is raised:

            {code:sql}
            CREATE OR REPLACE TABLE t1 (a CHAR(10) COLLATE latin1_swedish_ci NOT NULL COLLATE latin1_bin);
            SHOW CREATE TABLE t1;
            {code}
            {noformat}
            +-------+----------------------------------------------------------------------------------------------------------------------------+
            | Table | Create Table |
            +-------+----------------------------------------------------------------------------------------------------------------------------+
            | t1 | CREATE TABLE `t1` (
              `a` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
            ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
            +-------+----------------------------------------------------------------------------------------------------------------------------+
            {noformat}

            Notice, the first COLLATE was ignored, the last COLLATE was used.


            The same problem is repeatable on the table level:
            {code:sql}
            CREATE OR REPLACE TABLE t1 (a CHAR(10)) COLLATE latin1_swedish_ci COLLATE latin1_bin;
            SHOW CREATE TABLE t1;
            {code}
            {noformat}
            +-------+------------------------------------------------------------------------------------------------------------------------------+
            | Table | Create Table |
            +-------+------------------------------------------------------------------------------------------------------------------------------+
            | t1 | CREATE TABLE `t1` (
              `a` char(10) COLLATE latin1_bin DEFAULT NULL
            ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin |
            +-------+------------------------------------------------------------------------------------------------------------------------------+
            {noformat}
            If I specify mutiple conflicting COLLATE clauses on the column level, no error is raised:

            {code:sql}
            CREATE OR REPLACE TABLE t1 (a CHAR(10) COLLATE latin1_swedish_ci NOT NULL COLLATE latin1_bin);
            SHOW CREATE TABLE t1;
            {code}
            {noformat}
            +-------+----------------------------------------------------------------------------------------------------------------------------+
            | Table | Create Table |
            +-------+----------------------------------------------------------------------------------------------------------------------------+
            | t1 | CREATE TABLE `t1` (
              `a` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
            ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
            +-------+----------------------------------------------------------------------------------------------------------------------------+
            {noformat}

            Notice, the first COLLATE was ignored, the last COLLATE was used.


            The same problem is repeatable on the table level. See MDEV-28117.
            bar Alexander Barkov made changes -
            Fix Version/s 10.9.0 [ 27113 ]
            Fix Version/s 10.9 [ 26905 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]

            People

              bar Alexander Barkov
              bar Alexander Barkov
              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.