summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_json.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-08-22 14:02:43 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-08-22 14:02:43 +0300
commitd65a2b7bde6f735af3669ccbf550f60b2278d816 (patch)
tree7cbdb0836e653d7c534f4f7898ef45c5ca0c0dc9 /mysql-test/main/func_json.test
parentf02ca429f70c16be2b2e3d5671d9990cd3d474b6 (diff)
parent1d90d6874db367629f45d1284e9efa36557b400a (diff)
downloadmariadb-git-d65a2b7bde6f735af3669ccbf550f60b2278d816.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'mysql-test/main/func_json.test')
-rw-r--r--mysql-test/main/func_json.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index 1021ce07139..83f4bf9d1ad 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -628,6 +628,25 @@ SELECT * FROM t1 WHERE JSON_EXTRACT(j, '$.Age')=19;
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 # End of 10.3 tests
--echo #