Bug #106429 Please document Bug #33199145 in more details, perhaps INCOMPATIBLE change too
Submitted: 10 Feb 5:40 Modified: 4 Mar 19:55
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S1 (Critical)
Version:8.0.28 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[10 Feb 5:40] Shane Bester
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
[4 Mar 19:55] Jon Stephens
Fixed in mysqldoc rev 72179, mysql-relnotes rev 24299.

Closed.