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