summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_json.test
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2023-05-02 16:34:07 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2023-05-03 12:33:11 +0530
commit4e5b771e980edfdad5c5414aa62c81d409d585a4 (patch)
tree4025c5b267b38a81b718de56ac92cf1942af4999 /mysql-test/main/func_json.test
parent97675570ca1e5a3428be1bf6d125f401e37e539d (diff)
downloadmariadb-git-4e5b771e980edfdad5c5414aa62c81d409d585a4.tar.gz
MDEV-30677: Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"HEAD11.1
Analysis: null_value is not set if any one of the arguments is NULL. So it returns 1. Fix: when either argument is NULL, set null_value to true, so that null can be returned
Diffstat (limited to 'mysql-test/main/func_json.test')
-rw-r--r--mysql-test/main/func_json.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index e0da9819785..7fc2f05a57a 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -3586,4 +3586,11 @@ SELECT JSON_SCHEMA_VALID(repeat('[', 100000), json_object());
SELECT JSON_SCHEMA_VALID(json_object(), repeat('[', 10000000));
+--echo #
+--echo # MDEV-30677: Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"
+--echo #
+SELECT JSON_SCHEMA_VALID('{}', NULL);
+SELECT JSON_SCHEMA_VALID(NULL, '{}');
+SELECT JSON_SCHEMA_VALID(NULL, NULL);
+
--echo # End of 11.1 test