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_number.phpt ('Bind with NUMBER column variants')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table bind_number_tab",
9:     
"create table bind_number_tab (
10:                     id                  number,
11:                     number_t6          number(6),
12:                     float_t              float,
13:                     binary_float_t      binary_float,
14:                     binary_double_t      binary_double,
15:                     decimal_t          decimal,
16:                     integer_t          integer)"
17:
);
18:
19:
oci8_test_sql_execute($c$stmtarray);
20:
21: function 
check_col($c$colname$id)
22: {
23:     
$s oci_parse($c"select $colname from bind_number_tab where id = :id");
24:     
oci_bind_by_name($s":id"$id);
25:     
oci_execute($s);
26:     
oci_fetch_all($s$r);
27:     
var_dump($r);
28: }
29:
30:
// Run Test
31:
32:
echo "Test 1 - invalid number\n";
33:
34:
$s oci_parse($c"INSERT INTO bind_number_tab (id, number_t6) VALUES (1, :n1)");
35:
$n1 "Hello";
36:
oci_bind_by_name($s":n1"$n1);
37:
oci_execute($s);
38:
39:
check_col($c"number_t6"1);
40:
41: echo 
"\nTEST66 insert a float\n";
42:
43:
$s oci_parse($c"INSERT INTO bind_number_tab (id, float_t) VALUES (66, :f1)");
44:
$f1 123.456;
45:
oci_bind_by_name($s":f1"$f1);
46:
oci_execute($s);
47:
48:
check_col($c'float_t'66);
49:
50: echo 
"\nTEST67 insert a binary float\n";
51:
52:
$s oci_parse($c"INSERT INTO bind_number_tab (id, binary_float_t) VALUES (67, :f1)");
53:
$f1 567.456;
54:
oci_bind_by_name($s":f1"$f1);
55:
oci_execute($s);
56:
57:
check_col($c'binary_float_t'67);
58:
59: echo 
"\nTEST69 insert a binary double\n";
60:
61:
$s oci_parse($c"INSERT INTO bind_number_tab (id, binary_double_t) VALUES (69, :f1)");
62:
$f1 567.456;
63:
oci_bind_by_name($s":f1"$f1);
64:
oci_execute($s);
65:
66:
check_col($c'binary_double_t'69);
67:
68: echo 
"\nTEST71 insert a decimal\n";
69:
70:
$s oci_parse($c"INSERT INTO bind_number_tab (id, decimal_t) VALUES (71, :f1)");
71:
$f1 123.789;
72:
oci_bind_by_name($s":f1"$f1);
73:
oci_execute($s);
74:
75:
check_col($c'decimal_t'71);
76:
77: echo 
"\nTEST72 insert a decimal\n";
78:
79:
$s oci_parse($c"INSERT INTO bind_number_tab (id, decimal_t) VALUES (72, :f1)");
80:
$f1 123.789;
81:
oci_bind_by_name($s":f1"$f1, -1SQLT_NUM);
82:
oci_execute($s);
83:
84:
check_col($c'decimal_t'72);
85:
86: echo 
"\nTEST73 insert a double\n";
87:
88:
$s oci_parse($c"INSERT INTO bind_number_tab (id, binary_double_t) VALUES (73, :f1)");
89:
$f1 483.589;
90:
oci_bind_by_name($s":f1"$f1);
91:
oci_execute($s);
92:
93:
check_col($c'binary_double_t'73);
94:
95: echo 
"\nTEST75 insert a INTEGER\n";
96:
97:
$s oci_parse($c"INSERT INTO bind_number_tab (id, integer_t) VALUES (75, :f1)");
98:
$f1 589;
99:
oci_bind_by_name($s":f1"$f1);
100:
oci_execute($s);
101:
102:
check_col($c'integer_t'75);
103:
104: echo 
"\nTEST76 insert a INTEGER\n";
105:
106:
$s oci_parse($c"INSERT INTO bind_number_tab (id, integer_t) VALUES (76, :f1)");
107:
$f1 42;
108:
oci_bind_by_name($s":f1"$f1, -1SQLT_INT);
109:
oci_execute($s);
110:
111:
check_col($c'integer_t'76);
112:
113:
114:
// Clean up
115:
116:
$stmtarray = array(
117:     
"drop table bind_number_tab"
118:
);
119:
120:
oci8_test_sql_execute($c$stmtarray);
121:
122:
?>
123:
===DONE===
124:

