From 39f37ce950d8cc2783a5cc010b43dfefe3bafb98 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 2 Dec 2007 20:58:14 +0000 Subject: [PATCH] Fixed bug #43457 (Prepared statement with incorrect parms doens't throw exception with pdo_pgsql driver) --- ext/pdo_pgsql/pgsql_statement.c | 2 +- ext/pdo_pgsql/tests/bug36727.phpt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index b640974d44a..aa54886fce6 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -238,7 +238,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * param->name, param->namelen + 1, (void**)&nameptr)) { param->paramno = atoi(nameptr + 1) - 1; } else { - pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY093"); + pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name TSRMLS_CC); return 0; } } diff --git a/ext/pdo_pgsql/tests/bug36727.phpt b/ext/pdo_pgsql/tests/bug36727.phpt index c6f7c8a80fa..13197edcc69 100644 --- a/ext/pdo_pgsql/tests/bug36727.phpt +++ b/ext/pdo_pgsql/tests/bug36727.phpt @@ -19,5 +19,6 @@ var_dump($stmt->bindValue(':test', 1, PDO::PARAM_INT)); echo "Done\n"; ?> --EXPECT-- +Warning: PDOStatement::bindValue(): SQLSTATE[HY093]: Invalid parameter number: :test in %s/bug36727.php on line %d bool(false) -Done +Done \ No newline at end of file