fix/exec-raises-on-pdo-exec-failure#7
Merged
Conversation
Connection::exec() and Statement::exec() previously discarded the return value of PDO::exec() in the no-params branch, so a failure under ERRMODE_SILENT would pass silently. Check the return and route through prepareException() to surface the error. Cover both call sites with a Testo test that forces the branch via an ERRMODE_SILENT handle and invalid SQL. Document the remaining $statement->execute($params) asymmetry as relying on the default ERRMODE_EXCEPTION. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
execRaisesPrepareExceptionOnFailure asserted only the exception class, leaving three Infection survivors in ErrorInfo::__construct that swapped $errorInfo[0]/[1]/[2] indices undetected. Tighten both tests with a withMessagePattern that requires a non-numeric SQLSTATE token and a non-empty multi-word driver message — kills all three mutants while staying resilient to libsqlite wording changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.