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

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

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:
Solve the problem : 17 + 4 = ?

 [2008-05-04 17: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().


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