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_sqltnum_11g.phpt ('Bind with SQLT_NUM')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table bind_sqltnum_tab",
9:
10:     
"create table bind_sqltnum_tab (
11:         id                number,
12:         varchar2_t10      varchar2(10),
13:         number_t          number,
14:         number_t92        number(9,2))"
15:
);
16:
17:
oci8_test_sql_execute($c$stmtarray);
18:
19: function 
check_col($c$colname$id)
20: {
21:     
$s oci_parse($c"select $colname from bind_sqltnum_tab where id = :id");
22:     
oci_bind_by_name($s":id"$id);
23:     
oci_execute($s);
24:     
oci_fetch_all($s$r);
25:     
var_dump($r);
26: }
27:
28:
29:
// Run Test
30:
31:
echo "Test 1 - baseline test\n";
32:
33:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, varchar2_t10) VALUES (100, :c2)");
34:
$c2 "Hood";
35:
$r oci_bind_by_name($s":c2"$c2, -1);
36: if (!
$r) {
37:     
$e oci_error($s);
38:     
var_dump($e);
39: }
40:
$r oci_execute($sOCI_DEFAULT);
41: if (!
$r) {
42:     
$e oci_error($s);
43:     
var_dump($e);
44: }
45:
46:
$s oci_parse($c"select id, varchar2_t10 from bind_sqltnum_tab");
47:
oci_execute($s);
48:
oci_fetch_all($s$data);
49:
var_dump($data);
50:
51: echo 
"Test 2 - SQLT_NUM to a VARCHAR2 column\n";
52:
53:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, varchar2_t10) VALUES (100, :c2)");
54:
$c2 "Hood";
55:
$r oci_bind_by_name($s":c2"$c2, -1SQLT_NUM);
56: if (!
$r) {
57:     
$e oci_error($s);
58:     
var_dump($e['message']);
59: }
60:
$r oci_execute($sOCI_DEFAULT);
61: if (!
$r) {
62:     
$e oci_error($s);
63:     
var_dump($e['message']);
64: }
65:
66: echo 
"\nTEST41 wrong bind type SQLT_NUM\n";
67:
68:
$c2 "Hood41";
69:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, varchar2_t10) VALUES (41, :c2)");
70:
oci_bind_by_name($s":c2"$c2, -1SQLT_NUM);
71:
oci_execute($s);
72:
73: echo 
"\nTEST42 insert numbers SQLT_NUM\n";
74:
75:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t) VALUES (42, :n1)");
76:
$n1 42;
77:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
78:
oci_execute($s);
79:
80:
check_col($c'number_t'42);
81:
82: echo 
"\nTEST43 insert numbers SQLT_NUM\n";
83:
84:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t) VALUES (43, :n1)");
85:
$n1 42.69;
86:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
87:
oci_execute($s);
88:
89:
check_col($c'number_t'43);
90:
91: echo 
"\nTEST44\n";
92:
93:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t) VALUES (44, :n1)");
94:
$n1 0;
95:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
96:
oci_execute($s);
97:
98:
check_col($c'number_t'44);
99:
100: echo 
"\nTEST45\n";
101:
102:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t) VALUES (45, :n1)");
103:
$n1 = -23;
104:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
105:
oci_execute($s);
106:
107:
check_col($c'number_t'45);
108:
109: echo 
"\nTEST46 insert numbers\n";
110:
111:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t) VALUES (46, :n1)");
112:
$n1 "-23";
113:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
114:
oci_execute($s);
115:
116:
check_col($c'number_t'46);
117:
118: echo 
"\nTEST47\n";
119:
120:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t) VALUES (47, :n1)");
121:
$n1 "23";
122:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
123:
oci_execute($s);
124:
125:
check_col($c'number_t'47);
126:
127: echo 
"\nTEST48\n";
128:
129:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t92) VALUES (48, :n1)");
130:
$n1 123.56;
131:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
132:
oci_execute($s);
133:
134:
check_col($c'number_t92'48);
135:
136: echo 
"\nTEST49\n";
137:
138:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t92) VALUES (49, :n1)");
139:
$n1 "123.56";
140:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
141:
oci_execute($s);
142:
143:
check_col($c'number_t92'49);
144:
145: echo 
"\nTEST50\n";
146:
147:
$s oci_parse($c"INSERT INTO bind_sqltnum_tab (id, number_t92) VALUES (50, :n1)");
148:
$n1 "";
149:
oci_bind_by_name($s":n1"$n1, -1SQLT_NUM);
150:
oci_execute($s);
151:
152:
check_col($c'number_t92'50);
153:
154:
// Clean up
155:
156:
$stmtarray = array(
157:     
"drop table bind_sqltnum_tab"
158:
);
159:
160:
oci8_test_sql_execute($c$stmtarray);
161:
162:
?>
163:
===DONE===
164:

