Skip to content

fix(c/driver/sqlite): support SQLite builds with SQLITE_OMIT_AUTORESET - #5029

Draft
edgarrmondragon wants to merge 1 commit into
apache:mainfrom
edgarrmondragon:fix/driver-sqlite-reset
Draft

edgarrmondragon wants to merge 1 commit into
apache:mainfrom
edgarrmondragon:fix/driver-sqlite-reset

Conversation

@edgarrmondragon

@edgarrmondragon edgarrmondragon commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

(Waiting for a maintainer to comment on the issue to see if this is even the right approach)

Closes #5031

@edgarrmondragon edgarrmondragon changed the title fix(c/driver/sqlite): support SQLite builds with SQLITE_OMIT_AUTORESET. fix(c/driver/sqlite): support SQLite builds with SQLITE_OMIT_AUTORESET Nov 13, 2026
Signed-off-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

https://www.sqlite.org/c3ref/reset.html

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

c/driver/sqlite: re-executing a prepared statement fails with "no more rows available" on macOS system SQLite

2 participants