Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
5.5, 10.1, 10.2, 10.3, 10.4, 10.5
-
None
Description
SET @x=_utf8'ß'; |
SELECT IF (0,@x:=10,@x), CHARSET(@x), @x; |
+------------------+-------------+------+
|
| IF (0,@x:=10,@x) | CHARSET(@x) | @x |
|
+------------------+-------------+------+
|
| ß | latin1 | ß |
|
+------------------+-------------+------+
|
Notice, the variable @x changed its character set from utf8 to latin1 and therefore returns a wrong value.
The problem happens because Item_func_set_user_val::fix_length_and_dec(), performed for @x:=10, changes the character set of @x from utf8 to latin1.
But the assignment of @x to 10 does not actually happen, because of the 0 in the first argument of IF.
So the underlying code erroneously changes the variable character set separately from the value, which looks wrong.
Attachments
Issue Links
- relates to
-
MDEV-23246 Illegal mix of collations
- Open