Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
5.3.12, 5.5.39, 10.0.13
-
None
Description
CAST from BINARY to CHAR does not check wel-formedness:
MariaDB [test]> SELECT CAST(0xFFFF AS CHAR(10) CHARACTER SET utf8) AS ch, HEX(CAST(0xFFFF AS CHAR(10) CHARACTER SET utf8)) AS hex;
|
+----+------+
|
| ch | hex |
|
+----+------+
|
| �� | FFFF |
|
+----+------+
|
1 row in set (0.00 sec)
|
The expected result would be to replace bad bytes to question
marks and produce a warning.