Bug #64037 [NEW]: Firebird return wrong value for numeric field

From: Date: Mon, 21 Jan 2013 13:18:01 +0000
Subject: Bug #64037 [NEW]: Firebird return wrong value for numeric field
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-176151@lists.php.net to get a copy of this message
From: vberko at mail dot com Operating system: Windows PHP version: 5.4.11 Package: PDO related Bug Type: Bug Bug description:Firebird return wrong value for numeric field Description: ------------ When i store -1 value in a numeric field and i read back, i get -0.00 Test script: --------------- SET SQL DIALECT 3; SET NAMES WIN1250; CREATE DATABASE '127.0.0.1/gds_db:C:\TEST\test2.fdb' USER 'test' PASSWORD 'test' PAGE_SIZE = 4096 DEFAULT CHARACTER SET WIN1250; CREATE TABLE PRICE (ID INTEGER NOT NULL, TEXT VARCHAR(10), COST NUMERIC(15, 2)); INSERT INTO PRICE (ID, TEXT, COST) VALUES (2, 'test', -1); $db=new PDO("firebird:dbname=localhost:c:/TEST/test2.fdb","test","test",array()); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql="select id,cost from price where id=2"; $q=$db->query($sql); $ret=$q->fetchAll(); var_dump($ret); result: array(1) { [0]=> array(4) { ["ID"]=> string(1) "2" [0]=> string(1) "2" ["COST"]=> string(5) "-0.00" [1]=> string(5) "-0.00" } } Expected result: ---------------- I get back -0.00 but the right result is -1. -- Edit bug report at https://bugs.php.net/bug.php?id=64037&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64037&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64037&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64037&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64037&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64037&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64037&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64037&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64037&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64037&r=support Expected behavior: https://bugs.php.net/fix.php?id=64037&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64037&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64037&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64037&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64037&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64037&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64037&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64037&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64037&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64037&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64037&r=mysqlcfg

« previous php.bugs (#176151) next »