Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
-
None
Description
If I insert an incomplete multi-byte character into a table:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET ujis); |
INSERT INTO t1 VALUES (0x8FA1); |
SHOW WARNINGS;
|
SELECT HEX(a) FROM t1; |
it correctly returns a warning:
+---------+------+------------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+------------------------------------------------------------+
|
| Warning | 1366 | Incorrect string value: '\x8F\xA1' for column 'a' at row 1 |
|
+---------+------+------------------------------------------------------------+
|
and translates every byte in the incomplete sequence to QUESTION MARK:
+--------+
|
| HEX(a) |
|
+--------+
|
| 3F3F |
|
+--------+
|
If I put the same sequence into a file:
printf "\x8F\xA1"> /tmp/test.txt
|
and load it:
DELETE FROM t1; |
LOAD DATA INFILE '/tmp/test.txt' INTO TABLE t1 CHARACTER SET ujis; |
SELECT HEX(a) FROM t1; |
it returns no warnings and truncates the incomplete sequence:
+--------+
|
| HEX(a) |
|
+--------+
|
| |
|
+--------+
|
LOAD should be fixed to work consistently with INSERT.
Attachments
Issue Links
- blocks
-
MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring
- Closed