diff options
author | danielk1977 <danielk1977@noemail.net> | 2005-12-06 12:52:59 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2005-12-06 12:52:59 +0000 |
commit | 261919cc16a3176b2388001e146bad0a872bf8fd (patch) | |
tree | 9861cbc52e9ab2cd1723efd6ba6bf0c1b823ebb0 /src/trigger.c | |
parent | 67e0b84f7d63e23bf9573ec4415635db0115c2a1 (diff) | |
download | sqlite-261919cc16a3176b2388001e146bad0a872bf8fd.tar.gz sqlite-261919cc16a3176b2388001e146bad0a872bf8fd.zip |
Some elements of the new malloc() failure handling. Not all cases work properly yet. Also, library is not threadsafe if malloc() fails right now. (CVS 2800)
FossilOrigin-Name: e1606658f1b4530e3001db4779b5669c8d13c853
Diffstat (limited to 'src/trigger.c')
-rw-r--r-- | src/trigger.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/trigger.c b/src/trigger.c index 3da62decb..cc5fc080e 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -80,14 +80,14 @@ void sqlite3BeginTrigger( ** If sqlite3SrcListLookup() returns 0, indicating the table does not ** exist, the error is caught by the block below. */ - if( !pTableName || sqlite3_malloc_failed ) goto trigger_cleanup; + if( !pTableName || sqlite3Tsd()->mallocFailed ) goto trigger_cleanup; pTab = sqlite3SrcListLookup(pParse, pTableName); if( pName2->n==0 && pTab && pTab->iDb==1 ){ iDb = 1; } /* Ensure the table name matches database name and that the table exists */ - if( sqlite3_malloc_failed ) goto trigger_cleanup; + if( sqlite3Tsd()->mallocFailed ) goto trigger_cleanup; assert( pTableName->nSrc==1 ); if( sqlite3FixInit(&sFix, pParse, iDb, "trigger", pName) && sqlite3FixSrcList(&sFix, pTableName) ){ @@ -250,7 +250,7 @@ void sqlite3FinishTrigger( pDel = sqlite3HashInsert(&db->aDb[pTrig->iDb].trigHash, pTrig->name, strlen(pTrig->name)+1, pTrig); if( pDel ){ - assert( sqlite3_malloc_failed && pDel==pTrig ); + assert( sqlite3Tsd()->mallocFailed && pDel==pTrig ); goto triggerfinish_cleanup; } pTab = sqlite3LocateTable(pParse,pTrig->table,db->aDb[pTrig->iTabDb].zName); @@ -430,7 +430,7 @@ void sqlite3DropTrigger(Parse *pParse, SrcList *pName){ int nName; sqlite3 *db = pParse->db; - if( sqlite3_malloc_failed ) goto drop_trigger_cleanup; + if( sqlite3Tsd()->mallocFailed ) goto drop_trigger_cleanup; if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ goto drop_trigger_cleanup; } |