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/bind_boolean_1.phpt ('Basic PL/SQL "BOOLEAN" (SQLT_BOL) bind test')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Run Test
6:
7:
echo "Test 1\n";
8:
9:
$sql "begin
10:         :output1 := true;
11:         :output2 := false;
12:        end;"
;
13:
14:
$s oci_parse($c$sql);
15:
oci_bind_by_name($s':output1'$output1, -1OCI_B_BOL);
16:
oci_bind_by_name($s':output2'$output2, -1OCI_B_BOL);
17:
oci_execute($s);
18:
var_dump($output1);
19:
var_dump($output2);
20:
21: echo 
"Test 2\n";
22:
23:
$b "abc";  // bind var type will change
24:
$sql "begin :b := true; end;";
25:
$s oci_parse($c$sql);
26:
oci_bind_by_name($s':b'$b, -1OCI_B_BOL);
27:
oci_execute($s);
28:
var_dump($b);
29:
30:
31: echo 
"Test 3\n";
32:
33:
$sql 
34:     
"begin
35:     if (:input < 10) then
36:         :output := true;
37:     else
38:         :output := false;
39:     end if;
40: end;"
;
41:
$s oci_parse($c$sql);
42:
oci_bind_by_name($s':output'$output, -1OCI_B_BOL);
43: for (
$input 5$input 15; ++$input) {
44:     
oci_bind_by_name($s':input'$input);
45:     
oci_execute($s);
46:     
var_dump($output);
47: }
48:
49: echo 
"Test 4\n";
50:
51:
$sql 
52:
"begin
53:   if (mod(:userid,2) = 0) then
54:     :b := true;
55:   else
56:     :b := false;
57:   end if;
58: end;"
;
59:
$s oci_parse($c$sql);
60:
oci_bind_by_name($s':b'$b, -1OCI_B_BOL);
61: for (
$userid 1$userid <= 10; ++$userid) {
62:     
oci_bind_by_name($s':userid'$userid, -1SQLT_INT);
63:     
oci_execute($s);
64:     
var_dump($b);
65: }
66:
67: echo 
"Test 5\n";
68:
69:
$sql 
70:
"declare
71:   l boolean;
72: begin
73:   l := :b1;
74:   :b1 := :b2;
75:   :b2 := l;
76: end;"
;
77:
$s oci_parse($c$sql);
78:
$b1 true;
79:
$b2 false;
80:
var_dump($b1$b2);
81:
oci_bind_by_name($s':b1'$b1, -1OCI_B_BOL);
82:
oci_bind_by_name($s':b2'$b2, -1OCI_B_BOL);
83:
oci_execute($s);
84:
var_dump($b1$b2);
85:
86:
?>
87:
===DONE===
88:

Expected

Test 1
bool(true)
bool(false)
Test 2
bool(true)
Test 3
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
Test 4
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
Test 5
bool(true)
bool(false)
bool(false)
bool(true)
===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 04:50:57
  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

Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
    nt secondary err code: 111
    nt OS err code: 0

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 04:50:57
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+ Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
018+     nt secondary err code: 111
019+     nt OS err code: 0
001- Test 1
002- bool(true)
003- bool(false)
004- Test 2
005- bool(true)
006- Test 3
007- bool(true)
008- bool(true)
009- bool(true)
010- bool(true)
011- bool(true)
012- bool(false)
013- bool(false)
014- bool(false)
015- bool(false)
016- bool(false)
017- Test 4
018- bool(false)
019- bool(true)
020- bool(false)
021- bool(true)
022- bool(false)
023- bool(true)
024- bool(false)
025- bool(true)
026- bool(false)
027- bool(true)
028- Test 5
029- bool(true)
030- bool(false)
031- bool(false)
032- bool(true)
033- ===DONE===

 

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

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