[sqlite] SQLITE_MISUE returned from sqlite3_step with inconsistent errMsg

2012-08-30 Thread Daniel Dawson
Hey Guys,

I am calling sqlite3_step and checking the return value,

Usually I get an SQLITE_DONE, or an SQLITE_BUSY which I handle.

However, sometimes I get an SQLITE_MISUSE return code. If I call sqlite3_errmsg 
straight after receiving the code then I get "Database is Locked" - The 
documentation states that SQLITE_MISUSE only occurs if I call the library 
routines incorrectly.

I don't understand why this would happen occasionally. I am not using any 
custom compiler options, everything is just set up by default.

Any help on the matter would be great, thanks.

~ Dan
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_MISUE returned from sqlite3_step with inconsistent errMsg

2012-08-30 Thread Simon Slavin

On 31 Aug 2012, at 6:42am, Daniel Dawson  wrote:

> I am calling sqlite3_step and checking the return value,
> 
> Usually I get an SQLITE_DONE, or an SQLITE_BUSY which I handle.
> 
> However, sometimes I get an SQLITE_MISUSE return code. If I call 
> sqlite3_errmsg straight after receiving the code then I get "Database is 
> Locked" - The documentation states that SQLITE_MISUSE only occurs if I call 
> the library routines incorrectly.

Do you check the return values for all your other sqlite3_ functions ?  It can 
happen if, for example, your _prepare() call returned an error but you 
proceeded to _step() anyway.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_MISUE returned from sqlite3_step with inconsistent errMsg

2012-08-31 Thread Dan Kennedy

On 08/31/2012 12:42 PM, Daniel Dawson wrote:

Hey Guys,

I am calling sqlite3_step and checking the return value,

Usually I get an SQLITE_DONE, or an SQLITE_BUSY which I handle.

However, sometimes I get an SQLITE_MISUSE return code. If I call sqlite3_errmsg straight 
after receiving the code then I get "Database is Locked" - The documentation 
states that SQLITE_MISUSE only occurs if I call the library routines incorrectly.

I don't understand why this would happen occasionally. I am not using any 
custom compiler options, everything is just set up by default.

Any help on the matter would be great, thanks.


There's a good chance there is something wrong with the sqlite3_stmt*
value passed to sqlite3_step(). Maybe it is NULL, invalid or points
to a statement object that has been finalized.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users