Skip to content

Commit 39f37ce

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #43457 (Prepared statement with incorrect parms doens't
throw exception with pdo_pgsql driver)
1 parent fd73296 commit 39f37ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ext/pdo_pgsql/pgsql_statement.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
238238
param->name, param->namelen + 1, (void**)&nameptr)) {
239239
param->paramno = atoi(nameptr + 1) - 1;
240240
} else {
241-
pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY093");
241+
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name TSRMLS_CC);
242242
return 0;
243243
}
244244
}

ext/pdo_pgsql/tests/bug36727.phpt

+2-1
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)