Commit 073095ed8d9 for php
commit 073095ed8d9a29c014aec50b98765909a979bb0b
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Mon Aug 24 13:02:56 2026 -0400
ext/pdo: Return false from rewrite_name_to_position() on IM001 error
rewrite_name_to_position() returns bool, so the -1 returned after raising
IM001 for a named parameter repeated across positions converted to true,
and really_register_bound_param() never saw the failure.
Closes GH-23465
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index b5b74351419..52a75010bb2 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -76,7 +76,7 @@ static inline bool rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_p
if (param->paramno >= 0) {
/* TODO Error? */
pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO refuses to handle repeating the same :named parameter for multiple positions with this driver, as it might be unsafe to do so. Consider using a separate name for each parameter instead");
- return -1;
+ return false;
}
param->paramno = position;
return 1;