Repository navigation
fix(c/driver/sqlite): support SQLite builds with SQLITE_OMIT_AUTORESET - #5029
edgarrmondragon wants to merge 1 commit into
Conversation
72ec5af to
de890e0
Compare
Signed-off-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>
de890e0 to
833b213
Compare
lidavidm
left a comment
There was a problem hiding this comment.
It seems fine, but shouldn't we reset when we get SQLITE_DONE at the end of a query instead of always calling it?
If the most recent call to sqlite3_step(S) for the prepared statement S indicated an error, then sqlite3_reset(S) returns an appropriate error code. The sqlite3_reset(S) interface might also return an error code if there were no prior errors but the process of resetting the prepared statement caused a new error. For example, if an INSERT statement with a RETURNING clause is only stepped one time, that one call to sqlite3_step(S) might return SQLITE_ROW but the overall statement might still fail and the sqlite3_reset(S) call might return SQLITE_BUSY if locking constraints prevent the database change from committing. Therefore, it is important that applications check the return code from sqlite3_reset(S) even if no prior call to sqlite3_step(S) indicated a problem.
(Waiting for a maintainer to comment on the issue to see if this is even the right approach)
Closes #5031