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_misccoltypes.phpt ('Bind miscellaneous column types using default types')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:
9:     
"alter session set nls_date_format = 'DD-MON-YY'",
10:
11:     
"drop table bind_misccoltypes_tab",
12:
13:     
"create table bind_misccoltypes_tab (
14:         id                number,
15:         char_t            char(1),
16:         char_t10          char(10),
17:         varchar2_t10      varchar2(10),
18:         number_t          number,
19:         number_t92        number(9,2),
20:         number_t6         number(6),
21:         date_t            date,
22:         timestamp_t       timestamp,
23:         float_t           float,
24:         binary_float_t    binary_float,
25:         binary_double_t   binary_double,
26:         decimal_t         decimal,
27:         integer_t         integer,
28:         nchar_t           nchar(10),
29:         nvarchar2_t10     nvarchar2(10),
30:         varchar_t10       varchar(10) )"
,
31: );
32:
33:
oci8_test_sql_execute($c$stmtarray);
34:
35: function 
check_col($c$colname$id)
36: {
37:     
$s oci_parse($c"select $colname from bind_misccoltypes_tab where id = :id");
38:     
oci_bind_by_name($s":id"$id);
39:     
oci_execute($s);
40:     
oci_fetch_all($s$r);
41:     
var_dump($r);
42: }
43:
44:
// Tests
45:
46:
echo "\nTEST86 insert all ORATYPE values\n";
47:
48:
$insert_sql "INSERT INTO bind_misccoltypes_tab ( id, "
49:     
"   char_t, "
50:     
"   char_t10, "
51:     
"   varchar2_t10, "
52:     
"   number_t, "
53:     
"   number_t92, "
54:     
"   number_t6, "
55:     
"   date_t, "
56:     
"   timestamp_t, "
57:     
"   float_t, "
58:     
"   binary_float_t, "
59:     
"   binary_double_t, "
60:     
"   decimal_t, "
61:     
"   integer_t, "
62:     
"   nchar_t, "
63:     
"   nvarchar2_t10, "
64:     
"   varchar_t10) "
65:     
" VALUES (:n1, "
66:     
.         " :c1, "
67:     
.         " :c2, "
68:     
.         " :c3, "
69:     
.         " :n2, "
70:     
.         " :n3, "
71:     
.         " :n4, "
72:     
.         " to_date(:d1, 'YYYY-MM-DD HH24:MI:SS'), "
73:     
.         " to_timestamp(:d1, 'YYYY-MM-DD HH24:MI:SS'), "
74:     
.         " :n5, "
75:     
.         " :n5, "
76:     
.         " :n5, "
77:     
.         " :n1, "
78:     
.         " :n1, "
79:     
.         " :c4, "
80:     
.         " :c5, "
81:     
.         " :c6) ";
82:
83:
84:
$n1 "86";
85:
$c1 "C";
86:
$c2 "char10";
87:
$c3 "varchar210";
88:
$n2 "-123.456";
89:
$n3 "789.346";
90:
$n4 "123456.023";
91:
$n5 "12345678901234567890123456789012345678.723";
92:
$d1 "2010-03-29 13:09:15";
93:
$c4 "nchar10";
94:
$c5 "nvarchar2x";
95:
$c6 "varchar";
96:
97:
$s oci_parse($c$insert_sql);
98:
oci_bind_by_name($s":n1"$n1);
99:
oci_bind_by_name($s":c1"$c1);
100:
oci_bind_by_name($s":c2"$c2);
101:
oci_bind_by_name($s":c3"$c3);
102:
oci_bind_by_name($s":n2"$n2);
103:
oci_bind_by_name($s":n3"$n3);
104:
oci_bind_by_name($s":n4"$n4);
105:
oci_bind_by_name($s":d1"$d1);
106:
oci_bind_by_name($s":n5"$n5);
107:
oci_bind_by_name($s":c4"$c4);
108:
oci_bind_by_name($s":c5"$c5);
109:
oci_bind_by_name($s":c6"$c6);
110:
111:
oci_execute($s);
112:
113: echo 
"\nTEST87 SELECT all values using DEFINEs\n";
114:
$select_sql "select "
115:     
"id, "
116:     
"char_t, "
117:     
"char_t10, "
118:     
"varchar2_t10, "
119:     
"number_t, "
120:     
"number_t92, "
121:     
"number_t6, "
122:     
"date_t, "
123:     
"timestamp_t, "
124:     
"float_t, "
125:     
"binary_float_t, "
126:     
"binary_double_t, "
127:     
"decimal_t, "
128:     
"integer_t, "
129:     
"nchar_t, "
130:     
"nvarchar2_t10, "
131:     
"varchar_t10 "
132:     
"from bind_misccoltypes_tab where id = 86";
133:
134:
$s oci_parse($c$select_sql);
135:
136:
oci_define_by_name($s"ID"$ID);
137:
oci_define_by_name($s"CHAR_T"$CHAR_T);
138:
oci_define_by_name($s"CHAR_T10"$CHAR_T10);
139:
oci_define_by_name($s"VARCHAR2_T10"$VARCHAR2_T10);
140:
oci_define_by_name($s"NUMBER_T"$NUMBER_T);
141:
oci_define_by_name($s"NUMBER_T92"$NUMBER_T92);
142:
oci_define_by_name($s"NUMBER_T6"$NUMBER_T6);
143:
oci_define_by_name($s"DATE_T"$DATE_T);
144:
oci_define_by_name($s"TIMESTAMP_T"$TIMESTAMP_T);
145:
oci_define_by_name($s"FLOAT_T"$FLOAT_T);
146:
oci_define_by_name($s"BINARY_FLOAT_T"$BINARY_FLOAT_T);
147:
oci_define_by_name($s"BINARY_DOUBLE_T"$BINARY_DOUBLE_T);
148:
oci_define_by_name($s"DECIMAL_T"$DECIMAL_T);
149:
oci_define_by_name($s"INTEGER_T"$INTEGER_T);
150:
oci_define_by_name($s"NCHAR_T"$NCHAR_T);
151:
oci_define_by_name($s"NVARCHAR2_T10"$NVARCHAR2_T10);
152:
oci_define_by_name($s"VARCHAR_T10"$VARCHAR_T10);
153:
154:
oci_execute($s);
155:
156: while (
oci_fetch($s)) {
157:     echo 
"ID is "              "$ID\n";
158:     echo 
"CHAR_T is "          "$CHAR_T\n";
159:     echo 
"CHAR_T10 is "        "$CHAR_T10\n";
160:     echo 
"VARCHAR2_T10 is "    "$VARCHAR2_T10\n";
161:     echo 
"NUMBER_T is "        "$NUMBER_T\n";
162:     echo 
"NUMBER_T92 is "      "$NUMBER_T92\n";
163:     echo 
"NUMBER_T6 is "       "$NUMBER_T6\n";
164:     echo 
"DATE_T is "          "$DATE_T\n";
165:     echo 
"TIMESTAMP_T is "     "$TIMESTAMP_T\n";
166:     echo 
"FLOAT_T is "         "$FLOAT_T\n";
167:     echo 
"BINARY_FLOAT_T is "  "$BINARY_FLOAT_T\n";
168:     echo 
"BINARY_DOUBLE_T is " "$BINARY_DOUBLE_T\n";
169:     echo 
"DECIMAL_T is "       "$DECIMAL_T\n";
170:     echo 
"INTEGER_T is "       "$INTEGER_T\n";
171:     echo 
"NCHAR_T is "         "$NCHAR_T\n";
172:     echo 
"NVARCHAR2_T10 is "   "$NVARCHAR2_T10\n";
173:     echo 
"VARCHAR_T10 is "     "$VARCHAR_T10\n";
174: }
175:
176: echo 
"\nTEST52 insert numbers\n";
177:
178:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, number_t92) VALUES (52, :n1)");
179:
$n1 3;
180:
oci_bind_by_name($s":n1"$n1);
181:
oci_execute($s);
182:
183:
check_col($c'number_t92'52);
184:
185:
186: echo 
"\nTEST53 insert numbers \n";
187:
188:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, number_t92) VALUES (53, :n1)");
189:
$n1 8.67;
190:
oci_bind_by_name($s":n1"$n1);
191:
oci_execute($s);
192:
193:
check_col($c'number_t92'53);
194:
195:
196: echo 
"\nTEST54 insert numbers \n";
197:
198:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, number_t) VALUES (54, :n1)");
199:
$n1 4.67;
200:
oci_bind_by_name($s":n1"$n1);
201:
oci_execute($s);
202:
203:
check_col($c'number_t'54);
204:
205: echo 
"\nTEST55 insert numbers \n";
206:
207:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, number_t) VALUES (55, :n1)");
208:
$n1 "7.67";
209:
oci_bind_by_name($s":n1"$n1);
210:
oci_execute($s);
211:
212:
check_col($c'number_t'55);
213:
214: echo 
"\nTEST56 insert numbers \n";
215:
216:
$n1 = -5.67;
217:
218:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, number_t) VALUES (56, :n1)");
219:
oci_bind_by_name($s":n1"$n1);
220:
oci_execute($s);
221:
222:
check_col($c'number_t'56);
223:
224: echo 
"\nTEST58 insert a VARCHAR2\n";
225:
226:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, varchar2_t10) VALUES (58, :c2)");
227:
$c2 "Hood";
228:
oci_bind_by_name($s":c2"$c2);
229:
oci_execute($s);
230:
231:
check_col($c'varchar2_t10'58);
232:
233: echo 
"\nTEST59 insert a VARCHAR2\n";
234:
235:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, char_t10) VALUES (59, :c2)");
236:
$c2 "Hood";
237:
oci_bind_by_name($s":c2"$c2);
238:
oci_execute($s);
239:
240:
check_col($c'char_t10'59);
241:
242: echo 
"\nTEST60 insert a date\n";
243:
244:
$s oci_parse($c"INSERT INTO bind_misccoltypes_tab (id, date_t) VALUES (60, to_date(:c2, 'YYYY-MM-DD'))");
245:
$c2 '2010-04-09';
246:
oci_bind_by_name($s":c2"$c2);
247:
oci_execute($s);
248:
249:
check_col($c'date_t'60);
250:
251:
252:
// Clean up
253:
254:
$stmtarray = array(
255:     
"drop table bind_misccoltypes_tab"
256:
);
257:
258:
oci8_test_sql_execute($c$stmtarray);
259:
260:
oci_close($c);
261:
262:
?>
263:
===DONE===
264:

