Bug #390 | Discrepancy with ISO about primary key and NOT NULL (error 1171) | ||
---|---|---|---|
Submitted: | 7 May 2003 9:14 | Modified: | 13 May 2003 11:10 |
Reporter: | Raf Schietekat | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.0.13 | OS: | Any (All) |
Assigned to: | Per-Erik Martin | CPU Architecture: | Any |
[7 May 2003 9:14]
Raf Schietekat
[13 May 2003 10:20]
Per-Erik Martin
This also fixed this problem (as noted in t/key.test). The ALTER TABLE below now works: CREATE TABLE t1 (program enum('signup','unique','sliding') not null, type enum('basic','sliding','signup'), sites set('mt'), PRIMARY KEY (program)); ALTER TABLE t1 modify program enum('signup','unique','sliding');
[13 May 2003 11:10]
Per-Erik Martin
Thank you for your bug report. This issue has been fixed in the latest development tree for that product. You can find more information about accessing our development trees at http://www.mysql.com/doc/en/Installing_source_tree.html
[14 May 2003 11:25]
Peter Gulutzan
An additional note about what ISO's requirements are ... In SQL-92 entry level, any column which you use in a PRIMARY KEY or UNIQUE clause must be explicitly declared as NOT NULL. So many DBMSs (including DB2 and Ingres and InterBase and Sybase the last time I looked) require NOT NULL. In SQL-92 intermediate, and in SQL-99, the NOT NULL is implied. MySQL is now moving to SQL-99 compliance, hence the change, but this example shows why it's good to be specific about the ISO version and level number when asking about compliance.
[17 Mar 2005 12:55]
Daniel
It's still not fixed! We have to specify it explicitly. I am using 4.1