Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Bug #13356 Add float4 to _mapNativeDatatype()
Submitted: 2008-03-09 10:33 UTC
From: smcn Assigned: quipo
Status: Closed Package: MDB2_Driver_pgsql (version 1.4.1)
PHP Version: 5.2.1 OS: Linux
Roadmaps: (Not assigned)    

 [2008-03-09 10:33 UTC] smcn (Sandy McNeil)
Description: ------------ When using Postgresql database getTableFieldDefinition($table, $field) returns a PEAR:Error object when $field is of type real. The userinfo error message "_mapNativeDatatype: [Error message: unknown database attribute type: float4]" is returned. float4 is a alias for real. Adding float4 to _mapNativeDatatype() method fixes the bug. The patch below adds float4 to the _mapNativeDatatype() method method from cvs. Test script: --------------- Index: MDB2/Driver/Datatype/pgsql.php =================================================================== RCS file: /repository/pear/MDB2/MDB2/Driver/Datatype/pgsql.php,v retrieving revision 1.90 diff -U 3 -r1.90 pgsql.php --- pgsql.php 22 Feb 2008 19:23:49 -0000 1.90 +++ pgsql.php 8 Mar 2008 22:48:58 -0000 @@ -460,6 +460,7 @@ $length = null; break; case 'float': + case 'float4': case 'float8': case 'double': case 'real': Expected result: ---------------- This is what I get when I add float4 to the _mapNativeDatatype() method array(1) { [0]=> array(6) { ["notnull"]=> bool(false) ["nativetype"]=> string(6) "float4" ["length"]=> string(1) "4" ["default"]=> NULL ["type"]=> string(5) "float" ["mdb2type"]=> string(5) "float" } } Actual result: -------------- This is the start of what I get if float4 is missing from the _mapNativeDatatype() method. object(MDB2_Error)#4 (8) { ["error_message_prefix"]=> string(0) "" ["mode"]=> int(1) ["level"]=> int(1024) ["code"]=> int(-6) ["message"]=> string(25) "MDB2 Error: not supported" ["userinfo"]=> string(1966) "_mapNativeDatatype: [Error message: unknown database attribute type: float4] [Last executed query: SELECT a.attname AS name,........


 [2008-03-09 11:28 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.