xref: /PHP-7.1/ext/oci8/tests/bug26133.phpt (revision a2c0f872)
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(dirname(__FILE__).'/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 = OCIParse($c,$ora_sql);
24$rowid = OCINewDescriptor($c,OCI_D_ROWID);
25OCIBindByName($statement,":v_rowid", $rowid,-1,OCI_B_ROWID);
26if (OCIExecute($statement)) {
27    OCICommit($c);
28}
29OCIFreeStatement($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