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

Wrong utf8mb4_0900_bin alias for utf8mb4_bin (should be utf8mb4_nopad_bin)

Details

    Description

      I run this query:

      SELECT collation_name, id, comment
      FROM information_schema.collations
      WHERE collation_name='utf8mb4_0900_bin';
      

      It says utf8mb4_0900_bin is an alias for utf8mb4_bin:

      +------------------+------+-----------------------+
      | collation_name   | id   | comment               |
      +------------------+------+-----------------------+
      | utf8mb4_0900_bin |  309 | Alias for utf8mb4_bin |
      +------------------+------+-----------------------+
      

      This looks wrong.

      According to https://dev.mysql.com/doc/refman/8.4/en/charset-mysql.html, utf8mb4_0900_bin is a NO PAD collation:

      | utf8mb4_0900_bin           | utf8mb4 | 309 |         | Yes      |       1 | NO PAD        |
      

      utf8mb4_0900_bin should be fixed to be an alias for utf8mb4_nopad_bin.

      MySQL

      MySQL [test]> SET NAMES utf8mb4 COLLATE utf8mb4_0900_bin;
      Query OK, 0 rows affected (0.000 sec)
       
      MySQL [test]> SELECT 'a\t'<'a';
      +-----------+
      | 'a\t'<'a' |
      +-----------+
      |         0 |
      +-----------+
      1 row in set (0.000 sec)
       
      MySQL [test]> SET NAMES utf8mb4 COLLATE utf8mb4_bin;
      Query OK, 0 rows affected (0.000 sec)
       
      MySQL [test]> SELECT 'a\t'<'a';
      +-----------+
      | 'a\t'<'a' |
      +-----------+
      |         1 |
      +-----------+
      1 row in set (0.000 sec)
      

      MariaDB

      MariaDB [test]> SET NAMES utf8mb4 COLLATE utf8mb4_0900_bin;
      Query OK, 0 rows affected (0.001 sec)
       
      MariaDB [test]> SELECT 'a\t'<'a';
      +-----------+
      | 'a\t'<'a' |
      +-----------+
      |         1 |    <---  0 is expected here
      +-----------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> SET NAMES utf8mb4 COLLATE utf8mb4_bin;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> SELECT 'a\t'<'a';
      +-----------+
      | 'a\t'<'a' |
      +-----------+
      |         1 |
      +-----------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            Pushed under a wrong MDEV number in a mistake:

            commit 3bbe11acd93ad63ed1d90656e11a665d6326996f (HEAD -> 11.4, origin/bb-11.4-bar-MDEV-36361, origin/HEAD, origin/11.4)
            Author: Alexander Barkov <bar@mariadb.com>
            Date:   Mon Mar 24 18:54:45 2025 +0400
             
                MDEV-20912 Add support for utf8mb4_0900_* collations in MariaDB Server
                
                Fixing a wrong alias utf8mb4_0900_bin:
                - was utf8mb4_bin
                - changed to utf8mb4_nopad_bin
                
                MySQL 0900 collations are NOPAD, including utf8mb4_0900_bin.
            

            bar Alexander Barkov added a comment - Pushed under a wrong MDEV number in a mistake: commit 3bbe11acd93ad63ed1d90656e11a665d6326996f (HEAD -> 11.4, origin/bb-11.4-bar-MDEV-36361, origin/HEAD, origin/11.4) Author: Alexander Barkov <bar@mariadb.com> Date: Mon Mar 24 18:54:45 2025 +0400   MDEV-20912 Add support for utf8mb4_0900_* collations in MariaDB Server Fixing a wrong alias utf8mb4_0900_bin: - was utf8mb4_bin - changed to utf8mb4_nopad_bin MySQL 0900 collations are NOPAD, including utf8mb4_0900_bin.

            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.