aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c36
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;
-}
-