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

Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level

    XMLWordPrintable

Details

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

    Description

      The order of the CHARACTER SET and the COLLATE clauses is not strict on the table and the database level.
      If COLLATE goes before CHARACTER SET, the COLLATE is ignored.

      CREATE OR REPLACE TABLE t1 (a CHAR) COLLATE latin1_bin CHARACTER SET latin1;
      SHOW CREATE TABLE t1;
      

      +-------+---------------------------------------------------------------------------------------+
      | Table | Create Table                                                                          |
      +-------+---------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` char(1) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
      +-------+---------------------------------------------------------------------------------------+
      

      Notice, the COLLATE latin1_bin was ignored.

      CREATE OR REPLACE DATABASE d1 COLLATE latin1_bin CHARACTER SET latin1;
      SHOW CREATE DATABASE d1;
      

      +----------+---------------------------------------------------------------+
      | Database | Create Database                                               |
      +----------+---------------------------------------------------------------+
      | d1       | CREATE DATABASE `d1` /*!40100 DEFAULT CHARACTER SET latin1 */ |
      +----------+---------------------------------------------------------------+
      

      Notice, the COLLATE latin1_bin was ignored.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.