diff options
| author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-08-22 12:34:42 +0300 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-08-22 12:34:42 +0300 |
| commit | 36d173e523ca5e844310798c40d695c4db604dbc (patch) | |
| tree | 1cf06301c5010e791fd2b0627aa3ac5cb3a78073 /mysql-test/main/func_json.test | |
| parent | 6005f3c548d312f48b575961889194a0a4767ae1 (diff) | |
| parent | fd0cd4801a00c61adb5ab6cbefcf360467a02f20 (diff) | |
| download | mariadb-git-36d173e523ca5e844310798c40d695c4db604dbc.tar.gz | |
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/main/func_json.test')
| -rw-r--r-- | mysql-test/main/func_json.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index db6a8553073..b0db63f16a9 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 # |
