File: bug42134.phpt

package info (click to toggle)
php5 5.3.3-7%2Bsqueeze17
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 122,824 kB
  • ctags: 55,742
  • sloc: ansic: 633,963; php: 19,620; sh: 11,344; xml: 5,816; cpp: 2,400; yacc: 1,745; exp: 1,514; makefile: 1,019; pascal: 623; awk: 537; sql: 22
file content (100 lines) | stat: -rw-r--r-- 2,084 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
--TEST--
Bug #42134 (Collection error for invalid collection name)
--SKIPIF--
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--FILE--
<?php

require(dirname(__FILE__).'/details.inc');

// Test collection creation error for normal connection

if (!empty($dbase)) {
	$c = oci_connect($user,$password,$dbase);
}
else {
	$c = oci_connect($user,$password);
}

$collection = oci_new_collection($c, "ABC");
if (!$collection) {
	echo "Normal connection: New Collection error\n";
	$m = oci_error($c);
	var_dump($m);
}

// Test collection creation error for new connection

if (!empty($dbase)) {
	$c = oci_new_connect($user,$password,$dbase);
}
else {
	$c = oci_new_connect($user,$password);
}

$collection = oci_new_collection($c, "DEF");
if (!$collection) {
	echo "New connection: New Collection error\n";
	$m = oci_error($c);
	var_dump($m);
}

// Test collection creation error for persistent connection

if (!empty($dbase)) {
	$c = oci_pconnect($user,$password,$dbase);
}
else {
	$c = oci_pconnect($user,$password);
}

$collection = oci_new_collection($c, "GHI");
if (!$collection) {
	echo "Persistent connection: New Collection error\n";
	$m = oci_error($c);
	var_dump($m);
}

echo "Done\n";

?>
--EXPECTF--
Warning: oci_new_collection(): OCI-22303: type ""."ABC" not found in %s on line %d
Normal connection: New Collection error
array(4) {
  ["code"]=>
  int(22303)
  ["message"]=>
  string(34) "OCI-22303: type ""."ABC" not found"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}

Warning: oci_new_collection(): OCI-22303: type ""."DEF" not found in %s on line %d
New connection: New Collection error
array(4) {
  ["code"]=>
  int(22303)
  ["message"]=>
  string(34) "OCI-22303: type ""."DEF" not found"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}

Warning: oci_new_collection(): OCI-22303: type ""."GHI" not found in %s on line %d
Persistent connection: New Collection error
array(4) {
  ["code"]=>
  int(22303)
  ["message"]=>
  string(34) "OCI-22303: type ""."GHI" not found"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}
Done