php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68311 Firebird return wrong value
Submitted: 2014-10-27 16:16 UTC Modified: 2015-12-03 14:33 UTC
From: info at der-dirigent dot de Assigned: mariuz (profile)
Status: Duplicate Package: PDO Firebird
PHP Version: 5.4.34 OS: Debian 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: info at der-dirigent dot de
New email:
PHP Version: OS:

 

 [2014-10-27 16:16 UTC] info at der-dirigent dot de
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-03 14:32 UTC] mariuz@php.net
-Assigned To: +Assigned To: mariuz
 [2015-12-03 14:33 UTC] mariuz@php.net
-Status: Assigned +Status: Duplicate
 [2015-12-03 14:33 UTC] mariuz@php.net
Duplicate of #60052
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 21 19:01:23 2020 UTC