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
594c6b37
Commit
594c6b37
authored
Sep 12, 2017
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13138 JSON_OBJECT returns null with strings containing backticks.
Condition was fixed.
parent
66a09bd6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
mysql-test/r/func_json.result
mysql-test/r/func_json.result
+6
-0
mysql-test/t/func_json.test
mysql-test/t/func_json.test
+6
-0
strings/json_lib.c
strings/json_lib.c
+1
-1
No files found.
mysql-test/r/func_json.result
View file @
594c6b37
...
...
@@ -674,3 +674,9 @@ JSON_EXTRACT('{"foo": "bar" foobar foo invalid ', '$.foo')
NULL
Warnings:
Warning 4038 Syntax error in JSON text in argument 1 to function 'json_extract' at position 15
SELECT JSON_OBJECT('foo', '`');
JSON_OBJECT('foo', '`')
{"foo": "`"}
SELECT JSON_OBJECT("foo", "bar`bar");
JSON_OBJECT("foo", "bar`bar")
{"foo": "bar`bar"}
mysql-test/t/func_json.test
View file @
594c6b37
...
...
@@ -322,3 +322,9 @@ select JSON_EXTRACT('{\"input1\":\"\\u00f6\"}', '$.\"input1\"');
#
select
JSON_EXTRACT
(
'{"foo": "bar" foobar foo invalid '
,
'$.foo'
);
#
# MDEV-13138 JSON_OBJECT returns null with strings containing backticks.
#
SELECT
JSON_OBJECT
(
'foo'
,
'`'
);
SELECT
JSON_OBJECT
(
"foo"
,
"bar`bar"
);
strings/json_lib.c
View file @
594c6b37
...
...
@@ -1586,7 +1586,7 @@ int json_escape(CHARSET_INFO *str_cs,
enum
json_esc_char_classes
c_class
;
str
+=
c_len
;
if
(
c_chr
>
0x60
||
(
c_class
=
json_escape_chr_map
[
c_chr
])
==
ESC_
)
if
(
c_chr
>
=
0x60
||
(
c_class
=
json_escape_chr_map
[
c_chr
])
==
ESC_
)
{
if
((
c_len
=
json_cs
->
cset
->
wc_mb
(
json_cs
,
c_chr
,
json
,
json_end
))
>
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