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
12618cfb
Commit
12618cfb
authored
Jan 08, 2023
by
Weijun-H
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19160 json_pretty() alias for json_detailed()
parent
17920291
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
mysql-test/main/func_json.result
mysql-test/main/func_json.result
+31
-0
mysql-test/main/func_json.test
mysql-test/main/func_json.test
+1
-0
sql/item_create.cc
sql/item_create.cc
+1
-0
No files found.
mysql-test/main/func_json.result
View file @
12618cfb
...
...
@@ -1253,6 +1253,37 @@ JSON_DETAILED(JSON_EXTRACT(a, '$**.analyzing_range_alternatives'))
["123"]
}
]
select JSON_PRETTY(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200;
JSON_PRETTY(JSON_EXTRACT(a, '$**.analyzing_range_alternatives'))
[
{
"range_scan_alternatives":
[
{
"index": "a_b",
"ranges":
[
"2 <= a <= 2 AND 4 <= b <= 4",
"123"
],
"rowid_ordered": true,
"using_mrr": false,
"index_only": true,
"rows": 1,
"cost": 1.1752,
"chosen": true
}
],
"analyzing_roworder_intersect":
{
"cause": "too few roworder scans"
},
"analyzing_index_merge_union":
[],
"test_one_line_array":
["123"]
}
]
select JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200;
JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives'))
[{"range_scan_alternatives": [{"index": "a_b", "ranges": ["2 <= a <= 2 AND 4 <= b <= 4", "123"], "rowid_ordered": true, "using_mrr": false, "index_only": true, "rows": 1, "cost": 1.1752, "chosen": true}], "analyzing_roworder_intersect": {"cause": "too few roworder scans"}, "analyzing_index_merge_union": [], "test_one_line_array": ["123"]}]
...
...
mysql-test/main/func_json.test
View file @
12618cfb
...
...
@@ -812,6 +812,7 @@ insert into t200 values
select
JSON_DETAILED
(
JSON_EXTRACT
(
a
,
'$**.analyzing_range_alternatives'
))
from
t200
;
select
JSON_PRETTY
(
JSON_EXTRACT
(
a
,
'$**.analyzing_range_alternatives'
))
from
t200
;
select
JSON_LOOSE
(
JSON_EXTRACT
(
a
,
'$**.analyzing_range_alternatives'
))
from
t200
;
drop
table
t200
;
...
...
sql/item_create.cc
View file @
12618cfb
...
...
@@ -7351,6 +7351,7 @@ Native_func_registry func_array[] =
{
{
STRING_WITH_LEN
(
"JSON_CONTAINS_PATH"
)
},
BUILDER
(
Create_func_json_contains_path
)},
{
{
STRING_WITH_LEN
(
"JSON_DEPTH"
)
},
BUILDER
(
Create_func_json_depth
)},
{
{
STRING_WITH_LEN
(
"JSON_DETAILED"
)
},
BUILDER
(
Create_func_json_detailed
)},
{
{
STRING_WITH_LEN
(
"JSON_PRETTY"
)
},
BUILDER
(
Create_func_json_detailed
)},
{
{
STRING_WITH_LEN
(
"JSON_EXISTS"
)
},
BUILDER
(
Create_func_json_exists
)},
{
{
STRING_WITH_LEN
(
"JSON_EXTRACT"
)
},
BUILDER
(
Create_func_json_extract
)},
{
{
STRING_WITH_LEN
(
"JSON_INSERT"
)
},
BUILDER
(
Create_func_json_insert
)},
...
...
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