1
create table t1 (a decimal(10,4) not null, primary key(a)) engine='InnoDB'
3
partition pa1 max_rows=20 min_rows=2,
4
partition pa2 max_rows=30 min_rows=3,
5
partition pa3 max_rows=30 min_rows=4,
6
partition pa4 max_rows=40 min_rows=2);
10
`a` decimal(10,4) NOT NULL,
12
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) */
13
insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567);
27
select * from t1 where a=1234.567;
30
delete from t1 where a=1234.567;
44
create table t2 (a decimal(18,9) not null, primary key(a)) engine='InnoDB'
45
partition by key (a) partitions 10;
48
t2 CREATE TABLE `t2` (
49
`a` decimal(18,9) NOT NULL,
51
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
52
insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567);
63
select * from t2 where a=1234.567;
66
delete from t2 where a=1234.567;
78
select count(*) from t2;