On Tue, Mar 13, 2012 at 6:43 PM, Rob Richardson <rdrichard...@rad-con.com>wrote:

> Hello!
>
> I am sending a badly formed query string to sqlite_exec().  It is giving
> me error 21 (misuse of library), but it is not giving me an error message.
>  The value of the pointer sent as the fifth argument of sqlite_exec() is
> not changed.  Is this expected behavior?  Is there something I have to do
> to tell sqlite that I want the error message to be generated?
>

If you are getting back SQLITE_MISUSE, that probably means you are calling
sqlite3_exec() with a database connection that has previously been closed.
SQLite tries to catch that situation and report the SQLITE_MISUSE error,
but there are no guarantees that doing so will work.  Depending on how
malloc() is implemented on your system, it might segfault instead.

So:  Don't call sqlite3_exec() with a closed database connection.

General rule:  You should never do anything to SQLite that causes it to
return SQLITE_MISUSE.  If you do, there is an error in your code.  Fix your
code.


>
> Thank you very much.
>
> RobR
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to