Hi,
I tried this in the latest 5.1 tree (BitKeeper version) and it had no
problem. Most likely you are hitting BUG #18753 which was fixed
in 5.1.10. I think 5.1.10 is not out yet so if you need to check this
you probably have to use a software version of 5.1.
Rgrds Mikael
Jan Hansen wrote:
> 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?
Mikael Ronstrom
Senior Software Architect, MySQL AB
My blog:
http://mikaelronstrom.blogspot.com