xref: /PHP-7.0/ext/oci8/tests/lob_036.phpt (revision c7a8bd6a)
1--TEST--
2Exercise cleanup code when LOB buffering is on
3--SKIPIF--
4<?php
5$target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
6require(dirname(__FILE__).'/skipif.inc');
7?>
8--FILE--
9<?php
10
11require dirname(__FILE__).'/connect.inc';
12require dirname(__FILE__).'/create_table.inc';
13
14$ora_sql = "INSERT INTO
15                       ".$schema.$table_name." (blob)
16                      VALUES (empty_blob())
17                      RETURNING
18                               blob
19                      INTO :v_blob ";
20
21$s = oci_parse($c,$ora_sql);
22$blob = oci_new_descriptor($c,OCI_DTYPE_LOB);
23
24
25oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB);
26oci_execute($s, OCI_DEFAULT);
27
28var_dump($blob->write("test"));
29var_dump($blob->setBuffering(true));
30var_dump($blob->write("test"));
31
32$blob = null;
33
34require dirname(__FILE__).'/drop_table.inc';
35
36echo "Done\n";
37
38?>
39--EXPECT--
40int(4)
41bool(true)
42int(4)
43Done
44