Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.11, 11.4, 11.8, 12.3
-
None
Description
This shows in a test case for MDEV-22558
set names utf8mb3; |
--error ER_INVALID_CHARACTER_STRING
|
create table t1 (x int comment 'a’'); |
set names utf8mb4 |
--echo # no error ???
|
create table t1 (x int comment 'a’'); |
In the second case the comment is valid 'a?' string.
This happens because all metadata are internally always utf8mb3, stored as utf8mb3, shown in INFORMATION_SCHEMA as utf8mb3.
So if the connection charset is utf8mb3, the parser gives it to the server as is. Later validate_comment_length() validates that the comment is well formed and finds that it is not.
If the connection charset is not utf8mb3, the parser uses TEXT_STRING_sys rule that converts the string to utf8mb3 with THD::convert_string() and the latter ignores charset conversion errors. The server and validate_comment_length() gets a perfectly well-formed string "a?".
Attachments
Issue Links
- relates to
-
MDEV-30041 don't set utf8_is_utf8mb3 by default in the old-mode
-
- In Testing
-