diff options
author | danielk1977 <danielk1977@noemail.net> | 2009-02-19 14:39:25 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2009-02-19 14:39:25 +0000 |
commit | 6ab3a2ec8a7a21f8eb607679875e3193e6d16f4c (patch) | |
tree | 58e9ac88aa2cd60f02228baeda46b9c16eb6d5a9 /src/vdbeapi.c | |
parent | 076d4661a68f67dbabc421eab124fe5908ebbeee (diff) | |
download | sqlite-6ab3a2ec8a7a21f8eb607679875e3193e6d16f4c.tar.gz sqlite-6ab3a2ec8a7a21f8eb607679875e3193e6d16f4c.zip |
Changes to reduce the heap space consumed by triggers, views and tables in the in-memory representation of the schema. Also to reduce the space used by prepared statements slightly. (CVS 6305)
FossilOrigin-Name: d9f6ffbc5ea090ba0daac571fc9a6c68b9c864e4
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r-- | src/vdbeapi.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c index d3274b540..e5a327a79 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -13,7 +13,7 @@ ** This file contains code use to implement APIs that are part of the ** VDBE. ** -** $Id: vdbeapi.c,v 1.151 2009/02/04 03:59:25 shane Exp $ +** $Id: vdbeapi.c,v 1.152 2009/02/19 14:39:25 danielk1977 Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -488,15 +488,14 @@ static int sqlite3Step(Vdbe *p){ #ifndef SQLITE_OMIT_TRACE /* Invoke the profile callback if there is one */ - if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy && p->nOp>0 - && p->aOp[0].opcode==OP_Trace && p->aOp[0].p4.z!=0 ){ + if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy && p->zSql ){ double rNow; u64 elapseTime; sqlite3OsCurrentTime(db->pVfs, &rNow); elapseTime = (u64)((rNow - (int)rNow)*3600.0*24.0*1000000000.0); elapseTime -= p->startTime; - db->xProfile(db->pProfileArg, p->aOp[0].p4.z, elapseTime); + db->xProfile(db->pProfileArg, p->zSql, elapseTime); } #endif @@ -505,7 +504,7 @@ static int sqlite3Step(Vdbe *p){ p->rc = sqlite3ApiExit(p->db, p->rc); end_of_step: assert( (rc&0xff)==rc ); - if( p->zSql && (rc&0xff)<SQLITE_ROW ){ + if( p->isPrepareV2 && (rc&0xff)<SQLITE_ROW ){ /* This behavior occurs if sqlite3_prepare_v2() was used to build ** the prepared statement. Return error codes directly */ p->db->errCode = p->rc; @@ -549,7 +548,7 @@ int sqlite3_step(sqlite3_stmt *pStmt){ sqlite3_reset(pStmt); v->expired = 0; } - if( rc==SQLITE_SCHEMA && v->zSql && db->pErr ){ + if( rc==SQLITE_SCHEMA && v->isPrepareV2 && db->pErr ){ /* This case occurs after failing to recompile an sql statement. ** The error message from the SQL compiler has already been loaded ** into the database handle. This block copies the error message |