mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Fix the sqlite3_result_xxxxx() routines so that they all check for and
perform any necessary text encoding conversions and check for oversize strings and BLOBs. Thus those checks can be done where they are most efficient and avoided in cases like OP_Function where they are more expensive. FossilOrigin-Name: d50b162b2f2e320af0889b931351f9443580465a933f6657fa98f437b6579277
This commit is contained in:
15
src/vdbe.c
15
src/vdbe.c
@@ -7378,9 +7378,6 @@ case OP_AggFinal: {
|
||||
}
|
||||
sqlite3VdbeChangeEncoding(pMem, encoding);
|
||||
UPDATE_MAX_BLOBSIZE(pMem);
|
||||
if( sqlite3VdbeMemTooBig(pMem) ){
|
||||
goto too_big;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7919,9 +7916,6 @@ case OP_VColumn: {
|
||||
REGISTER_TRACE(pOp->p3, pDest);
|
||||
UPDATE_MAX_BLOBSIZE(pDest);
|
||||
|
||||
if( sqlite3VdbeMemTooBig(pDest) ){
|
||||
goto too_big;
|
||||
}
|
||||
if( rc ) goto abort_due_to_error;
|
||||
break;
|
||||
}
|
||||
@@ -8214,11 +8208,10 @@ case OP_Function: { /* group */
|
||||
if( rc ) goto abort_due_to_error;
|
||||
}
|
||||
|
||||
/* Copy the result of the function into register P3 */
|
||||
if( pOut->flags & (MEM_Str|MEM_Blob) ){
|
||||
sqlite3VdbeChangeEncoding(pOut, encoding);
|
||||
if( sqlite3VdbeMemTooBig(pOut) ) goto too_big;
|
||||
}
|
||||
assert( (pOut->flags&MEM_Str)==0
|
||||
|| pOut->enc==encoding
|
||||
|| db->mallocFailed );
|
||||
assert( !sqlite3VdbeMemTooBig(pOut) );
|
||||
|
||||
REGISTER_TRACE(pOp->p3, pOut);
|
||||
UPDATE_MAX_BLOBSIZE(pOut);
|
||||
|
Reference in New Issue
Block a user