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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9b269ea1
Commit
9b269ea1
authored
Apr 26, 2012
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MWL#182: Explain running statements
- Correct thd->killed checks in join cache and filesort modules.
parent
ca8aa390
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
sql/filesort.cc
sql/filesort.cc
+11
-9
sql/sql_join_cache.cc
sql/sql_join_cache.cc
+3
-3
No files found.
sql/filesort.cc
View file @
9b269ea1
...
...
@@ -493,7 +493,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
my_off_t
record
;
TABLE
*
sort_form
;
THD
*
thd
=
current_thd
;
volatile
killed_state
*
killed
=
&
thd
->
killed
;
//
volatile killed_state *killed= &thd->killed;
handler
*
file
;
MY_BITMAP
*
save_read_set
,
*
save_write_set
,
*
save_vcol_set
;
uchar
*
next_sort_key
=
sort_keys_buf
;
...
...
@@ -588,7 +588,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
break
;
}
if
(
*
killed
)
if
(
thd
->
check_killed
()
)
{
DBUG_PRINT
(
"info"
,(
"Sort killed by user"
));
if
(
!
indexfile
&&
!
quick_select
)
...
...
@@ -1229,18 +1229,20 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
void
*
first_cmp_arg
;
element_count
dupl_count
=
0
;
uchar
*
src
;
killed_state
not_killable
;
/* killed_state not_killable; */
uchar
*
unique_buff
=
param
->
unique_buff
;
volatile
killed_state
*
killed
=
&
current_thd
->
killed
;
/* volatile killed_state *killed= ¤t_thd->killed; */
const
bool
killable
=
!
param
->
not_killable
;
THD
*
const
thd
=
current_thd
;
DBUG_ENTER
(
"merge_buffers"
);
status_var_increment
(
current_
thd
->
status_var
.
filesort_merge_passes
);
current_
thd
->
query_plan_fsort_passes
++
;
if
(
param
->
not_killable
)
status_var_increment
(
thd
->
status_var
.
filesort_merge_passes
);
thd
->
query_plan_fsort_passes
++
;
/*
if (param->not_killable)
{
killed= ¬_killable;
not_killable= NOT_KILLED;
}
}
*/
error
=
0
;
rec_length
=
param
->
rec_length
;
...
...
@@ -1317,7 +1319,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
while
(
queue
.
elements
>
1
)
{
if
(
*
killed
)
if
(
killable
&&
thd
->
check_killed
()
)
{
error
=
1
;
goto
err
;
/* purecov: inspected */
}
...
...
sql/sql_join_cache.cc
View file @
9b269ea1
...
...
@@ -2235,7 +2235,7 @@ enum_nested_loop_state JOIN_CACHE::join_matching_records(bool skip_last)
while
(
!
(
error
=
join_tab_scan
->
next
()))
{
if
(
join
->
thd
->
killed
)
if
(
join
->
thd
->
check_killed
()
)
{
/* The user has aborted the execution of the query */
join
->
thd
->
send_kill_message
();
...
...
@@ -2505,7 +2505,7 @@ enum_nested_loop_state JOIN_CACHE::join_null_complements(bool skip_last)
for
(
;
cnt
;
cnt
--
)
{
if
(
join
->
thd
->
killed
)
if
(
join
->
thd
->
check_killed
()
)
{
/* The user has aborted the execution of the query */
join
->
thd
->
send_kill_message
();
...
...
@@ -3355,7 +3355,7 @@ int JOIN_TAB_SCAN::next()
update_virtual_fields
(
thd
,
table
);
while
(
!
err
&&
select
&&
(
skip_rc
=
select
->
skip_record
(
thd
))
<=
0
)
{
if
(
thd
->
killed
||
skip_rc
<
0
)
if
(
thd
->
check_killed
()
||
skip_rc
<
0
)
return
1
;
/*
Move to the next record if the last retrieved record does not
...
...
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