Fix GH-22051: report errors from SQLite3Result reset and finalize#22363
Open
iliaal wants to merge 1 commit into
Open
Fix GH-22051: report errors from SQLite3Result reset and finalize#22363iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
SQLite3Stmt::reset() reports a failed sqlite3_reset() through php_sqlite3_error(), but SQLite3Result::reset() returned false silently and SQLite3Result::finalize() ignored the result. Both now surface the underlying SQLite error the same way; finalize() keeps its : true return type and reports without altering the return value. Fixes phpGH-22051
LamentXU123
reviewed
Jun 19, 2026
LamentXU123
left a comment
Contributor
There was a problem hiding this comment.
No strong opinions. Might need to hear from @ndossche to deal with this as I have zero experience in sqlite.
ndossche
approved these changes
Jun 19, 2026
ndossche
left a comment
Member
There was a problem hiding this comment.
Ok to me. Could ask Saki for a double check as dbs are her cup of tea.
LamentXU123
approved these changes
Jun 19, 2026
LamentXU123
left a comment
Contributor
There was a problem hiding this comment.
As far as I could tell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SQLite3Stmt::reset() reports a failed sqlite3_reset() through php_sqlite3_error(), but SQLite3Result::reset() returned false silently and SQLite3Result::finalize() ignored the result. Both now report the same way; finalize() keeps its : true return type and reports without changing it. The other sqlite3_reset/sqlite3_finalize calls are left unchecked deliberately: resets after a successful step cannot fail, the reset-before-execute for bug #77051 returns the prior run's stale code, the error-path finalize calls would re-report an error already surfaced in the same function, and the destructor calls have no userland frame to report from.
Fixes #22051