1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

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
This commit is contained in:
drh
2023-08-11 11:12:46 +00:00
parent 89e1caf294
commit 91c0092917
6 changed files with 30 additions and 17 deletions

View File

@ -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