21 #include "myisamdef.h"
50 int mi_assign_to_key_cache(
MI_INFO *info,
51 ulonglong
key_map __attribute__((unused)),
56 DBUG_ENTER(
"mi_assign_to_key_cache");
57 DBUG_PRINT(
"enter",(
"old_key_cache_handle: 0x%lx new_key_cache_handle: 0x%lx",
58 (
long) share->key_cache, (
long) key_cache));
64 if (share->key_cache == key_cache)
79 if (flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE))
82 mi_print_error(info->s, HA_ERR_CRASHED);
83 mi_mark_crashed(info);
94 (void) flush_key_blocks(key_cache, share->kfile, FLUSH_RELEASE);
105 share->key_cache= key_cache;
108 if (multi_key_cache_set((uchar*) share->unique_file_name,
109 share->unique_name_length,
138 void mi_change_key_cache(
KEY_CACHE *old_key_cache,
142 DBUG_ENTER(
"mi_change_key_cache");
148 for (pos=myisam_open_list ; pos ; pos=pos->next)
152 if (share->key_cache == old_key_cache)
153 mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache);
161 multi_key_cache_change(old_key_cache, new_key_cache);