Browse Source

- MFH: Segfault when an exception is thrown on persistent connections

PECL
Pierre Joye 18 years ago
parent
commit
39ae248465
  1. 2
      NEWS
  2. 2
      ext/pdo_oci/oci_statement.c
  3. 25
      ext/pdo_oci/tests/bug44301.phpt

2
NEWS

@ -232,6 +232,8 @@ PHP NEWS
(Andrey)
- Fixed bug #44336 (Improve pcre UTF-8 string matching performance).
(frode at coretrek dot com, Nuno)
- Fixed bug #44301 (Segfault when an exception is thrown on persistent connections).
(Martin Jansen)
- Fixed bug #44257 (timelib_tz_lookup_table must use float for gmtoffset).
(Derick, iuri dot fiedoruk at hp dot com).
- Fixed bug #44214 (Crash using preg_replace_callback() and global variable).

2
ext/pdo_oci/oci_statement.c

@ -87,7 +87,7 @@ static int oci_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
}
if (S->einfo.errmsg) {
efree(S->einfo.errmsg);
pefree(S->einfo.errmsg, stmt->dbh->is_persistent);
S->einfo.errmsg = NULL;
}

25
ext/pdo_oci/tests/bug44301.phpt

@ -0,0 +1,25 @@
--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)
Loading…
Cancel
Save