[MDEV-30716] Wrong casefolding in xxx_unicode_520_ci for U+0700..U+07FF Created: 2023-02-23  Updated: 2023-02-23  Resolved: 2023-02-23

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 10.7
Fix Version/s: 10.11.3, 11.0.2, 10.8.8, 10.9.6, 10.10.4

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-30577 Case folding for uca1400 collations i... Closed
Problem/Incident
is caused by MDEV-26572 Improve simple multibyte collation pe... Closed

 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           |
+---------+----------------+----------------+


Generated at Thu Feb 08 10:18:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.