1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge next-mr -> next-4284.

This commit is contained in:
Konstantin Osipov
2010-02-03 03:06:42 +03:00
756 changed files with 16223 additions and 15025 deletions

View File

@ -25,6 +25,7 @@
#include "sql_trigger.h"
#include "sql_show.h"
#include "transaction.h"
#include "keycaches.h"
#ifdef __WIN__
#include <io.h>
@ -2290,10 +2291,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;
@ -5122,45 +5123,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