SHOW EXPLAIN: Code cleanup
This commit is contained in:
parent
950dc8022e
commit
cf8461a0f7
@ -502,7 +502,6 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
|
|||||||
my_off_t record;
|
my_off_t record;
|
||||||
TABLE *sort_form;
|
TABLE *sort_form;
|
||||||
THD *thd= current_thd;
|
THD *thd= current_thd;
|
||||||
//volatile killed_state *killed= &thd->killed;
|
|
||||||
handler *file;
|
handler *file;
|
||||||
MY_BITMAP *save_read_set, *save_write_set, *save_vcol_set;
|
MY_BITMAP *save_read_set, *save_write_set, *save_vcol_set;
|
||||||
uchar *next_sort_key= sort_keys_buf;
|
uchar *next_sort_key= sort_keys_buf;
|
||||||
@ -1236,9 +1235,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
|
|||||||
void *first_cmp_arg;
|
void *first_cmp_arg;
|
||||||
element_count dupl_count= 0;
|
element_count dupl_count= 0;
|
||||||
uchar *src;
|
uchar *src;
|
||||||
/* killed_state not_killable; */
|
|
||||||
uchar *unique_buff= param->unique_buff;
|
uchar *unique_buff= param->unique_buff;
|
||||||
/* volatile killed_state *killed= ¤t_thd->killed; */
|
|
||||||
const bool killable= !param->not_killable;
|
const bool killable= !param->not_killable;
|
||||||
THD* const thd=current_thd;
|
THD* const thd=current_thd;
|
||||||
DBUG_ENTER("merge_buffers");
|
DBUG_ENTER("merge_buffers");
|
||||||
|
@ -4725,7 +4725,6 @@ int subselect_hash_sj_engine::exec()
|
|||||||
thd->lex->current_select= materialize_engine->select_lex;
|
thd->lex->current_select= materialize_engine->select_lex;
|
||||||
/* The subquery should be optimized, and materialized only once. */
|
/* The subquery should be optimized, and materialized only once. */
|
||||||
DBUG_ASSERT(materialize_join->optimized && !is_materialized);
|
DBUG_ASSERT(materialize_join->optimized && !is_materialized);
|
||||||
|
|
||||||
materialize_join->exec();
|
materialize_join->exec();
|
||||||
if ((res= test(materialize_join->error || thd->is_fatal_error ||
|
if ((res= test(materialize_join->error || thd->is_fatal_error ||
|
||||||
thd->is_error())))
|
thd->is_error())))
|
||||||
|
@ -53,8 +53,7 @@ public:
|
|||||||
int timeout_sec, bool *timed_out);
|
int timeout_sec, bool *timed_out);
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
int n_calls_processed;
|
int n_calls_processed; /* Number of calls served by this target */
|
||||||
//int call_queue_size;
|
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
class Call_request;
|
class Call_request;
|
||||||
|
@ -1656,7 +1656,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
|
|||||||
while ((ifm= li++))
|
while ((ifm= li++))
|
||||||
parent_lex->ftfunc_list->push_front(ifm);
|
parent_lex->ftfunc_list->push_front(ifm);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent_lex->have_merged_subqueries= TRUE;
|
parent_lex->have_merged_subqueries= TRUE;
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
@ -1361,7 +1361,7 @@ void THD::cleanup(void)
|
|||||||
mysql_mutex_unlock(&LOCK_user_locks);
|
mysql_mutex_unlock(&LOCK_user_locks);
|
||||||
ull= NULL;
|
ull= NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
apc_target.destroy();
|
apc_target.destroy();
|
||||||
cleanup_done=1;
|
cleanup_done=1;
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
@ -1372,8 +1372,6 @@ THD::~THD()
|
|||||||
{
|
{
|
||||||
THD_CHECK_SENTRY(this);
|
THD_CHECK_SENTRY(this);
|
||||||
DBUG_ENTER("~THD()");
|
DBUG_ENTER("~THD()");
|
||||||
//psergey-todo: assert that the queue is disabled and empty.
|
|
||||||
|
|
||||||
/* Ensure that no one is using THD */
|
/* Ensure that no one is using THD */
|
||||||
mysql_mutex_lock(&LOCK_thd_data);
|
mysql_mutex_lock(&LOCK_thd_data);
|
||||||
mysys_var=0; // Safety (shouldn't be needed)
|
mysys_var=0; // Safety (shouldn't be needed)
|
||||||
@ -2311,8 +2309,8 @@ int select_send::send_data(List<Item> &items)
|
|||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int select_result_explain_buffer::send_data(List<Item> &items)
|
int select_result_explain_buffer::send_data(List<Item> &items)
|
||||||
{
|
{
|
||||||
List_iterator_fast<Item> li(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);
|
buffer.set(buff, sizeof(buff), &my_charset_bin);
|
||||||
}
|
}
|
||||||
//TODO: do we need the following:
|
|
||||||
if (thd->is_error())
|
if (thd->is_error())
|
||||||
{
|
{
|
||||||
protocol->remove_last_row();
|
protocol->remove_last_row();
|
||||||
DBUG_RETURN(1);
|
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;
|
const char *packet_data;
|
||||||
size_t len;
|
size_t len;
|
||||||
protocol->get_packet(&packet_data, &len);
|
protocol->get_packet(&packet_data, &len);
|
||||||
|
@ -2228,7 +2228,7 @@ void JOIN::exec_inner()
|
|||||||
List<Item> *columns_list= &fields_list;
|
List<Item> *columns_list= &fields_list;
|
||||||
int tmp_error;
|
int tmp_error;
|
||||||
DBUG_ENTER("JOIN::exec");
|
DBUG_ENTER("JOIN::exec");
|
||||||
|
|
||||||
thd_proc_info(thd, "executing");
|
thd_proc_info(thd, "executing");
|
||||||
error= 0;
|
error= 0;
|
||||||
if (procedure)
|
if (procedure)
|
||||||
@ -2526,16 +2526,12 @@ void JOIN::exec_inner()
|
|||||||
|
|
||||||
/* Free first data from old join */
|
/* 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.
|
psergey-todo: this is the place of pre-mature JOIN::free call.
|
||||||
*/
|
*/
|
||||||
curr_join->join_free();
|
curr_join->join_free();
|
||||||
//psergey-todo: SHOW EXPLAIN probe here
|
|
||||||
if (curr_join->make_simple_join(this, curr_tmp_table))
|
if (curr_join->make_simple_join(this, curr_tmp_table))
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
//psergey-todo: SHOW EXPLAIN probe here
|
|
||||||
calc_group_buffer(curr_join, group_list);
|
calc_group_buffer(curr_join, group_list);
|
||||||
count_field_types(select_lex, &curr_join->tmp_table_param,
|
count_field_types(select_lex, &curr_join->tmp_table_param,
|
||||||
curr_join->tmp_all_fields1,
|
curr_join->tmp_all_fields1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user