pajoye          Tue Jul 22 06:48:09 2008 UTC

  Added files:                 
    /php-src/ext/pdo_oci/tests  bug44301.phpt 

  Modified files:              
    /php-src/ext/pdo_oci        oci_statement.c 
  Log:
  - Segfault when an exception is thrown on persistent connections
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_oci/oci_statement.c?r1=1.26&r2=1.27&diff_format=u
Index: php-src/ext/pdo_oci/oci_statement.c
diff -u php-src/ext/pdo_oci/oci_statement.c:1.26 
php-src/ext/pdo_oci/oci_statement.c:1.27
--- php-src/ext/pdo_oci/oci_statement.c:1.26    Mon Jul 21 17:17:58 2008
+++ php-src/ext/pdo_oci/oci_statement.c Tue Jul 22 06:48:09 2008
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: oci_statement.c,v 1.26 2008/07/21 17:17:58 pajoye Exp $ */
+/* $Id: oci_statement.c,v 1.27 2008/07/22 06:48:09 pajoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -86,7 +86,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