Commit a837775a authored by unknown's avatar unknown

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1

into sanja.is.com.ua:/home/bell/mysql/bk/work-4.1


sql/sql_parse.cc:
  Auto merged
parents 7f6d7aa1 d679b52e
......@@ -1112,8 +1112,11 @@ void st_select_lex_unit::exclude_level()
SELECT_LEX_UNIT *units= 0, **units_last= &units;
for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
{
// unlink current level from global SELECTs list
if (sl->link_prev && (*sl->link_prev= sl->link_next))
sl->link_next->link_prev= sl->link_prev;
// bring up underlay levels
SELECT_LEX_UNIT **last= 0;
for (SELECT_LEX_UNIT *u= sl->first_inner_unit(); u; u= u->next_unit())
{
......@@ -1128,11 +1131,20 @@ void st_select_lex_unit::exclude_level()
}
if (units)
{
// include brought up levels in place of current
(*prev)= units;
(*units_last)= (SELECT_LEX_UNIT*)next;
if (next)
next->prev= (SELECT_LEX_NODE**)units_last;
units->prev= prev;
}
else
{
// exclude currect unit from list of nodes
(*prev)= next;
if (next)
next->prev= prev;
}
}
......@@ -1147,15 +1159,20 @@ void st_select_lex_unit::exclude_tree()
SELECT_LEX_UNIT *units= 0, **units_last= &units;
for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
{
// unlink current level from global SELECTs list
if (sl->link_prev && (*sl->link_prev= sl->link_next))
sl->link_next->link_prev= sl->link_prev;
// unlink underlay levels
for (SELECT_LEX_UNIT *u= sl->first_inner_unit(); u; u= u->next_unit())
{
u->exclude_level();
}
}
// exclude currect unit from list of nodes
(*prev)= next;
if (next)
next->prev= prev;
}
......
......@@ -3708,7 +3708,6 @@ mysql_new_select(LEX *lex, bool move_down)
unit->link_prev= 0;
unit->return_to= lex->current_select;
select_lex->include_down(unit);
// TODO: assign resolve_mode for fake subquery after merging with new tree
}
else
{
......@@ -3728,6 +3727,7 @@ mysql_new_select(LEX *lex, bool move_down)
fake->make_empty_select();
fake->linkage= GLOBAL_OPTIONS_TYPE;
fake->select_limit= lex->thd->variables.select_limit;
fake->resolve_mode= SELECT_LEX::SELECT_MODE;
}
}
......
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