1
0
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:
drh
2023-11-21 22:36:32 +00:00
parent 27fea97e44
commit cf72606a7d
3 changed files with 13 additions and 9 deletions

View File

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