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
28b0e7fe
Commit
28b0e7fe
authored
Oct 05, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.5730
parents
70a3abf2
4f42bc6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
37 deletions
+37
-37
sql/sql_cache.cc
sql/sql_cache.cc
+37
-37
No files found.
sql/sql_cache.cc
View file @
28b0e7fe
...
@@ -1953,55 +1953,55 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
...
@@ -1953,55 +1953,55 @@ 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
align_len
=
ALIGN_SIZE
(
len
);
DBUG_ENTER
(
"Query_cache::allocate_data_chain"
);
DBUG_PRINT
(
"qcache"
,
(
"data_len %lu, all_headers_len %lu"
,
data_len
,
all_headers_len
));
ulong
min_size
=
(
first_block_arg
?
ulong
min_size
=
(
first_block_arg
?
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
,
align_len
),
Query_cache_block
*
prev_block
=
NULL
;
min_result_data_size
==
0
,
Query_cache_block
*
new_block
;
all_headers_len
+
min_result_data_size
,
DBUG_ENTER
(
"Query_cache::allocate_data_chain"
);
1
);
DBUG_PRINT
(
"qcache"
,
(
"data_len %lu, all_headers_len %lu"
,
my_bool
success
=
(
*
result_block
!=
0
);
data_len
,
all_headers_len
));
if
(
success
)
do
{
{
Query_cache_block
*
new_block
=
*
result_block
;
ulong
len
=
data_len
+
all_headers_len
;
ulong
align_len
=
ALIGN_SIZE
(
len
);
if
(
!
(
new_block
=
allocate_block
(
max
(
min_size
,
align_len
),
min_result_data_size
==
0
,
all_headers_len
+
min_result_data_size
,
1
)))
{
DBUG_PRINT
(
"warning"
,
(
"Can't allocate block for results"
));
DBUG_RETURN
(
FALSE
);
}
new_block
->
n_tables
=
0
;
new_block
->
n_tables
=
0
;
new_block
->
used
=
0
;
new_block
->
used
=
min
(
len
,
new_block
->
length
)
;
new_block
->
type
=
Query_cache_block
::
RES_INCOMPLETE
;
new_block
->
type
=
Query_cache_block
::
RES_INCOMPLETE
;
new_block
->
next
=
new_block
->
prev
=
new_block
;
new_block
->
next
=
new_block
->
prev
=
new_block
;
Query_cache_result
*
header
=
new_block
->
result
();
Query_cache_result
*
header
=
new_block
->
result
();
header
->
parent
(
query_block
);
header
->
parent
(
query_block
);
if
(
new_block
->
length
<
len
)
DBUG_PRINT
(
"qcache"
,
(
"Block len %lu used %lu"
,
{
/*
We got less memory then we need (no big memory blocks) =>
Continue to allocated more blocks until we got everything we need.
*/
Query_cache_block
*
next_block
;
if
((
success
=
allocate_data_chain
(
&
next_block
,
len
-
new_block
->
length
,
query_block
,
first_block_arg
)))
double_linked_list_join
(
new_block
,
next_block
);
}
if
(
success
)
{
new_block
->
used
=
min
(
len
,
new_block
->
length
);
DBUG_PRINT
(
"qcache"
,
(
"Block len %lu used %lu"
,
new_block
->
length
,
new_block
->
used
));
new_block
->
length
,
new_block
->
used
));
}
if
(
prev_block
)
double_linked_list_join
(
prev_block
,
new_block
);
else
else
DBUG_PRINT
(
"warning"
,
(
"Can't allocate block for continue"
));
*
result_block
=
new_block
;
}
if
(
new_block
->
length
>=
len
)
else
break
;
DBUG_PRINT
(
"warning"
,
(
"Can't allocate block for results"
));
DBUG_RETURN
(
success
);
/*
We got less memory then we need (no big memory blocks) =>
Continue to allocated more blocks until we got everything we need.
*/
data_len
=
len
-
new_block
->
length
;
prev_block
=
new_block
;
}
while
(
1
);
DBUG_RETURN
(
TRUE
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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