Loading mysql-test/r/range.result +1 −1 Original line number Diff line number Diff line Loading @@ -255,7 +255,7 @@ t1 ref y y 5 const 1 Using where t2 range x x 5 NULL 2 Using where explain select count(*) from t1 where x in (1); table type possible_keys key key_len ref rows Extra t1 range x x 5 NULL 1 Using where; Using index t1 ref x x 5 const 1 Using where; Using index explain select count(*) from t1 where x in (1,2); table type possible_keys key key_len ref rows Extra t1 range x x 5 NULL 2 Using where; Using index Loading sql/sql_select.cc +3 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
mysql-test/r/range.result +1 −1 Original line number Diff line number Diff line Loading @@ -255,7 +255,7 @@ t1 ref y y 5 const 1 Using where t2 range x x 5 NULL 2 Using where explain select count(*) from t1 where x in (1); table type possible_keys key key_len ref rows Extra t1 range x x 5 NULL 1 Using where; Using index t1 ref x x 5 const 1 Using where; Using index explain select count(*) from t1 where x in (1,2); table type possible_keys key key_len ref rows Extra t1 range x x 5 NULL 2 Using where; Using index Loading
sql/sql_select.cc +3 −1 Original line number Diff line number Diff line Loading @@ -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); Loading