From: tawood at vlsmaps dot com
Operating system: Fedora 4
PHP version: 5.0.5
PHP Bug Type: OCI8 related
Bug description: BINARY_FLOAT type is null in oci_fetch_assoc & oci_fetch_array
Description:
------------
I have php 5.0.5, apache 2.0.55 and oci8-beta 1.1.1.
BINARY_FLOAT data types in 10g are always returned as a null value in php.
I have made sure that the values are there via SQL*Plus and the Enterprise
Manager.
In the below example, the output of the binary_float column is empty.
The obvious work around to this is to use a NUMBER data type.
Reproduce code:
---------------
------------
$oraDb = oci_connect("YOUR_SCHEMA","password","TNSNAME");
$oraCreate = 'CREATE TABLE binf_test (bt_idx INTEGER, reg_float NUMBER
(10, 3), bin_float BINARY_FLOAT, CONSTRAINT bt_pk PRIMARY KEY (bt_idx))';
oci_execute(oci_parse($oraDb, $oraCreate));
for($i=0;$i<10;$i++) {
$decnum = ($i / (.429));
$oraInsert = "INSERT INTO binf_test VALUES (".$i.", ".$decnum.",
".$decnum.")";
oci_execute(oci_parse($oraDb, $oraInsert));
}
$oraSelect = "SELECT * FROM binf_test";
$oraParse = oci_parse($oraDb, $oraSelect);
if (oci_execute($oraParse)) {
while ($oraRow = oci_fetch_assoc($oraParse)) {
foreach ($oraRow as $key => $val) {
echo $key." : ".$val."<br />\n";
}
}
}
oci_close($oraDb);
Expected result:
----------------
The correct values of binary_float columns to be displayed.
--
Edit bug report at http://bugs.php.net/?id=35280&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35280&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35280&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35280&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35280&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35280&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35280&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35280&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35280&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35280&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35280&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35280&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35280&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35280&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35280&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35280&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35280&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35280&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35280&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35280&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35280&r=mysqlcfg