mbeccati                Tue May 12 21:57:42 2009 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/pdo_oci/tests  bug44301.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/pdo_oci        oci_driver.c oci_statement.c 
  Log:
  MFH
  - Backported fix for #44301
  - Fixed bug #48070
  # The backport was required to also fix #48070
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1499&r2=1.2027.2.547.2.1500&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1499 php-src/NEWS:1.2027.2.547.2.1500
--- php-src/NEWS:1.2027.2.547.2.1499    Tue May 12 12:35:45 2009
+++ php-src/NEWS        Tue May 12 21:57:40 2009
@@ -23,6 +23,8 @@
   bindto). (Ilia)
 - Fixed bug #48132 (configure check for curl ssl support fails with
   --disable-rpath). (Jani)
+- Fixed bug #48070 (PDO_OCI: Segfault when using persistent connection).
+  (Pierre, Matteo)
 - Fixed bug #48058 (Year formatter goes wrong with out-of-int range). (Derick)
 - Fixed bug #48038 (odbc_execute changes variables used to form params array).
   (Felipe)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/oci_driver.c?r1=1.24.2.4.2.11&r2=1.24.2.4.2.12&diff_format=u
Index: php-src/ext/pdo_oci/oci_driver.c
diff -u php-src/ext/pdo_oci/oci_driver.c:1.24.2.4.2.11 
php-src/ext/pdo_oci/oci_driver.c:1.24.2.4.2.12
--- php-src/ext/pdo_oci/oci_driver.c:1.24.2.4.2.11      Wed Dec 31 11:17:42 2008
+++ php-src/ext/pdo_oci/oci_driver.c    Tue May 12 21:57:40 2009
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: oci_driver.c,v 1.24.2.4.2.11 2008/12/31 11:17:42 sebastian Exp $ */
+/* $Id: oci_driver.c,v 1.24.2.4.2.12 2009/05/12 21:57:40 mbeccati Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -70,15 +70,13 @@
                S = (pdo_oci_stmt*)stmt->driver_data;
                einfo = &S->einfo;
                pdo_err = &stmt->error_code;
-               if (einfo->errmsg) {
-                       efree(einfo->errmsg);
-               }
        }
        else {
                einfo = &H->einfo;
-               if (einfo->errmsg) {
-                       pefree(einfo->errmsg, dbh->is_persistent);
-               }
+       }
+
+       if (einfo->errmsg) {
+               pefree(einfo->errmsg, dbh->is_persistent);
        }
 
        einfo->errmsg = NULL;
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/oci_statement.c?r1=1.16.2.10.2.9&r2=1.16.2.10.2.10&diff_format=u
Index: php-src/ext/pdo_oci/oci_statement.c
diff -u php-src/ext/pdo_oci/oci_statement.c:1.16.2.10.2.9 
php-src/ext/pdo_oci/oci_statement.c:1.16.2.10.2.10
--- php-src/ext/pdo_oci/oci_statement.c:1.16.2.10.2.9   Wed Dec 31 11:17:42 2008
+++ php-src/ext/pdo_oci/oci_statement.c Tue May 12 21:57:41 2009
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: oci_statement.c,v 1.16.2.10.2.9 2008/12/31 11:17:42 sebastian Exp $ */
+/* $Id: oci_statement.c,v 1.16.2.10.2.10 2009/05/12 21:57:41 mbeccati Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -87,7 +87,7 @@
        }
 
        if (S->einfo.errmsg) {
-               efree(S->einfo.errmsg);
+               pefree(S->einfo.errmsg, stmt->dbh->is_persistent);
                S->einfo.errmsg = NULL;
        }
 

http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/tests/bug44301.phpt?view=markup&rev=1.1
Index: php-src/ext/pdo_oci/tests/bug44301.phpt
+++ php-src/ext/pdo_oci/tests/bug44301.phpt
--TEST--
PDO OCI Bug #44301 (Segfault when an exception is thrown on persistent 
connections)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not 
loaded');
require dirname(__FILE__).'/../../pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
putenv("PDO_OCI_TEST_ATTR=" . serialize(array(PDO::ATTR_PERSISTENT => true)));
require 'ext/pdo/tests/pdo_test.inc';
$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

try {
    $stmt = $db->prepare('SELECT * FROM no_table');
    $stmt->execute();
} catch (PDOException $e) {
    print $e->getMessage();
}
$db = null;
--EXPECTF--
SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view 
does not exist
 (%s/ext/pdo_oci/oci_statement.c:%d)



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

Reply via email to