Bug #103223 | improve ifnull() documentation, refer to mixing collations | ||
---|---|---|---|
Submitted: | 6 Apr 2021 12:28 | Modified: | 18 Mar 2022 22:05 |
Reporter: | Simon Mudd (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 8.0.22,8.0.23 | OS: | Any |
Assigned to: | Jon Stephens | CPU Architecture: | Any |
Tags: | bug, collatiions, documentation, IFNULL() |
[6 Apr 2021 12:28]
Simon Mudd
[6 Apr 2021 12:47]
MySQL Verification Team
Hello Simon, Thank you for the documentation enhancement request. regards, Umesh
[6 Apr 2021 21:00]
Roy Lyseng
This is actually a problem for all CASE-derived functions, not just IFNULL. Earlier, the determination of the aggregated collation ignored const values: if the const value only contained characters from the same repertoire as the second string, the character set and collation of that string was chosen as the resulting properties of the IFNULL function. However, with system variables like @@hostname no longer being const values, we cannot inspect the contents during resolving and instead treat such values equivalent to a column expression of the same collation. This means we can now issue the "Illegal mix of collations" also when system variables are involved. The workaround to this is to cast the system variable reference to a character string with the same character set as the column reference.
[10 Aug 2021 17:40]
Jon Stephens
See also BUG#104387.
[18 Mar 2022 22:05]
Jon Stephens
Fixed in mysqldoc rev 72360. Closed.