PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/oci8/tests/error_parse.phpt ('Test error handling when persistent connection is passed to oci_error()')

Script

1: <?php
2:
3:
// As part of the fix for Bug 42134, an error handling difference was
4: // noticed when oci_error() was passed a persistent connection.  This
5: // was fixed and the behavior of oci_error() for all connections types
6: // was made consistent.
7:
8:
require(dirname(__FILE__).'/details.inc');
9:
10:
// Test parse error for normal connection
11:
12:
if (!empty($dbase)) {
13:     
$c1 oci_connect($user,$password,$dbase);
14: }
15: else {
16:     
$c1 oci_connect($user,$password);
17: }
18:
19:
$s = @oci_parse($c1"select ' from dual");
20: if (!
$s) {
21:     echo 
"Normal connection: Parse error\n";
22:     
$m oci_error($c1);
23:     
var_dump($m);
24: }
25:
26:
// Test parse error for new connection
27:
28:
if (!empty($dbase)) {
29:     
$c2 oci_new_connect($user,$password,$dbase);
30: }
31: else {
32:     
$c2 oci_new_connect($user,$password);
33: }
34:
35:
$s = @oci_parse($c2"select ' from dual");
36: if (!
$s) {
37:     echo 
"New connection: Parse error\n";
38:     
$m oci_error($c2);
39:     
var_dump($m);
40: }
41:
42:
// Test parse error for persistent connection
43:
44:
if (!empty($dbase)) {
45:     
$c3 oci_pconnect($user,$password,$dbase);
46: }
47: else {
48:     
$c3 oci_pconnect($user,$password);
49: }
50:
51:
$s = @oci_parse($c3"select ' from dual");
52: if (!
$s) {
53:     echo 
"Persistent connection: Parse error\n";
54:     
$m oci_error($c3);
55:     
var_dump($m);
56: }
57:
58:
// Verify that passing no connection doesn't affect future calls
59:
60:
$m oci_error();
61: echo 
"No connection: error: ";
62:
var_dump($m);
63:
64:
// Check the errors are still accessible in the respective handles
65:
66:
$m oci_error($c1);
67: echo 
"Normal connection (take #2): Parse error: ";
68: echo 
$m["message"], "\n";
69:
70:
$m oci_error($c2);
71: echo 
"New connection (take #2): Parse error: ";
72: echo 
$m["message"], "\n";
73:
74:
$m oci_error($c3);
75: echo 
"Persistent connection (take #2): Parse error: ";
76: echo 
$m["message"], "\n";
77:
78:
// Now create a new error for a normal connection and check all again
79:
80:
$s = @oci_new_collection($c1"ABC");
81:
$m oci_error($c1);
82: echo 
"Normal connection: New Collection error: ";
83: echo 
$m["message"], "\n";
84:
85:
$m oci_error($c2);
86: echo 
"New connection (take #3): Parse error: ";
87: echo 
$m["message"], "\n";
88:
89:
$m oci_error($c3);
90: echo 
"Persistent connection (take #3): Parse error: ";
91: echo 
$m["message"], "\n";
92:
93: echo 
"Done\n";
94:
95:
?>
96:

Expected

Normal connection: Parse error
array(4) {
  ["code"]=>
  int(1756)
  ["message"]=>
  string(48) "ORA-01756: %s"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}
New connection: Parse error
array(4) {
  ["code"]=>
  int(1756)
  ["message"]=>
  string(48) "ORA-01756: %s"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}
Persistent connection: Parse error
array(4) {
  ["code"]=>
  int(1756)
  ["message"]=>
  string(48) "ORA-01756: %s"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}
