xref: /PHP-5.6/ext/pdo_oci/tests/bug44301.phpt (revision 39ae2484)
1--TEST--
2PDO OCI Bug #44301 (Segfault when an exception is thrown on persistent connections)
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
6require dirname(__FILE__).'/../../pdo/tests/pdo_test.inc';
7PDOTest::skip();
8?>
9--FILE--
10<?php
11putenv("PDO_OCI_TEST_ATTR=" . serialize(array(PDO::ATTR_PERSISTENT => true)));
12require 'ext/pdo/tests/pdo_test.inc';
13$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt');
14$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
15
16try {
17    $stmt = $db->prepare('SELECT * FROM no_table');
18    $stmt->execute();
19} catch (PDOException $e) {
20    print $e->getMessage();
21}
22$db = null;
23--EXPECTF--
24SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view does not exist
25 (%s/ext/pdo_oci/oci_statement.c:%d)
26