1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Prevent an infinite loop when deleting a table that has a TEMP trigger. (CVS 984)

FossilOrigin-Name: c8c823b068916711857fa67db10fb479999b55c2
This commit is contained in:
drh
2003-05-17 19:04:03 +00:00
parent 24f1eb74c8
commit 79a519c047
7 changed files with 90 additions and 35 deletions

View File

@@ -23,7 +23,7 @@
** ROLLBACK
** PRAGMA
**
** $Id: build.c,v 1.153 2003/05/17 17:35:11 drh Exp $
** $Id: build.c,v 1.154 2003/05/17 19:04:04 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1297,12 +1297,8 @@ void sqliteDropTable(Parse *pParse, Token *pName, int isView){
/* Drop all triggers associated with the table being dropped */
pTrigger = pTable->pTrigger;
while( pTrigger ){
SrcList *pNm;
assert( pTrigger->iDb==pTable->iDb || pTrigger->iDb==1 );
pNm = sqliteSrcListAppend(0, 0, 0);
pNm->a[0].zName = sqliteStrDup(pTrigger->name);
pNm->a[0].zDatabase = sqliteStrDup(db->aDb[pTable->iDb].zName);
sqliteDropTrigger(pParse, pNm, 1);
sqliteDropTriggerPtr(pParse, pTrigger, 1);
if( pParse->explain ){
pTrigger = pTrigger->pNext;
}else{