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

Ensure that the insert/delete size delta on JSONB objects in the JSON cache

are always set to zero.

FossilOrigin-Name: 4b4581668a908473dbf1322a3e98bc7cca122998c44518ea183af7f0d1ba9f95
This commit is contained in:
drh
2023-12-18 15:53:48 +00:00
parent cf6fe5abe3
commit 095f2c5082
3 changed files with 10 additions and 7 deletions

View File

@@ -374,6 +374,7 @@ static int jsonCacheInsert(
assert( pParse->zJson!=0 );
assert( pParse->bJsonIsRCStr );
assert( pParse->delta==0 );
p = sqlite3_get_auxdata(ctx, JSON_CACHE_ID);
if( p==0 ){
sqlite3 *db = sqlite3_context_db_handle(ctx);
@@ -446,6 +447,7 @@ static JsonParse *jsonCacheSearch(
p->a[p->nUsed-1] = tmp;
i = p->nUsed - 1;
}
assert( p->a[i]->delta==0 );
return p->a[i];
}else{
return 0;
@@ -3306,6 +3308,7 @@ static void jsonReturnParse(
}else{
JsonString s;
jsonStringInit(&s, ctx);
p->delta = 0;
jsonXlateBlobToText(p, 0, &s);
jsonReturnString(&s, p, ctx);
sqlite3_result_subtype(ctx, JSON_SUBTYPE);