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

Regression in ucs2_general_mysql500_ci

    XMLWordPrintable

Details

    Description

      ucs2_general_mysql500_ci is a MySQL-5.0.0 compatibility collations and (unlike ucs2_general_ci) sorts 'ß' after 's' in all MariaDB versions up to 10.3:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_general_mysql500_ci);
      INSERT INTO t1 VALUES ('s'),('z'),(_latin1 0xDF);
      SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a;
      

      +-----------------+
      | GROUP_CONCAT(a) |
      +-----------------+
      | s               |
      | z               |
      | ß               |
      +-----------------+
      

      Starting from 10.4 it returns a wrong result (equal to ucs2_general_ci):

      +-----------------+
      | GROUP_CONCAT(a) |
      +-----------------+
      | s,ß             |
      | z               |
      +-----------------+
      

      This is not expected. The compatibility collations should still provide the old MySQL-5.0.0 order.

      The order was broken by:

      commit a8efe7ab1f28e2219df5ae9aa88fa63c40ad1066
      Author: Alexander Barkov <bar@mariadb.com>
      Date:   Fri Oct 19 14:20:31 2018 +0400
       
          MDEV-17502 MDEV-17474 Change Unicode xxx_general_ci and xxx_bin collation implementation to "inline" style
      

      Note, a similar collation for utf8mb3 correctly returns results in the expected order in all MariaDB versions:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARCHAR(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_mysql500_ci);
      INSERT INTO t1 VALUES ('s'),('z'),(_latin1 0xDF);
      SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a;
      

      +-----------------+
      | GROUP_CONCAT(a) |
      +-----------------+
      | s               |
      | z               |
      | ß               |
      +-----------------+
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              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.