Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 30010
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: florian [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.49
Fixed in: 2.0.0



Subject: SQL_NUMERIC rounds (12450.46 is stored as 12450.50 in the database)
Given the following table: === Column | Type | Modifiers --------+---------------+----------- id | numeric(32,0) | not null num | numeric(8,2) | not null dez | numeric(8,2) | not null === inserting values with: === my $sth = $dbh->prepare(" INSERT INTO fh_test VALUES (:pk, :num, :dec) "); $sth->bind_param(':pk', 1, SQL_NUMERIC); $sth->bind_param(':num', 12450.46, SQL_NUMERIC); $sth->bind_param(':dec', 12450.46, SQL_DECIMAL); $sth->execute; $sth->finish; === results in: === id | num | dez ----+----------+---------- 1 | 12450.50 | 12450.46 === I tried this with DBD::Oracle too - no rounding occurs there. I also found no reference in the DBI and DBD::Pg documentation about this behavior while using bind types.
Fixed in r10101, will be a part of the next release.