[MDEV-6586] Multi-chunk string literals are not consistent against character set introducer Created: 2014-08-14  Updated: 2014-08-22

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.3.12, 5.5.40, 10.0.14
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None


 Description   

MariaDB [test]> SELECT HEX(_ucs2'abc' ''),HEX(_ucs2 'ab' 'c'), HEX(_ucs2'a' 'bc');
+--------------------+---------------------+--------------------+
| HEX(_ucs2'abc' '') | HEX(_ucs2 'ab' 'c') | HEX(_ucs2'a' 'bc') |
+--------------------+---------------------+--------------------+
| 00616263           | 61620063            | 006100620063       |
+--------------------+---------------------+--------------------+
1 row in set (0.00 sec)

The leftmost chunk is "cast" to the character set of the introducer.
The second and further chunks are converted.

All chunks must be either "cast" individually,
or all chunks must be concatenated together, then cast.

Btw, according to the SQL standard, all chunks should
actually be converted (not cast!) from the session character set
to the introducer character set. But this can be changed only
in a major release (10.1?).


Generated at Thu Feb 08 07:13:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.