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

Collation "binary" is not accepted for databases, tables, columns

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
    • Fix Version/s: 10.9
    • Component/s: Character Sets, Parser
    • Labels:
      None

      Description

      binary collation is shown in information_schema.collations, but it's not accepted in CREATE statements and such, e.g.

      MariaDB [test]> create table t (a char(1) collate binary);
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'binary)' at line 1
      

      Maybe semantically binary collation doesn't make much sense, but not being able to parse it can cause a problem loading a dump from MySQL 8.0, as it can produce such structures:

      8.0.28

      MySQL [test]> create table t (a enum('a') character set binary, b char(8)) character set latin1;
      Query OK, 0 rows affected (0.194 sec)
       
      MySQL [test]> show create table t \G
      *************************** 1. row ***************************
             Table: t
      Create Table: CREATE TABLE `t` (
        `a` enum('a') CHARACTER SET binary COLLATE binary DEFAULT NULL,
        `b` char(8) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1
      1 row in set (0.001 sec)
      

        Attachments

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.