1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Multiple optimizations that try to preserve or infer the zero-terminated

property of TEXT values.  Avoid unnecessary copying of text values destined
to become function parameters.  All changes help improve performance of
doing UPDATEs on large JSON values that are indexed multiple ways.

FossilOrigin-Name: d0278cdedfa04fb0b61838ab9622be8a2c462f58d5c3ebc4c5f802a727d0974e
This commit is contained in:
drh
2023-07-21 15:01:53 +00:00
parent f9bfc32b73
commit 7a2280fe65
6 changed files with 28 additions and 13 deletions

View File

@@ -514,6 +514,15 @@ void sqlite3_result_text64(
(void)invokeValueDestructor(z, xDel, pCtx);
}else{
setResultStrOrError(pCtx, z, (int)n, enc, xDel);
if( xDel==sqlite3_free && enc==SQLITE_UTF8 ){
Mem *pOut = pCtx->pOut;
if( pOut->z==z
&& sqlite3_msize(pOut->z)>=pOut->n+1
&& pOut->z[n]==0
){
pOut->flags |= MEM_Term;
}
}
}
}
#ifndef SQLITE_OMIT_UTF16