Bug #7884 Able to add invalid unique index on TIMESTAMP prefix
Submitted: 13 Jan 2005 19:40 Modified: 31 Jan 2005 19:24
Reporter: Dean Ellis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10 OS:
Assigned to: Dmitry Lenev CPU Architecture:Any

[13 Jan 2005 19:40] Dean Ellis
Description:
You can add an invalid index on a TIMESTAMP column prefix via ALTER TABLE.  (It is rejected by CREATE TABLE).  Subsequent inserts can fail for some table definitions (in MyISAM you receive "Invalid Keyfile" errors).

This was seen in 4.1.7 and verified in 4.1.10; does not occur in 4.0.24.

How to repeat:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( a TIMESTAMP, UNIQUE ( a(1) ) );
CREATE TABLE t1 ( a TIMESTAMP );
ALTER TABLE t1 ADD UNIQUE ( a(1) );

Suggested fix:
n/a
[26 Jan 2005 11:48] Dmitry Lenev
Fixed in 4.1.10 and 5.0.3
[31 Jan 2005 19:24] Paul DuBois
Mentioned in 4.1.10 and 5.0.3 change notes.