iliaa Tue Sep 19 15:46:25 2006 UTC
Modified files:
/php-src/ext/pdo/tests bug_38253.phpt
/php-src/ext/pdo_pgsql pgsql_statement.c pgsql_driver.c
Log:
MFB:
Fixed bug #37870 (pgo_pgsql tries to de-allocate unused statements).
Fixed bug #36681 (pdo_pgsql driver incorrectly ignored some errors).
Fixed test for bug #38253 not to use faulty SQL that generates
errors in PostgreSQL
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/tests/bug_38253.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/pdo/tests/bug_38253.phpt
diff -u php-src/ext/pdo/tests/bug_38253.phpt:1.2
php-src/ext/pdo/tests/bug_38253.phpt:1.3
--- php-src/ext/pdo/tests/bug_38253.phpt:1.2 Sun Jul 30 11:20:41 2006
+++ php-src/ext/pdo/tests/bug_38253.phpt Tue Sep 19 15:46:25 2006
@@ -15,7 +15,7 @@
$pdo = PDOTest::factory();
$pdo->exec ("create table test (id integer primary key, n text)");
-$pdo->exec ("INSERT INTO test (n) VALUES ('hi')");
+$pdo->exec ("INSERT INTO test (id, n) VALUES (1, 'hi')");
$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_CLASS);
$stmt = $pdo->prepare ("SELECT * FROM test");
@@ -25,7 +25,7 @@
$pdo = PDOTest::factory();
$pdo->exec ("create table test2 (id integer primary key, n text)");
-$pdo->exec ("INSERT INTO test2 (n) VALUES ('hi')");
+$pdo->exec ("INSERT INTO test2 (id, n) VALUES (1,'hi')");
$pdo->setAttribute (PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_FUNC);
$stmt = $pdo->prepare ("SELECT * FROM test2");
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.38&r2=1.39&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.38
php-src/ext/pdo_pgsql/pgsql_statement.c:1.39
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.38 Tue Aug 1 16:32:30 2006
+++ php-src/ext/pdo_pgsql/pgsql_statement.c Tue Sep 19 15:46:25 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_statement.c,v 1.38 2006/08/01 16:32:30 iliaa Exp $ */
+/* $Id: pgsql_statement.c,v 1.39 2006/09/19 15:46:25 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -55,10 +55,14 @@
char *q = NULL;
PGresult *res;
- spprintf(&q, 0, "DEALLOCATE %s", S->stmt_name);
- res = PQexec(H->server, q);
- efree(q);
- if (res) PQclear(res);
+ if (S->is_prepared) {
+ spprintf(&q, 0, "DEALLOCATE %s", S->stmt_name);
+ res = PQexec(H->server, q);
+ efree(q);
+ if (res) {
+ PQclear(res);
+ }
+ }
efree(S->stmt_name);
S->stmt_name = NULL;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.59&r2=1.60&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.59
php-src/ext/pdo_pgsql/pgsql_driver.c:1.60
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.59 Mon May 8 14:33:23 2006
+++ php-src/ext/pdo_pgsql/pgsql_driver.c Tue Sep 19 15:46:25 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_driver.c,v 1.59 2006/05/08 14:33:23 iliaa Exp $ */
+/* $Id: pgsql_driver.c,v 1.60 2006/09/19 15:46:25 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -414,6 +414,7 @@
res = PQexec(H->server, cmd);
if (PQresultStatus(res) != PGRES_COMMAND_OK) {
+ pdo_pgsql_error(dbh, PQresultStatus(res),
pdo_pgsql_sqlstate(res));
ret = 0;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php