Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL)
-
None
-
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) |