Skip to content

fix/exec-raises-on-pdo-exec-failure#7

Merged
kuaukutsu merged 2 commits into
mainfrom
fix/exec-raises-on-pdo-exec-failure
May 27, 2026
Merged

fix/exec-raises-on-pdo-exec-failure#7
kuaukutsu merged 2 commits into
mainfrom
fix/exec-raises-on-pdo-exec-failure

Conversation

@kuaukutsu

Copy link
Copy Markdown
Member

No description provided.

kuaukutsu and others added 2 commits May 27, 2026 08:17
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>
@kuaukutsu kuaukutsu self-assigned this May 27, 2026
@kuaukutsu kuaukutsu merged commit 8c4dcd3 into main May 27, 2026
4 checks passed
@kuaukutsu kuaukutsu deleted the fix/exec-raises-on-pdo-exec-failure branch May 27, 2026 08:27
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.

1 participant