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

CREATE TABLE allows COLLATE in non-character-string data types

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5, 10.1, 10.2, 10.3, 10.4, 10.5
    • None
    • None
    • None

    Description

      CREATE OR REPLACE TABLE t1 (a INT COLLATE latin1_bin);
      

      Query OK, 0 rows affected (0.020 sec)
      

      Looks wrong. COLLATE should be applicable only to character string data types:

      • CHAR
      • VARCHAR
      • TEXT (and its variants)
      • ENUM
      • SET

      COLLATE with non-character-string data types should return an error.

      Note, this includes binary strings. COLLATE with a binary string data type should also return an error:

      • BINARY
      • VARBINARY
      • BLOB (and its variants)

      The best way to fix this is to add a new method into Type_handler, to test COLLATE clause applicability.

      Attachments

        Activity

          People

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