mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Improved handling of OOM errors in sqlite3ExpandReturning().
dbsqlfuzz 1040b720f0bbc3bdcfe7336acffbf71517e3ef82. FossilOrigin-Name: 33c6b8e94bda12df13b4d2dd782b3120c3628596b86ef531d20b3100bf159b50
This commit is contained in:
@@ -933,7 +933,7 @@ static void codeReturningTrigger(
|
||||
}
|
||||
sqlite3ExprListDelete(db, sSelect.pEList);
|
||||
pNew = sqlite3ExpandReturning(pParse, pReturning->pReturnEL, pTab);
|
||||
if( pNew ){
|
||||
if( !db->mallocFailed ){
|
||||
NameContext sNC;
|
||||
memset(&sNC, 0, sizeof(sNC));
|
||||
if( pReturning->nRetCol==0 ){
|
||||
@@ -954,7 +954,7 @@ static void codeReturningTrigger(
|
||||
for(i=0; i<nCol; i++){
|
||||
Expr *pCol = pNew->a[i].pExpr;
|
||||
assert( pCol!=0 || pParse->db->mallocFailed );
|
||||
if( pCol==0 ) continue;
|
||||
if( NEVER(pCol==0) ) continue;
|
||||
sqlite3ExprCodeFactorable(pParse, pCol, reg+i);
|
||||
if( sqlite3ExprAffinity(pCol)==SQLITE_AFF_REAL ){
|
||||
sqlite3VdbeAddOp1(v, OP_RealAffinity, reg+i);
|
||||
@@ -964,10 +964,10 @@ static void codeReturningTrigger(
|
||||
sqlite3VdbeAddOp2(v, OP_NewRowid, pReturning->iRetCur, reg+i+1);
|
||||
sqlite3VdbeAddOp3(v, OP_Insert, pReturning->iRetCur, reg+i, reg+i+1);
|
||||
}
|
||||
sqlite3ExprListDelete(db, pNew);
|
||||
pParse->eTriggerOp = 0;
|
||||
pParse->pTriggerTab = 0;
|
||||
}
|
||||
sqlite3ExprListDelete(db, pNew);
|
||||
pParse->eTriggerOp = 0;
|
||||
pParse->pTriggerTab = 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user