create database if not exists keycache_bug; use keycache_bug; create table trc (c int, key i(c)) partition by range(c) ( partition p0 values less than (10), partition p1 values less than (20), partition p2 values less than (30), partition p3 values less than (40) ); create table tlc (c int, key i(c)) partition by list(c) ( partition p0 values in (1,5,9), partition p1 values in (2,6,10), partition p2 values in (3,7,11), partition p3 values in (4,8,12) ); create table thc (c int, key i(c)) partition by hash(c) partitions 4; create table tkc (c int, key i(c)) partition by key(c) partitions 4; insert into trc values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); insert into tlc values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); insert into thc values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); insert into tkc values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); set global kc_trc.key_buffer_size = 256*1024; set global kc_tlc.key_buffer_size = 256*1024; set global kc_thc.key_buffer_size = 256*1024; set global kc_tkc.key_buffer_size = 256*1024; cache index trc partition p0 in kc_trc; cache index trc partition p1 in kc_trc; cache index trc partition all in kc_trc; cache index trc key i partition p0 in kc_trc; cache index trc key i in kc_trc; cache index trc in kc_trc; load index into cache trc partition p0; load index into cache trc partition p1; load index into cache trc partition all; load index into cache trc; cache index tlc partition p0 in kc_tlc; cache index tlc partition p1 in kc_tlc; cache index tlc partition all in kc_tlc; cache index tlc key i partition p0 in kc_tlc; cache index tlc key i in kc_tlc; cache index tlc in kc_tlc; load index into cache tlc partition p0; load index into cache tlc partition p1; load index into cache tlc partition all; load index into cache tlc; cache index thc partition p0 in kc_thc; cache index thc partition p1 in kc_thc; cache index thc partition all in kc_thc; cache index thc key i partition p0 in kc_thc; cache index thc key i in kc_thc; cache index thc in kc_thc; load index into cache thc partition p0; load index into cache thc partition p1; load index into cache thc partition all; load index into cache thc; cache index tkc partition p0 in kc_tkc; cache index tkc partition p1 in kc_tkc; cache index tkc partition all in kc_tkc; cache index tkc key i partition p0 in kc_tkc; cache index tkc key i in kc_tkc; cache index tkc in kc_tkc; load index into cache tkc partition p0; load index into cache tkc partition p1; load index into cache tkc partition all; load index into cache tkc;