aboutsummaryrefslogtreecommitdiff
path: root/test/json101.test
diff options
context:
space:
mode:
authordrh <>2023-08-11 11:12:46 +0000
committerdrh <>2023-08-11 11:12:46 +0000
commit91c009291756e7e7fa338f8f28335a3d2f3bc3ea (patch)
tree62a948a5e113d473922ca7e2a7dca872cd7753a0 /test/json101.test
parent89e1caf294e50ccbbc94cb75ba8a21c41aeb160c (diff)
downloadsqlite-91c009291756e7e7fa338f8f28335a3d2f3bc3ea.tar.gz
sqlite-91c009291756e7e7fa338f8f28335a3d2f3bc3ea.zip
Up until version 3.42.0, there was a bug in json_valid() such that it would
return False (0) for a NULL input. That bug is fixed in 3.42.0. This check-in adds a compile-time option -DSQLITE_LEGACY_JSON_VALID that restores the old buggy behavior for applications that depend on it. FossilOrigin-Name: 15c2eadbff8e732cca45d6c3771d1fcea5aab2127e87f2a611b41ccfef4d1a0d
Diffstat (limited to 'test/json101.test')
-rw-r--r--test/json101.test12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/json101.test b/test/json101.test
index 543e4c71e..555232e4a 100644
--- a/test/json101.test
+++ b/test/json101.test
@@ -923,9 +923,15 @@ do_execsql_test json-20.3 {
# a NULL value as the JSON input.
#
db null NULL
-do_execsql_test json-21.1 {
- SELECT json_valid(NULL);
-} NULL
+if {[db exists {SELECT * FROM pragma_compile_options WHERE compile_options LIKE '%legacy_json_valid%'}] {
+ do_execsql_test json-21.1-legacy {
+ SELECT json_valid(NULL);
+ } 0
+} else {
+ do_execsql_test json-21.1-correct {
+ SELECT json_valid(NULL);
+ } NULL
+}
do_execsql_test json-21.2 {
SELECT json_error_position(NULL);
} NULL