From 373f3516849ae789c0419b933b1dc35dac158055 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Oct 2003 13:06:55 +0200 Subject: key_map with more that 64 bits width sql/field.cc: typedef Bitmap<64> key_map all tests pass sql/ha_berkeley.cc: typedef Bitmap<64> key_map all tests pass sql/ha_berkeley.h: typedef Bitmap<64> key_map all tests pass sql/item.cc: typedef Bitmap<64> key_map all tests pass sql/item_func.cc: typedef Bitmap<64> key_map all tests pass sql/opt_sum.cc: typedef Bitmap<64> key_map all tests pass sql/sql_delete.cc: typedef Bitmap<64> key_map all tests pass sql/sql_show.cc: typedef Bitmap<64> key_map all tests pass sql/sql_test.cc: typedef Bitmap<64> key_map all tests pass sql/sql_update.cc: typedef Bitmap<64> key_map all tests pass include/my_bitmap.h: more bitmap methods mysys/my_bitmap.c: more bitmap methods sql/field.h: init bitmaps sql/ha_innodb.h: optimization sql/ha_isam.cc: optimization sql/ha_myisam.cc: optimization sql/ha_myisammrg.cc: optimization sql/handler.h: optimization sql/mysqld.cc: bitmap_init() interface changed sql/opt_range.cc: optimization sql/opt_range.h: optimization sql/slave.cc: bitmap_init() interface changed sql/sql_base.cc: optimization sql/sql_select.cc: init bitmaps using const for bitmaps whenever possible sql/sql_select.h: cleanup sql/table.cc: always init bitmaps BitKeeper/etc/ignore: Added sql/udf_example.so to the ignore list sql/mysql_priv.h: use Bitmap over ulonglong by default --- sql/ha_myisam.cc | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'sql/ha_myisam.cc') diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index cec1aefa2d5..9fa99dc26d5 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -705,20 +705,21 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt) DBUG_ENTER("ha_myisam::preload_keys"); - /* Check validity of the index references */ + /* Check validity of the index references */ if (table_list->use_index) { - key_map kmap= get_key_map_from_key_list(table, table_list->use_index); - if (kmap == ~(key_map) 0) + 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) - map= kmap; + if (!kmap.is_clear_all()) + map= kmap.to_ulonglong(); } - + mi_extra(file, HA_EXTRA_PRELOAD_BUFFER_SIZE, (void *) &thd->variables.preload_buff_size); @@ -731,16 +732,16 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt) case HA_ERR_OUT_OF_MEM: errmsg= "Failed to allocate buffer"; break; - default: + default: char buf[ERRMSGSIZE+20]; - my_snprintf(buf, ERRMSGSIZE, + my_snprintf(buf, ERRMSGSIZE, "Failed to read from index file (errno: %d)", my_errno); errmsg= buf; } error= HA_ADMIN_FAILED; goto err; } - + DBUG_RETURN(HA_ADMIN_OK); err: @@ -1022,9 +1023,9 @@ void ha_myisam::info(uint flag) ref_length=info.reflength; table->db_options_in_use = info.options; block_size=myisam_block_size; - table->keys_in_use= (set_bits(key_map, table->keys) & - (key_map) info.key_map); - table->keys_for_keyread= table->keys_in_use & ~table->read_only_keys; + table->keys_in_use.set_prefix(table->keys).intersect(info.key_map); + table->keys_for_keyread= table->keys_in_use; + table->keys_for_keyread.subtract(table->read_only_keys); table->db_record_offset=info.record_offset; if (table->key_parts) memcpy((char*) table->key_info[0].rec_per_key, -- cgit v1.2.1