Bug #6562 traditional mode does not prevent alterations of NULL columns to NOT NULL
Submitted: 10 Nov 2004 22:09 Modified: 5 Apr 2005 21:03
Reporter: Matthew Lord Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.2 OS:Any (all)
Assigned to: Antony Curtis CPU Architecture:Any

[10 Nov 2004 22:09] Matthew Lord

traditional mode should prevent alter table foo modify name NOT NULL default ""; if name
already has NULL values in it.

How to repeat:
// start mysqld with ansi-mode=traditional

create table foo( a  int );

insert into foo ( a ) values ( 1 ), (NULL);

alter table foo modify a datetime default '1900-01-01' not null;

Suggested fix:
error on the alter table statement.
[28 Dec 2004 12:18] Ingo Strüwing
I take one review.
[28 Dec 2004 19:49] Ingo Strüwing
The code change is OK, but message texts must be reworked because of the new messages file.
[9 Mar 2005 14:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

[5 Apr 2005 21:03] Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at

Additional info:

This thing is already fixed in the current bk tree
Fix will be in 5.0.4