xref: /PHP-8.0/ext/oci8/tests/lob_036.phpt (revision 26dfce7f)
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(__DIR__.'/skipif.inc');
7?>
8--FILE--
9<?php
10
11require __DIR__.'/connect.inc';
12require __DIR__.'/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 __DIR__.'/drop_table.inc';
35
36echo "Done\n";
37
38?>
39--EXPECT--
40int(4)
41bool(true)
42int(4)
43Done
44