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

Script

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

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:28
  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:28
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.