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_char_1.phpt ('SELECT oci_bind_by_name with SQLT_AFC aka CHAR')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table bind_char_tab",
9:     
"create table bind_char_tab (id number, c1 char(10), c2 varchar2(10))",
10:     
"insert into bind_char_tab values (1, 'abc', NULL)",
11:     
"insert into bind_char_tab values (2, NULL, 'abc')",
12:     
"insert into bind_char_tab values (3, NULL, 'abc       ')"
13:
);
14:                          
15:
oci8_test_sql_execute($c$stmtarray);
16:
17:
// Run Test
18:
19:
echo "*** Non-null Data Tests against CHAR***\n";
20:
21:
$bv1 'abc';
22:
23: echo 
"Test 1.1: Type: default.  Length: default\n";
24:
$s oci_parse($c"select * from bind_char_tab where c1 = :bv");
25:
$r oci_bind_by_name($s":bv"$bv1);
26: if (
$r)
27:     
do_e_q($s);
28:
29: echo 
"Test 1.2: Type: AFC.  Length: default\n";
30:
$r oci_bind_by_name($s":bv"$bv1, -1SQLT_AFC);
31: if (
$r)
32:     
do_e_q($s);
33:
34: echo 
"Test 1.3: Type: AFC:  Length: 0\n";
35:
$r oci_bind_by_name($s":bv"$bv10SQLT_AFC);
36: if (
$r)
37:     
do_e_q($s);
38:
39: echo 
"Test 1.4: Type: AFC:  Length: strlen\n";
40:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1), SQLT_AFC);
41: if (
$r)
42:     
do_e_q($s);
43:
44: echo 
"Test 1.5: Type: AFC.  Length: strlen-1\n";
45:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)-1SQLT_AFC);
46: if (
$r)
47:     
do_e_q($s);
48:
49: echo 
"Test 1.6: Type: AFC.  Length: strlen+1\n";
50:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)+1SQLT_AFC);
51: if (
$r)
52:     
do_e_q($s);
53:
54: echo 
"\n\n*** NULL data tests against CHAR ***\n";
55:
56:
$bv1 null;
57:
58: echo 
"Test 2.1: Type: default.  Length: default\n";
59:
$s oci_parse($c"select * from bind_char_tab where c1 = :bv");
60:
$r oci_bind_by_name($s":bv"$bv1);
61: if (
$r)
62:     
do_e_q($s);
63:
64: echo 
"Test 2.2: Type: AFC.  Length: default\n";
65:
$r oci_bind_by_name($s":bv"$bv1, -1SQLT_AFC);
66: if (
$r)
67:     
do_e_q($s);
68:
69: echo 
"Test 2.3: Type: AFC:  Length: 0\n";
70:
$r oci_bind_by_name($s":bv"$bv10SQLT_AFC);
71: if (
$r)
72:     
do_e_q($s);
73:
74: echo 
"Test 2.4: Type: AFC:  Length: strlen\n";
75:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1), SQLT_AFC);
76: if (
$r)
77:     
do_e_q($s);
78:
79: echo 
"Test 2.5: Type: AFC.  Length: strlen-1\n";
80:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)-1SQLT_AFC);
81: if (
$r)
82:     
do_e_q($s);
83:
84: echo 
"Test 2.6: Type: AFC.  Length: strlen+1\n";
85:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)+1SQLT_AFC);
86: if (
$r)
87:     
do_e_q($s);
88:
89:
90: echo 
"\n\n*** Non-null Data Tests against VARCHAR2***\n";
91:
92:
$bv1 'abc';
93:
94: echo 
"Test 3.1: Type: default.  Length: default\n";
95:
$s oci_parse($c"select * from bind_char_tab where c2 = :bv");
96:
$r oci_bind_by_name($s":bv"$bv1);
97: if (
$r)
98:     
do_e_q($s);
99:
100: echo 
"Test 3.2: Type: AFC.  Length: default\n";
101:
$r oci_bind_by_name($s":bv"$bv1, -1SQLT_AFC);
102: if (
$r)
103:     
do_e_q($s);
104:
105: echo 
"Test 3.3: Type: AFC:  Length: 0\n";
106:
$r oci_bind_by_name($s":bv"$bv10SQLT_AFC);
107: if (
$r)
108:     
do_e_q($s);
109:
110: echo 
"Test 3.4: Type: AFC:  Length: strlen\n";
111:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1), SQLT_AFC);
112: if (
$r)
113:     
do_e_q($s);
114:
115: echo 
"Test 3.5: Type: AFC.  Length: strlen-1\n";
116:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)-1SQLT_AFC);
117: if (
$r)
118:     
do_e_q($s);
119:
120: echo 
"Test 3.6: Type: AFC.  Length: strlen+1\n";
121:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)+1SQLT_AFC);
122: if (
$r)
123:     
do_e_q($s);
124:
125:
126: echo 
"\n\n*** NULL data tests against VARCHAR2 ***\n";
127:
128:
$bv1 null;
129:
130: echo 
"Test 4.1: Type: default.  Length: default\n";
131:
$s oci_parse($c"select * from bind_char_tab where c2 = :bv");
132:
$r oci_bind_by_name($s":bv"$bv1);
133: if (
$r)
134:     
do_e_q($s);
135:
136: echo 
"Test 4.2: Type: AFC.  Length: default\n";
137:
$r oci_bind_by_name($s":bv"$bv1, -1SQLT_AFC);
138: if (
$r)
139:     
do_e_q($s);
140:
141: echo 
"Test 4.3: Type: AFC:  Length: 0\n";
142:
$r oci_bind_by_name($s":bv"$bv10SQLT_AFC);
143: if (
$r)
144:     
do_e_q($s);
145:
146: echo 
"Test 4.4: Type: AFC:  Length: strlen\n";
147:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1), SQLT_AFC);
148: if (
$r)
149:     
do_e_q($s);
150:
151: echo 
"Test 4.5: Type: AFC.  Length: strlen-1\n";
152:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)-1SQLT_AFC);
153: if (
$r)
154:     
do_e_q($s);
155:
156: echo 
"Test 4.6: Type: AFC.  Length: strlen+1\n";
157:
$r oci_bind_by_name($s":bv"$bv1strlen($bv1)+1SQLT_AFC);
158: if (
$r)
159:     
do_e_q($s);
160:
161:
162:
163: function 
do_e_q($s)
164: {
165:     echo 
"  Querying:\n";
166:
167:     
$r = @oci_execute($s);
168:     if (!
$r) {
169:         
$m oci_error($s);
170:         echo 
"    Oci_execute error ORA-".$m['code']." Exiting Query\n";
171:         return;
172:     }
173:     while (
$row oci_fetch_array($sOCI_ASSOC+OCI_RETURN_NULLS)) {
174:         foreach (
$row as $item) {
175:             echo 
"    :" $item ":\n";
176:         }
177:     }
178: }
179:
180:
// Cleanup
181:
$stmtarray = array(
182:     
"drop table bind_char_tab"
183:
);
184:                          
185:
oci8_test_sql_execute($c$stmtarray);
186:
187: echo 
"Done\n";
188:
189:
?>
190:

