Annotation of embedaddon/php/ext/oci8/tests/lob_042.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Check various LOB error messages
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)
16: VALUES (empty_blob())
17: RETURNING
18: blob
19: INTO :v_blob ";
20:
21: $statement = oci_parse($c,$ora_sql);
22: $blob = oci_new_descriptor($c,OCI_D_LOB);
23: oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB);
24: oci_execute($statement, OCI_DEFAULT);
25:
26: var_dump($blob);
27:
28: var_dump($blob->writeTemporary("test", OCI_D_LOB));
29:
30: $str = "string";
31: var_dump($blob->write($str));
32: var_dump($blob->truncate(1));
33: var_dump($blob->truncate(1));
34: var_dump($blob->truncate(2));
35: var_dump($blob->truncate(-1));
36: var_dump($blob->read(2));
37:
38: var_dump($blob->import("does_not_exist"));
39: var_dump($blob->saveFile("does_not_exist"));
40:
41: require(dirname(__FILE__).'/drop_table.inc');
42:
43: echo "Done\n";
44:
45: ?>
46: --EXPECTF--
47: object(OCI-Lob)#%d (1) {
48: ["descriptor"]=>
49: resource(%d) of type (oci8 descriptor)
50: }
51:
52: Warning: OCI-Lob::writetemporary(): Invalid temporary lob type: %d in %s on line %d
53: bool(false)
54: int(6)
55: bool(true)
56: bool(true)
57:
58: Warning: OCI-Lob::truncate(): Size must be less than or equal to the current LOB size in %s on line %d
59: bool(false)
60:
61: Warning: OCI-Lob::truncate(): Length must be greater than or equal to zero in %s on line %d
62: bool(false)
63:
64: Warning: OCI-Lob::read(): Offset must be less than size of the LOB in %s on line %d
65: bool(false)
66:
67: Warning: OCI-Lob::import(): Can't open file %s in %s on line %d
68: bool(false)
69:
70: Warning: OCI-Lob::savefile(): Can't open file %s in %s on line %d
71: bool(false)
72: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>