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
294a4260
Commit
294a4260
authored
6 years ago
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/10.2' into 10.3
parents
f74d2a9f
a8227a15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
mysql-test/main/func_json.result
mysql-test/main/func_json.result
+14
-1
mysql-test/main/func_json.test
mysql-test/main/func_json.test
+10
-0
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+1
-1
No files found.
mysql-test/main/func_json.result
View file @
294a4260
...
...
@@ -297,7 +297,7 @@ json_quote('foo')
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`json_quote('foo')` varchar(
10
) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
`json_quote('foo')` varchar(
38
) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select json_merge('string');
...
...
@@ -748,6 +748,19 @@ SELECT * FROM t1 WHERE c IN (JSON_EXTRACT('{"a":"b"}', '$.*'));
c
DROP TABLE t1;
#
# MDEV-16814 CREATE TABLE SELECT JSON_QUOTE(multibyte_charset_expr) makes a field of a wrong length
#
CREATE TABLE t1 AS SELECT
JSON_QUOTE(_latin1'foo') AS c1,
JSON_QUOTE(_utf8'foo') AS c2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(38) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
`c2` varchar(38) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# End of 10.2 tests
#
#
...
...
This diff is collapsed.
Click to expand it.
mysql-test/main/func_json.test
View file @
294a4260
...
...
@@ -412,6 +412,16 @@ INSERT INTO t1 VALUES ('foo'),('bar');
SELECT
*
FROM
t1
WHERE
c
IN
(
JSON_EXTRACT
(
'{"a":"b"}'
,
'$.*'
));
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-16814 CREATE TABLE SELECT JSON_QUOTE(multibyte_charset_expr) makes a field of a wrong length
--
echo
#
CREATE
TABLE
t1
AS
SELECT
JSON_QUOTE
(
_latin1
'foo'
)
AS
c1
,
JSON_QUOTE
(
_utf8
'foo'
)
AS
c2
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
...
...
This diff is collapsed.
Click to expand it.
sql/item_jsonfunc.cc
View file @
294a4260
...
...
@@ -575,7 +575,7 @@ bool Item_func_json_quote::fix_length_and_dec()
Odd but realistic worst case is when all characters
of the argument turn into '\uXXXX\uXXXX', which is 12.
*/
max_length
=
args
[
0
]
->
max_length
*
12
+
2
;
fix_char_length_ulonglong
((
ulonglong
)
args
[
0
]
->
max_char_length
()
*
12
+
2
)
;
return
FALSE
;
}
...
...
This diff is collapsed.
Click to expand it.
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