Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.3.12, 5.5.39, 10.0.13
-
None
-
None
Description
MariaDB [test]> SELECT HEX(_big5 0xC840), HEX(QUOTE(_big5 0xC840));
|
+-------------------+--------------------------+
|
| HEX(_big5 0xC840) | HEX(QUOTE(_big5 0xC840)) |
|
+-------------------+--------------------------+
|
| C840 | NULL |
|
+-------------------+--------------------------+
|
1 row in set (0.00 sec)
|
The result for in the second column is wrong.
The expected result is C840, similar to the first column.
The problem happens because Item_func_quote::val_str()
uses an mb_wc()..wc_mb() loop, which breaks and returns
null on unassigned characters.
The loop should be fixed to use a native non-Unicode API instead, e.g. ismbchar().