mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Inserts invalid JSONB should return "malformed JSON", not a json path error.
FossilOrigin-Name: 306ee66fbd0231a9f5b229e5630d5cc66c9cf08b466d2d9204e79e1f44a16374
This commit is contained in:
@@ -4427,7 +4427,7 @@ static void jsonInsertIntoBlob(
|
||||
int eEdit /* JEDIT_INS, JEDIT_REPL, or JEDIT_SET */
|
||||
){
|
||||
int i;
|
||||
u32 rc;
|
||||
u32 rc = 0;
|
||||
const char *zPath = 0;
|
||||
int flgs;
|
||||
JsonParse px, ax;
|
||||
@@ -4471,7 +4471,11 @@ static void jsonInsertIntoBlob(
|
||||
|
||||
jsonInsertIntoBlob_patherror:
|
||||
if( px.nBlobAlloc ) sqlite3_free(px.aBlob);
|
||||
jsonPathSyntaxError(zPath, ctx);
|
||||
if( rc==JSON_BLOB_ERROR ){
|
||||
sqlite3_result_error(ctx, "malformed JSON", -1);
|
||||
}else{
|
||||
jsonPathSyntaxError(zPath, ctx);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user