diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index d9cdf3c3240..4a22b174fb5 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -344,7 +344,7 @@ The following options may be given as the first argument: log if it is open. --log-slow-verbosity=name log-slow-verbosity=[value[,value ...]] where value is one - of 'innodb', 'query_plan' + of 'innodb', 'query_plan', 'explain' --log-tc=name Path to transaction coordinator log (used for transactions that affect more than one storage engine, when binary log is disabled). diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2c510a39f8e..15c9a2e3a58 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -22553,8 +22553,6 @@ int JOIN::save_qpf(QPF_query *output, bool need_tmp_table, bool need_order, table_map used_tables=0; join->select_lex->set_explain_type(true); - uint select_id= join->select_lex->select_number; - qp_sel->select_id= join->select_lex->select_number; qp_sel->select_type= join->select_lex->type; @@ -22563,6 +22561,15 @@ int JOIN::save_qpf(QPF_query *output, bool need_tmp_table, bool need_order, for (JOIN_TAB *tab= first_breadth_first_tab(join, WALK_OPTIMIZATION_TABS); tab; tab= next_breadth_first_tab(join, WALK_OPTIMIZATION_TABS, tab)) { + uint select_id; + if (tab->bush_root_tab) + { + JOIN_TAB *first_sibling= tab->bush_root_tab->bush_children->start; + select_id= first_sibling->emb_sj_nest->sj_subq_pred->get_identifier(); + } + else + select_id= join->select_lex->select_number; + TABLE *table=tab->table; TABLE_LIST *table_list= tab->table->pos_in_table_list; char buff4[512];