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
f6e488cc
Commit
f6e488cc
authored
Jan 17, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-26506 Over-quoted JSON when combining JSON_ARRAYAGG with JSON_OBJECT
add the test case
parent
cb364a78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
mysql-test/main/type_json.result
mysql-test/main/type_json.result
+18
-0
mysql-test/main/type_json.test
mysql-test/main/type_json.test
+14
-0
No files found.
mysql-test/main/type_json.result
View file @
f6e488cc
...
...
@@ -159,5 +159,23 @@ def j 250 (format=json) 9437283 16 Y 0 39 33
j
{"a": {"b":"c"}}
#
# MDEV-26506 Over-quoted JSON when combining JSON_ARRAYAGG with JSON_OBJECT
#
# maintain JSON property through internal temporary tables
create table t1 (a varchar(30));
insert into t1 values ('root');
select json_object('attr2',o) from (select a, json_arrayagg(json_object('attr1', a)) as o from t1) u;
json_object('attr2',o)
{"attr2": [{"attr1": "root"}]}
drop table t1;
create view v1 as select json_object(_latin1 'a', _latin1'b') as v1_json;
select v1_json from v1;
v1_json
{"a": "b"}
select json_arrayagg(v1_json) from v1;
json_arrayagg(v1_json)
[{"a": "b"}]
drop view v1;
#
# End of 10.5 tests
#
mysql-test/main/type_json.test
View file @
f6e488cc
...
...
@@ -121,6 +121,20 @@ SELECT json_object('a', (SELECT json_objectagg(b, c) FROM (SELECT 'b','c') d)) A
--
disable_ps_protocol
--
enable_view_protocol
--
echo
#
--
echo
# MDEV-26506 Over-quoted JSON when combining JSON_ARRAYAGG with JSON_OBJECT
--
echo
#
--
echo
# maintain JSON property through internal temporary tables
create
table
t1
(
a
varchar
(
30
));
insert
into
t1
values
(
'root'
);
select
json_object
(
'attr2'
,
o
)
from
(
select
a
,
json_arrayagg
(
json_object
(
'attr1'
,
a
))
as
o
from
t1
)
u
;
drop
table
t1
;
create
view
v1
as
select
json_object
(
_latin1
'a'
,
_latin1
'b'
)
as
v1_json
;
select
v1_json
from
v1
;
select
json_arrayagg
(
v1_json
)
from
v1
;
drop
view
v1
;
--
echo
#
--
echo
# End of 10.5 tests
--
echo
#
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