From:
Operating system: Windows 7 32bit
PHP version: 5.3.12
Package: PDO related
Bug Type: Bug
Bug description:PDO_FIREBIRD incorrect result of query for NUMERIC(x, y) or
DECIMAL (x, y) type
Description:
------------
PDO_FIREBIRD incorrect result of query for NUMERIC(x, y) or DECIMAL (x, y)
type
<?php
$sql = 'select * from price';
$dbh = new
PDO('firebird:dbname=localhost:d:\interbasedata\test.fdb;charset=win1251',
'sysdba', 'masterkey');
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sth = $dbh->prepare($sql);
$sth->execute();
$obj = $sth->fetch();
var_dump($obj);
$sth = null;
?>
Script print
object(stdClass)[3]
public 'ID' => string '1' (length=1)
public 'NAME' => string 'my price' (length=8)
public 'COST' => string '1.00' (length=4) <-- Error hear (correct result
12.34)
Test script:
---------------
Sql script for create database
SET SQL DIALECT 1;
SET NAMES WIN1251;
CREATE DATABASE 'LOCALHOST:D:\interbasedata\test.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
DEFAULT CHARACTER SET WIN1251 COLLATION WIN1251;
CREATE TABLE PRICE (
ID INTEGER NOT NULL,
NAME VARCHAR(10),
COST NUMERIC(15,2)
);
INSERT INTO PRICE (ID, NAME, COST) VALUES (1, 'my price', 12.34);
COMMIT WORK;
ALTER TABLE PRICE ADD CONSTRAINT PK_PRICE PRIMARY KEY (ID);
--
Edit bug report at https://bugs.php.net/bug.php?id=61939&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61939&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61939&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61939&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61939&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61939&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61939&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61939&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61939&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61939&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61939&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61939&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61939&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61939&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61939&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61939&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61939&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61939&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61939&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61939&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61939&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61939&r=mysqlcfg