Expected

*** Non-null Data Tests against CHAR***
Test 1.1: Type: default.  Length: default
  Querying:
Test 1.2: Type: AFC.  Length: default
  Querying:
    :1:
    :abc       :
    ::
Test 1.3: Type: AFC:  Length: 0
  Querying:
    :1:
    :abc       :
    ::
Test 1.4: Type: AFC:  Length: strlen
  Querying:
    :1:
    :abc       :
    ::
Test 1.5: Type: AFC.  Length: strlen-1
  Querying:
Test 1.6: Type: AFC.  Length: strlen+1
  Querying:
    :1:
    :abc       :
    ::


*** NULL data tests against CHAR ***
Test 2.1: Type: default.  Length: default
  Querying:
Test 2.2: Type: AFC.  Length: default
  Querying:
Test 2.3: Type: AFC:  Length: 0
  Querying:
Test 2.4: Type: AFC:  Length: strlen
  Querying:
Test 2.5: Type: AFC.  Length: strlen-1
  Querying:
Test 2.6: Type: AFC.  Length: strlen+1
  Querying:


*** Non-null Data Tests against VARCHAR2***
Test 3.1: Type: default.  Length: default
  Querying:
    :2:
    ::
    :abc:
Test 3.2: Type: AFC.  Length: default
  Querying:
    :2:
    ::
    :abc:
