1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

use ref not range for ... WHERE key IN (val)

This commit is contained in:
serg@sergbook.mysql.com
2004-06-21 19:42:00 +03:00
parent 3b34ea8cd0
commit e2a3ca8637
2 changed files with 4 additions and 2 deletions

View File

@ -1590,12 +1590,14 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
// BETWEEN or IN
if (cond_func->key_item()->type() == Item::FIELD_ITEM)
add_key_field(key_fields,*and_level,
((Item_field*) (cond_func->key_item()))->field, 0,
((Item_field*) (cond_func->key_item()))->field,
#ifndef TO_BE_REMOVED_IN_4_1
/* special treatment for IN. Not necessary in 4.1 */
cond_func->argument_count() == 1,
cond_func->arguments() + (cond_func->functype() != Item_func::IN_FUNC),
cond_func->argument_count() - (cond_func->functype() != Item_func::IN_FUNC),
#else
cond_func->argument_count() == 2,
cond_func->arguments()+1, cond_func->argument_count()-1,
#endif
usable_tables);