Annotation of embedaddon/php/ext/oci8/tests/oci_execute_segfault.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: oci_execute() segfault after repeated bind of LOB descriptor
3: --SKIPIF--
4: <?php
5: $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
6: require(dirname(__FILE__).'/skipif.inc');
7: ?>
8: --FILE--
9: <?php
10:
11: require dirname(__FILE__).'/connect.inc';
12: require dirname(__FILE__).'/create_table.inc';
13:
14: $ora_sql = "INSERT INTO
15: ".$schema.$table_name." (blob, clob)
16: VALUES (empty_blob(), empty_clob())
17: RETURNING
18: blob
19: INTO :v_blob ";
20:
21: $s = oci_parse($c, $ora_sql);
22: $blob = oci_new_descriptor($c, OCI_D_LOB);
23: oci_bind_by_name($s, ":v_blob", $blob, -1, OCI_B_BLOB);
24: oci_execute($s, OCI_DEFAULT);
25: var_dump($blob->save("some binary data"));
26:
27: oci_bind_by_name($s, ":v_blob", $blob, -1, OCI_B_BLOB);
28: oci_execute($s, OCI_DEFAULT);
29: var_dump($blob->save("some more binary data"));
30:
31: $query = 'SELECT blob, DBMS_LOB.GETLENGTH(blob) FROM '.$schema.$table_name.' ORDER BY 2';
32:
33: $s = oci_parse ($c, $query);
34: oci_execute($s, OCI_DEFAULT);
35:
36: while ($arr = oci_fetch_assoc($s)) {
37: $result = $arr['BLOB']->load();
38: var_dump($result);
39: }
40:
41: require dirname(__FILE__).'/drop_table.inc';
42:
43: echo "Done\n";
44:
45: ?>
46: --EXPECT--
47: bool(true)
48: bool(true)
49: string(16) "some binary data"
50: string(21) "some more binary data"
51: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>