diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 6 | ||||
-rw-r--r-- | src/sqlite.h.in | 8 | ||||
-rw-r--r-- | src/vdbeapi.c | 9 |
3 files changed, 17 insertions, 6 deletions
diff --git a/src/select.c b/src/select.c index 487a8b920..47e409ffc 100644 --- a/src/select.c +++ b/src/select.c @@ -2526,8 +2526,8 @@ static void substSelect( ** (14) The subquery does not use OFFSET ** ** (15) The outer query is not part of a compound select or the -** subquery does not have both an ORDER BY and a LIMIT clause. -** (See ticket #2339) +** subquery does not have a LIMIT clause. +** (See ticket #2339 and ticket [02a8e81d44]). ** ** (16) The outer query is not an aggregate or the subquery does ** not contain ORDER BY. (Ticket #2942) This used to not matter @@ -2610,7 +2610,7 @@ static int flattenSubquery( ** and (14). */ if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ if( pSub->pOffset ) return 0; /* Restriction (14) */ - if( p->pRightmost && pSub->pLimit && pSub->pOrderBy ){ + if( p->pRightmost && pSub->pLimit ){ return 0; /* Restriction (15) */ } if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */ 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. */ |