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

When generated text JSON from JSONB, do not continue descending into

nested structures after an error is seen.  This avoids long loops and wait
times.

FossilOrigin-Name: 97666ec052ebaceab002874d7ca5c5e6883c3d04fb7d3992235a8c4c8d08407a
This commit is contained in:
drh
2024-01-29 20:36:17 +00:00
parent 581bf002ce
commit af3824d5fa
3 changed files with 10 additions and 10 deletions

View File

@@ -2270,7 +2270,7 @@ static u32 jsonTranslateBlobToText(
jsonAppendChar(pOut, '[');
j = i+n;
iEnd = j+sz;
while( j<iEnd ){
while( j<iEnd && pOut->eErr==0 ){
j = jsonTranslateBlobToText(pParse, j, pOut);
jsonAppendChar(pOut, ',');
}
@@ -2283,7 +2283,7 @@ static u32 jsonTranslateBlobToText(
jsonAppendChar(pOut, '{');
j = i+n;
iEnd = j+sz;
while( j<iEnd ){
while( j<iEnd && pOut->eErr==0 ){
j = jsonTranslateBlobToText(pParse, j, pOut);
jsonAppendChar(pOut, (x++ & 1) ? ',' : ':');
}