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
3608dbdc
Commit
3608dbdc
authored
Aug 22, 2007
by
gshchepa/uchum@gleb.loc
Browse files
Options
Browse Files
Download
Plain Diff
Merge gleb.loc:/home/uchum/work/bk/5.0-opt-30201
into gleb.loc:/home/uchum/work/bk/5.1-opt
parents
5b11e626
f3d0f62d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
sql/sql_cache.cc
sql/sql_cache.cc
+23
-14
No files found.
sql/sql_cache.cc
View file @
3608dbdc
...
...
@@ -749,6 +749,12 @@ void query_cache_end_of_result(THD *thd)
if
(
thd
->
net
.
query_cache_query
==
0
)
DBUG_VOID_RETURN
;
if
(
thd
->
killed
)
{
query_cache_abort
(
&
thd
->
net
);
DBUG_VOID_RETURN
;
}
#ifdef EMBEDDED_LIBRARY
query_cache_insert
(
&
thd
->
net
,
(
char
*
)
thd
,
emb_count_querycache_size
(
thd
));
...
...
@@ -775,28 +781,31 @@ void query_cache_end_of_result(THD *thd)
DUMP
(
&
query_cache
);
BLOCK_LOCK_WR
(
query_block
);
Query_cache_query
*
header
=
query_block
->
query
();
Query_cache_block
*
last_result_block
=
header
->
result
()
->
prev
;
ulong
allign_size
=
ALIGN_SIZE
(
last_result_block
->
used
);
ulong
len
=
max
(
query_cache
.
min_allocation_unit
,
allign_size
);
if
(
last_result_block
->
length
>=
query_cache
.
min_allocation_unit
+
len
)
query_cache
.
split_block
(
last_result_block
,
len
);
Query_cache_block
*
last_result_block
;
ulong
allign_size
;
ulong
len
;
#ifndef DBUG_OFF
if
(
header
->
result
()
==
0
)
{
DBUG_PRINT
(
"error"
,
(
"end of data whith no result. query '%s'"
,
header
->
query
()));
query_cache
.
wreck
(
__LINE__
,
""
);
DBUG_PRINT
(
"error"
,
(
"End of data with no result blocks; "
"Query '%s' removed from cache."
,
header
->
query
()));
/*
We do not need call of BLOCK_UNLOCK_WR(query_block); here because
query_cache.wreck() switched query cache off but left content
untouched for investigation (it is debugging method)
.
Extra safety: empty result should not happen in the normal call
to this function. In the release version that query should be ignored
and removed from QC
.
*/
DBUG_ASSERT
(
0
);
query_cache
.
free_query
(
query_block
);
STRUCT_UNLOCK
(
&
query_cache
.
structure_guard_mutex
);
DBUG_VOID_RETURN
;
}
#endif
last_result_block
=
header
->
result
()
->
prev
;
allign_size
=
ALIGN_SIZE
(
last_result_block
->
used
);
len
=
max
(
query_cache
.
min_allocation_unit
,
allign_size
);
if
(
last_result_block
->
length
>=
query_cache
.
min_allocation_unit
+
len
)
query_cache
.
split_block
(
last_result_block
,
len
);
header
->
found_rows
(
current_thd
->
limit_found_rows
);
header
->
result
()
->
type
=
Query_cache_block
::
RESULT
;
...
...
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