diff options
author | igor@rurik.mysql.com <> | 2004-09-02 22:07:07 -0700 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2004-09-02 22:07:07 -0700 |
commit | 5625988ca3a3959faa9f12bc895e7f2b02937b79 (patch) | |
tree | 3223f4d6ec8bfbe6a66219609d9cb848ad8b20d2 /sql | |
parent | f7bc60e0fc0848b441103a0303237031c56949cc (diff) | |
parent | f888026fdca8d3ee61d8b2fcac032cf0264b54c0 (diff) | |
download | mariadb-git-5625988ca3a3959faa9f12bc895e7f2b02937b79.tar.gz |
Merge rurik.mysql.com:/home/igor/mysql-4.0
into rurik.mysql.com:/home/igor/dev/mysql-4.0-0
Diffstat (limited to 'sql')
-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; |