[MDEV-6626] QUOTE() does not wok well with NULL+UCS2 Created: 2014-08-22  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.3.12, 5.5.39, 10.0.13
Fix Version/s: 10.4, 10.5, 10.6

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


 Description   

MariaDB [test]> SELECT QUOTE(CAST(NULL AS CHAR CHARACTER SET utf8)), QUOTE(_ucs2 0x0061), QUOTE(CAST(NULL AS CHAR CHARACTER SET ucs2));
+----------------------------------------------+---------------------+----------------------------------------------+
| QUOTE(CAST(NULL AS CHAR CHARACTER SET utf8)) | QUOTE(_ucs2 0x0061) | QUOTE(CAST(NULL AS CHAR CHARACTER SET ucs2)) |
+----------------------------------------------+---------------------+----------------------------------------------+
| NULL                                         | 'a'                 | 乕䱌                                         |
+----------------------------------------------+---------------------+----------------------------------------------+
1 row in set (0.00 sec)

The expected result according to the manual
for the third column should be a string 'NULL' (four letters),
similar to the first column.

For non-NULL values QUOTE seem to work fine for an UCS2 argument,
as the second column demonstrates.


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