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

Bug #7791 Calling getTableFieldDefinition with erroneus fieldname
Submitted: 2006-06-02 08:39 UTC
From: marcus dot kempe at gmail dot com Assigned: lsmith
Status: Closed Package: MDB2_Driver_pgsql (version 1.0.3)
PHP Version: 5.0.4 OS: Fedora Core 4
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 13 + 14 = ?

 
 [2006-06-02 08:39 UTC] marcus dot kempe at gmail dot com (Marcus Kempe)
Description: ------------ If I call getTableFieldDefinition($tablename,$fieldsname), everything works as expected (if both $tablename and $fieldname exist in my DB.) But if I call it with a fieldname that doesn't exist, it returns an error such as: Warning: array_change_key_case() [function.array-change-key-case]: The argument should be an array in /usr/share/pear/MDB2/Driver/Reverse/pgsql.php on line 97 Fatal error: Cannot use object of type MDB2_Error as array in /usr/share/pear/MDB2/Driver/Reverse/pgsql.php on line 98 I figure it might be nicer if it would return an empty result-set. I solved it by changing line 95 from: if (MDB2::isError($column)) { to: if (MDB2::isError($column) || is_null($column)) { I figure this might not be the right solution and you might very well not even consider this a bug. Just wanted to point out my problem. Best regards! /Marcus

Comments

 [2006-06-02 08:49 UTC] lsmith (Lukas Smith)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net 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.