

create table mil (a int);
insert into mil select A.a + 1000*B.a from test.one_k A, test.one_k B;
CREATE TABLE tb_test (
   pk1 int(11) NOT NULL,
   pk2 int(11) NOT NULL,
   fd5 bigint(20) DEFAULT NULL,
   filler1 char(200),
   filler2 char(200),
   PRIMARY KEY (pk1,pk2),
   UNIQUE KEY ux_pk1_fd5 (pk1,fd5)
 ) ENGINE=InnoDB PARTITION BY KEY (pk1) PARTITIONS 5;

insert into tb_test 
 select 
   mil1.a + four.a*1000*1000,
   mil1.a + four.a*1000*1000 + 4*1000*1000*bin1.a,
   mil1.a + four.a*1000*1000 + 4*1000*1000*bin1.a,
   'filler1-data-filler1-data-',
   'filler2-data-filler2-data-'
 from
   mil mil1, test.ten bin1, test.ten four
 where
   bin1.a in (0,1) and four.a in (0,1,2,3)
;
update tb_test set pk1=8287001 where pk1 between 100*1000 and 100*1000 + 61;
update tb_test set pk1=8287001 where pk1 between 100*1000 and 100*1000 + 64000;
update tb_test set pk1=pk2 where pk1=8287001 ;
update tb_test set pk1=8287001 where pk1 between 100*1000 and 100*1000 + 32000;


