mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge from next-mr.
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "sp_head.h"
|
||||
#include "sql_trigger.h"
|
||||
#include "sql_show.h"
|
||||
#include "keycaches.h"
|
||||
|
||||
#ifdef __WIN__
|
||||
#include <io.h>
|
||||
@ -2216,10 +2217,10 @@ static int sort_keys(KEY *a, KEY *b)
|
||||
{
|
||||
if (!(b_flags & HA_NOSAME))
|
||||
return -1;
|
||||
if ((a_flags ^ b_flags) & (HA_NULL_PART_KEY | HA_END_SPACE_KEY))
|
||||
if ((a_flags ^ b_flags) & HA_NULL_PART_KEY)
|
||||
{
|
||||
/* Sort NOT NULL keys before other keys */
|
||||
return (a_flags & (HA_NULL_PART_KEY | HA_END_SPACE_KEY)) ? 1 : -1;
|
||||
return (a_flags & HA_NULL_PART_KEY) ? 1 : -1;
|
||||
}
|
||||
if (a->name == primary_key_name)
|
||||
return -1;
|
||||
@ -5058,45 +5059,6 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Reassign all tables assigned to a key cache to another key cache
|
||||
|
||||
SYNOPSIS
|
||||
reassign_keycache_tables()
|
||||
thd Thread object
|
||||
src_cache Reference to the key cache to clean up
|
||||
dest_cache New key cache
|
||||
|
||||
NOTES
|
||||
This is called when one sets a key cache size to zero, in which
|
||||
case we have to move the tables associated to this key cache to
|
||||
the "default" one.
|
||||
|
||||
One has to ensure that one never calls this function while
|
||||
some other thread is changing the key cache. This is assured by
|
||||
the caller setting src_cache->in_init before calling this function.
|
||||
|
||||
We don't delete the old key cache as there may still be pointers pointing
|
||||
to it for a while after this function returns.
|
||||
|
||||
RETURN VALUES
|
||||
0 ok
|
||||
*/
|
||||
|
||||
int reassign_keycache_tables(THD *thd, KEY_CACHE *src_cache,
|
||||
KEY_CACHE *dst_cache)
|
||||
{
|
||||
DBUG_ENTER("reassign_keycache_tables");
|
||||
|
||||
DBUG_ASSERT(src_cache != dst_cache);
|
||||
DBUG_ASSERT(src_cache->in_init);
|
||||
src_cache->param_buff_size= 0; // Free key cache
|
||||
ha_resize_key_cache(src_cache);
|
||||
ha_change_key_cache(src_cache, dst_cache);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Preload specified indexes for a table into key cache
|
||||
|
||||
|
Reference in New Issue
Block a user