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