iliaa           Tue Sep 19 15:45:22 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/pdo/tests      bug_38253.phpt 
    /php-src/ext/pdo_pgsql      pgsql_statement.c pgsql_driver.c 
    /php-src    NEWS 
  Log:
  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.1.2.1&r2=1.1.2.2&diff_format=u
Index: php-src/ext/pdo/tests/bug_38253.phpt
diff -u php-src/ext/pdo/tests/bug_38253.phpt:1.1.2.1 
php-src/ext/pdo/tests/bug_38253.phpt:1.1.2.2
--- php-src/ext/pdo/tests/bug_38253.phpt:1.1.2.1        Sun Jul 30 11:19:56 2006
+++ php-src/ext/pdo/tests/bug_38253.phpt        Tue Sep 19 15:45:21 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.31.2.12.2.2&r2=1.31.2.12.2.3&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.2 
php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.3
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.2       Tue Aug  1 
16:31:29 2006
+++ php-src/ext/pdo_pgsql/pgsql_statement.c     Tue Sep 19 15:45:21 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pgsql_statement.c,v 1.31.2.12.2.2 2006/08/01 16:31:29 iliaa Exp $ */
+/* $Id: pgsql_statement.c,v 1.31.2.12.2.3 2006/09/19 15:45:21 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -60,10 +60,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.53.2.14.2.1&r2=1.53.2.14.2.2&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.1 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.2
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.1  Mon May  8 14:33:00 2006
+++ php-src/ext/pdo_pgsql/pgsql_driver.c        Tue Sep 19 15:45:21 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pgsql_driver.c,v 1.53.2.14.2.1 2006/05/08 14:33:00 iliaa Exp $ */
+/* $Id: pgsql_driver.c,v 1.53.2.14.2.2 2006/09/19 15:45:21 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -472,6 +472,7 @@
        res = PQexec(H->server, cmd);
 
        if (PQresultStatus(res) != PGRES_COMMAND_OK) {
+               pdo_pgsql_error(dbh, PQresultStatus(res), 
pdo_pgsql_sqlstate(res));
                ret = 0;
        }
 
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.256&r2=1.2027.2.547.2.257&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.256 php-src/NEWS:1.2027.2.547.2.257
--- php-src/NEWS:1.2027.2.547.2.256     Tue Sep 19 09:04:15 2006
+++ php-src/NEWS        Tue Sep 19 15:45:22 2006
@@ -5,6 +5,10 @@
   (Tony)
 - Fixed bug #38574 (missing curl constants and improper constant detection).
   (Ilia)
+- Fixed bug #37870 (pgo_pgsql tries to de-allocate unused statements).
+  (Ilia, ce at netage dot bg)
+- Fixed bug #36681 (pdo_pgsql driver incorrectly ignored some errors). (Wez,
+  Ilia)
 - Fixed bug #34066 (recursive array_walk causes segfault). (Tony)
 
 14 Sep 2006, PHP 5.2.0RC4

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to