Description:
Current release notes say:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-28.html
"CONVERT(string USING charset) did not compute the correct maximum length for its return value, which should be the same as that calculated for CAST(string AS charset). (Bug #33199145)"
This is not explaining the full consequences of the fix. e.g.
8.0.28:
mysql> select cast(0xDF8912DC1DFE as char(3072) charset utf16);
+--------------------------------------------------+
| cast(0xDF8912DC1DFE as char(3072) charset utf16) |
+--------------------------------------------------+
| NULL |
+--------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
8.0.27:
mysql> select cast(0xDF8912DC1DFE as char(3072) charset utf16);
+--------------------------------------------------+
| cast(0xDF8912DC1DFE as char(3072) charset utf16) |
+--------------------------------------------------+
| ?褒?᷾ |
+--------------------------------------------------+
1 row in set (0.00 sec)
Why is this important? Even though the 8.0.27 result is incorrect, indexed GENERATED COLUMNS based on this result cause problems after upgrade:
1. replication *might* break due to not finding the row
2. innodb index corruption occurs due to innodb not finding the row.
3. applications might be using the invalid result (unknowingly, since no warnings in <8.0.27 !).
This is therefore a potential INCOMPATIBLE CHANGE.
How to repeat:
Read the changes:
https://github.com/mysql/mysql-server/commit/26ff88515e51b22ff88e174a18bb5a01138544b6
Some other references:
https://bugs.mysql.com/bug.php?id=106419
https://bugs.mysql.com/bug.php?id=106418
Bug 33799038 - corruption of index on generated column after upgrade to 8.0.28