diff options
author | Marc Alff <marc.alff@sun.com> | 2008-07-16 16:29:22 -0600 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2008-07-16 16:29:22 -0600 |
commit | 95ca2c6d96735edac951bd3b6995847e3ad03536 (patch) | |
tree | 08dba6ff192e8dcebc2a5483bfcb8935ca8ae1ba /sql | |
parent | 76bd3a55a64bd91ad5b8e48aaf07656c8978bd11 (diff) | |
download | mariadb-git-95ca2c6d96735edac951bd3b6995847e3ad03536.tar.gz |
Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning
Reverting the previous patch
Diffstat (limited to 'sql')
-rw-r--r-- | sql/set_var.cc | 7 | ||||
-rw-r--r-- | sql/share/errmsg.txt | 14 | ||||
-rw-r--r-- | sql/sql_cache.cc | 29 | ||||
-rw-r--r-- | sql/sql_cache.h | 2 |
4 files changed, 13 insertions, 39 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index fd9beff35b7..84766e511ca 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1342,7 +1342,12 @@ static void fix_net_retry_count(THD *thd __attribute__((unused)), static void fix_query_cache_size(THD *thd, enum_var_type type) { #ifdef HAVE_QUERY_CACHE - query_cache_size= query_cache.resize(query_cache_size); + ulong requested= query_cache_size; + query_cache.resize(query_cache_size); + if (requested != query_cache_size) + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), + requested, query_cache_size); #endif } diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 0cb6672732c..7d345d633c6 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -4992,13 +4992,13 @@ ER_WRONG_NAME_FOR_CATALOG 42000 spa "Nombre de catalog incorrecto '%-.100s'" swe "Felaktigt katalog namn '%-.100s'" ER_WARN_QC_RESIZE - eng "Query cache failed to set size %lu (minimal value: %lu); new query cache size is %lu" - ger "Änderung der Query-Cache-Größe auf %lu (Minimale Zahl: %lu) fehlgeschlagen; neue Query-Cache-Größe ist %lu" - por "Falha em Query cache para configurar tamanho %lu (Número mínimo: %lu), novo tamanho de query cache é %lu" - rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu (minimal value: %lu), ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" - spa "Query cache fallada para configurar tamaño %lu (Número mínimo: %lu), nuevo tamaño de query cache es %lu" - swe "Storleken av "Query cache" kunde inte sättas till %lu (minsta värde: %lu); ny storlek är %lu" - ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu (minimal value: %lu), ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" + eng "Query cache failed to set size %lu; new query cache size is %lu" + ger "Änderung der Query-Cache-Größe auf %lu fehlgeschlagen; neue Query-Cache-Größe ist %lu" + por "Falha em Query cache para configurar tamanho %lu, novo tamanho de query cache é %lu" + rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu, ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" + spa "Query cache fallada para configurar tamaño %lu, nuevo tamaño de query cache es %lu" + swe "Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu" + ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu, ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" ER_BAD_FT_COLUMN eng "Column '%-.64s' cannot be part of FULLTEXT index" ger "Feld '%-.64s' kann nicht Teil eines FULLTEXT-Index sein" diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index cce5123aef3..f8906a17c12 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -816,16 +816,6 @@ ulong Query_cache::resize(ulong query_cache_size_arg) free_cache(); query_cache_size= query_cache_size_arg; ::query_cache_size= init_cache(); - - if (::query_cache_size != query_cache_size_arg) - { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), - query_cache_size_arg, - get_minimal_size_limit(), - ::query_cache_size); - } - STRUCT_UNLOCK(&structure_guard_mutex); DBUG_RETURN(::query_cache_size); } @@ -1624,25 +1614,6 @@ void Query_cache::init() } -/** - Return the lowest possible query cache size. -*/ - -ulong Query_cache::get_minimal_size_limit() -{ - ulong approx_additional_data_size= (sizeof(Query_cache) + - sizeof(gptr)*(def_query_hash_size+ - def_table_hash_size)); - - ulong data_size= (min_allocation_unit << QUERY_CACHE_MEM_BIN_STEP_PWR2 << - QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) + - ALIGN_SIZE(1) - 1 + - (1 << QUERY_CACHE_MEM_BIN_STEP_PWR2) - 1 + - (1 << QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) - 1; - - return(data_size + approx_additional_data_size); -} - ulong Query_cache::init_cache() { uint mem_bin_count, num, step; diff --git a/sql/sql_cache.h b/sql/sql_cache.h index c5d89780af3..34fc3a5c8d5 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -245,8 +245,6 @@ private: void free_query_internal(Query_cache_block *point); - ulong get_minimal_size_limit(); - protected: /* The following mutex is locked when searching or changing global |