records_in_range start_key, end_key
select * from federatedTest where name='aaa';
(gdb) p *start_key
$2 = {key = 0x7f64f4103be8 "", length = 23, keypart_map = 1, flag = HA_READ_KEY_EXACT}
(gdb) p *end_key
$3 = {key = 0x7f64f4104ae6 "", length = 23, keypart_map = 1, flag = HA_READ_AFTER_KEY}
select * from federatedTest use index (idx_name_age) where name='aaa' and age=10;
(gdb) p *start_key
$6 = {key = 0x7f64f4103be8 "", length = 28, keypart_map = 3, flag = HA_READ_KEY_EXACT}
(gdb) p *end_key
$7 = {key = 0x7f64f4104ae6 "", length = 28, keypart_map = 3, flag = HA_READ_AFTER_KEY}
select * from federatedTest use index (idx_name_age) where name='aaa' and age>10;
(gdb) p *start_key
$8 = {key = 0x7f64f4103be8 "", length = 28, keypart_map = 3, flag = HA_READ_AFTER_KEY}
(gdb) p *end_key
$9 = {key = 0x7f64f4104ae6 "", length = 23, keypart_map = 1, flag = HA_READ_AFTER_KEY}
select * from federatedTest use index (idx_name_age) where name > 'aaa' ;
(gdb) p *start_key
$10 = {key = 0x7f64f4103be8 "", length = 23, keypart_map = 1, flag = HA_READ_AFTER_KEY}
(gdb) p *end_key
Cannot access memory at address 0x0
select * from federatedTest use index (idx_name_age) where name > 'aaa' and age >10;
$11 = {key = 0x7f64f4103be8 "", length = 23, keypart_map = 1, flag = HA_READ_AFTER_KEY}
(gdb) p *end_key
Cannot access memory at address 0x0
select * from federatedTest use index (idx_name_age) where name > 'aaa' and age <10;
(gdb) p *start_key
$12 = {key = 0x7f64f4103be8 "", length = 23, keypart_map = 1, flag = HA_READ_AFTER_KEY}
(gdb) p *end_key
Cannot access memory at address 0x0
(gdb)
select * from federatedTest use index (idx_name_age) where name = 'aaa' and age <10;
(gdb) p *start_key
$13 = {key = 0x7f64f4103be8 "", length = 28, keypart_map = 3, flag = HA_READ_AFTER_KEY}
(gdb) p *end_key
$14 = {key = 0x7f64f4104ae6 "", length = 28, keypart_map = 3, flag = HA_READ_BEFORE_KEY}
http://www.yougemysqldba.com
如有进一步需要请联系微信onesoft007
微博账号@友哥一指