mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
SHOW EXPLAIN: Code cleanup
This commit is contained in:
@ -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= ¤t_thd->killed; */
|
||||
const bool killable= !param->not_killable;
|
||||
THD* const thd=current_thd;
|
||||
DBUG_ENTER("merge_buffers");
|
||||
|
@ -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())))
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user