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

Wrong casefolding in xxx_unicode_520_ci for U+0700..U+07FF

    XMLWordPrintable

Details

    Description

      Functions UPPER() and LOWER() erroneously translate charcters in the range U+0700..U+07FF to U+0600..U+06FF in combination with the collation xxx_unicode_520_ci:

      DELIMITER $$
      BEGIN NOT ATOMIC
        DECLARE ch CHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_520_ci;
        FOR i IN 0x700..0x7FF
        DO
          SET ch= CHAR(i USING ucs2);
          SELECT HEX(ch), HEX(LOWER(ch)), HEX(UPPER(ch));
        END FOR;
      END;
      $$
      DELIMITER ;
      

      +---------+----------------+----------------+
      | HEX(ch) | HEX(LOWER(ch)) | HEX(UPPER(ch)) |
      +---------+----------------+----------------+
      | 0700    | 0600           | 0600           |
      +---------+----------------+----------------+
      1 row in set (0.001 sec)
       
      +---------+----------------+----------------+
      | HEX(ch) | HEX(LOWER(ch)) | HEX(UPPER(ch)) |
      +---------+----------------+----------------+
      | 0701    | 0601           | 0601           |
      +---------+----------------+----------------+
      1 row in set (0.001 sec)
       
      +---------+----------------+----------------+
      | HEX(ch) | HEX(LOWER(ch)) | HEX(UPPER(ch)) |
      +---------+----------------+----------------+
      | 0702    | 0602           | 0602           |
      +---------+----------------+----------------+
      1 row in set (0.001 sec)
       
      ...
       
      +---------+----------------+----------------+
      | HEX(ch) | HEX(LOWER(ch)) | HEX(UPPER(ch)) |
      +---------+----------------+----------------+
      | 07FE    | 06FE           | 06FE           |
      +---------+----------------+----------------+
      1 row in set (0.017 sec)
       
      +---------+----------------+----------------+
      | HEX(ch) | HEX(LOWER(ch)) | HEX(UPPER(ch)) |
      +---------+----------------+----------------+
      | 07FF    | 06FF           | 06FF           |
      +---------+----------------+----------------+
      

      Attachments

        Issue Links

          Activity

            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.