MySQL Forums
Forum List  »  Partitioning

Re: Partitioning causes duplicate key error
Posted by: Mikael Ronström
Date: May 27, 2006 08:06AM

Hi,
I tried this in the latest bk tree and the behaviour was the
expected so it's also fixed by the bug fix I previously
mentioned.

Rgrds Mikael


fz wsc wrote:
> So I add "KEY" in the "create table" statement:
>
> CREATE TABLE `t1` (
> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
> `p1` varchar(50) NOT NULL,
> KEY(`id`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8
> ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1
> COLLATE utf8_general_ci
> PARTITION BY LINEAR KEY(`p1`)
> PARTITIONS 4;
>
>
> =============== the result is wrong apparently
> ===========
> mysql> insert into t1 values(null,'abc');
> Query OK, 1 row affected (0.00 sec)
>
> mysql> insert into t1 values(null,'abc');
> Query OK, 1 row affected (0.00 sec)
>
> mysql> insert into t1 values(null,'abc');
> Query OK, 1 row affected (0.00 sec)
>
> mysql> insert into t1 values(null,'abc');
> Query OK, 1 row affected (0.00 sec)
>
> mysql> insert into t1 values(null,'abc');
> Query OK, 1 row affected (0.00 sec)
>
> mysql> insert into t1 values(null,'abc');
> Query OK, 1 row affected (0.01 sec)
>
> mysql> insert into t1 values(null,'abc');
> Query OK, 1 row affected (0.00 sec)
>
> mysql> select * from t1;
> +----+-----+
> | id | p1 |
> +----+-----+
> | 1 | abc |
> | 1 | abc |
> | 1 | abc |
> | 1 | abc |
> | 1 | abc |
> | 1 | abc |
> | 1 | abc |
> +----+-----+
> 7 rows in set (0.01 sec)
>
> mysql>

Mikael Ronstrom
Senior Software Architect, MySQL AB
My blog: http://mikaelronstrom.blogspot.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partitioning causes duplicate key error
2669
May 27, 2006 08:06AM


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.