xref: /PHP-7.2/ext/pdo_oci/tests/bug44301.phpt (revision 268a3332)
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%epdo_oci%eoci_statement.c:%d)
26