Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
None
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4, b TEXT CHARACTER SET utf8mb3); |
INSERT INTO t1 VALUES ('a','a'); |
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=b; |
SHOW WARNINGS;
|
+-------+------+--------------------------------------------------------------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+-------+------+--------------------------------------------------------------------------------------------------------------------------------------+
|
| Note | 1003 | select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` = convert(`test`.`t1`.`b` using utf8mb4) |
|
+-------+------+--------------------------------------------------------------------------------------------------------------------------------------+
|
The Item_func_conv_charset behind CONVERT() is redundant here. utf8mb3 can be reinterpreted to utf8mb4 without conversion.
Note, we even allow online alter when converting an utf8mb3 column to utf8mb4 column with the same data type and size. The same optimization can be applied here.
Attachments
Issue Links
- relates to
-
MDEV-15564 Avoid table rebuild in ALTER TABLE on collation or charset changes
- Closed
-
MDEV-19284 INSTANT ALTER with ucs2-to-utf16 conversion produces bad data
- Closed
-
MDEV-19285 INSTANT ALTER from ascii_general_ci to latin1_general_ci produces corrupt data
- Closed