Expected

Test 1 - baseline test
array(2) {
  ["ID"]=>
  array(1) {
    [0]=>
    string(3) "100"
  }
  ["VARCHAR2_T10"]=>
  array(1) {
    [0]=>
    string(4) "Hood"
  }
}
Test 2 - SQLT_NUM to a VARCHAR2 column

Warning: oci_execute(): ORA-12899: %s (%s: 40, %s: 10) in %sbind_sqltnum_11g.php on line %d
string(%d) "ORA-12899: %s"

TEST41 wrong bind type SQLT_NUM

Warning: oci_execute(): ORA-12899: %s "%s"."BIND_SQLTNUM_TAB"."VARCHAR2_T10" (%s: 40, %s: 10) in %sbind_sqltnum_11g.php on line %d

TEST42 insert numbers SQLT_NUM
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    NULL
  }
}

TEST43 insert numbers SQLT_NUM
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    NULL
  }
}

TEST44
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    string(127) "-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  }
}

TEST45
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    NULL
  }
}

TEST46 insert numbers
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    NULL
  }
}

TEST47
array(1) {
  ["NUMBER_T"]=>
  array(1) {
    [0]=>
    NULL
  }
}

TEST48
array(1) {
  ["NUMBER_T92"]=>
  array(1) {
    [0]=>
    string(1) "0"
  }
}

TEST49
array(1) {
  ["NUMBER_T92"]=>
  array(1) {
    [0]=>
    string(1) "0"
  }
}

TEST50

Warning: oci_execute(): ORA-01438: %s in %sbind_sqltnum_11g.php on line %d
array(1) {
  ["NUMBER_T92"]=>
  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:56:41
  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:56:41
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
001- Test 1 - baseline test
002- array(2) {
003-   ["ID"]=>
004-   array(1) {
005-     [0]=>
006-     string(3) "100"
007-   }
008-   ["VARCHAR2_T10"]=>
009-   array(1) {
010-     [0]=>
011-     string(4) "Hood"
012-   }
013- }
014- Test 2 - SQLT_NUM to a VARCHAR2 column
016- Warning: oci_execute(): ORA-12899: %s (%s: 40, %s: 10) in %sbind_sqltnum_11g.php on line %d
017- string(%d) "ORA-12899: %s"
018- 
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
019- TEST41 wrong bind type SQLT_NUM
020- 
021- Warning: oci_execute(): ORA-12899: %s "%s"."BIND_SQLTNUM_TAB"."VARCHAR2_T10" (%s: 40, %s: 10) in %sbind_sqltnum_11g.php on line %d
022- 
023- TEST42 insert numbers SQLT_NUM
024- array(1) {
025-   ["NUMBER_T"]=>
026-   array(1) {
027-     [0]=>
028-     NULL
029-   }
030- }
031- 
032- TEST43 insert numbers SQLT_NUM
033- array(1) {
034-   ["NUMBER_T"]=>
035-   array(1) {
036-     [0]=>
037-     NULL
038-   }
039- }
040- 
041- TEST44
042- array(1) {
043-   ["NUMBER_T"]=>
044-   array(1) {
045-     [0]=>
046-     string(127) "-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
047-   }
048- }
049- 
050- TEST45
051- array(1) {
052-   ["NUMBER_T"]=>
053-   array(1) {
054-     [0]=>
055-     NULL
056-   }
057- }
058- 
059- TEST46 insert numbers
060- array(1) {
061-   ["NUMBER_T"]=>
062-   array(1) {
063-     [0]=>
064-     NULL
065-   }
066- }
067- 
068- TEST47
069- array(1) {
070-   ["NUMBER_T"]=>
071-   array(1) {
072-     [0]=>
073-     NULL
074-   }
075- }
076- 
077- TEST48
078- array(1) {
079-   ["NUMBER_T92"]=>
080-   array(1) {
081-     [0]=>
082-     string(1) "0"
083-   }
084- }
085- 
086- TEST49
087- array(1) {
088-   ["NUMBER_T92"]=>
089-   array(1) {
090-     [0]=>
091-     string(1) "0"
092-   }
093- }
094- 
095- TEST50
096- 
097- Warning: oci_execute(): ORA-01438: %s in %sbind_sqltnum_11g.php on line %d
098- array(1) {
099-   ["NUMBER_T92"]=>
100-   array(0) {
101-   }
102- }
103- ===DONE===

 

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

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