2520
2520
&handler::ha_optimize));
2525
Assigned specified indexes for a table into key cache
2528
mysql_assign_to_keycache()
2529
session Thread object
2530
tables Table list (one table only)
2537
bool mysql_assign_to_keycache(Session* session, TableList* tables,
2538
LEX_STRING *key_cache_name)
2540
HA_CHECK_OPT check_opt;
2541
KEY_CACHE *key_cache;
2544
pthread_mutex_lock(&LOCK_global_system_variables);
2545
if (!(key_cache= get_key_cache(key_cache_name)))
2547
pthread_mutex_unlock(&LOCK_global_system_variables);
2548
my_error(ER_UNKNOWN_KEY_CACHE, MYF(0), key_cache_name->str);
2551
pthread_mutex_unlock(&LOCK_global_system_variables);
2552
check_opt.key_cache= key_cache;
2553
return(mysql_admin_table(session, tables, &check_opt,
2554
"assign_to_keycache", TL_READ_NO_INSERT, 0, 0,
2555
0, 0, &handler::assign_to_keycache));
2560
Reassign all tables assigned to a key cache to another key cache
2563
reassign_keycache_tables()
2564
session Thread object
2565
src_cache Reference to the key cache to clean up
2566
dest_cache New key cache
2569
This is called when one sets a key cache size to zero, in which
2570
case we have to move the tables associated to this key cache to
2573
One has to ensure that one never calls this function while
2574
some other thread is changing the key cache. This is assured by
2575
the caller setting src_cache->in_init before calling this function.
2577
We don't delete the old key cache as there may still be pointers pointing
2578
to it for a while after this function returns.
2584
int reassign_keycache_tables(Session *,
2585
KEY_CACHE *src_cache,
2586
KEY_CACHE *dst_cache)
2588
assert(src_cache != dst_cache);
2589
assert(src_cache->in_init);
2590
src_cache->param_buff_size= 0; // Free key cache
2591
ha_resize_key_cache(src_cache);
2592
ha_change_key_cache(src_cache, dst_cache);
2596
2523
static bool mysql_create_like_schema_frm(Session* session,
2597
2524
TableList* schema_table,
2598
2525
HA_CREATE_INFO *create_info,