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

Bug #8429 bad handling of tables named 'update'
Submitted: 2006-08-14 15:48 UTC
From: landrzejak at gmail dot com Assigned: lsmith
Status: Closed Package: MDB2_Schema (version 0.6.0)
PHP Version: 5.1.4 OS: linux2.6.17.8
Roadmaps: (Not assigned)    
Subscription  


 [2006-08-14 15:48 UTC] landrzejak at gmail dot com (Meltir)
Description: ------------ When issuing $foo->dumpDatabase ($foo being an instance of MDB2_Schema), a simple check of $database_definition is lacking, adding: if (PEAR::isError($database_definition)) { return $database_definition; } will resolve this. Without it - in some cases the scripts will fail with a logged error: PHP Fatal error: Cannot use object of type MDB2_Error as array in /foo/PEAR/lib/MDB2/Schema.php on line 1852 I came by this problem when trying do dump a database that contained a table named 'upgrade' under mysql 5.x. The reason was that 5.x has a (newly introduced in the late 4.1.19 - or so series) keyword 'upgrade' which conflicts with the tables name. Regardless, this means that somewhere earlier the table name was not escaped properly. Presumably the method that caused it was getDefinitionFromDatabase. Test script: --------------- The bug can be reproduced with the example.php script attached to the pear package of MDB2_Schema, when acting on a 5.0 series mysql database, using the mysqli extension. Only other requirement is that the database contains a table named 'upgrade'. All dumps of such a table will fail. Please attempt trying to dump a database into an example schema.xml file to see for yourself.

Comments

 [2006-08-14 17:22 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!