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
53d922fc
Commit
53d922fc
authored
Jun 06, 2002
by
monty@bitch.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge hundin:/my/mysql-4.0 into bitch.mysql.fi:/my/mysql-4.0
parents
268e82a0
1937feae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
sql/sql_cache.cc
sql/sql_cache.cc
+27
-9
No files found.
sql/sql_cache.cc
View file @
53d922fc
...
@@ -704,17 +704,17 @@ Query_cache::Query_cache(ulong query_cache_limit,
...
@@ -704,17 +704,17 @@ Query_cache::Query_cache(ulong query_cache_limit,
query_cache_limit
(
query_cache_limit
),
query_cache_limit
(
query_cache_limit
),
queries_in_cache
(
0
),
hits
(
0
),
inserts
(
0
),
refused
(
0
),
queries_in_cache
(
0
),
hits
(
0
),
inserts
(
0
),
refused
(
0
),
total_blocks
(
0
),
total_blocks
(
0
),
min_allocation_unit
(
min_allocation_unit
),
min_allocation_unit
(
ALIGN_SIZE
(
min_allocation_unit
)
),
min_result_data_size
(
min_result_data_size
),
min_result_data_size
(
ALIGN_SIZE
(
min_result_data_size
)
),
def_query_hash_size
(
def_query_hash_size
),
def_query_hash_size
(
ALIGN_SIZE
(
def_query_hash_size
)
),
def_table_hash_size
(
def_table_hash_size
),
def_table_hash_size
(
ALIGN_SIZE
(
def_table_hash_size
)
),
initialized
(
0
)
initialized
(
0
)
{
{
ulong
min_needed
=
(
ALIGN_SIZE
(
sizeof
(
Query_cache_block
))
+
ulong
min_needed
=
(
ALIGN_SIZE
(
sizeof
(
Query_cache_block
))
+
ALIGN_SIZE
(
sizeof
(
Query_cache_block_table
))
+
ALIGN_SIZE
(
sizeof
(
Query_cache_block_table
))
+
ALIGN_SIZE
(
sizeof
(
Query_cache_query
))
+
3
);
ALIGN_SIZE
(
sizeof
(
Query_cache_query
))
+
3
);
set_if_bigger
(
min_allocation_unit
,
min_needed
);
set_if_bigger
(
min_allocation_unit
,
min_needed
);
this
->
min_allocation_unit
=
min_allocation_unit
;
this
->
min_allocation_unit
=
ALIGN_SIZE
(
min_allocation_unit
)
;
set_if_bigger
(
this
->
min_result_data_size
,
min_allocation_unit
);
set_if_bigger
(
this
->
min_result_data_size
,
min_allocation_unit
);
}
}
...
@@ -1218,6 +1218,7 @@ ulong Query_cache::init_cache()
...
@@ -1218,6 +1218,7 @@ ulong Query_cache::init_cache()
uint
mem_bin_count
,
num
,
step
;
uint
mem_bin_count
,
num
,
step
;
ulong
mem_bin_size
,
prev_size
,
inc
;
ulong
mem_bin_size
,
prev_size
,
inc
;
ulong
additional_data_size
,
max_mem_bin_size
,
approx_additional_data_size
;
ulong
additional_data_size
,
max_mem_bin_size
,
approx_additional_data_size
;
int
align
;
DBUG_ENTER
(
"Query_cache::init_cache"
);
DBUG_ENTER
(
"Query_cache::init_cache"
);
if
(
!
initialized
)
if
(
!
initialized
)
...
@@ -1228,7 +1229,13 @@ ulong Query_cache::init_cache()
...
@@ -1228,7 +1229,13 @@ ulong Query_cache::init_cache()
if
(
query_cache_size
<
approx_additional_data_size
)
if
(
query_cache_size
<
approx_additional_data_size
)
goto
err
;
goto
err
;
query_cache_size
-=
approx_additional_data_size
;
query_cache_size
-=
approx_additional_data_size
;
align
=
query_cache_size
%
ALIGN_SIZE
(
1
);
if
(
align
)
{
query_cache_size
-=
align
;
approx_additional_data_size
+=
align
;
}
/*
/*
Count memory bins number.
Count memory bins number.
...
@@ -1542,10 +1549,12 @@ Query_cache::write_block_data(ulong data_len, gptr data,
...
@@ -1542,10 +1549,12 @@ Query_cache::write_block_data(ulong data_len, gptr data,
ALIGN_SIZE
(
ntab
*
sizeof
(
Query_cache_block_table
))
+
ALIGN_SIZE
(
ntab
*
sizeof
(
Query_cache_block_table
))
+
header_len
);
header_len
);
ulong
len
=
data_len
+
all_headers_len
;
ulong
len
=
data_len
+
all_headers_len
;
ulong
align_len
=
ALIGN_SIZE
(
len
);
DBUG_ENTER
(
"Query_cache::write_block_data"
);
DBUG_ENTER
(
"Query_cache::write_block_data"
);
DBUG_PRINT
(
"qcache"
,
(
"data: %ld, header: %ld, all header: %ld"
,
DBUG_PRINT
(
"qcache"
,
(
"data: %ld, header: %ld, all header: %ld"
,
data_len
,
header_len
,
all_headers_len
));
data_len
,
header_len
,
all_headers_len
));
Query_cache_block
*
block
=
allocate_block
(
max
(
len
,
min_allocation_unit
),
Query_cache_block
*
block
=
allocate_block
(
max
(
align_len
,
min_allocation_unit
),
1
,
0
,
under_guard
);
1
,
0
,
under_guard
);
if
(
block
!=
0
)
if
(
block
!=
0
)
{
{
...
@@ -1740,7 +1749,8 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
...
@@ -1740,7 +1749,8 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
{
{
ulong
all_headers_len
=
(
ALIGN_SIZE
(
sizeof
(
Query_cache_block
))
+
ulong
all_headers_len
=
(
ALIGN_SIZE
(
sizeof
(
Query_cache_block
))
+
ALIGN_SIZE
(
sizeof
(
Query_cache_result
)));
ALIGN_SIZE
(
sizeof
(
Query_cache_result
)));
ulong
len
=
data_len
+
all_headers_len
;
ulong
len
=
data_len
+
all_headers_len
;
ulong
align_len
=
ALIGN_SIZE
(
len
);
DBUG_ENTER
(
"Query_cache::allocate_data_chain"
);
DBUG_ENTER
(
"Query_cache::allocate_data_chain"
);
DBUG_PRINT
(
"qcache"
,
(
"data_len %lu, all_headers_len %lu"
,
DBUG_PRINT
(
"qcache"
,
(
"data_len %lu, all_headers_len %lu"
,
data_len
,
all_headers_len
));
data_len
,
all_headers_len
));
...
@@ -1748,7 +1758,7 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
...
@@ -1748,7 +1758,7 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
ulong
min_size
=
(
first_block
?
ulong
min_size
=
(
first_block
?
get_min_first_result_data_size
()
:
get_min_first_result_data_size
()
:
get_min_append_result_data_size
());
get_min_append_result_data_size
());
*
result_block
=
allocate_block
(
max
(
min_size
,
len
),
*
result_block
=
allocate_block
(
max
(
min_size
,
align_
len
),
min_result_data_size
==
0
,
min_result_data_size
==
0
,
all_headers_len
+
min_result_data_size
,
all_headers_len
+
min_result_data_size
,
1
);
1
);
...
@@ -3046,6 +3056,14 @@ my_bool Query_cache::check_integrity(bool not_locked)
...
@@ -3046,6 +3056,14 @@ my_bool Query_cache::check_integrity(bool not_locked)
{
{
DBUG_PRINT
(
"qcache"
,
(
"block 0x%lx, type %u..."
,
DBUG_PRINT
(
"qcache"
,
(
"block 0x%lx, type %u..."
,
(
ulong
)
block
,
(
uint
)
block
->
type
));
(
ulong
)
block
,
(
uint
)
block
->
type
));
// Check allignment
if
((
ulonglong
)
block
%
ALIGN_SIZE
(
1
))
{
DBUG_PRINT
(
"error"
,
(
"block 0x%lx do not aligned by %d"
,
(
ulong
)
block
,
ALIGN_SIZE
(
1
)));
result
=
1
;
}
// Check memory allocation
// Check memory allocation
if
(
block
->
pnext
==
first_block
)
// Is it last block?
if
(
block
->
pnext
==
first_block
)
// Is it last block?
{
{
...
...
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