[MDEV-13703] Illegal mix of collations for operation 'json_object' on using JSON_UNQUOTE as an argument Created: 2017-09-01  Updated: 2017-10-06  Resolved: 2017-10-06

Status: Closed
Project: MariaDB Server
Component/s: Character Sets, JSON
Affects Version/s: 10.2
Fix Version/s: 10.2.10

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None

Sprint: 10.2.10

 Description   

Test case

CREATE TABLE t1 (c VARCHAR(8));
INSERT INTO t1 VALUES ('abc'),('def');
 
SELECT
  JSON_OBJECT('foo', JSON_UNQUOTE(JSON_OBJECT('bar', c)),'qux', c) AS fld
FROM t1;
 
# Cleanup
DROP TABLE t1;

10.2, 10.3

MariaDB [test]> SELECT
    ->   JSON_OBJECT('foo', JSON_UNQUOTE(JSON_OBJECT('bar', c)),'qux', c) AS fld
    -> FROM t1;
ERROR 1271 (HY000): Illegal mix of collations for operation 'json_object'

MySQL 5.7

MySQL [test]> SELECT
    ->   JSON_OBJECT('foo', JSON_UNQUOTE(JSON_OBJECT('bar', c)),'qux', c) AS fld
    -> FROM t1;
+---------------------------------------------+
| fld                                         |
+---------------------------------------------+
| {"foo": "{\"bar\": \"abc\"}", "qux": "abc"} |
| {"foo": "{\"bar\": \"def\"}", "qux": "def"} |
+---------------------------------------------+
2 rows in set (0.00 sec)



 Comments   
Comment by Alexey Botchkov [ 2017-10-06 ]

http://lists.askmonty.org/pipermail/commits/2017-October/011529.html

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