[MDEV-6973] XOR aggregates argument collations Created: 2014-10-29  Updated: 2015-06-09  Resolved: 2015-06-09

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 5.5.40, 10.0.14, 10.1
Fix Version/s: 10.1.6

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

mysql> SELECT '10' COLLATE utf8_general_ci XOR '20' COLLATE utf8_unicode_ci;
ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,EXPLICIT) and (utf8_unicode_ci,EXPLICIT) for operation 'xor'

XOR is a numeric operation. It should not aggregate collations. The above query should return a result without an error.

Notice, the other numeric operations work without problems:

mysql> SELECT '10' COLLATE utf8_general_ci + '20' COLLATE utf8_unicode_ci;
+-------------------------------------------------------------+
| '10' COLLATE utf8_general_ci + '20' COLLATE utf8_unicode_ci |
+-------------------------------------------------------------+
|                                                          30 |
+-------------------------------------------------------------+
1 row in set (0.00 sec)


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