[MDEV-9178] Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) Created: 2015-11-24  Updated: 2015-11-24  Resolved: 2015-11-24

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: 10.1.10

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


 Description   

mysql> SELECT CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED);
+--------------------------------------------+
| CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)  |
+--------------------------------------------+
|                                        123 |
+--------------------------------------------+
1 row in set (0.00 sec)

The above result is wrong. The expected result is 1 with a warning.

The character:

U+0132 LATIN CAPITAL LIGATURE IJ

is misinterpreted as

U+0032 DIGIT TWO


Generated at Thu Feb 08 07:32:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.