Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
badf6de1
Commit
badf6de1
authored
Feb 12, 2023
by
Weijun Huang
Committed by
Daniel Black
Feb 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-30412: JSON_OBJECTAGG doesn't escape double quote in key
parent
c41c7965
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
mysql-test/main/func_json.result
mysql-test/main/func_json.result
+12
-0
mysql-test/main/func_json.test
mysql-test/main/func_json.test
+8
-0
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+1
-1
No files found.
mysql-test/main/func_json.result
View file @
badf6de1
...
...
@@ -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 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }
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
#
mysql-test/main/func_json.test
View file @
badf6de1
...
...
@@ -1067,6 +1067,14 @@ INSERT INTO test.arrNestTest (doc) VALUES ('{ "_id" : { "$oid" : "611c0a463b1501
SELECT
*
FROM
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
# End of 10.5 tests
--
echo
#
...
...
sql/item_jsonfunc.cc
View file @
badf6de1
...
...
@@ -4060,7 +4060,7 @@ bool Item_func_json_objectagg::add()
result
.
append
(
", "
);
result
.
append
(
"
\"
"
);
result
.
append
(
*
key
);
st_append_escaped
(
&
result
,
key
);
result
.
append
(
"
\"
:"
);
buf
.
length
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment