diff options
Diffstat (limited to 'myisammrg/myrg_queue.c')
-rw-r--r-- | myisammrg/myrg_queue.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/myisammrg/myrg_queue.c b/myisammrg/myrg_queue.c index 4d94f984722..d6f831db48c 100644 --- a/myisammrg/myrg_queue.c +++ b/myisammrg/myrg_queue.c @@ -34,21 +34,24 @@ int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag) int error=0; QUEUE *q= &(info->by_key); - if (!is_queue_inited(q)) + if (inx < (int) info->keys) { - if (init_queue(q,info->tables, 0, - (myisam_readnext_vec[search_flag] == SEARCH_SMALLER), - queue_key_cmp, - info->open_tables->table->s->keyinfo[inx].seg)) - error=my_errno; - } - else - { - if (reinit_queue(q,info->tables, 0, - (myisam_readnext_vec[search_flag] == SEARCH_SMALLER), - queue_key_cmp, - info->open_tables->table->s->keyinfo[inx].seg)) - error=my_errno; + if (!is_queue_inited(q)) + { + if (init_queue(q,info->tables, 0, + (myisam_readnext_vec[search_flag] == SEARCH_SMALLER), + queue_key_cmp, + info->open_tables->table->s->keyinfo[inx].seg)) + error=my_errno; + } + else + { + if (reinit_queue(q,info->tables, 0, + (myisam_readnext_vec[search_flag] == SEARCH_SMALLER), + queue_key_cmp, + info->open_tables->table->s->keyinfo[inx].seg)) + error=my_errno; + } } return error; } |