Commit 6ce8e1e7 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

fixed excluding st_select_lex from global select list

fixed destroing not well constructed analize object
fixed wrong detection of unions in derived tables
parent 0ceba0e5
...@@ -306,13 +306,14 @@ class analyse: public Procedure ...@@ -306,13 +306,14 @@ class analyse: public Procedure
public: public:
uint max_tree_elements, max_treemem; uint max_tree_elements, max_treemem;
analyse(select_result *res) :Procedure(res, PROC_NO_SORT), rows(0), analyse(select_result *res) :Procedure(res, PROC_NO_SORT), f_info(0),
output_str_length(0) {} rows(0), output_str_length(0) {}
~analyse() ~analyse()
{ {
for (field_info **f=f_info; f != f_end; f++) if (f_info)
delete (*f); for (field_info **f=f_info; f != f_end; f++)
delete (*f);
} }
virtual void add() {} virtual void add() {}
virtual bool change_columns(List<Item> &fields); virtual bool change_columns(List<Item> &fields);
......
...@@ -71,7 +71,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, ...@@ -71,7 +71,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
select_union *derived_result; select_union *derived_result;
TABLE_LIST *tables= (TABLE_LIST *)sl->table_list.first; TABLE_LIST *tables= (TABLE_LIST *)sl->table_list.first;
TMP_TABLE_PARAM tmp_table_param; TMP_TABLE_PARAM tmp_table_param;
bool is_union= sl->next_select() && sl->next_select()->linkage == UNION_TYPE; bool is_union= sl->next_select();
bool is_subsel= sl->first_inner_unit() ? 1: 0; bool is_subsel= sl->first_inner_unit() ? 1: 0;
SELECT_LEX_NODE *save_current_select= lex->current_select; SELECT_LEX_NODE *save_current_select= lex->current_select;
DBUG_ENTER("mysql_derived"); DBUG_ENTER("mysql_derived");
......
...@@ -1098,10 +1098,11 @@ void st_select_lex_node::fast_exclude() ...@@ -1098,10 +1098,11 @@ void st_select_lex_node::fast_exclude()
{ {
if ((*link_prev= link_next)) if ((*link_prev= link_next))
link_next->link_prev= link_prev; link_next->link_prev= link_prev;
// Remove slave structure
for (; slave; slave= slave->next)
slave->fast_exclude();
} }
// Remove slave structure
for (; slave; slave= slave->next)
slave->fast_exclude();
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment