summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-03-09 17:54:13 +0200
committerunknown <gkodinov/kgeorge@magare.gmz>2007-03-09 17:54:13 +0200
commit8555b8d7aba1de9b75c6242fe535ffb65972e8ec (patch)
tree8e59ca2cf3c5b7a4f42d291a1dccd71a60712715 /storage
parent209802eb79f69afd20b8e21db3b86ff6d9d933ea (diff)
parent79542930ea1c969a9300fe622be15eeecee2c48e (diff)
downloadmariadb-git-8555b8d7aba1de9b75c6242fe535ffb65972e8ec.tar.gz
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.1-opt BitKeeper/deleted/.del-sql_parse.cc.rej: Auto merged BitKeeper/deleted/.del-table.cc.rej: Auto merged mysql-test/r/endspace.result: Auto merged mysql-test/t/group_by.test: Auto merged sql/item.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged BitKeeper/deleted/.del-mysqld.cc.rej~35c1c438e11ebd89: Auto merged mysql-test/r/group_by.result: manual merge to 5.1-opt sql/mysqld.cc: manual merge to 5.1-opt sql/sql_base.cc: manual merge to 5.1-opt sql/sql_select.cc: manual merge to 5.1-opt sql/table.h: manual merge to 5.1-opt
Diffstat (limited to 'storage')
-rw-r--r--storage/myisam/ha_myisam.cc49
1 files changed, 24 insertions, 25 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 06ec5c4b44e..4d358008058 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1121,23 +1121,22 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
KEY_CACHE *new_key_cache= check_opt->key_cache;
const char *errmsg= 0;
int error= HA_ADMIN_OK;
- ulonglong map= ~(ulonglong) 0;
+ ulonglong map;
TABLE_LIST *table_list= table->pos_in_table_list;
DBUG_ENTER("ha_myisam::assign_to_keycache");
- /* Check validity of the index references */
- if (table_list->use_index)
+ table->keys_in_use_for_query.clear_all();
+
+ if (table_list->process_index_hints(table))
{
- /* We only come here when the user did specify an index map */
- key_map kmap;
- if (get_key_map_from_key_list(&kmap, table, table_list->use_index))
- {
- errmsg= thd->net.last_error;
- error= HA_ADMIN_FAILED;
- goto err;
- }
- map= kmap.to_ulonglong();
+ errmsg= thd->net.last_error;
+ error= HA_ADMIN_FAILED;
+ goto err;
}
+ map= ~(ulonglong) 0;
+ if (!table->keys_in_use_for_query.is_clear_all())
+ /* use all keys if there's no list specified by the user through hints */
+ map= table->keys_in_use_for_query.to_ulonglong();
if ((error= mi_assign_to_key_cache(file, map, new_key_cache)))
{
@@ -1173,27 +1172,27 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
{
int error;
const char *errmsg;
- ulonglong map= ~(ulonglong) 0;
+ ulonglong map;
TABLE_LIST *table_list= table->pos_in_table_list;
my_bool ignore_leaves= table_list->ignore_leaves;
DBUG_ENTER("ha_myisam::preload_keys");
- /* Check validity of the index references */
- if (table_list->use_index)
+ table->keys_in_use_for_query.clear_all();
+
+ if (table_list->process_index_hints(table))
{
- key_map kmap;
- get_key_map_from_key_list(&kmap, table, table_list->use_index);
- if (kmap.is_set_all())
- {
- errmsg= thd->net.last_error;
- error= HA_ADMIN_FAILED;
- goto err;
- }
- if (!kmap.is_clear_all())
- map= kmap.to_ulonglong();
+ errmsg= thd->net.last_error;
+ error= HA_ADMIN_FAILED;
+ goto err;
}
+ map= ~(ulonglong) 0;
+ /* Check validity of the index references */
+ if (!table->keys_in_use_for_query.is_clear_all())
+ /* use all keys if there's no list specified by the user through hints */
+ map= table->keys_in_use_for_query.to_ulonglong();
+
mi_extra(file, HA_EXTRA_PRELOAD_BUFFER_SIZE,
(void *) &thd->variables.preload_buff_size);