PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #730

PostgreSQL 'double precision' type is handled incorrectly

Details

Submitted2004-02-11 00:23 UTC
Fromieure at php dot net
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version4.2.2
OSLinux
Roadmaps(Not assigned)

Comments

[2004-02-11 00:23 UTC] ieure at php dot net

Description:
------------
DB_DataObject ignores PostgreSQL 'double precision' fields. It
incorrectly flags them as MySQL 'timestamp' fields.

This is with DB_DataObject 1.5.3. I regenerated the structure INI file
with this version to make sure it was consistent with what this version
of DB_DO outputs.

Reproduce code:
---------------
table structure:
Table "table"
Column | Type | Modifiers
--------------+--------------------------+------------------------------------------------------
id | integer | not null default nextval('"table_id_seq"'::text)
price | double precision | not null

$o = &DB_DataObject::factory('Table');
$o->price = 1.99;
$o->insert();

Expected result:
----------------
The 'price' column in 'Table' should be set to 1.99.

Actual result:
--------------
The 'price' column is not set; the type (from the INI file) is '257,' which
is the MySQL TIMESTAMP type, and the field is ignored. A PostgreSQL
error then occurs, as the field may not be NULL.