1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Improved handling of NULL arguments to json_valid() and

json_error_position(). [forum:/forumpost/06c6334412|Forum post 06c6334412].

FossilOrigin-Name: ab78e6946ba8125a83ff155561adf9c8df4d1c09a645fce08c8245ddb08bfa3b
This commit is contained in:
drh
2023-05-02 11:12:01 +00:00
parent 67a17779cb
commit 8c79ea8447
4 changed files with 103 additions and 8 deletions

View File

@@ -2556,6 +2556,7 @@ static void jsonValidFunc(
){
JsonParse *p; /* The parse */
UNUSED_PARAMETER(argc);
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
p = jsonParseCached(ctx, argv, 0);
if( p==0 || p->oom ){
sqlite3_result_error_nomem(ctx);
@@ -2601,6 +2602,7 @@ static void jsonErrorFunc(
){
JsonParse *p; /* The parse */
UNUSED_PARAMETER(argc);
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
p = jsonParseCached(ctx, argv, 0);
if( p==0 || p->oom ){
sqlite3_result_error_nomem(ctx);