c:\dbs>c:\dbs\5.1\bin\mysql -uroot --port=3510 --prompt="mysql 5.1 >" Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.35-Win X64 revno: 2852-log Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql 5.1 >drop database if exists tst; Query OK, 0 rows affected, 1 warning (0.05 sec) mysql 5.1 >create database tst; Query OK, 1 row affected (0.09 sec) mysql 5.1 >use tst; Database changed mysql 5.1 >create table t (i int not null auto_increment, primary key(i), f int) engine=innodb -> partition by hash(i) partitions 4; Query OK, 0 rows affected (0.41 sec) mysql 5.1 >insert into t ( f ) values ( 10 ); Query OK, 1 row affected (0.14 sec) mysql 5.1 >insert into t ( f ) values ( 20 ); Query OK, 1 row affected (0.13 sec) mysql 5.1 >insert into t ( i, f ) values ( -1, -10 ); Query OK, 1 row affected (0.13 sec) mysql 5.1 >insert into t ( f ) values ( 30 ); Query OK, 1 row affected (0.09 sec) mysql 5.1 >insert into t ( f ) values ( 40 ); ERROR 1062 (23000): Duplicate entry '2' for key 'PRIMARY' mysql 5.1 >select * from t; +----+------+ | i | f | +----+------+ | 1 | 30 | | -1 | -10 | | 1 | 10 | | 2 | 20 | +----+------+ 4 rows in set (0.00 sec) mysql 5.1 > mysql 5.1 >drop database if exists tst; Query OK, 1 row affected (0.31 sec) mysql 5.1 >create database tst; Query OK, 1 row affected (0.05 sec) mysql 5.1 >use tst; Database changed mysql 5.1 >-- Table without partition mysql 5.1 >create table t (i int not null auto_increment, primary key(i), f int) engine=innodb; Query OK, 0 rows affected (0.09 sec) mysql 5.1 >insert into t ( f ) values ( 10 ); Query OK, 1 row affected (0.13 sec) mysql 5.1 >insert into t ( f ) values ( 20 ); Query OK, 1 row affected (0.13 sec) mysql 5.1 >insert into t ( i, f ) values ( -1, -10 ); Query OK, 1 row affected (0.09 sec) mysql 5.1 >insert into t ( f ) values ( 30 ); Query OK, 1 row affected (0.08 sec) mysql 5.1 >insert into t ( f ) values ( 40 ); Query OK, 1 row affected (0.09 sec) mysql 5.1 >select * from t; +----+------+ | i | f | +----+------+ | -1 | -10 | | 1 | 10 | | 2 | 20 | | 3 | 30 | | 4 | 40 | +----+------+ 5 rows in set (0.00 sec) mysql 5.1 > mysql 5.1 >-- Table with partition MyISAM engine mysql 5.1 > mysql 5.1 >drop database if exists tst; Query OK, 1 row affected (0.11 sec) mysql 5.1 >create database tst; Query OK, 1 row affected (0.05 sec) mysql 5.1 >use tst; Database changed mysql 5.1 >create table t (i int not null auto_increment, primary key(i), f int) engine=MyISAM -> partition by hash(i) partitions 4; Query OK, 0 rows affected (0.09 sec) mysql 5.1 >insert into t ( f ) values ( 10 ); Query OK, 1 row affected (0.03 sec) mysql 5.1 >insert into t ( f ) values ( 20 ); Query OK, 1 row affected (0.05 sec) mysql 5.1 >insert into t ( i, f ) values ( -1, -10 ); Query OK, 1 row affected (0.06 sec) mysql 5.1 >insert into t ( f ) values ( 30 ); Query OK, 1 row affected (0.02 sec) mysql 5.1 >insert into t ( f ) values ( 40 ); ERROR 1062 (23000): Duplicate entry '2' for key 'PRIMARY' mysql 5.1 >select * from t; +----+------+ | i | f | +----+------+ | 1 | 30 | | 1 | 10 | | -1 | -10 | | 2 | 20 | +----+------+ 4 rows in set (0.00 sec) mysql 5.1 > mysql 5.1 >