diff options
author | unknown <serg@sergbook.mysql.com> | 2004-06-21 19:44:20 +0300 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2004-06-21 19:44:20 +0300 |
commit | 073de02c1346430a4ef7df57cd2e7ca7e36c641e (patch) | |
tree | 0c405beb40b91b73592b3c37552fd6f7bbcce847 | |
parent | 94df4f36dd315f569c3d52979475b004b8fefceb (diff) | |
parent | 83a4e46d8e6c324ae6f2232a36907a554a3d9dd4 (diff) | |
download | mariadb-git-073de02c1346430a4ef7df57cd2e7ca7e36c641e.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-4.0
mysql-test/r/range.result:
Auto merged
-rw-r--r-- | mysql-test/r/range.result | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 028f49a8d16..55e03731fc7 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -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 diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5b754186736..096b73c482f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -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); |