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_errs.phpt ('Bind miscellaneous column types and generating errors')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table bind_misccoltypes_errs_tab",
9:
10:     
"create table bind_misccoltypes_errs_tab (
11:         id                number,
12:         char_t            char(1),
13:         char_t10          char(10),
14:         varchar2_t10      varchar2(10),
15:         number_t          number,
16:         number_t92        number(9,2),
17:         number_t6         number(6),
18:         date_t            date,
19:         timestamp_t       timestamp,
20:         float_t           float,
21:         binary_float_t    binary_float,
22:         binary_double_t   binary_double,
23:         decimal_t         decimal,
24:         integer_t         integer,
25:         nchar_t           nchar(10),
26:         nvarchar2_t10     nvarchar2(10),
27:         varchar_t10       varchar(10) )"
,
28: );
29:
30:
oci8_test_sql_execute($c$stmtarray);
31:
32: function 
check_col($c$colname$id)
33: {
34:     
$s oci_parse($c"select $colname from bind_misccoltypes_errs_tab where id = :id");
35:     
oci_bind_by_name($s":id"$id);
36:     
oci_execute($s);
37:     
oci_fetch_all($s$r);
38:     
var_dump($r);
39: }
40:
41:
// Tests
42:
43:
echo "\nTest 1 insert numbers \n";
44:
45:
$n1 = -23253245.3432467;
46:
47:
$s oci_parse($c"INSERT INTO bind_misccoltypes_errs_tab (id, number_t6) VALUES (1, :n1)");
48:
oci_bind_by_name($s":n1"$n1);
49:
oci_execute($s);
50:
51:
check_col($c'number_t6'57);
52:
53: echo 
"\nTest 2 insert numbers \n";
54:
55:
$n1 "Hello";
56:
57:
$s oci_parse($c"INSERT INTO bind_misccoltypes_errs_tab (id, number_t6) VALUES (2, :n1)");
58:
oci_bind_by_name($s":n1"$n1);
59:
oci_execute($s);
60:
61:
check_col($c'number_t6'57);
62:
63: echo 
"\nTest 3 - too long CHAR\n";
64:
65:
$s oci_parse($c"INSERT INTO bind_misccoltypes_errs_tab (id, char_t) VALUES (3, :c2)");
66:
$c2 "AB";
67:
oci_bind_by_name($s":c2"$c2, -1SQLT_AFC);
68:
oci_execute($s);
69:
70: echo 
"\nTest 4 - too long VARCHAR2\n";
71:
72:
$s oci_parse($c"INSERT INTO bind_misccoltypes_errs_tab (id, varchar2_t10) VALUES (4, :c2)");
73:
$c2 "AAAAAAAAAAB";
74:
oci_bind_by_name($s":c2"$c2, -1SQLT_AFC);
75:
oci_execute($s);
76:
77: echo 
"\nTest 5 - invalid number\n";
78:
79:
$s oci_parse($c"INSERT INTO bind_misccoltypes_errs_tab (id, number_t) VALUES (5, :c2)");
80:
$c2 "ABC";
81:
oci_bind_by_name($s":c2"$c2, -1SQLT_AFC);
82:
oci_execute($s);
83:
84: echo 
"\nTest 6 - insert a VARCHAR2 with SQLT_BIN\n";
85:
86:
$s oci_parse($c"INSERT INTO bind_misccoltypes_errs_tab (id, varchar2_t10) VALUES (6, :c2)");
87:
$c2 "Hood 6";
88:
oci_bind_by_name($s":c2"$c2, -1SQLT_BIN);
89:
oci_execute($s);
90:
91:
check_col($c'varchar2_t10'6);
92:
93: echo 
"\nTest 7 - insert a VARCHAR2 with SQLT_LBI\n";
94:
95:
$s oci_parse($c"INSERT INTO bind_misccoltypes_errs_tab (id, varchar2_t10) VALUES (7, :c2)");
96:
$c2 "Hood 7";
97:
oci_bind_by_name($s":c2"$c2, -1SQLT_LBI);
98:
oci_execute($s);
99:
100:
check_col($c'varchar2_t10'7);
101:
102:
103:
// Clean up
104:
105:
$stmtarray = array(
106:     
"drop table bind_misccoltypes_errs_tab"
107:
);
108:
109:
oci8_test_sql_execute($c$stmtarray);
110:
111:
oci_close($c);
112:
113:
?>
114:
===DONE===
115:

Expected

Test 1 insert numbers 

Warning: oci_execute(): ORA-01438: %s in %sbind_misccoltypes_errs.php on line %d
array(1) {
  ["NUMBER_T6"]=>
  array(0) {
  }
}

Test 2 insert numbers 

Warning: oci_execute(): ORA-01722: %s in %sbind_misccoltypes_errs.php on line %d
array(1) {
  ["NUMBER_T6"]=>
  array(0) {
  }
}

Test 3 - too long CHAR

Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."CHAR_T" \(%s: 2, %s: 1\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d

Test 4 - too long VARCHAR2

Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 11, %s: 10\)|%s data right truncation)%r in %sbind_misccoltypes_errs.php on line %d

Test 5 - invalid number

Warning: oci_execute(): ORA-01722: %s in %sbind_misccoltypes_errs.php on line %d

Test 6 - insert a VARCHAR2 with SQLT_BIN

Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 12, %s: 10\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d
array(1) {
  ["VARCHAR2_T10"]=>
  array(0) {
  }
}

Test 7 - insert a VARCHAR2 with SQLT_LBI

Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 12, %s: 10\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d
array(1) {
  ["VARCHAR2_T10"]=>
  array(0) {
  }
}
===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:54:11
  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- Test 1 insert numbers 
003- Warning: oci_execute(): ORA-01438: %s in %sbind_misccoltypes_errs.php on line %d
004- array(1) {
005-   ["NUMBER_T6"]=>
006-   array(0) {
007-   }
008- }
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:54:11
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
010- Test 2 insert numbers 
011- 
012- Warning: oci_execute(): ORA-01722: %s in %sbind_misccoltypes_errs.php on line %d
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
013- array(1) {
014-   ["NUMBER_T6"]=>
015-   array(0) {
016-   }
017- }
018- 
019- Test 3 - too long CHAR
020- 
021- Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."CHAR_T" \(%s: 2, %s: 1\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d
022- 
023- Test 4 - too long VARCHAR2
024- 
025- Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 11, %s: 10\)|%s data right truncation)%r in %sbind_misccoltypes_errs.php on line %d
026- 
027- Test 5 - invalid number
028- 
029- Warning: oci_execute(): ORA-01722: %s in %sbind_misccoltypes_errs.php on line %d
030- 
031- Test 6 - insert a VARCHAR2 with SQLT_BIN
032- 
033- Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 12, %s: 10\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d
034- array(1) {
035-   ["VARCHAR2_T10"]=>
036-   array(0) {
037-   }
038- }
039- 
040- Test 7 - insert a VARCHAR2 with SQLT_LBI
041- 
042- Warning: oci_execute(): ORA-12899: %r(%s "%s"."BIND_MISCCOLTYPES_ERRS_TAB"."VARCHAR2_T10" \(%s: 12, %s: 10\)|String data right truncation)%r in %sbind_misccoltypes_errs.php on line %d
043- array(1) {
044-   ["VARCHAR2_T10"]=>
045-   array(0) {
046-   }
047- }
048- ===DONE===

 

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

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