diff options
author | dan <dan@noemail.net> | 2009-10-19 18:11:09 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2009-10-19 18:11:09 +0000 |
commit | 1d2ce4f80422b0d8720817b057f834102e1738e3 (patch) | |
tree | 0242dfefd86f20e21877d9d9d037c5a3140cb0b6 /src/vdbeapi.c | |
parent | f7b0b0ad5fb083c194f0f69e75747dccf71427ed (diff) | |
download | sqlite-1d2ce4f80422b0d8720817b057f834102e1738e3.tar.gz sqlite-1d2ce4f80422b0d8720817b057f834102e1738e3.zip |
Remove the sqlite3_reoptimize() API. The same functionality is now provided automatically to queries prepared using prepare_v2().
FossilOrigin-Name: 2c50b3d5aab7cd8cc841d61f8c3b2b34d2f0b54b
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r-- | src/vdbeapi.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 107c1eb6c..12d7349ac 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -915,17 +915,10 @@ static int vdbeUnbind(Vdbe *p, int i){ pVar->flags = MEM_Null; sqlite3Error(p->db, SQLITE_OK, 0); - /* If the bit corresponding to this variable is set in Vdbe.opmask, set - ** the optimizable flag before returning. This tells the sqlite3_reoptimize() - ** function that the VM program may benefit from recompilation. - ** - ** If the bit in Vdbe.expmask is set, then binding a new value to this - ** variable invalidates the current query plan. This comes about when the - ** variable is the RHS of a LIKE or GLOB operator and the LIKE/GLOB is - ** able to use an index. */ - if( (i<32 && p->optmask & ((u32)1 << i)) || p->optmask==0xffffffff ){ - p->optimizable = 1; - } + /* If the bit corresponding to this variable in Vdbe.expmask is set, then + ** binding a new value to this variable invalidates the current query plan. + */ + assert( p->isPrepareV2 || p->expmask==0 ); if( (i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff ){ p->expired = 1; } @@ -1221,24 +1214,3 @@ int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ return v; } -/* -** If possible, optimize the statement for the current bindings. -*/ -int sqlite3_reoptimize(sqlite3_stmt *pStmt){ - int rc = SQLITE_OK; - Vdbe *v = (Vdbe *)pStmt; - sqlite3 *db = v->db; - - sqlite3_mutex_enter(db->mutex); - if( v->isPrepareV2==0 || v->pc>0 ){ - rc = SQLITE_MISUSE; - }else if( v->optimizable ){ - rc = sqlite3Reprepare(v); - rc = sqlite3ApiExit(db, rc); - } - assert( rc!=SQLITE_OK || v->optimizable==0 ); - sqlite3_mutex_leave(db->mutex); - - return rc; -} - |