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
8c21dc52
Commit
8c21dc52
authored
Aug 15, 2022
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.3' into bb-10.3-release
parents
faddcf3c
6d90d2ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
18 deletions
+53
-18
VERSION
VERSION
+1
-1
cmake/os/Darwin.cmake
cmake/os/Darwin.cmake
+0
-16
mysql-test/main/func_json.result
mysql-test/main/func_json.result
+27
-0
mysql-test/main/func_json.test
mysql-test/main/func_json.test
+19
-0
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+6
-1
No files found.
VERSION
View file @
8c21dc52
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=3
MYSQL_VERSION_MINOR=3
MYSQL_VERSION_PATCH=3
6
MYSQL_VERSION_PATCH=3
7
SERVER_MATURITY=stable
SERVER_MATURITY=stable
cmake/os/Darwin.cmake
deleted
100644 → 0
View file @
faddcf3c
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
# This file includes OSX specific options and quirks, related to system checks
mysql-test/main/func_json.result
View file @
8c21dc52
...
@@ -1016,5 +1016,32 @@ j
...
@@ -1016,5 +1016,32 @@ j
{"ID": "4", "Name": "Betty", "Age": 19}
{"ID": "4", "Name": "Betty", "Age": 19}
drop table t1;
drop table t1;
#
#
# MDEV-27151: JSON_VALUE() does not parse NULL properties properly
#
#
# It is correct for JSON_EXTRACT() to give null instead of "NULL" because
# it returns the json literal that is put inside json.
# Hence it should return null as in 'null' string and not SQL NULL.
# JSON_VALUE() returns the "VALUE" so it is correct for it to return SQl NULL
#
SELECT NULL;
NULL
NULL
SELECT JSON_VALUE('{"nulltest": null}', '$.nulltest');
JSON_VALUE('{"nulltest": null}', '$.nulltest')
NULL
SELECT 1 + NULL;
1 + NULL
NULL
SELECT 1 + JSON_VALUE('{"nulltest": null}', '$.nulltest');
1 + JSON_VALUE('{"nulltest": null}', '$.nulltest')
NULL
SELECT NULL;
NULL
NULL
SELECT JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a');
JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a')
null
#
# End of 10.3 tests
# End of 10.3 tests
#
#
mysql-test/main/func_json.test
View file @
8c21dc52
...
@@ -627,6 +627,25 @@ SELECT * FROM t1 WHERE JSON_EXTRACT(j, '$.Age')=19;
...
@@ -627,6 +627,25 @@ SELECT * FROM t1 WHERE JSON_EXTRACT(j, '$.Age')=19;
drop
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-27151: JSON_VALUE() does not parse NULL properties properly
--
echo
#
--
echo
#
--
echo
# It is correct for JSON_EXTRACT() to give null instead of "NULL" because
--
echo
# it returns the json literal that is put inside json.
--
echo
# Hence it should return null as in 'null' string and not SQL NULL.
--
echo
# JSON_VALUE() returns the "VALUE" so it is correct for it to return SQl NULL
--
echo
#
SELECT
NULL
;
SELECT
JSON_VALUE
(
'{"nulltest": null}'
,
'$.nulltest'
);
SELECT
1
+
NULL
;
SELECT
1
+
JSON_VALUE
(
'{"nulltest": null}'
,
'$.nulltest'
);
SELECT
NULL
;
SELECT
JSON_EXTRACT
(
'{"a":null, "b":10, "c":"null"}'
,
'$.a'
);
--
echo
#
--
echo
#
--
echo
# End of 10.3 tests
--
echo
# End of 10.3 tests
--
echo
#
--
echo
#
sql/item_jsonfunc.cc
View file @
8c21dc52
...
@@ -619,6 +619,12 @@ String *Item_func_json_value::val_str(String *str)
...
@@ -619,6 +619,12 @@ String *Item_func_json_value::val_str(String *str)
if
(
json_read_value
(
&
je
))
if
(
json_read_value
(
&
je
))
goto
err_return
;
goto
err_return
;
if
(
je
.
value_type
==
JSON_VALUE_NULL
)
{
null_value
=
1
;
return
NULL
;
}
if
(
unlikely
(
check_and_get_value
(
&
je
,
str
,
&
error
)))
if
(
unlikely
(
check_and_get_value
(
&
je
,
str
,
&
error
)))
{
{
if
(
error
)
if
(
error
)
...
@@ -1111,7 +1117,6 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to)
...
@@ -1111,7 +1117,6 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to)
case
JSON_VALUE_OBJECT
:
case
JSON_VALUE_OBJECT
:
case
JSON_VALUE_ARRAY
:
case
JSON_VALUE_ARRAY
:
case
JSON_VALUE_FALSE
:
case
JSON_VALUE_FALSE
:
// TODO: fix: NULL should be NULL
case
JSON_VALUE_NULL
:
case
JSON_VALUE_NULL
:
int2my_decimal
(
E_DEC_FATAL_ERROR
,
0
,
false
/*unsigned_flag*/
,
to
);
int2my_decimal
(
E_DEC_FATAL_ERROR
,
0
,
false
/*unsigned_flag*/
,
to
);
return
to
;
return
to
;
...
...
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