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