Expected

Test 1 - invalid number

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

TEST66 insert a float
array(1) {
  ["FLOAT_T"]=>
  array(1) {
    [0]=>
    string(7) "123.456"
  }
}

TEST67 insert a binary float
array(1) {
  ["BINARY_FLOAT_T"]=>
  array(1) {
    [0]=>
    string(%r15|8%r) "%r(5.67455994E\+002|567.4560)%r"
  }
}

TEST69 insert a binary double
array(1) {
  ["BINARY_DOUBLE_T"]=>
  array(1) {
    [0]=>
    string(%r23|16%r) "%r(5.6745600000000002E\+002|567.456000000000)%r"
  }
}

TEST71 insert a decimal
array(1) {
  ["DECIMAL_T"]=>
  array(1) {
    [0]=>
    string(3) "124"
  }
}

TEST72 insert a decimal
array(1) {
  ["DECIMAL_T"]=>
  array(1) {
    [0]=>
    string(1) "0"
  }
}

TEST73 insert a double
array(1) {
  ["BINARY_DOUBLE_T"]=>
  array(1) {
    [0]=>
    string(%r12|16%r) "%r(4.83589E\+002|483.589000000000)%r"
  }
}

TEST75 insert a INTEGER
array(1) {
  ["INTEGER_T"]=>
  array(1) {
    [0]=>
    string(3) "589"
  }
}

TEST76 insert a INTEGER
array(1) {
  ["INTEGER_T"]=>
  array(1) {
    [0]=>
    string(2) "42"
  }
}
===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:26
  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 - invalid number
003- Warning: oci_execute(): ORA-01722: %s in %sbind_number.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:26
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- TEST66 insert a float
011- array(1) {
012-   ["FLOAT_T"]=>
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-     [0]=>
015-     string(7) "123.456"
016-   }
017- }
018- 
019- TEST67 insert a binary float
020- array(1) {
021-   ["BINARY_FLOAT_T"]=>
022-   array(1) {
023-     [0]=>
024-     string(%r15|8%r) "%r(5.67455994E\+002|567.4560)%r"
025-   }
026- }
027- 
028- TEST69 insert a binary double
029- array(1) {
030-   ["BINARY_DOUBLE_T"]=>
031-   array(1) {
032-     [0]=>
033-     string(%r23|16%r) "%r(5.6745600000000002E\+002|567.456000000000)%r"
034-   }
035- }
036- 
037- TEST71 insert a decimal
038- array(1) {
039-   ["DECIMAL_T"]=>
040-   array(1) {
041-     [0]=>
042-     string(3) "124"
043-   }
044- }
045- 
046- TEST72 insert a decimal
047- array(1) {
048-   ["DECIMAL_T"]=>
049-   array(1) {
050-     [0]=>
051-     string(1) "0"
052-   }
053- }
054- 
055- TEST73 insert a double
056- array(1) {
057-   ["BINARY_DOUBLE_T"]=>
058-   array(1) {
059-     [0]=>
060-     string(%r12|16%r) "%r(4.83589E\+002|483.589000000000)%r"
061-   }
062- }
063- 
064- TEST75 insert a INTEGER
065- array(1) {
066-   ["INTEGER_T"]=>
067-   array(1) {
068-     [0]=>
069-     string(3) "589"
070-   }
071- }
072- 
073- TEST76 insert a INTEGER
074- array(1) {
075-   ["INTEGER_T"]=>
076-   array(1) {
077-     [0]=>
078-     string(2) "42"
079-   }
080- }
081- ===DONE===

 

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

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