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

Bug #5977 Error in updateDatabase()/verifyAlterDatabase()
Submitted: 2005-11-16 03:24 UTC
From: richtl at arscognita dot com Assigned: lsmith
Status: Closed Package: MDB2_Schema
PHP Version: 5.1.0 OS: linux
Roadmaps: (Not assigned)    

 [2005-11-16 03:24 UTC] richtl at arscognita dot com
Description: ------------ Updating a database from one schema to another generates an error with both the mysql and mysqli drivers. I am using MySQL 5.0. Test script: --------------- My test script drops any existing DB, deletes the xml.old file, creates schema1.xml successfully, and then throws an error when calling updateDatabase() on the schema2.xml. schema1.xml is: <?xml version="1.0" encoding="ISO-8859-1" ?> <database> <name><variable>database_name</variable></name> <create><variable>create_db</variable></create> <table><name>table1</name> <declaration> <field><name>field1</name> <type>integer</type> </field> <index><name>table1_field1</name> <field><name>field1</name></field> </index> </declaration> </table> </database> schema2.xml is: <?xml version="1.0" encoding="ISO-8859-1" ?> <database> <name><variable>database_name</variable></name> <create><variable>create_db</variable></create> <table><name>table1</name> <declaration> <field><name>field1</name> <type>integer</type> </field> <field><name>field2</name> <type>integer</type> </field> <index><name>table1_field1</name> <field><name>field1</name></field> </index> </declaration> </table> </database> Expected result: ---------------- Clean upgrade. Actual result: -------------- Warning: array_key_exists(): The second argument should be either an array or an object in /usr/share/pear/MDB2/Schema.php on line 1360 Call Stack: 0.0010 48512 1. {main}() /home/richtl/workspace/libmindmeld/install/makedb.php:0 0.4116 2522728 2. MDB2_Schema->updateDatabase() /home/richtl/workspace/libmindmeld/install/makedb.php:13 0.4646 2535104 3. MDB2_Schema->alterDatabase() /usr/share/pear/MDB2/Schema.php:1910 0.4673 2546200 4. MDB2_Schema->alterDatabaseTables() /usr/share/pear/MDB2/Schema.php:1478 0.4674 2546200 5. array_key_exists() /usr/share/pear/MDB2/Schema.php:1360


 [2005-11-16 11:06 UTC] lsmith
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.