sqlite
sqlite copied to clipboard
Check all statements are reset at Pool.Close
We already check Conn.CheckReset
in Pool.Put
. All we have to do is make sure all connections are returned to the pool before Close
is called.
I'm not sure CheckReset
is checking the right thing. lastHasRow
is false if the last step returned SQLITE_DONE
, but I can't find anywhere in the docs a guarantee that it's the same as being reset.
For example, I wonder if the implicit transaction is committed:
An implicit transaction (a transaction that is started automatically, not a transaction started by BEGIN) is committed automatically when the last active statement finishes. A statement finishes when its prepared statement is reset or finalized.
Pool.Put
should probably call Reset
automatically if lastHasRow
is false, though.