diff options
author | unknown <igor@rurik.mysql.com> | 2004-09-02 22:07:07 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2004-09-02 22:07:07 -0700 |
commit | 3f79af6a5c112e29674ef4b7537a2767700d51c1 (patch) | |
tree | 3223f4d6ec8bfbe6a66219609d9cb848ad8b20d2 /sql/sql_select.cc | |
parent | f956ce5284ea964f11f4c5b44cf762dfd244a451 (diff) | |
parent | 76936acef507d98c35dfb0500ea2bd7a02f2f83f (diff) | |
download | mariadb-git-3f79af6a5c112e29674ef4b7537a2767700d51c1.tar.gz |
Merge rurik.mysql.com:/home/igor/mysql-4.0
into rurik.mysql.com:/home/igor/dev/mysql-4.0-0
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cf5e8a75f85..e46b7fb8b97 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4907,6 +4907,15 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos) } else { + if (!table->key_read && + (table->used_keys & ((key_map) 1 << tab->ref.key)) && + !table->no_keyread && + (int) table->reginfo.lock_type <= (int) TL_READ_HIGH_PRIORITY) + { + table->key_read=1; + table->file->extra(HA_EXTRA_KEYREAD); + tab->index= tab->ref.key; + } if ((error=join_read_const(tab))) { tab->info="unique row not found"; @@ -7623,7 +7632,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, sprintf(buff3,"%.0f",join->best_positions[i].records_read); item_list.push_back(new Item_string(buff3,strlen(buff3))); my_bool key_read=table->key_read; - if (tab->type == JT_NEXT && + if ((tab->type == JT_NEXT || tab->type == JT_CONST) && ((table->used_keys & ((key_map) 1 << tab->index)))) key_read=1; |