Bug #29418 ERROR 1491 (HY000): A UNIQUE INDEX must include all columns in the table's parti
Submitted: 28 Jun 2007 12:42 Modified: 28 Jun 2007 13:03
Reporter: Mauro Braggio Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version: 5.1.19-beta-log MySQL OS:Linux
Assigned to: CPU Architecture:Any

[28 Jun 2007 12:42] Mauro Braggio
Description:
if i alter a table mysql return me this error:

ERROR 1491 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function

The indexes is correct, if they are incorrect mysql returns:

ERROR 1491 (HY000): A PRIMARY INDEX must include all columns in the table's partitioning function

If i create a new table, mysql works.

How to repeat:
CREATE TABLE test  (
  `sr_recno` bigint(15) NOT NULL AUTO_INCREMENT,
  `d1` date NOT NULL DEFAULT '0000-00-00',
 PRIMARY KEY (`sr_recno`,`data_mov`),
)

ALTER TABLE test PARTITION BY RANGE (year(data_mov)) (  PARTITION p0 VALUES LESS THAN (1995) );
[28 Jun 2007 13:03] Mauro Braggio
I can't reproduce the error.