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 : 27 + 21 = ?

 
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!