Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning
This bugs clarifies a warning message issued when the query cache data size becomes smaller than the minium allowed size.
This commit is contained in:
parent
22bd6d9de6
commit
71be65dd11
@ -564,7 +564,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=1024;
|
set GLOBAL query_cache_size=1024;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 1024; new query cache size is 0
|
Warning 1282 Query cache failed to set size 1024 (minimal value: 41297); new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
@ -572,7 +572,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=10240;
|
set GLOBAL query_cache_size=10240;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 10240; new query cache size is 0
|
Warning 1282 Query cache failed to set size 10240 (minimal value: 41297); new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
@ -580,7 +580,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=20480;
|
set GLOBAL query_cache_size=20480;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 20480; new query cache size is 0
|
Warning 1282 Query cache failed to set size 20480 (minimal value: 41297); new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
@ -588,7 +588,7 @@ select * from t1;
|
|||||||
a
|
a
|
||||||
set GLOBAL query_cache_size=40960;
|
set GLOBAL query_cache_size=40960;
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1282 Query cache failed to set size 40960; new query cache size is 0
|
Warning 1282 Query cache failed to set size 40960 (minimal value: 41297); new query cache size is 0
|
||||||
show global variables like "query_cache_size";
|
show global variables like "query_cache_size";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
query_cache_size 0
|
query_cache_size 0
|
||||||
|
@ -1342,12 +1342,7 @@ static void fix_net_retry_count(THD *thd __attribute__((unused)),
|
|||||||
static void fix_query_cache_size(THD *thd, enum_var_type type)
|
static void fix_query_cache_size(THD *thd, enum_var_type type)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_QUERY_CACHE
|
#ifdef HAVE_QUERY_CACHE
|
||||||
ulong requested= query_cache_size;
|
query_cache_size= query_cache.resize(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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4992,13 +4992,13 @@ ER_WRONG_NAME_FOR_CATALOG 42000
|
|||||||
spa "Nombre de catalog incorrecto '%-.100s'"
|
spa "Nombre de catalog incorrecto '%-.100s'"
|
||||||
swe "Felaktigt katalog namn '%-.100s'"
|
swe "Felaktigt katalog namn '%-.100s'"
|
||||||
ER_WARN_QC_RESIZE
|
ER_WARN_QC_RESIZE
|
||||||
eng "Query cache failed to set size %lu; new query cache size is %lu"
|
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 fehlgeschlagen; neue Query-Cache-Größe ist %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, novo tamanho de query cache é %lu"
|
por "Falha em Query cache para configurar tamanho %lu (Número mínimo: %lu), novo tamanho de query cache é %lu"
|
||||||
rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu, ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu"
|
rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu (minimal value: %lu), ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu"
|
||||||
spa "Query cache fallada para configurar tamaño %lu, nuevo tamaño de query cache es %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, ny storlek är %lu"
|
swe "Storleken av "Query cache" kunde inte sättas till %lu (minsta värde: %lu); ny storlek är %lu"
|
||||||
ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu, ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu"
|
ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu (minimal value: %lu), ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu"
|
||||||
ER_BAD_FT_COLUMN
|
ER_BAD_FT_COLUMN
|
||||||
eng "Column '%-.64s' cannot be part of FULLTEXT index"
|
eng "Column '%-.64s' cannot be part of FULLTEXT index"
|
||||||
ger "Feld '%-.64s' kann nicht Teil eines FULLTEXT-Index sein"
|
ger "Feld '%-.64s' kann nicht Teil eines FULLTEXT-Index sein"
|
||||||
|
@ -816,6 +816,16 @@ ulong Query_cache::resize(ulong query_cache_size_arg)
|
|||||||
free_cache();
|
free_cache();
|
||||||
query_cache_size= query_cache_size_arg;
|
query_cache_size= query_cache_size_arg;
|
||||||
::query_cache_size= init_cache();
|
::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);
|
STRUCT_UNLOCK(&structure_guard_mutex);
|
||||||
DBUG_RETURN(::query_cache_size);
|
DBUG_RETURN(::query_cache_size);
|
||||||
}
|
}
|
||||||
@ -1614,6 +1624,25 @@ 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()
|
ulong Query_cache::init_cache()
|
||||||
{
|
{
|
||||||
uint mem_bin_count, num, step;
|
uint mem_bin_count, num, step;
|
||||||
|
@ -245,6 +245,8 @@ private:
|
|||||||
|
|
||||||
void free_query_internal(Query_cache_block *point);
|
void free_query_internal(Query_cache_block *point);
|
||||||
|
|
||||||
|
ulong get_minimal_size_limit();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*
|
/*
|
||||||
The following mutex is locked when searching or changing global
|
The following mutex is locked when searching or changing global
|
||||||
|
Loading…
x
Reference in New Issue
Block a user