mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Fix a crash that can occur after a malloc failure. Ticket #2775. (CVS 4547)
FossilOrigin-Name: c91bc8d33306881cb2501070dccced92c82cf165
This commit is contained in:
@@ -773,12 +773,13 @@ int sqlite3CodeRowTrigger(
|
||||
|
||||
for(p=pTab->pTrigger; p; p=p->pNext){
|
||||
int fire_this = 0;
|
||||
sqlite3 *db = pParse->db;
|
||||
|
||||
/* Determine whether we should code this trigger */
|
||||
if(
|
||||
p->op==op &&
|
||||
p->tr_tm==tr_tm &&
|
||||
(p->pSchema==p->pTabSchema || p->pSchema==pParse->db->aDb[1].pSchema) &&
|
||||
(p->pSchema==p->pTabSchema || p->pSchema==db->aDb[1].pSchema) &&
|
||||
(op!=TK_UPDATE||!p->pColumns||checkColumnOverLap(p->pColumns,pChanges))
|
||||
){
|
||||
TriggerStack *pS; /* Pointer to trigger-stack entry */
|
||||
@@ -816,8 +817,8 @@ int sqlite3CodeRowTrigger(
|
||||
|
||||
/* code the WHEN clause */
|
||||
endTrigger = sqlite3VdbeMakeLabel(pParse->pVdbe);
|
||||
whenExpr = sqlite3ExprDup(pParse->db, p->pWhen);
|
||||
if( sqlite3ExprResolveNames(&sNC, whenExpr) ){
|
||||
whenExpr = sqlite3ExprDup(db, p->pWhen);
|
||||
if( db->mallocFailed || sqlite3ExprResolveNames(&sNC, whenExpr) ){
|
||||
pParse->trigStack = trigStackEntry.pNext;
|
||||
sqlite3ExprDelete(whenExpr);
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user