]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #43457 (Prepared statement with incorrect parms doens't
authorIlia Alshanetsky <iliaa@php.net>
Sun, 2 Dec 2007 21:00:06 +0000 (21:00 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 2 Dec 2007 21:00:06 +0000 (21:00 +0000)
throw exception with pdo_pgsql driver)

NEWS
ext/pdo_pgsql/pgsql_statement.c
ext/pdo_pgsql/tests/bug36727.phpt

diff --git a/NEWS b/NEWS
index 2ac5ec4ff5d27a67a7e3bde04cd5d6acff5a8b01..1a87ce1a8d1807060171ec363c92237deeebcab3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2008, PHP 5.2.6
+- Fixed bug #43457 (Prepared statement with incorrect parms doens't
+  throw exception with pdo_pgsql driver). (Ilia)
 - Fixed bug #43386 (array_globals not reset to 0 properly on init). (Ilia)
 - Fixed bug #43377 (PHP crashes with invalid argument for DateTimeZone). (Ilia)
 - Fixed bug #43373 (pcntl_fork() should not raise E_ERROR on error). (Ilia)
index b640974d44addf760c24fd27a576981c9ab20abd..aa54886fce6d88b3ce51448472dd7e153935b7b0 100644 (file)
@@ -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;
                                                }
                                        }
index c6f7c8a80fa338f971fba946aa519abc83fb5fdc..13197edcc694a8f13cb4dc8ef1eb81eb63019d65 100644 (file)
@@ -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