Re: [sqlite] statement prepares OK but step returns SQLITE_NOTADB

2012-10-29 Thread Adam DeVita
Thanks for the clarification. Adam On Sat, Oct 27, 2012 at 12:13 PM, Simon Slavin slav...@bigfraud.org wrote: On 27 Oct 2012, at 6:36am, Dan Kennedy danielk1...@gmail.com wrote: On 10/27/2012 07:06 AM, Simon Slavin wrote: On 26 Oct 2012, at 11:05pm, Clemens Ladischclem...@ladisch.de

Re: [sqlite] statement prepares OK but step returns SQLITE_NOTADB

2012-10-27 Thread Simon Slavin
On 27 Oct 2012, at 6:36am, Dan Kennedy danielk1...@gmail.com wrote: On 10/27/2012 07:06 AM, Simon Slavin wrote: On 26 Oct 2012, at 11:05pm, Clemens Ladischclem...@ladisch.de wrote: Yes; sqlite3_finalize _always_ frees the statement. And if the statement is already finalized (due to an

[sqlite] statement prepares OK but step returns SQLITE_NOTADB

2012-10-26 Thread Adam DeVita
Good day, As an error check, I've got a program opening an encrypted file. sqlite3_prepare_v2 returns SQLITE_OK and ppStmt is not null. When I run sqlite3_step(ppStmt) it returns SQLITE_NOTADB. Recognizing an error at this point I'd like to clean up properly. sqlite3_finalize(ppStmt) returns

Re: [sqlite] statement prepares OK but step returns SQLITE_NOTADB

2012-10-26 Thread Clemens Ladisch
Adam DeVita wrote: As an error check, I've got a program opening an encrypted file. sqlite3_prepare_v2 returns SQLITE_OK and ppStmt is not null. When I run sqlite3_step(ppStmt) it returns SQLITE_NOTADB. sqlite3_prepare_v2 does not yet start a transaction (to allow keeping cached prepared

Re: [sqlite] statement prepares OK but step returns SQLITE_NOTADB

2012-10-26 Thread Simon Slavin
On 26 Oct 2012, at 11:05pm, Clemens Ladisch clem...@ladisch.de wrote: Yes; sqlite3_finalize _always_ frees the statement. And if the statement is already finalized (due to an earlier error, perhaps) then it is a harmless noop. So you can do it near the end of your routine harmlessly.

Re: [sqlite] statement prepares OK but step returns SQLITE_NOTADB

2012-10-26 Thread Dan Kennedy
On 10/27/2012 07:06 AM, Simon Slavin wrote: On 26 Oct 2012, at 11:05pm, Clemens Ladischclem...@ladisch.de wrote: Yes; sqlite3_finalize _always_ frees the statement. And if the statement is already finalized (due to an earlier error, perhaps) then it is a harmless noop. So you can do it