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
47ac7252
Commit
47ac7252
authored
Apr 24, 2018
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'grooverdan-10.2-MDEV-10814-dont-dump-query-cache' into bb-10.3-MDEV-10814
parents
461de7ed
abb4db4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
sql/sql_cache.cc
sql/sql_cache.cc
+18
-1
sql/sql_cache.h
sql/sql_cache.h
+1
-0
No files found.
sql/sql_cache.cc
View file @
47ac7252
...
...
@@ -329,6 +329,9 @@ TODO list:
*/
#include "mariadb.h"
/* NO_EMBEDDED_ACCESS_CHECKS */
#if defined(DBUG_OFF) && defined(HAVE_MADVISE)
#include <sys/mman.h>
#endif
#include "sql_priv.h"
#include "sql_basic_types.h"
#include "sql_cache.h"
...
...
@@ -2591,7 +2594,7 @@ size_t Query_cache::init_cache()
{
size_t
mem_bin_count
,
num
,
step
;
size_t
mem_bin_size
,
prev_size
,
inc
;
size_t
additional_data_size
,
max_mem_bin_size
,
approx_additional_data_size
;
size_t
max_mem_bin_size
,
approx_additional_data_size
;
int
align
;
DBUG_ENTER
(
"Query_cache::init_cache"
);
...
...
@@ -2656,6 +2659,13 @@ size_t Query_cache::init_cache()
if
(
!
(
cache
=
(
uchar
*
)
my_malloc_lock
(
query_cache_size
+
additional_data_size
,
MYF
(
0
))))
goto
err
;
#if defined(DBUG_OFF) && defined(HAVE_MADVISE) && defined(MADV_DONTDUMP)
if
(
madvise
(
cache
,
query_cache_size
+
additional_data_size
,
MADV_DONTDUMP
))
{
DBUG_PRINT
(
"warning"
,
(
"coudn't mark query cache memory as MADV_DONTDUMP: %s"
,
strerror
(
errno
)));
}
#endif
DBUG_PRINT
(
"qcache"
,
(
"cache length %zu, min unit %zu, %zu bins"
,
query_cache_size
,
min_allocation_unit
,
mem_bin_num
));
...
...
@@ -2818,6 +2828,13 @@ void Query_cache::free_cache()
}
while
(
block
!=
queries_blocks
);
}
#if defined(DBUG_OFF) && defined(HAVE_MADVISE) && defined(MADV_DODUMP)
if
(
madvise
(
cache
,
query_cache_size
+
additional_data_size
,
MADV_DODUMP
))
{
DBUG_PRINT
(
"warning"
,
(
"coudn't mark query cache memory as MADV_DODUMP: %s"
,
strerror
(
errno
)));
}
#endif
my_free
(
cache
);
make_disabled
();
my_hash_free
(
&
queries
);
...
...
sql/sql_cache.h
View file @
47ac7252
...
...
@@ -337,6 +337,7 @@ class Query_cache
till the end of a flush operation.
*/
mysql_mutex_t
structure_guard_mutex
;
size_t
additional_data_size
;
uchar
*
cache
;
// cache memory
Query_cache_block
*
first_block
;
// physical location block list
Query_cache_block
*
queries_blocks
;
// query list (LIFO)
...
...
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