-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
close()
doesn't work.
#13
Comments
Hi there, Will |
I've put together a very simple test case. Steps to reproduce:
I added a simple check to the tests in my "closedbfix" branch. It should complain: "Error: Error closing database" Not only is |
For .close() to work, make sure that you call .finalize() on all statements. If there are any statements that are not finalized, .close() fill fail. |
the callback passed to
close
almost inevitably gets passed an error object. unfortunately, the sqlite result code is not attached, so it's hard to guess at why.I've hacked some printfs into the close routines and it seems that the returned error is always 5-> SQLITE_BUSY which is mentioned in the man page for close: "If sqlite3_close() is called on a database connection that still has outstanding prepared statements or BLOB handles, then it returns SQLITE_BUSY."
I'm afraid my c++ isn't too hot, but it seems that
sqlite3_finalize
is never called on the prepared statement handle in the case ofPrepare
(PrepareAndStep does call finalize)Steps to reproduce:
If the tests are changed to log an error in the close callback, none of the tests are able to close without error. ( not sure how to attach a patch here, and I'm not sure if it makes sense to...)
The text was updated successfully, but these errors were encountered: