MySQL Forums
Forum List  »  Partitioning

Re: Partitioning causes duplicate key error
Posted by: fz wsc
Date: May 27, 2006 03:47AM

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>

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partitioning causes duplicate key error
2525
May 27, 2006 03:47AM


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.