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/connect_scope_try4.phpt ('Check oci_new_connect try/catch end-of-scope with old_oci_close_semantics On')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/details.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table scope_try4_tab",
9:     
"create table scope_try4_tab (c1 number)"
10:
);
11:
12: if (!empty(
$dbase))
13:     
$c1 oci_new_connect($user,$password,$dbase);
14: else
15:     
$c1 oci_new_connect($user,$password);
16:                          
17:
oci8_test_sql_execute($c1$stmtarray);
18:
19:
// Run Test
20:
21:
echo "Test 1\n";
22:
23:
// Make errors throw exceptions
24:
25:
set_error_handler(function($x$y) { throw new Exception($y$x); });
26:
27: try
28: {
29:     if (!empty(
$dbase))
30:         
$c oci_new_connect($user,$password,$dbase);
31:     else
32:         
$c oci_new_connect($user,$password);
33:     
$s oci_parse($c"insert into scope_try4_tab values (1)");
34:     
oci_execute($sOCI_DEFAULT);  // no commit
35:     
$s oci_parse($c"insert into scope_try4_tab values (ABC)"); // syntax error -> throws exception
36:     
oci_execute($sOCI_DEFAULT);  // no commit
37:
}
38: catch (
Exception $e)
39: {
40:     echo 
"Caught Exception: "$e->getMessage(), "\n";
41:     
var_dump($c);
42:
43:     
// Verify data is not yet committed
44:     
$s1 oci_parse($c1"select * from scope_try4_tab");
45:     
oci_execute($s1);
46:     
oci_fetch_all($s1$r);
47:     
var_dump($r);
48:
49:     
// Now commit
50:     
oci_commit($c);
51: }
52:
53:
// Verify data was committed in the Catch block
54:
55:
$s1 oci_parse($c1"select * from scope_try4_tab");
56:
oci_execute($s1);
57:
oci_fetch_all($s1$r);
58:
var_dump($r);
59:
60:
// Cleanup
61:
62:
$stmtarray = array(
63:     
"drop table scope_try4_tab"
64:
);
65:
66:
oci8_test_sql_execute($c1$stmtarray);
67:
68: echo 
"Done\n";
69:
70:
?>
71:

Expected

Test 1
Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s
resource(%d) of type (oci8 connection)
array(1) {
  ["C1"]=>
  array(0) {
  }
}
array(1) {
  ["C1"]=>
  array(1) {
    [0]=>
    string(1) "1"
  }
}
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:21:42
  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/connect_scope_try4.php on line 13
    nt secondary err code: 111
    nt OS err code: 0

Warning: oci_parse() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 52

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 54
oci8_test_sql_execute() error:
drop table scope_try4_tab


Warning: oci_parse() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 52

Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 54
oci8_test_sql_execute() error:
create table scope_try4_tab (c1 number)

Test 1


***********************************************************************
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:21:43
  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
Caught Exception: oci_new_connect(): ORA-12541: TNS:no listener    nt secondary err code: 111
    nt OS err code: 0


Fatal error: Uncaught Exception: Undefined variable: c in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect_scope_try4.php:25
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect_scope_try4.php(41): {closure}(8, 'Undefined varia...', '/var/php_gcov/P...', 41, Array)
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect_scope_try4.php on line 25

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:21:42
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+ 
001- Test 1
002- Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s
003- resource(%d) of type (oci8 connection)
004- array(1) {
005-   ["C1"]=>
006-   array(0) {
007-   }
008- }
009- array(1) {
010-   ["C1"]=>
011-   array(1) {
012-     [0]=>
013-     string(1) "1"
014-   }
015- }
016- Done
017+ Warning: oci_new_connect(): ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect_scope_try4.php on line 13
018+     nt secondary err code: 111
019+     nt OS err code: 0
020+ 
021+ Warning: oci_parse() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 52
022+ 
023+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 54
024+ oci8_test_sql_execute() error:
025+ drop table scope_try4_tab
026+ 
027+ 
028+ Warning: oci_parse() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 52
029+ 
030+ Warning: oci_error() expects parameter 1 to be resource, bool given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/details.inc on line 54
031+ oci8_test_sql_execute() error:
032+ create table scope_try4_tab (c1 number)
033+ 
034+ Test 1
035+ 
036+ 
037+ ***********************************************************************
038+ Fatal NI connect error 12541, connecting to:
039+  (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)))
040+ 
041+   VERSION INFORMATION:
042+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
043+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
044+   Time: 17-JUN-2018 05:21:43
045+   Tracing not turned on.
046+   Tns error struct:
047+     ns main err code: 12541
048+     TNS-12541: TNS:no listener
049+     ns secondary err code: 12560
050+     nt main err code: 511
051+     TNS-00511: No listener
052+ Caught Exception: oci_new_connect(): ORA-12541: TNS:no listener    nt secondary err code: 111
053+     nt OS err code: 0
054+ 
055+ 
056+ Fatal error: Uncaught Exception: Undefined variable: c in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect_scope_try4.php:25
057+ Stack trace:
058+ #0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect_scope_try4.php(41): {closure}(8, 'Undefined varia...', '/var/php_gcov/P...', 41, Array)
059+ #1 {main}
060+   thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect_scope_try4.php on line 25

 

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

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