diff options
author | drh <drh@noemail.net> | 2006-01-11 21:41:20 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2006-01-11 21:41:20 +0000 |
commit | 6f7adc8a8036ec2d30ba4cd12610e0cba5834640 (patch) | |
tree | da5457aef1a8cb9194acffdf80b19f512aea3823 /src/insert.c | |
parent | 0203bde908cb15eecef3a03c9761827e165d71db (diff) | |
download | sqlite-6f7adc8a8036ec2d30ba4cd12610e0cba5834640.tar.gz sqlite-6f7adc8a8036ec2d30ba4cd12610e0cba5834640.zip |
Automatically deallocate thread-specific data when it is no longer
being used. Ticket #1601. Also implemented the suggestion of
ticket #1603. Memory management is now off by default at compile-time.
The sqlite3_enable_memory_management() API has been removed. (CVS 2919)
FossilOrigin-Name: 5d9c6aa964305c3f36741ff0058da5b5f3ce0d24
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/insert.c b/src/insert.c index 3d4c460b6..e24968690 100644 --- a/src/insert.c +++ b/src/insert.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** -** $Id: insert.c,v 1.156 2006/01/10 17:58:23 danielk1977 Exp $ +** $Id: insert.c,v 1.157 2006/01/11 21:41:22 drh Exp $ */ #include "sqliteInt.h" @@ -225,7 +225,9 @@ void sqlite3Insert( int counterRowid; /* Memory cell holding rowid of autoinc counter */ #endif - if( pParse->nErr || sqlite3ThreadData()->mallocFailed ) goto insert_cleanup; + if( pParse->nErr || sqlite3ThreadDataReadOnly()->mallocFailed ){ + goto insert_cleanup; + } db = pParse->db; /* Locate the table into which we will be inserting new information. @@ -331,7 +333,9 @@ void sqlite3Insert( /* Resolve the expressions in the SELECT statement and execute it. */ rc = sqlite3Select(pParse, pSelect, SRT_Subroutine, iInsertBlock,0,0,0,0); - if( rc || pParse->nErr || sqlite3ThreadData()->mallocFailed ) goto insert_cleanup; + if( rc || pParse->nErr || sqlite3ThreadDataReadOnly()->mallocFailed ){ + goto insert_cleanup; + } iCleanup = sqlite3VdbeMakeLabel(v); sqlite3VdbeAddOp(v, OP_Goto, 0, iCleanup); |