1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Fixes to error handling in json_array_length().

FossilOrigin-Name: aa85df2d26b74c171c55bde19ef17c4f11f40b8af7181bbf7162f87cdea7e88b
This commit is contained in:
drh
2023-12-04 19:32:17 +00:00
parent 0b8b1c309d
commit f26e26afc5
3 changed files with 8 additions and 12 deletions

View File

@@ -3115,11 +3115,7 @@ static void jsonArrayLengthFunc(
if( (p->aBlob[i] & 0x0f)==JSONB_ARRAY ){
cnt = jsonbArrayCount(p, i);
}
if( eErr ){
if( eErr==2 ) sqlite3_result_error(ctx, "malformed JSON", -1);
}else{
sqlite3_result_int64(ctx, cnt);
}
if( !eErr ) sqlite3_result_int64(ctx, cnt);
jsonParseFree(p);
}