Bug #71652 [NEW]: Wrong float values will be returned
| From: | b dot vonheesen at maprom dot de | Date: | Tue, 23 Feb 2016 15:41:45 +0000 |
| Subject: | Bug #71652 [NEW]: Wrong float values will be returned | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-199424@lists.php.net to get a copy of this message | ||
From: b dot vonheesen at maprom dot de
Operating system: Ubuntu 14.04 LTS 64-Bit
PHP version: 7.0.3
Package: PDO Firebird
Bug Type: Bug
Bug description:Wrong float values will be returned
Description:
------------
Starting position:
Ubuntu 14.04 LTS 64-Bit, PHP 7.0.3
Interbase with dialect 1
All columns of type NUMERIC return wrong values.
The returned value is the ordinal position multiplied with 0.4 instead
of the correct value.
Sorry, I don't know how to use git diff so I created a diff with
diff -Naur firebird_statement.c firebird_statement.new > patch.c
Test script:
---------------
$pdo = new PDO('firebird:...');
$pdo->query('CREATE TABLE test (id INTEGER, name VARCHAR(20), price
NUMERIC(15,2), price2 NUMERIC(15,2))');
$pdo->query('INSERT INTO test(id, name, price, price2) VALUES(1,
'Test1', 6.45, 7.25)');
$pdo->query('SELECT id, name, price FROM test');
$result = $pdo->fetchAll();
Expected result:
----------------
$result = [
[
'id' => 1, // column 0
'name' => 'Test1', // column 1
'price' => 6.45, // column 2
'price2' => 7.25 // column 3
]
Actual result:
--------------
$result = [
'id' => 1, // column 0
'name' => 'Test1', // column 1
'price' => 0.8, // column 2: 0.4 * 2
'price2' => 1.2 // column 3: 0.4 * 3
]
--
Edit bug report at https://bugs.php.net/bug.php?id=71652&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71652&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71652&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71652&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71652&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71652&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71652&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71652&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71652&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71652&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71652&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71652&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71652&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71652&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71652&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71652&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71652&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71652&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71652&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71652&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71652&r=mysqlcfg