Test 3.3: Type: AFC:  Length: 0
  Querying:
    :2:
    ::
    :abc:
Test 3.4: Type: AFC:  Length: strlen
  Querying:
    :2:
    ::
    :abc:
Test 3.5: Type: AFC.  Length: strlen-1
  Querying:
Test 3.6: Type: AFC.  Length: strlen+1
  Querying:
    :2:
    ::
    :abc:


*** NULL data tests against VARCHAR2 ***
Test 4.1: Type: default.  Length: default
  Querying:
Test 4.2: Type: AFC.  Length: default
  Querying:
Test 4.3: Type: AFC:  Length: 0
  Querying:
Test 4.4: Type: AFC:  Length: strlen
  Querying:
Test 4.5: Type: AFC.  Length: strlen-1
  Querying:
Test 4.6: Type: AFC.  Length: strlen+1
  Querying:
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:51:12
  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:51:12
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- *** Non-null Data Tests against CHAR***
002- Test 1.1: Type: default.  Length: default
003-   Querying:
004- Test 1.2: Type: AFC.  Length: default
005-   Querying:
006-     :1:
007-     :abc       :
008-     ::
009- Test 1.3: Type: AFC:  Length: 0
010-   Querying:
011-     :1:
012-     :abc       :
013-     ::
014- Test 1.4: Type: AFC:  Length: strlen
015-   Querying:
016-     :1:
017-     :abc       :
018-     ::
019- Test 1.5: Type: AFC.  Length: strlen-1
020-   Querying:
021- Test 1.6: Type: AFC.  Length: strlen+1
022-   Querying:
023-     :1:
024-     :abc       :
025-     ::
026- 
027- 
028- *** NULL data tests against CHAR ***
029- Test 2.1: Type: default.  Length: default
030-   Querying:
031- Test 2.2: Type: AFC.  Length: default
032-   Querying:
033- Test 2.3: Type: AFC:  Length: 0
034-   Querying:
035- Test 2.4: Type: AFC:  Length: strlen
036-   Querying:
037- Test 2.5: Type: AFC.  Length: strlen-1
038-   Querying:
039- Test 2.6: Type: AFC.  Length: strlen+1
040-   Querying:
041- 
042- 
043- *** Non-null Data Tests against VARCHAR2***
044- Test 3.1: Type: default.  Length: default
045-   Querying:
046-     :2:
047-     ::
048-     :abc:
049- Test 3.2: Type: AFC.  Length: default
050-   Querying:
051-     :2:
052-     ::
053-     :abc:
054- Test 3.3: Type: AFC:  Length: 0
055-   Querying:
056-     :2:
057-     ::
058-     :abc:
059- Test 3.4: Type: AFC:  Length: strlen
060-   Querying:
061-     :2:
062-     ::
063-     :abc:
064- Test 3.5: Type: AFC.  Length: strlen-1
065-   Querying:
066- Test 3.6: Type: AFC.  Length: strlen+1
067-   Querying:
068-     :2:
069-     ::
070-     :abc:
071- 
072- 
073- *** NULL data tests against VARCHAR2 ***
074- Test 4.1: Type: default.  Length: default
075-   Querying:
076- Test 4.2: Type: AFC.  Length: default
077-   Querying:
078- Test 4.3: Type: AFC:  Length: 0
079-   Querying:
080- Test 4.4: Type: AFC:  Length: strlen
081-   Querying:
082- Test 4.5: Type: AFC.  Length: strlen-1
083-   Querying:
084- Test 4.6: Type: AFC.  Length: strlen+1
085-   Querying:
086- Done

 

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

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