Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
-
None
Description
I create an XML file with a broken utf8 byte sequence:
printf "<table><row><a>a\xD0</a></row></table>" >/tmp/test.xml
|
Notice, 0xD0 is a utf8 leading byte of a 2-byte character, but it is not followed by a tail byte.
Now I try to load this file into a table:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a TEXT CHARACTER SET utf8); |
LOAD XML INFILE '/tmp/test.xml' INTO TABLE t1 CHARACTER SET utf8 ROWS IDENTIFIED BY '<row>'; |
SHOW WARNINGS;
|
SELECT * FROM t1; |
It produces this warning:
+---------+------+------------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+------------------------------------------------------------+
|
| Warning | 1366 | Incorrect string value: '\xD0</a>' for column 'a' at row 1 |
|
+---------+------+------------------------------------------------------------+
|
and this result set:
+--------+
|
| a |
|
+--------+
|
| a?</a> |
|
+--------+
|
This is wrong. The closing tag '</a>' was interpreted as data rather than markup.
The expected result would be to return 'a?' rather than 'a?</a>'.
Attachments
Issue Links
- blocks
-
MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring
- Closed