MySQL Forums
Forum List  »  Partitioning

Partitioning causes duplicate key error
Posted by: Jan Hansen
Date: May 23, 2006 09:32AM

I'm just trying out 5.1, largely because of the partitioning. I immediately run into a problem. Here's my definition:

CREATE TABLE `sentences` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`previous_entry` varchar(255) NOT NULL DEFAULT '',
`current_entry` varchar(255) NOT NULL DEFAULT '',
`next_entry` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `current_previous` (`current_entry`(31),`previous_entry`(31))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY(id) PARTITIONS 10;

The following works OK first time, and the id column ends up containing 1 as it should:

INSERT INTO sentences(previous_entry,current_entry,next_entry) values('a','b','c');

Next insert, though, I get a duplicate key error. If I remove the partitioning, the duplicate error does not occur and the autoincrement behaves as it should.

Is this a bug or have I done something wrong?

Options: ReplyQuote


Subject
Views
Written By
Posted
Partitioning causes duplicate key error
5752
May 23, 2006 09:32AM


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.