Skip to content

Commit c81c24d

Browse files
author
Ilia Alshanetsky
committed
MFB: Fixed bug #43457 (Prepared statement with incorrect parms doens't throw exception with pdo_pgsql driver)
1 parent 9da6da8 commit c81c24d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ext/pdo_pgsql/pgsql_statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
175175
param->name, param->namelen + 1, (void**)&nameptr)) {
176176
param->paramno = atoi(nameptr + 1) - 1;
177177
} else {
178-
pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY093");
178+
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name TSRMLS_CC);
179179
return 0;
180180
}
181181
}

ext/pdo_pgsql/tests/bug36727.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ var_dump($stmt->bindValue(':test', 1, PDO::PARAM_INT));
1919
echo "Done\n";
2020
?>
2121
--EXPECT--
22+
Warning: PDOStatement::bindValue(): SQLSTATE[HY093]: Invalid parameter number: :test in %s/bug36727.php on line %d
2223
bool(false)
23-
Done
24+
Done

0 commit comments

Comments
 (0)