aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sqlite.h.in8
-rw-r--r--src/vdbeapi.c9
2 files changed, 14 insertions, 3 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 78f3773e9..c1363031e 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -2885,6 +2885,14 @@ const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
** be the case that the same database connection is being used by two or
** more threads at the same moment in time.
**
+** For all versions of SQLite up to and including 3.6.23.1, it was required
+** after sqlite3_step() returned anything other than [SQLITE_ROW] that
+** [sqlite3_reset()] be called before any subsequent invocation of
+** sqlite3_step(). Failure to invoke [sqlite3_reset()] in this way would
+** result in an [SQLITE_MISUSE] return from sqlite3_step(). But after
+** version 3.6.23.1, sqlite3_step() began calling [sqlite3_reset()]
+** automatically in this circumstance rather than returning [SQLITE_MISUSE].
+**
** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite3_step()
** API always returns a generic error code, [SQLITE_ERROR], following any
** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 125f325d1..29a2a429b 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -321,9 +321,12 @@ static int sqlite3Step(Vdbe *p){
assert(p);
if( p->magic!=VDBE_MAGIC_RUN ){
- sqlite3_log(SQLITE_MISUSE,
- "attempt to step a halted statement: [%s]", p->zSql);
- return SQLITE_MISUSE_BKPT;
+ /* We used to require that sqlite3_reset() be called before retrying
+ ** sqlite3_step() after any error. But after 3.6.23, we changed this
+ ** so that sqlite3_reset() would be called automatically instead of
+ ** throwing the error.
+ */
+ sqlite3_reset((sqlite3_stmt*)p);
}
/* Check that malloc() has not failed. If it has, return early. */