sqlite icon indicating copy to clipboard operation
sqlite copied to clipboard

Check all statements are reset at Pool.Close

Open crawshaw opened this issue 6 years ago • 1 comments

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.

crawshaw avatar Feb 08 '19 09:02 crawshaw

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.

FiloSottile avatar Mar 15 '19 02:03 FiloSottile