[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread gwenn
Sorry, I misread the documentation. And do you recommend the strategy used in tclsqlite.c: rcs = sqlite3_step(pStmt); if( rcs==SQLITE_ROW ){ return TCL_OK; } ... rcs = sqlite3_reset(pStmt); ... Reset the stmt as soon as possible after sqlite3_step

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread Simon Slavin
On 31 Jul 2015, at 6:03pm, gwenn wrote: > And do you recommend the strategy used in tclsqlite.c: > > rcs = sqlite3_step(pStmt); > if( rcs==SQLITE_ROW ){ >return TCL_OK; > } > ... > rcs = sqlite3_reset(pStmt); > ... > > > Reset the stmt as soon as

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread Richard Hipp
On 7/30/15, gwenn wrote: > Hello, > sqlite3_stmt_busy returns true after sqlite3_step returns DONE. Fixed at https://www.sqlite.org/src/info/047d3475e93d08cf -- D. Richard Hipp drh at sqlite.org

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread Clemens Ladisch
Stephan Beal wrote: > On Thu, Jul 30, 2015 at 11:35 PM, Clemens Ladisch > wrote: >> gwenn wrote: >>> sqlite3_stmt_busy returns true after sqlite3_step returns DONE. >> >> The documentation says: >> | The sqlite3_stmt_busy(S) interface returns true (non-zero) if the >> | prepared statement S has

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread Stephan Beal
On Fri, Jul 31, 2015 at 10:51 AM, Hick Gunter wrote: > SQLITE_DONE means that there are no (more) rows to be retrieved. > So that's the difference (for a SELECT) between that and "running to completion"? i think that's the source of the confusion. -- - stephan beal

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread Stephan Beal
On Thu, Jul 30, 2015 at 11:35 PM, Clemens Ladisch wrote: > gwenn wrote: > > sqlite3_stmt_busy returns true after sqlite3_step returns DONE. > > The documentation says: > | The sqlite3_stmt_busy(S) interface returns true (non-zero) if the > | prepared statement S has been stepped at least once

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread Hick Gunter
SQLITE_DONE means that there are no (more) rows to be retrieved. -Urspr?ngliche Nachricht- Von: Stephan Beal [mailto:sgbeal at googlemail.com] Gesendet: Freitag, 31. Juli 2015 10:12 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Strange behaviour of sqlite3_stmt_busy

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread Clemens Ladisch
gwenn wrote: > sqlite3_stmt_busy returns true after sqlite3_step returns DONE. The documentation says: | The sqlite3_stmt_busy(S) interface returns true (non-zero) if the | prepared statement S has been stepped at least once using | sqlite3_step(S) but has not run to completion and/or has not

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-30 Thread gwenn
Hello, sqlite3_stmt_busy returns true after sqlite3_step returns DONE. Here is the code: #include #include #include "sqlite3.h" int main(int argc, char **argv) { sqlite3 *db = NULL; sqlite3_stmt *stmt = NULL; char *zErrMsg = NULL; const char *z; int rc = 0; rc =