summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-06-08 02:19:36 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-06-08 02:19:36 +0400
commitcf8461a0f75eebcc15cddd3c48d5e24f872930c2 (patch)
treed864179bdb8e42bdf6bf378f124191c11817e151 /sql
parent950dc8022e64339abc93adc6953661cf38afa530 (diff)
downloadmariadb-git-cf8461a0f75eebcc15cddd3c48d5e24f872930c2.tar.gz
SHOW EXPLAIN: Code cleanup
Diffstat (limited to 'sql')
-rw-r--r--sql/filesort.cc3
-rw-r--r--sql/item_subselect.cc1
-rw-r--r--sql/my_apc.h3
-rw-r--r--sql/opt_subselect.cc2
-rw-r--r--sql/sql_class.cc13
-rw-r--r--sql/sql_select.cc6
6 files changed, 10 insertions, 18 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 5220d80767d..6d1cabb02b7 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -502,7 +502,6 @@ 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;
handler *file;
MY_BITMAP *save_read_set, *save_write_set, *save_vcol_set;
uchar *next_sort_key= sort_keys_buf;
@@ -1236,9 +1235,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
void *first_cmp_arg;
element_count dupl_count= 0;
uchar *src;
- /* killed_state not_killable; */
uchar *unique_buff= param->unique_buff;
- /* volatile killed_state *killed= &current_thd->killed; */
const bool killable= !param->not_killable;
THD* const thd=current_thd;
DBUG_ENTER("merge_buffers");
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 7b1e4fc8b27..276f35fe301 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -4725,7 +4725,6 @@ int subselect_hash_sj_engine::exec()
thd->lex->current_select= materialize_engine->select_lex;
/* The subquery should be optimized, and materialized only once. */
DBUG_ASSERT(materialize_join->optimized && !is_materialized);
-
materialize_join->exec();
if ((res= test(materialize_join->error || thd->is_fatal_error ||
thd->is_error())))
diff --git a/sql/my_apc.h b/sql/my_apc.h
index 8e6980fa855..5de1cf7d8d3 100644
--- a/sql/my_apc.h
+++ b/sql/my_apc.h
@@ -53,8 +53,7 @@ public:
int timeout_sec, bool *timed_out);
#ifndef DBUG_OFF
- int n_calls_processed;
- //int call_queue_size;
+ int n_calls_processed; /* Number of calls served by this target */
#endif
private:
class Call_request;
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 34e73f5cac8..dfd0785cc4a 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -1656,7 +1656,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
while ((ifm= li++))
parent_lex->ftfunc_list->push_front(ifm);
}
-
+
parent_lex->have_merged_subqueries= TRUE;
DBUG_RETURN(FALSE);
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 65ead744ddb..ba9140fc9bc 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1361,7 +1361,7 @@ void THD::cleanup(void)
mysql_mutex_unlock(&LOCK_user_locks);
ull= NULL;
}
-
+
apc_target.destroy();
cleanup_done=1;
DBUG_VOID_RETURN;
@@ -1372,8 +1372,6 @@ THD::~THD()
{
THD_CHECK_SENTRY(this);
DBUG_ENTER("~THD()");
- //psergey-todo: assert that the queue is disabled and empty.
-
/* Ensure that no one is using THD */
mysql_mutex_lock(&LOCK_thd_data);
mysys_var=0; // Safety (shouldn't be needed)
@@ -2311,8 +2309,8 @@ int select_send::send_data(List<Item> &items)
DBUG_RETURN(0);
}
-
//////////////////////////////////////////////////////////////////////////////
+
int select_result_explain_buffer::send_data(List<Item> &items)
{
List_iterator_fast<Item> li(items);
@@ -2336,13 +2334,16 @@ int select_result_explain_buffer::send_data(List<Item> &items)
*/
buffer.set(buff, sizeof(buff), &my_charset_bin);
}
- //TODO: do we need the following:
+
if (thd->is_error())
{
protocol->remove_last_row();
DBUG_RETURN(1);
}
- /* psergey-TODO: instead of protocol->write(), steal the packet here */
+ /*
+ Instead of calling protocol->write(), steal the packed and put it to our
+ buffer
+ */
const char *packet_data;
size_t len;
protocol->get_packet(&packet_data, &len);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 5aa69f54fa3..e1af5605d37 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2228,7 +2228,7 @@ void JOIN::exec_inner()
List<Item> *columns_list= &fields_list;
int tmp_error;
DBUG_ENTER("JOIN::exec");
-
+
thd_proc_info(thd, "executing");
error= 0;
if (procedure)
@@ -2526,16 +2526,12 @@ void JOIN::exec_inner()
/* Free first data from old join */
- fprintf(stderr,"Q: %s\n", thd->query());
- //DBUG_ASSERT(0);
/*
psergey-todo: this is the place of pre-mature JOIN::free call.
*/
curr_join->join_free();
- //psergey-todo: SHOW EXPLAIN probe here
if (curr_join->make_simple_join(this, curr_tmp_table))
DBUG_VOID_RETURN;
- //psergey-todo: SHOW EXPLAIN probe here
calc_group_buffer(curr_join, group_list);
count_field_types(select_lex, &curr_join->tmp_table_param,
curr_join->tmp_all_fields1,