Expected

TEST86 insert all ORATYPE values

TEST87 SELECT all values using DEFINEs
ID is 86
CHAR_T is C
CHAR_T10 is char10    
VARCHAR2_T10 is varchar210
NUMBER_T is -123.456
NUMBER_T92 is 789.35
NUMBER_T6 is 123456
DATE_T is 29-MAR-10
TIMESTAMP_T is 29-MAR-10 01.09.15.000000 PM
FLOAT_T is 12345678901234567890123456789012345679
BINARY_FLOAT_T is 1.23456784E+037
BINARY_DOUBLE_T is 1.2345678901234568E+037
DECIMAL_T is 86
INTEGER_T is 86
NCHAR_T is nchar10   
NVARCHAR2_T10 is nvarchar2x
VARCHAR_T10 is varchar

TEST52 insert numbers
array(1) {
  ["NUMBER_T92"]=>
  array(1) {
    [0]=>
    string(1) "3"
  }
}

TEST53 insert numbers 
array(1) {
  ["NUMBER_T92"]=>
  array(1) {
    [0]=>
    string(4) "8.67"
  }
}

TEST54 insert numbers 
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    string(4) "4.67"
  }
}

TEST55 insert numbers 
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    string(4) "7.67"
  }
}

TEST56 insert numbers 
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    string(5) "-5.67"
  }
}

