-C When\sgenerating\sWHERE\sclause\sterms\sinternally\sfor\sNATURAL\sand\sUSING\sjoins,\sidentify\sthe\stable\sby\sits\sposition\sin\sthe\sFROM\slist,\snot\sby\sits\sname\sor\salias.\sFix\sfor\s[b73fb0bd64].
-D 2009-10-19T15:52:33
+C Remove\sthe\ssqlite3_reoptimize()\sAPI.\sThe\ssame\sfunctionality\sis\snow\sprovided\sautomatically\sto\squeries\sprepared\susing\sprepare_v2().
+D 2009-10-19T18:11:10
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 4ca3f1dd6efa2075bcb27f4dc43eef749877740d
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/rowset.c c64dafba1f9fd876836c8db8682966b9d197eb1f
F src/select.c cbe366a0ce114856e66f5daf0f848d7c48a88298
F src/shell.c 270231b3f587f1f86391b9994fdfcd5d472c3fdf
-F src/sqlite.h.in 02edbab15c4556dc562f6f6b9b9d322e7719c800
+F src/sqlite.h.in 8e1ccddb12b5e983d0a17e1f1477c72b0a72dd84
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
F src/sqliteInt.h 3b00a3ce79e60c5a47c342b738c8b75013f3ec84
F src/sqliteLimit.h 38b2fffcd01faeaeaadea71b2b47695a81580c8b
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
-F src/tclsqlite.c 00cefd8c37cc934e13cb5238ed53f090391aa99a
-F src/test1.c 92ccdb2e68f8c5b529bfbf833b759b5fa39a88f7
+F src/tclsqlite.c 97e1d25695e47897294bf84f689191052a00fefa
+F src/test1.c 2232a39540a6b72f3be8f84b34d1ca0714f92aee
F src/test2.c 0de743ec8890ca4f09e0bce5d6d5a681f5957fec
F src/test3.c 2445c2beb5e7a0c91fd8136dc1339ec369a24898
F src/test4.c b5fd530f02a6a0dbffb23be202168a690985dedd
F src/util.c 59d4e9456bf1fe581f415a783fa0cee6115c8f35
F src/vacuum.c f2347520907ee4ec867c9b804d24456b0fd912a7
F src/vdbe.c f0d6e7dbd4515758c188c9dd7025eb9dfcf021e0
-F src/vdbe.h 1fb725c38df7f79dc60e9a61cb368152d9457e3c
-F src/vdbeInt.h aafda2e9761298e12ef0a3e8b5caed9aaf9c7592
-F src/vdbeapi.c a7669f434f1fb53457343e7e85d06d695f7bb4e8
-F src/vdbeaux.c bd26b3c765dff7c0bc089f550d82510a37f24d6a
+F src/vdbe.h 3fedb2121d026dd127350d33e875a49cf05df2e8
+F src/vdbeInt.h 8e07f4356dd5bfe03ac5991338e59b68c9b3c717
+F src/vdbeapi.c 1124f16bbb1d8c9682d9aaead78b87826c39b262
+F src/vdbeaux.c fc032b050e0500000de534b2b0f0c63642459b8f
F src/vdbeblob.c 9bfaeab22e261a6a7b6df04e7faaf7d6dfdbef5a
F src/vdbemem.c 7055a2941a7802094f4704cedc7a28cc88a23749
F src/vtab.c 3e54fe39374e5feb8b174de32a90e7a21966025d
F src/walker.c 1edca756275f158b80f20eb6f104c8d3fcc96a04
-F src/where.c 9e8bb75c39adfd85fa0bbfa803836de9485716a8
+F src/where.c acf24024bc00d84bfb83c82daa1d72a907cc8456
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
F test/all.test 14165b3e32715b700b5f0cbf8f6e3833dda0be45
F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc
F test/analyze.test ad5329098fe4de4a96852231d53e3e9e6283ad4b
F test/analyze2.test a2ad7b0a4e13801ee3968fe70f22aff52326569c
-F test/analyze3.test 2f00779be9c1637dd72793de755a17722995d836
+F test/analyze3.test 5c87ca746d3cf52d5172cfbc4890695d526f1e90
F test/async.test 8c75d31b8330f8b70cf2571b014d4476a063efdb
F test/async2.test bf5e2ca2c96763b4cba3d016249ad7259a5603b6
F test/async3.test 93edaa9122f498e56ea98c36c72abc407f4fb11e
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f x
-P ca3e41b0574cfd8d971c2be2114e58273a531970
-R cd248a323e6fa543f7b6dc5498e63431
+P 6fe6371175482d38ac4aeea994c7b20c18b7de01
+R f87103fb96f6ce262ce840e0ef0a5e44
U dan
-Z ef39b99c6d9e839e5c682ef365e81b03
+Z 5a02708d47ce169d35256d399f3d9643
-6fe6371175482d38ac4aeea994c7b20c18b7de01
\ No newline at end of file
+2c50b3d5aab7cd8cc841d61f8c3b2b34d2f0b54b
\ No newline at end of file
*/
int sqlite3_strnicmp(const char *, const char *, int);
-/*
-** CAPI3REF: Optimizing for Bound Parameters
-** EXPERIMENTAL
-**
-** If possible, optimize the SQL statement passed as the only argument
-** for the values currently bound to the statements SQL variables.
-**
-** SQLite currently contains two optimizations that depend upon the values
-** of SQL literals specified as part of a query:
-**
-** <ul>
-** <li> The [range query optimization], and
-** <li> The [LIKE optimization].
-** </ul>
-**
-** Normally, queries that use an SQL [parameter] in the relevant expression
-** or expressions may not benefit from either of the above optimizations.
-** This function may be used to overcome this limitation.
-**
-** Calling sqlite3_reoptimize() on a statement handle after values have been
-** bound to its SQL parameters causes SQLite to inspect the query and the
-** bound values to determine if either of the above optimizations may be
-** applied to it. If so, a new query plan is formulated to take advantage
-** of the optimizations.
-**
-** If it is determined that neither of the above optimizations may be
-** profitably applied to the query based on the values bound to SQL
-** parameters, this function is a no-op.
-*/
-int sqlite3_reoptimize(sqlite3_stmt *pStmt);
-
/*
** Undo the hack that converts floating point types to integer for
** builds on processors without floating point support.
pPreStmt->nParm = iParm;
*ppPreStmt = pPreStmt;
- /* Call sqlite3_reoptimize() to optimize the statement according to
- ** the values just bound to it. If SQLITE_ENABLE_STAT2 is not defined
- ** or the statement will not benefit from re-optimization, this
- ** call is a no-op. */
- if( SQLITE_OK!=sqlite3_reoptimize(pPreStmt->pStmt) ){
- Tcl_SetObjResult(interp, dbTextToObj(sqlite3_errmsg(pDb->db)));
- return TCL_ERROR;
- }
-
return TCL_OK;
}
return TCL_OK;
}
-/*
-** Usage: sqlite3_reoptimize STMT
-**
-** Call sqlite3_reoptimize() on the statement handle passed as the
-** only parameter. Return a string representing the value returned by
-** sqlite3_reoptimize - "SQLITE_OK", "SQLITE_MISUSE" etc.
-*/
-static int test_reoptimize(
- void * clientData,
- Tcl_Interp *interp,
- int objc,
- Tcl_Obj *CONST objv[]
-){
- sqlite3_stmt *pStmt;
- int rc;
-
- if( objc!=2 ){
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- Tcl_GetString(objv[0]), " STMT", 0);
- return TCL_ERROR;
- }
- if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR;
- rc = sqlite3_reoptimize(pStmt);
- Tcl_ResetResult(interp);
- Tcl_SetResult(interp, (char *)t1ErrorName(rc), 0);
- return TCL_OK;
-}
-
/*
** Usage: sqlite3_next_stmt DB STMT
**
{ "sqlite3_step", test_step ,0 },
{ "sqlite3_sql", test_sql ,0 },
{ "sqlite3_next_stmt", test_next_stmt ,0 },
- { "sqlite3_reoptimize", test_reoptimize ,0 },
{ "sqlite3_release_memory", test_release_memory, 0},
{ "sqlite3_soft_heap_limit", test_soft_heap_limit, 0},
VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*);
void sqlite3VdbeProgramDelete(sqlite3 *, SubProgram *, int);
sqlite3_value *sqlite3VdbeGetValue(Vdbe*, int, u8);
-void sqlite3VdbeSetVarmask(Vdbe*,int,int);
+void sqlite3VdbeSetVarmask(Vdbe*, int);
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
int sqlite3VdbeReleaseMemory(int);
#endif
VdbeFrame *pFrame; /* Parent frame */
int nFrame; /* Number of frames in pFrame list */
- u8 optimizable; /* True if VM may benefit from sqlite3_reoptimize() */
- u32 optmask; /* Bitmask of vars that may be used by reoptimize() */
u32 expmask; /* Binding to these vars invalidates VM */
};
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;
}
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;
-}
-
** Remember the SQL string for a prepared statement.
*/
void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
+ assert( isPrepareV2==1 || isPrepareV2==0 );
if( p==0 ) return;
#ifdef SQLITE_OMIT_TRACE
if( !isPrepareV2 ) return;
#endif
assert( p->zSql==0 );
p->zSql = sqlite3DbStrNDup(p->db, z, n);
- p->isPrepareV2 = isPrepareV2 ? 1 : 0;
+ p->isPrepareV2 = isPrepareV2;
}
/*
** to sqlite3_reoptimize() that re-preparing the statement may result
** in a better query plan.
*/
-void sqlite3VdbeSetVarmask(Vdbe *v, int iVar, int isExpire){
- u32 *mask = (isExpire ? &v->expmask : &v->optmask);
+void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
assert( iVar>0 );
if( iVar>32 ){
- *mask = 0xffffffff;
+ v->expmask = 0xffffffff;
}else{
- *mask |= ((u32)1 << (iVar-1));
+ v->expmask |= ((u32)1 << (iVar-1));
}
}
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
z = (char *)sqlite3_value_text(pVal);
}
- sqlite3VdbeSetVarmask(pParse->pVdbe, pRight->iColumn, 0);
+ sqlite3VdbeSetVarmask(pParse->pVdbe, pRight->iColumn);
assert( pRight->op==TK_VARIABLE || pRight->op==TK_REGISTER );
}else if( op==TK_STRING ){
z = pRight->u.zToken;
*ppPrefix = pPrefix;
if( op==TK_VARIABLE ){
Vdbe *v = pParse->pVdbe;
- sqlite3VdbeSetVarmask(v, pRight->iColumn, 1);
+ sqlite3VdbeSetVarmask(v, pRight->iColumn);
if( *pisComplete && pRight->u.zToken[1] ){
/* If the rhs of the LIKE expression is a variable, and the current
** value of the variable means there is no need to invoke the LIKE
|| (pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
){
int iVar = pExpr->iColumn;
- sqlite3VdbeSetVarmask(pParse->pVdbe, iVar, 0);
+ sqlite3VdbeSetVarmask(pParse->pVdbe, iVar);
*pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff);
return SQLITE_OK;
}
#***********************************************************************
#
# This file implements regression tests for SQLite library. This file
-# implements tests for the sqlite3_reoptimize() functionality.
+# implements tests for range and LIKE constraints that use bound variables
+# instead of literal constant arguments.
#
set testdir [file dirname $argv0]
# in the same way as constants when planning queries that
# use LIKE expressions in the WHERE clause.
#
-# analyze3-3.*: Test that sqlite3_reoptimize() is a no-op when there is
-# no way for re-preparing the query to produce a superior
-# query plan.
+# analyze3-3.*: Test that binding to a variable does not invalidate the
+# query plan when there is no way in which replanning the
+# query may produce a superior outcome.
#
# analyze3-4.*: Test that SQL or authorization callback errors occuring
-# within sqlite3_reoptimize() are handled correctly.
+# within sqlite3Reprepare() are handled correctly.
#
proc getvar {varname} { uplevel #0 set $varname }
#
# analyze3-1.1.4 - 3.1.9
# Show that using SQL variables produces the same results as using
-# literal values to constrain the range scan. This works because the
-# Tcl interface always calls [sqlite3_reoptimize] after binding values.
+# literal values to constrain the range scan.
#
# These tests also check that the compiler code considers column
# affinities when estimating the number of rows scanned by the "use
#-------------------------------------------------------------------------
-# This block of tests checks that sqlite3_reoptimize() is a no-op if
-# the values bound to any parameters that may affect the query plan
-# have not changed since the statement was last compiled.
-#
-# It is possible to tell if sqlite3_reoptimize() is a no-op by registering
-# an authorization callback. If the auth callback is not invoked from
-# within a give call to reoptimize(), then it must have been a no-op.
-#
-# Also test that:
-#
-# * sqlite3_reoptimize() returns SQLITE_MISUSE if called on a statement
-# that was prepared using the legacy sqlite3_prepare() interface,
-#
-# * sqlite3_reoptimize() returns SQLITE_MISUSE if called on a statement
-# that is not in the "reset" state.
+# This block of tests checks that statements are correctly marked as
+# expired when the values bound to any parameters that may affect the
+# query plan are modified.
#
drop_all_tables
db auth auth
return SQLITE_OK
}
-# Return true if calling reoptimize() on the statement handle passed
-# as an argument causes the statement to be recompiled.
-#
-proc test_reoptimize {stmt} {
- set ::auth 0
- sqlite3_reoptimize $stmt
- set ::auth
-}
-
do_test analyze3-3.1 {
execsql {
BEGIN;
do_test analyze3-3.2.1 {
set S [sqlite3_prepare_v2 db "SELECT * FROM t1 WHERE b>?" -1 dummy]
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.2.2 {
sqlite3_bind_text $S 1 "abc" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
-do_test analyze3-3.2.3 {
- test_reoptimize $S
-} {0}
do_test analyze3-3.2.4 {
sqlite3_finalize $S
} {SQLITE_OK}
-do_test analyze3-3.2.1 {
+do_test analyze3-3.2.5 {
set S [sqlite3_prepare_v2 db "SELECT * FROM t1 WHERE b=?" -1 dummy]
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
-do_test analyze3-3.2.2 {
+do_test analyze3-3.2.6 {
sqlite3_bind_text $S 1 "abc" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
-do_test analyze3-3.2.3 {
- sqlite3_finalize $S
-} {SQLITE_OK}
-
-do_test analyze3-3.3.1 {
- set S [sqlite3_prepare db "SELECT * FROM t1 WHERE b=?" -1 dummy]
- sqlite3_reoptimize $S
-} {SQLITE_MISUSE}
-do_test analyze3-3.3.2 {
- sqlite3_finalize $S
-} {SQLITE_OK}
-
-do_test analyze3-3.3.1 {
- set S [sqlite3_prepare_v2 db "SELECT * FROM t1" -1 dummy]
- sqlite3_reoptimize $S
-} {SQLITE_OK}
-do_test analyze3-3.3.2 {
- sqlite3_step $S
-} {SQLITE_ROW}
-do_test analyze3-3.3.3 {
- sqlite3_reoptimize $S
-} {SQLITE_MISUSE}
-do_test analyze3-3.3.4 {
- while {"SQLITE_ROW" == [sqlite3_step $S]} {}
- sqlite3_reoptimize $S
-} {SQLITE_MISUSE}
-do_test analyze3-3.3.5 {
+do_test analyze3-3.2.7 {
sqlite3_finalize $S
} {SQLITE_OK}
do_test analyze3-3.4.1 {
set S [sqlite3_prepare_v2 db "SELECT * FROM t1 WHERE a=? AND b>?" -1 dummy]
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.4.2 {
sqlite3_bind_text $S 1 "abc" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.4.3 {
sqlite3_bind_text $S 2 "def" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
do_test analyze3-3.4.4 {
sqlite3_bind_text $S 2 "ghi" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
do_test analyze3-3.4.5 {
- test_reoptimize $S
-} {0}
+ sqlite3_expired $S
+} {1}
do_test analyze3-3.4.6 {
sqlite3_finalize $S
} {SQLITE_OK}
?21, ?22, ?23, ?24, ?25, ?26, ?27, ?28, ?29, ?30, ?31
) AND b>?32;
} -1 dummy]
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.5.2 {
sqlite3_bind_text $S 31 "abc" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.5.3 {
sqlite3_bind_text $S 32 "def" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
-do_test analyze3-3.5.4 {
- test_reoptimize $S
-} {0}
do_test analyze3-3.5.5 {
sqlite3_finalize $S
} {SQLITE_OK}
?21, ?22, ?23, ?24, ?25, ?26, ?27, ?28, ?29, ?30, ?31, ?32
) AND b>?33;
} -1 dummy]
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.6.2 {
sqlite3_bind_text $S 32 "abc" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
do_test analyze3-3.6.3 {
sqlite3_bind_text $S 33 "def" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
-do_test analyze3-3.6.4 {
- test_reoptimize $S
-} {0}
do_test analyze3-3.6.5 {
sqlite3_finalize $S
} {SQLITE_OK}
?21, ?22, ?23, ?24, ?25, ?26, ?27, ?28, ?29, ?30, ?31, ?32
) AND b>?10;
} -1 dummy]
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.7.2 {
sqlite3_bind_text $S 32 "abc" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.7.3 {
sqlite3_bind_text $S 33 "def" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.7.4 {
sqlite3_bind_text $S 10 "def" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
-do_test analyze3-3.7.5 {
- test_reoptimize $S
-} {0}
do_test analyze3-3.7.6 {
sqlite3_finalize $S
} {SQLITE_OK}
set S [sqlite3_prepare_v2 db {
SELECT * FROM t4 WHERE x != ? AND y LIKE ?
} -1 dummy]
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.8.3 {
sqlite3_bind_text $S 1 "abc" 3
- test_reoptimize $S
+ sqlite3_expired $S
} {0}
do_test analyze3-3.8.4 {
sqlite3_bind_text $S 2 "def" 3
- test_reoptimize $S
-} {1}
-do_test analyze3-3.8.5 {
- test_reoptimize $S
-} {0}
-do_test analyze3-3.8.6 {
sqlite3_expired $S
-} {0}
+} {1}
do_test analyze3-3.8.7 {
sqlite3_bind_text $S 2 "ghi%" 4
sqlite3_expired $S
-} {0}
+} {1}
do_test analyze3-3.8.8 {
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
do_test analyze3-3.8.9 {
sqlite3_bind_text $S 2 "ghi%def" 7
sqlite3_expired $S
} {1}
do_test analyze3-3.8.10 {
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
do_test analyze3-3.8.11 {
sqlite3_bind_text $S 2 "%ab" 3
sqlite3_expired $S
} {1}
do_test analyze3-3.8.12 {
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
do_test analyze3-3.8.12 {
sqlite3_bind_text $S 2 "%de" 3
sqlite3_expired $S
-} {0}
+} {1}
do_test analyze3-3.8.13 {
- test_reoptimize $S
+ sqlite3_expired $S
} {1}
do_test analyze3-3.8.14 {
sqlite3_finalize $S
#-------------------------------------------------------------------------
# These tests check that errors encountered while repreparing an SQL
-# statement within sqlite3_reoptimize() are handled correctly.
+# statement within sqlite3Reprepare() are handled correctly.
#
-# Check an schema error.
+# Check a schema error.
#
do_test analyze3-4.1.1 {
set S [sqlite3_prepare_v2 db "SELECT * FROM t1 WHERE a=? AND b>?" -1 dummy]
- sqlite3_reoptimize $S
-} {SQLITE_OK}
+ sqlite3_step $S
+} {SQLITE_DONE}
do_test analyze3-4.1.2 {
+ sqlite3_reset $S
sqlite3_bind_text $S 2 "abc" 3
execsql { DROP TABLE t1 }
- sqlite3_reoptimize $S
-} {SQLITE_SCHEMA}
-do_test analyze3-4.1.3 {
sqlite3_step $S
} {SQLITE_SCHEMA}
-do_test analyze3-4.1.4 {
+do_test analyze3-4.1.3 {
sqlite3_finalize $S
} {SQLITE_SCHEMA}
execsql COMMIT
execsql ANALYZE
set S [sqlite3_prepare_v2 db "SELECT * FROM t1 WHERE a=? AND b>?" -1 dummy]
- sqlite3_reoptimize $S
-} {SQLITE_OK}
+ sqlite3_step $S
+} {SQLITE_DONE}
db auth auth
proc auth {args} {
if {[lindex $args 0] == "SQLITE_READ"} {return SQLITE_DENY}
return SQLITE_OK
}
do_test analyze3-4.2.2 {
+ sqlite3_reset $S
sqlite3_bind_text $S 2 "abc" 3
- sqlite3_reoptimize $S
-} {SQLITE_SCHEMA}
-do_test analyze3-4.2.3 {
sqlite3_step $S
} {SQLITE_SCHEMA}
do_test analyze3-4.2.4 {
# Check the effect of an authorization error that occurs in a re-prepare
# performed by sqlite3_step() is the same as one that occurs within
-# sqlite3_reoptimize().
+# sqlite3Reprepare().
#
do_test analyze3-4.3.1 {
db auth {}