Re: Partitioning causes duplicate key error
Posted by:
fz wsc
Date: May 27, 2006 03:32AM
The next table is OK:
CREATE TABLE `t1` (
`id` int(10) unsigned NOT NULL,
`p1` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC
COLLATE utf8_general_ci
PARTITION BY LINEAR KEY(`p1`)
PARTITIONS 4;
But I want id "auto_increment and unique", then error occurs:
mysql> CREATE TABLE `t1` (
-> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-> `p1` varchar(50) NOT NULL
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC
-> COLLATE utf8_general_ci
-> PARTITION BY LINEAR KEY(`p1`)
-> PARTITIONS 4;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto colum
n and it must be defined as a key
Subject
Views
Written By
Posted
5753
May 23, 2006 09:32AM
2552
May 24, 2006 05:06AM
2500
May 24, 2006 09:23AM
3038
May 27, 2006 03:15AM
Re: Partitioning causes duplicate key error
2405
May 27, 2006 03:32AM
2526
May 27, 2006 03:47AM
2671
May 27, 2006 08:06AM
2288
May 28, 2006 03:04AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.