> http://dev.mysql.com/doc/mysql/en/silent-column-changes.html > mentions that "Columns that are part of a PRIMARY KEY are made NOT NULL even > if not declared that way. " > > And http://dev.mysql.com/doc/mysql/en/create-table.html tells me that "A > PRIMARY KEY is a unique KEY where all key columns must be defined as NOT > NULL. If they are not explicitly declared as NOT NULL, MySQL declares them > so implicitly (and silently). " > > Why is this? I actually do need NULL values (they really are not equal to > '0', etc.), but also need this column as part of the PRIMARY key in an > InnoDB table... > It can't have anything to do with the 'uniqueness' of the data, since I can > have a lot of 'zero'-values in the column, as long as the combination of > columns in the PRIMARY key results in unique values.
Ehm... it might be me - but what sense does it make to have a NULL in a PK? If you "need" this, then your primary key probably isn't a primary key. Care to explain why and how you're designing your database? With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server Upscene Productions http://www.upscene.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]