Bug #15276 [Fbk]: Upgrading setting NOT NULL column default value to NULL
| From: | jan at horde dot org | Date: | Tue, 24 Feb 2009 14:56:10 +0000 |
| Subject: | Bug #15276 [Fbk]: Upgrading setting NOT NULL column default value to NULL | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-71@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=15276&edit=1
ID: 15276
Updated by: jan@horde.org
Reported By: jan at horde dot org
Summary: Upgrading setting NOT NULL column default value to
NULL
Status: Feedback
Type: Bug
Package: MDB2_Schema
Package Version: CVS
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
I don't think we should assume too much. I'd prefer to get an error
instead if I try to unset the default value on a NOT NULL column. This
way the schema author can resolve that conflict manually to exactly do
what he wants. That's better than guessing, I think.
Previous Comments:
------------------------------------------------------------------------
[2009-02-22 14:41:52] ifeghali
<div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Feedback</span>
</div>
Hello Jan,
If there is no "default" in the new field definition, shouldn't we
assume the field isn't "notnull" also ?
Say Field A is NOT NULL DEFAULT "FOO". It would make no sense to remove
the <default> tag from the new XML schema but leave <notnull> = 1.
What do you think ?
------------------------------------------------------------------------
[2008-12-09 09:58:00] yunosh
Description:
------------
If during a field update the default value is no longer set, the
default value is set to NULL. When this happens, a check is missing
whether this is allowed at all. The attached patch fixes this.
Alternatively this check might happen where the actual update query is
build.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=15276&edit=1