summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2006-01-04 17:49:45 +0300
committerunknown <konstantin@mysql.com>2006-01-04 17:49:45 +0300
commit3456c4be3acf92c2ec54dc2551e4e2a02e95512a (patch)
treed0ba85a749cfceb9ceb00a014db23734e8656646 /sql/sql_cache.cc
parent314f0fbf32d33baab1d43de180892a274f46992d (diff)
parentf577d864cdac14d9a5cf7714b3506bab7688b1c7 (diff)
downloadmariadb-git-3456c4be3acf92c2ec54dc2551e4e2a02e95512a.tar.gz
Merge mysql.com:/opt/local/work/mysql-4.1-7209-new
into mysql.com:/opt/local/work/mysql-5.0-merge mysys/hash.c: Auto merged ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp: Auto merged sql/lock.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_acl.cc: Manual merge. sql/sql_base.cc: Manual merge.
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 0a01832bb39..cf3ba9c8c40 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -3050,6 +3050,7 @@ my_bool Query_cache::move_by_type(byte **border,
}
case Query_cache_block::TABLE:
{
+ HASH_SEARCH_STATE record_idx;
DBUG_PRINT("qcache", ("block 0x%lx TABLE", (ulong) block));
if (*border == 0)
break;
@@ -3067,7 +3068,7 @@ my_bool Query_cache::move_by_type(byte **border,
byte *key;
uint key_length;
key=query_cache_table_get_key((byte*) block, &key_length, 0);
- hash_search(&tables, (byte*) key, key_length);
+ hash_first(&tables, (byte*) key, key_length, &record_idx);
block->destroy();
new_block->init(len);
@@ -3101,7 +3102,7 @@ my_bool Query_cache::move_by_type(byte **border,
/* Fix pointer to table name */
new_block->table()->table(new_block->table()->db() + tablename_offset);
/* Fix hash to point at moved block */
- hash_replace(&tables, tables.current_record, (byte*) new_block);
+ hash_replace(&tables, &record_idx, (byte*) new_block);
DBUG_PRINT("qcache", ("moved %lu bytes to 0x%lx, new gap at 0x%lx",
len, (ulong) new_block, (ulong) *border));
@@ -3109,6 +3110,7 @@ my_bool Query_cache::move_by_type(byte **border,
}
case Query_cache_block::QUERY:
{
+ HASH_SEARCH_STATE record_idx;
DBUG_PRINT("qcache", ("block 0x%lx QUERY", (ulong) block));
if (*border == 0)
break;
@@ -3126,7 +3128,7 @@ my_bool Query_cache::move_by_type(byte **border,
byte *key;
uint key_length;
key=query_cache_query_get_key((byte*) block, &key_length, 0);
- hash_search(&queries, (byte*) key, key_length);
+ hash_first(&queries, (byte*) key, key_length, &record_idx);
// Move table of used tables
memmove((char*) new_block->table(0), (char*) block->table(0),
ALIGN_SIZE(n_tables*sizeof(Query_cache_block_table)));
@@ -3194,7 +3196,7 @@ my_bool Query_cache::move_by_type(byte **border,
net->query_cache_query= (gptr) new_block;
}
/* Fix hash to point at moved block */
- hash_replace(&queries, queries.current_record, (byte*) new_block);
+ hash_replace(&queries, &record_idx, (byte*) new_block);
DBUG_PRINT("qcache", ("moved %lu bytes to 0x%lx, new gap at 0x%lx",
len, (ulong) new_block, (ulong) *border));
break;