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

Bug #13836 updateDatabase() does not remove default
Submitted: 2008-05-04 12:34 UTC Modified: 2008-11-15 14:24 UTC
From: hschletz Assigned: ifeghali
Status: Closed Package: MDB2_Schema (version 0.8.2)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2008-05-04 12:34 UTC] hschletz (Holger Schletz)
Description: ------------ When updateDatabase() is called on a column with a default value and the new column specification does not have a default, the default value remains unchanged instead of being removed (i.e. set to NULL). I have set "force_defaults" to "false" - maybe this is necessary to reproduce the problem. I found out that in the array of changes the 'default' element is present and set to 1, but the corresponding 'definition' element does not contain a 'default' element. The subsequently called to alterTable() interprets this as "don't change". The attached patch detects this situation and inserts a NULL default which is handled as expected by alterTable().

Comments

 [2008-11-15 14:24 UTC] ifeghali (Igor Feghali)
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.