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/field_funcs2.phpt ('Bug #41917 (invalid scale and precision)')

Script

1: <?php
2:
3:
require(dirname(__FILE__)."/connect.inc");
4:
5:
$s oci_parse($c'drop table field_funcs2_tab');
6: @
oci_execute($s);
7:
8:
$t = array("C01" => "NUMBER",
9:            
"C02" => "NUMBER(*,1)",
10:            
"C03" => "NUMBER(9)",
11:            
"C04" => "NUMBER(9,2)",
12:            
"C05" => "NUMBER(9,1)",
13:            
"C06" => "NUMBER(7,-2)",
14:            
"C07" => "DECIMAL(4,9)",
15:            
"C08" => "NUMERIC(4,9)",
16:            
"C09" => "DECIMAL(4)",
17:            
"C10" => "INTEGER",
18:            
"C11" => "INT",
19:            
"C12" => "SMALLINT",
20:            
"C13" => "FLOAT",
21:            
"C14" => "FLOAT(9)",
22:            
"C15" => "DOUBLE PRECISION",
23:            
"C16" => "REAL",
24:            );
25:
26:
$stmt "create table field_funcs2_tab (\n";
27: foreach (
$t as $colname => $type) {
28:     
$stmt .= "$colname $type,\n";
29: }
30:
$stmt[strlen($stmt)-2] = ")";
31:
32:
$s oci_parse($c$stmt);
33:
oci_execute($s);
34:
35:
$s oci_parse($c"select * from field_funcs2_tab");
36:
oci_execute($s);
37:
38: for (
$i 1$i <= oci_num_fields($s); $i++) {
39:     
$name oci_field_name($s$i);
40:     
$precision oci_field_precision($s$i);
41:     
$scale oci_field_scale($s$i);
42:     echo 
"$name ".$t[$name] .": precision $precision, scale $scale\n";
43: }
44:
45: echo 
"Done\n";
46:
?>
47:

Expected

C01 NUMBER: precision 0, scale -127
C02 NUMBER(*,1): precision 38, scale 1
C03 NUMBER(9): precision 9, scale 0
C04 NUMBER(9,2): precision 9, scale 2
C05 NUMBER(9,1): precision 9, scale 1
C06 NUMBER(7,-2): precision 7, scale -2
C07 DECIMAL(4,9): precision 4, scale 9
C08 NUMERIC(4,9): precision 4, scale 9
C09 DECIMAL(4): precision 4, scale 0
C10 INTEGER: precision 38, scale 0
C11 INT: precision 38, scale 0
C12 SMALLINT: precision 38, scale 0
C13 FLOAT: precision 126, scale -127
C14 FLOAT(9): precision 9, scale -127
C15 DOUBLE PRECISION: precision 126, scale -127
C16 REAL: precision 63, scale -127
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 05:41:57
  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 05:41:57
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
001- C01 NUMBER: precision 0, scale -127
002- C02 NUMBER(*,1): precision 38, scale 1
003- C03 NUMBER(9): precision 9, scale 0
004- C04 NUMBER(9,2): precision 9, scale 2
005- C05 NUMBER(9,1): precision 9, scale 1
006- C06 NUMBER(7,-2): precision 7, scale -2
007- C07 DECIMAL(4,9): precision 4, scale 9
008- C08 NUMERIC(4,9): precision 4, scale 9
009- C09 DECIMAL(4): precision 4, scale 0
010- C10 INTEGER: precision 38, scale 0
011- C11 INT: precision 38, scale 0
012- C12 SMALLINT: precision 38, scale 0
013- C13 FLOAT: precision 126, scale -127
014- C14 FLOAT(9): precision 9, scale -127
015- C15 DOUBLE PRECISION: precision 126, scale -127
016- C16 REAL: precision 63, scale -127
017- Done
018+     nt secondary err code: 111
019+     nt OS err code: 0

 

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

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