Bug #51213 [Opn->Csd]: pdo_mssql is trimming value of the money column
| From: | iliaa@php.net | Date: | Mon, 08 Mar 2010 12:39:53 +0000 |
| Subject: | Bug #51213 [Opn->Csd]: pdo_mssql is trimming value of the money column | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-148394@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51213&edit=1
ID: 51213
Updated by: iliaa@php.net
Reported by: alexr at oplot dot com
Summary: pdo_mssql is trimming value of the money column
-Status: Open
+Status: Closed
Type: Bug
Package: PDO related
Operating System: Windows
PHP Version: 5.2.13
Assigned To: iliaa
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2010-03-08 13:39:46] iliaa@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=295958
Log: Fixed bug #51213 (pdo_mssql is trimming value of the money column).
------------------------------------------------------------------------
[2010-03-05 10:36:45] alexr at oplot dot com
Description:
------------
Money column is wrongly converting to the char column and this cause
that value is rounding to the 2 digits after delimiter (dot).
Test script:
---------------
$dsn = 'mssql:dbname=DBNAME;host=HOSTNAME';
$user = 'USERNAME';
$password='PASSWORD';
$dbh = new PDO($dsn, $user, $password);
$sth = $dbh->query ('create table #tmp(col money)');
$sth = $dbh->query ('insert into #tmp(col) values(-0.1234)');
$sth = $dbh->query ('insert into #tmp(col) values(0.1234)');
$sth = $dbh->prepare('select * from #tmp');
$sth->execute();
$r = $sth->fetchAll(2);
print_r($r);
Expected result:
----------------
Array
(
[0] => Array
(
[col] => -0.1234
)
[1] => Array
(
[col] => 0.1234
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[col] => -0.12
)
[1] => Array
(
[col] => 0.12
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51213&edit=1