xref: /PHP-8.0/ext/oci8/tests/bug26133.phpt (revision 45475c2e)
1--TEST--
2Bug #26133 (ocifreedesc() segfault)
3--SKIPIF--
4<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
5--FILE--
6<?php
7
8require(__DIR__.'/connect.inc');
9
10// Initialize
11
12$stmtarray = array(
13    "drop table bug26133_tab",
14    "create table bug26133_tab (id number, value number)",
15);
16
17oci8_test_sql_execute($c, $stmtarray);
18
19// Run Test
20
21$ora_sql = "INSERT INTO bug26133_tab (id, value) VALUES (1,'1') RETURNING ROWID INTO :v_rowid ";
22
23$statement = oci_parse($c,$ora_sql);
24$rowid = oci_new_descriptor($c,OCI_D_ROWID);
25oci_bind_by_name($statement,":v_rowid", $rowid,-1,OCI_B_ROWID);
26if (oci_execute($statement)) {
27    oci_commit($c);
28}
29oci_free_statement($statement);
30$rowid->free();
31
32// Cleanup
33
34$stmtarray = array(
35    "drop table bug26133_tab"
36);
37
38oci8_test_sql_execute($c, $stmtarray);
39
40echo "Done\n";
41?>
42--EXPECT--
43Done
44