No connection: error: bool(false)
Normal connection (take #2): Parse error: ORA-01756: %s
New connection (take #2): Parse error: ORA-01756: %s
Persistent connection (take #2): Parse error: ORA-01756: %s
Normal connection: New Collection error: OCI-22303: type ""."ABC" not found
New connection (take #3): Parse error: ORA-01756: %s
Persistent connection (take #3): Parse error: ORA-01756: %s
Done

Output

***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 05:35:44
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Warning: oci_connect(): ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 13
    nt secondary err code: 111
    nt OS err code: 0
Normal connection: Parse error

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 22
NULL


***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 05:35:45
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Warning: oci_new_connect(): ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 29
    nt secondary err code: 111
    nt OS err code: 0
New connection: Parse error

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 38
NULL


***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 05:35:45
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Warning: oci_pconnect(): ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 45
    nt secondary err code: 111
    nt OS err code: 0
Persistent connection: Parse error

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 54
NULL
No connection: error: array(4) {
  ["code"]=>
  int(12541)
  ["message"]=>
  string(26) "ORA-12541: TNS:no listener"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 66
Normal connection (take #2): Parse error: 

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 70
New connection (take #2): Parse error: 

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 74
Persistent connection (take #2): Parse error: 

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 81
Normal connection: New Collection error: 

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 85
New connection (take #3): Parse error: 

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 89
Persistent connection (take #3): Parse error: 
Done

Diff

001+ ***********************************************************************
002+ Fatal NI connect error 12541, connecting to:
003+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
004+ 
005+   VERSION INFORMATION:
006+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
007+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
008+   Time: 17-JUN-2018 05:35:44
009+   Tracing not turned on.
010+   Tns error struct:
011+     ns main err code: 12541
012+     TNS-12541: TNS:no listener
013+     ns secondary err code: 12560
014+     nt main err code: 511
015+     TNS-00511: No listener
016+ 
017+ Warning: oci_connect(): ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 13
018+     nt secondary err code: 111
019+     nt OS err code: 0
020+ Normal connection: Parse error
021+ 
022+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 22
023+ NULL
024+ 
025+ 
026+ ***********************************************************************
027+ Fatal NI connect error 12541, connecting to:
028+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
029+ 
030+   VERSION INFORMATION:
031+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
032+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
033+   Time: 17-JUN-2018 05:35:45
034+   Tracing not turned on.
035+   Tns error struct:
036+     ns main err code: 12541
037+     TNS-12541: TNS:no listener
038+     ns secondary err code: 12560
039+     nt main err code: 511
040+     TNS-00511: No listener
041+ 
001- Normal connection: Parse error
002- array(4) {
003-   ["code"]=>
004-   int(1756)
005-   ["message"]=>
006-   string(48) "ORA-01756: %s"
007-   ["offset"]=>
008-   int(0)
009-   ["sqltext"]=>
010-   string(0) ""
011- }
012- New connection: Parse error
013- array(4) {
014-   ["code"]=>
015-   int(1756)
016-   ["message"]=>
017-   string(48) "ORA-01756: %s"
018-   ["offset"]=>
019-   int(0)
020-   ["sqltext"]=>
021-   string(0) ""
022- }
023- Persistent connection: Parse error
024- array(4) {
025-   ["code"]=>
026-   int(1756)
027-   ["message"]=>
028-   string(48) "ORA-01756: %s"
029-   ["offset"]=>
030-   int(0)
031-   ["sqltext"]=>
032-   string(0) ""
033- }
034- No connection: error: bool(false)
035- Normal connection (take #2): Parse error: ORA-01756: %s
036- New connection (take #2): Parse error: ORA-01756: %s
037- Persistent connection (take #2): Parse error: ORA-01756: %s
038- Normal connection: New Collection error: OCI-22303: type ""."ABC" not found
039- New connection (take #3): Parse error: ORA-01756: %s
040- Persistent connection (take #3): Parse error: ORA-01756: %s
041- Done
042+ Warning: oci_new_connect(): ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 29
043+     nt secondary err code: 111
044+     nt OS err code: 0
045+ New connection: Parse error
046+ 
047+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 38
048+ NULL
049+ 
050+ 
051+ ***********************************************************************
052+ Fatal NI connect error 12541, connecting to:
053+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
054+ 
055+   VERSION INFORMATION:
056+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
057+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
058+   Time: 17-JUN-2018 05:35:45
059+   Tracing not turned on.
060+   Tns error struct:
061+     ns main err code: 12541
062+     TNS-12541: TNS:no listener
063+     ns secondary err code: 12560
064+     nt main err code: 511
065+     TNS-00511: No listener
066+ 
067+ Warning: oci_pconnect(): ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 45
068+     nt secondary err code: 111
069+     nt OS err code: 0
070+ Persistent connection: Parse error
071+ 
072+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 54
073+ NULL
074+ No connection: error: array(4) {
075+   ["code"]=>
076+   int(12541)
077+   ["message"]=>
078+   string(26) "ORA-12541: TNS:no listener"
079+   ["offset"]=>
080+   int(0)
081+   ["sqltext"]=>
082+   string(0) ""
083+ }
084+ 
085+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 66
086+ Normal connection (take #2): Parse error: 
087+ 
088+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 70
089+ New connection (take #2): Parse error: 
090+ 
091+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 74
092+ Persistent connection (take #2): Parse error: 
093+ 
094+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 81
095+ Normal connection: New Collection error: 
096+ 
097+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 85
098+ New connection (take #3): Parse error: 
099+ 
100+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/error_parse.php on line 89
101+ Persistent connection (take #3): Parse error: 
102+ Done

 

Generated at Mon, 18 Jun 2018 17:33:50 +0000 (24 hours ago)

Copyright © 2005-2018 The PHP Group
All rights reserved.