mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-30412: JSON_OBJECTAGG doesn't escape double quote in key
This commit is contained in:
committed by
Daniel Black
parent
c41c79650a
commit
badf6de171
@ -1623,5 +1623,17 @@ id doc
|
|||||||
{"$oid":"611c0a463b150154132f6636"} { "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }
|
{"$oid":"611c0a463b150154132f6636"} { "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }
|
||||||
DROP TABLE arrNestTest;
|
DROP TABLE arrNestTest;
|
||||||
#
|
#
|
||||||
|
# MDEV-30412 JSON_OBJECTAGG doesn't escape double quote in key
|
||||||
|
#
|
||||||
|
SELECT JSON_OBJECTAGG('"', 1);
|
||||||
|
JSON_OBJECTAGG('"', 1)
|
||||||
|
{"\"":1}
|
||||||
|
SELECT JSON_OBJECTAGG('\"', 1);
|
||||||
|
JSON_OBJECTAGG('\"', 1)
|
||||||
|
{"\"":1}
|
||||||
|
SELECT JSON_OBJECTAGG('\\', 1);
|
||||||
|
JSON_OBJECTAGG('\\', 1)
|
||||||
|
{"\\":1}
|
||||||
|
#
|
||||||
# End of 10.5 tests
|
# End of 10.5 tests
|
||||||
#
|
#
|
||||||
|
@ -1067,6 +1067,14 @@ INSERT INTO test.arrNestTest (doc) VALUES ('{ "_id" : { "$oid" : "611c0a463b1501
|
|||||||
SELECT * FROM arrNestTest;
|
SELECT * FROM arrNestTest;
|
||||||
DROP TABLE arrNestTest;
|
DROP TABLE arrNestTest;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-30412 JSON_OBJECTAGG doesn't escape double quote in key
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SELECT JSON_OBJECTAGG('"', 1);
|
||||||
|
SELECT JSON_OBJECTAGG('\"', 1);
|
||||||
|
SELECT JSON_OBJECTAGG('\\', 1);
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 10.5 tests
|
--echo # End of 10.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -4060,7 +4060,7 @@ bool Item_func_json_objectagg::add()
|
|||||||
result.append(", ");
|
result.append(", ");
|
||||||
|
|
||||||
result.append("\"");
|
result.append("\"");
|
||||||
result.append(*key);
|
st_append_escaped(&result,key);
|
||||||
result.append("\":");
|
result.append("\":");
|
||||||
|
|
||||||
buf.length(0);
|
buf.length(0);
|
||||||
|
Reference in New Issue
Block a user