TEST58 insert a VARCHAR2
array(1) {
  ["VARCHAR2_T10"]=>
  array(1) {
    [0]=>
    string(4) "Hood"
  }
}

TEST59 insert a VARCHAR2
array(1) {
  ["CHAR_T10"]=>
  array(1) {
    [0]=>
    string(10) "Hood      "
  }
}

TEST60 insert a date
array(1) {
  ["DATE_T"]=>
  array(1) {
    [0]=>
    string(9) "09-APR-10"
  }
}
===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:53:56
  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)))
001- TEST86 insert all ORATYPE values
003- TEST87 SELECT all values using DEFINEs
004- ID is 86
005- CHAR_T is C
006- CHAR_T10 is char10    
007- VARCHAR2_T10 is varchar210
008- NUMBER_T is -123.456
009- NUMBER_T92 is 789.35
010- NUMBER_T6 is 123456
011- DATE_T is 29-MAR-10
012- TIMESTAMP_T is 29-MAR-10 01.09.15.000000 PM
013- FLOAT_T is 12345678901234567890123456789012345679
014- BINARY_FLOAT_T is 1.23456784E+037
015- BINARY_DOUBLE_T is 1.2345678901234568E+037
016- DECIMAL_T is 86
017- INTEGER_T is 86
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:53:56
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
018- NCHAR_T is nchar10   
019- NVARCHAR2_T10 is nvarchar2x
020- VARCHAR_T10 is varchar
021- 
022- TEST52 insert numbers
023- array(1) {
024-   ["NUMBER_T92"]=>
025-   array(1) {
026-     [0]=>
027-     string(1) "3"
028-   }
029- }
030- 
031- TEST53 insert numbers 
032- array(1) {
033-   ["NUMBER_T92"]=>
034-   array(1) {
035-     [0]=>
036-     string(4) "8.67"
037-   }
038- }
039- 
040- TEST54 insert numbers 
041- array(1) {
042-   ["NUMBER_T"]=>
043-   array(1) {
044-     [0]=>
045-     string(4) "4.67"
046-   }
047- }
048- 
049- TEST55 insert numbers 
050- array(1) {
051-   ["NUMBER_T"]=>
052-   array(1) {
053-     [0]=>
054-     string(4) "7.67"
055-   }
056- }
057- 
058- TEST56 insert numbers 
059- array(1) {
060-   ["NUMBER_T"]=>
061-   array(1) {
062-     [0]=>
063-     string(5) "-5.67"
064-   }
065- }
066- 
067- TEST58 insert a VARCHAR2
068- array(1) {
069-   ["VARCHAR2_T10"]=>
070-   array(1) {
071-     [0]=>
072-     string(4) "Hood"
073-   }
074- }
075- 
076- TEST59 insert a VARCHAR2
077- array(1) {
078-   ["CHAR_T10"]=>
079-   array(1) {
080-     [0]=>
081-     string(10) "Hood      "
082-   }
083- }
084- 
085- TEST60 insert a date
086- array(1) {
087-   ["DATE_T"]=>
088-   array(1) {
089-     [0]=>
090-     string(9) "09-APR-10"
091-   }
092- }
093- ===DONE===

 

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

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