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 #5604

DOUBLE PRECISION firebird fields not recognized by generator

Details

Submitted2005-10-04 17:15 UTC
Fromale dot pas at tiscali dot it
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version5.0.4
OSLinux
Roadmaps(Not assigned)

Comments

[2005-10-04 17:15 UTC] ale dot pas at tiscali dot it

Description:
------------
In firebird there is a DOUBLE PRECISION type, that is not recognized by generator.

This is similar to bug
Bug #730 PostgreSQL 'double precision' type is handled incorrectly

but this was fixed ages ago and I'm using one of the latest versions of PEAR...

Don't know why, but in generated .ini file, those fields are marked with the same type as DATE fields.

@version CVS: $Id: Generator.php,v 1.96 2005/06/16 02:03:45 alan_k Exp $

Test script:
---------------
No test, sorry, see patch below.

Just adding the line

case 'DOUBLE PRECISION':

in line 337 of DataObject/Generator.php solved the problem for me.

This is how it looks now:

case 'REAL':
case 'DOUBLE':
case 'DOUBLE PRECISION':
case 'FLOAT':
case 'FLOAT8': // double precision (postgres)
case 'DECIMAL':
case 'NUMERIC':
case 'NUMBER': // oci8
$type = DB_DATAOBJECT_INT; // should really by FLOAT!!! / MONEY...
break;

Expected result:
----------------
DB_DATAOBJECT_INT

Actual result:
--------------
DB_DATAOBJECT_DATE & DB_DATAOBJECT_STR