Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4f3e1efa
Commit
4f3e1efa
authored
Jul 16, 2008
by
Marc Alff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning
Reverting the previous patch
parent
82742241
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
43 deletions
+17
-43
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+4
-4
sql/set_var.cc
sql/set_var.cc
+6
-1
sql/share/errmsg.txt
sql/share/errmsg.txt
+7
-7
sql/sql_cache.cc
sql/sql_cache.cc
+0
-29
sql/sql_cache.h
sql/sql_cache.h
+0
-2
No files found.
mysql-test/r/query_cache.result
View file @
4f3e1efa
...
...
@@ -564,7 +564,7 @@ select * from t1;
a
set GLOBAL query_cache_size=1024;
Warnings:
Warning 1282 Query cache failed to set size 1024
(minimal value: 41297)
; new query cache size is 0
Warning 1282 Query cache failed to set size 1024; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
...
...
@@ -572,7 +572,7 @@ select * from t1;
a
set GLOBAL query_cache_size=10240;
Warnings:
Warning 1282 Query cache failed to set size 10240
(minimal value: 41297)
; new query cache size is 0
Warning 1282 Query cache failed to set size 10240; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
...
...
@@ -580,7 +580,7 @@ select * from t1;
a
set GLOBAL query_cache_size=20480;
Warnings:
Warning 1282 Query cache failed to set size 20480
(minimal value: 41297)
; new query cache size is 0
Warning 1282 Query cache failed to set size 20480; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
...
...
@@ -588,7 +588,7 @@ select * from t1;
a
set GLOBAL query_cache_size=40960;
Warnings:
Warning 1282 Query cache failed to set size 40960
(minimal value: 41297)
; new query cache size is 0
Warning 1282 Query cache failed to set size 40960; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
...
...
sql/set_var.cc
View file @
4f3e1efa
...
...
@@ -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
}
...
...
sql/share/errmsg.txt
View file @
4f3e1efa
...
...
@@ -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-Gre auf %lu
(Minimale Zahl: %lu)
fehlgeschlagen; neue Query-Cache-Gre ist %lu"
por "Falha em Query cache para configurar tamanho %lu
(Nmero mnimo: %lu)
, novo tamanho de query cache %lu"
rus " %lu
(minimal value: %lu)
, - %lu"
spa "Query cache fallada para configurar tamao %lu
(Nmero mnimo: %lu)
, nuevo tamao de query cache es %lu"
swe "Storleken av "Query cache" kunde inte sttas till %lu
(minsta vrde: %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-Gre auf %lu fehlgeschlagen; neue Query-Cache-Gre 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 tamao %lu, nuevo tamao de query cache es %lu"
swe "Storleken av "Query cache" kunde inte sttas 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"
...
...
sql/sql_cache.cc
View file @
4f3e1efa
...
...
@@ -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
;
...
...
sql/sql_cache.h
View file @
4f3e1efa
...
...
@@ -245,8 +245,6 @@ class Query_cache
void
free_query_internal
(
Query_cache_block
*
point
);
ulong
get_minimal_size_limit
();
protected:
/*
The following mutex is locked when searching or changing global
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment