1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Further improvements to large string handling in relation to JSON.

FossilOrigin-Name: 1e5df0aa3dae5cadbf1d07c718ae2a5212543300b68e49d35e8c96855a7f619c
This commit is contained in:
drh
2023-07-21 18:09:07 +00:00
parent eee8687a9f
commit 569700a72e
6 changed files with 44 additions and 22 deletions

View File

@@ -501,8 +501,8 @@ static void jsonAppendValue(
*/
static void jsonResult(JsonString *p){
if( p->bErr==0 ){
if( p->nAlloc>=p->nUsed+1 ) p->zBuf[p->nUsed] = 0;
sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed,
jsonAppendChar(p, 0);
sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed-1,
p->bStatic ? SQLITE_TRANSIENT : sqlite3_free,
SQLITE_UTF8);
jsonZero(p);