xref: /PHP-8.3/ext/oci8/tests/bug36010.phpt (revision a53e5617)
1--TEST--
2Bug #36010 (Crash when executing SQL statement with lob parameter twice)
3--EXTENSIONS--
4oci8
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
9require __DIR__.'/skipif.inc';
10?>
11--FILE--
12<?php
13
14require __DIR__.'/connect.inc';
15
16function f($conn)
17{
18    $sql =  "begin :p_clob := 'lob string'; end;";
19    $stid = oci_parse($conn, $sql);
20    $clob = oci_new_descriptor($conn, OCI_D_LOB);
21    oci_bind_by_name($stid, ":p_clob", $clob, -1, OCI_B_CLOB);
22    $r = oci_execute($stid, OCI_DEFAULT);
23}
24
25f($c);
26f($c);
27
28echo "Done\n";
29
30?>
31--EXPECT--
32Done
33