summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-06-25 18:39:26 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-06-25 18:39:26 +0400
commit66c62de1034e780144e6945b3a2150253e2a652c (patch)
treee5b54ec2a781797b4bc058c05141f1ada7e40844
parent45503698c13c55a6c21e02f4422bd3a4bcb02fd9 (diff)
downloadmariadb-git-66c62de1034e780144e6945b3a2150253e2a652c.tar.gz
MWL#182: Explain running statements
- Remove out-of-date comments, add dbug assertions.
-rw-r--r--sql/filesort.cc5
-rw-r--r--sql/my_apc.cc5
-rw-r--r--sql/my_apc.h2
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_select.cc7
-rw-r--r--sql/sql_show.cc1
6 files changed, 8 insertions, 18 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 6d1cabb02b7..f9f7288c93f 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1242,11 +1242,6 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
status_var_increment(thd->status_var.filesort_merge_passes);
thd->query_plan_fsort_passes++;
- /*if (param->not_killable)
- {
- killed= &not_killable;
- not_killable= NOT_KILLED;
- }*/
error=0;
rec_length= param->rec_length;
diff --git a/sql/my_apc.cc b/sql/my_apc.cc
index d5e3eb080a2..eae2843edb4 100644
--- a/sql/my_apc.cc
+++ b/sql/my_apc.cc
@@ -86,7 +86,7 @@ void Apc_target::disable()
void Apc_target::enqueue_request(Call_request *qe)
{
- //call_queue_size++;
+ mysql_mutex_assert_owner(LOCK_thd_data_ptr);
if (apc_calls)
{
Call_request *after= apc_calls->prev;
@@ -112,12 +112,11 @@ void Apc_target::enqueue_request(Call_request *qe)
void Apc_target::dequeue_request(Call_request *qe)
{
- //call_queue_size--;
+ mysql_mutex_assert_owner(LOCK_thd_data_ptr);
if (apc_calls == qe)
{
if ((apc_calls= apc_calls->next) == qe)
{
- //DBUG_ASSERT(!call_queue_size);
apc_calls= NULL;
}
}
diff --git a/sql/my_apc.h b/sql/my_apc.h
index 5879a0070d6..450e07b92a4 100644
--- a/sql/my_apc.h
+++ b/sql/my_apc.h
@@ -28,7 +28,7 @@ class Apc_target
{
mysql_mutex_t *LOCK_thd_data_ptr;
public:
- Apc_target() : enabled(0), apc_calls(NULL) /*, call_queue_size(0)*/ {}
+ Apc_target() : enabled(0), apc_calls(NULL) {}
~Apc_target() { DBUG_ASSERT(!enabled && !apc_calls);}
void init(mysql_mutex_t *target_mutex);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index d694afebc2c..5408b10c6b1 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3333,12 +3333,14 @@ void THD::restore_active_arena(Query_arena *set, Query_arena *backup)
void Show_explain_request::get_explain_data(void *arg)
{
Show_explain_request *req= (Show_explain_request*)arg;
- //TODO: change mem_root to point to request_thd->mem_root.
- // Actually, change the ARENA, because we're going to allocate items!
Query_arena backup_arena;
THD *target_thd= req->target_thd;
bool printed_anything= FALSE;
+ /*
+ Change the arena because JOIN::print_explain and co. are going to allocate
+ items. Let them allocate them on our arena.
+ */
target_thd->set_n_backup_active_arena((Query_arena*)req->request_thd,
&backup_arena);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 60530670ac9..c0e765b7991 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10321,12 +10321,7 @@ void JOIN_TAB::cleanup()
if (cache)
{
cache->free();
- cache= 0; // psergey: this is why we don't see "Using join cache" in SHOW EXPLAIN
- // when it is run for "Using temporary+filesort" queries while they
- // are at reading-from-tmp-table phase.
- //
- // TODO ask igor if this can be just moved to later phase
- // (JOIN_CACHE objects themselves are not big, arent they)
+ cache= 0;
}
limit= 0;
if (table)
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 9f0adf4a608..0671ebae199 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2092,7 +2092,6 @@ void mysqld_show_explain(THD *thd, ulong thread_id)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_YES, explain_req.query_str.c_ptr_safe());
}
- //mysql_mutex_unlock(&tmp->LOCK_thd_data);
if (!bres)
{
explain_buf->flush_data();