Bug #68311 [NEW]: Firebird return wrong value
| From: | info at der-dirigent dot de | Date: | Mon, 27 Oct 2014 16:16:22 +0000 |
| Subject: | Bug #68311 [NEW]: Firebird return wrong value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-188325@lists.php.net to get a copy of this message | ||
From: info at der-dirigent dot de
Operating system: Debian 7
PHP version: 5.4.34
Package: PDO Firebird
Bug Type: Bug
Bug description:Firebird return wrong value
Description:
------------
Dear List!
i have a strange problem.
I have a Firebird database (dialect 3). Firebird server: 2.0.6
I create a table, and insert a row like that:
CREATE TABLE PRICE (
ID INTEGER NOT NULL,
"NAME" VARCHAR(10),
COST NUMERIC(15, 2));
INSERT INTO PRICE (ID, "NAME", COST)
VALUES (2, 'my price2', -1);
when i read it back i get strange value. I get -0.0 and not -1.
Thanks for your advice,
Paul
Test script:
---------------
$db=new
PDO("firebird:dbname=localhost:c:/test/test.fdb","testuser","testpassword",array());
$sql="select cost from price where id=2";
$q=$db->query($sql);
$ret=$q->fetchAll(PDO::FETCH_ASSOC);
print_r($ret);
result:
Array ( [0] => Array ( [COST] => -0.00 ) )
Expected result:
----------------
-1.00
Actual result:
--------------
-0.00
--
Edit bug report at https://bugs.php.net/bug.php?id=68311&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68311&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68311&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68311&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68311&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68311&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68311&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68311&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68311&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68311&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68311&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68311&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68311&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68311&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68311&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68311&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68311&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68311&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68311&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68311&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68311&r=mysqlcfg