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

Implement SQL2014 compliant LIKE (utf8mb4_unicode_ci produces different result '=' vs. LIKE)

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Character Sets
    • None

    Description

      the problem is that the mentiond collation doesn't return the expected result in the LIKE query

      MariaDB [(none)]> SELECT "ss" LIKE "ß" COLLATE utf8mb4_unicode_ci;
      +-------------------------------------------+
      | "ss" LIKE "ß" COLLATE utf8mb4_unicode_ci  |
      +-------------------------------------------+
      |                                         0 |
      +-------------------------------------------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> SELECT "ss" = "ß" COLLATE utf8mb4_unicode_ci;
      +----------------------------------------+
      | "ss" = "ß" COLLATE utf8mb4_unicode_ci  |
      +----------------------------------------+
      |                                      1 |
      +----------------------------------------+
      1 row in set (0.00 sec)
      

      it just happens with the ß character, other umlauts are fine

      MariaDB [(none)]> SELECT "o" = "ö" COLLATE utf8mb4_unicode_ci;
      +---------------------------------------+
      | "o" = "ö" COLLATE utf8mb4_unicode_ci  |
      +---------------------------------------+
      |                                     1 |
      +---------------------------------------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> SELECT "o" LIKE "ö" COLLATE utf8mb4_unicode_ci;
      +------------------------------------------+
      | "o" LIKE "ö" COLLATE utf8mb4_unicode_ci  |
      +------------------------------------------+
      |                                        1 |
      +------------------------------------------+
      1 row in set (0.00 sec)
      

      Also the expected behaviour on the general collation is fine

      MariaDB [(none)]> SELECT "s" LIKE "ß" COLLATE utf8mb4_general_ci;
      +------------------------------------------+
      | "s" LIKE "ß" COLLATE utf8mb4_general_ci  |
      +------------------------------------------+
      |                                        1 |
      +------------------------------------------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> SELECT "s" = "ß" COLLATE utf8mb4_general_ci;
      +---------------------------------------+
      | "s" = "ß" COLLATE utf8mb4_general_ci  |
      +---------------------------------------+
      |                                     1 |
      +---------------------------------------+
      1 row in set (0.00 sec)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            blackout Roman Stingler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.