From 5c8124bd43dd889e843ff1a90e9b109c28e4c8ef Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Jul 2002 22:36:34 +0300 Subject: fixed query cahe resize bug mysql-test/r/query_cache.result: query cache resize bug test mysql-test/t/query_cache.test: query cache resize bug test sql/set_var.cc: typo fixed sql/sql_cache.cc: prevent of using very small (unusable) cache size, that cause problem in memory allocation system (query cache resize bug) --- sql/set_var.cc | 2 +- sql/sql_cache.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'sql') diff --git a/sql/set_var.cc b/sql/set_var.cc index ec8a9e83ed3..a9882af546a 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -467,7 +467,7 @@ struct show_var_st init_vars[]= { {sys_read_buff_size.name, (char*) &sys_read_buff_size, SHOW_SYS}, {sys_read_rnd_buff_size.name,(char*) &sys_read_rnd_buff_size, SHOW_SYS}, {sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS}, -#ifdef HAVE_QUERTY_CACHE +#ifdef HAVE_QUERY_CACHE {sys_query_cache_limit.name,(char*) &sys_query_cache_limit, SHOW_SYS}, {sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS}, {sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS}, diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index cba9f17359a..7b5e1bf4e59 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1276,10 +1276,11 @@ ulong Query_cache::init_cache() query_cache_size -= additional_data_size; STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size <= min_allocation_unit) + if (max_mem_bin_size <= min_allocation_unit) { DBUG_PRINT("qcache", - (" query_cache_size <= min_allocation_unit => cache disabled")); + (" max bin size (%lu) <= min_allocation_unit => cache disabled", + max_mem_bin_size)); STRUCT_UNLOCK(&structure_guard_mutex); goto err; } -- cgit v1.2.1