mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
processing of subselect in global ORDER BY (fifed crash of server)
this implementation have limitation: prohibited subselect in ORDER BY dependence of most outer query (will be solved after removing passing first select_lex as fake select for global mysql_select())
This commit is contained in:
@@ -3204,7 +3204,8 @@ mysql_init_query(THD *thd)
|
||||
lex->select_lex.init_query();
|
||||
lex->value_list.empty();
|
||||
lex->param_list.empty();
|
||||
lex->unit.next= lex->unit.master= lex->unit.link_next= 0;
|
||||
lex->unit.next= lex->unit.master= lex->unit.return_to=
|
||||
lex->unit.link_next= 0;
|
||||
lex->unit.prev= lex->unit.link_prev= 0;
|
||||
lex->unit.global_parameters= lex->unit.slave= lex->current_select=
|
||||
lex->all_selects_list= &lex->select_lex;
|
||||
@@ -3252,9 +3253,9 @@ bool
|
||||
mysql_new_select(LEX *lex, bool move_down)
|
||||
{
|
||||
SELECT_LEX *select_lex = new SELECT_LEX();
|
||||
select_lex->select_number= ++lex->thd->select_number;
|
||||
if (!select_lex)
|
||||
return 1;
|
||||
select_lex->select_number= ++lex->thd->select_number;
|
||||
select_lex->init_query();
|
||||
select_lex->init_select();
|
||||
if (move_down)
|
||||
@@ -3266,9 +3267,13 @@ mysql_new_select(LEX *lex, bool move_down)
|
||||
unit->init_query();
|
||||
unit->init_select();
|
||||
unit->thd= lex->thd;
|
||||
unit->include_down(lex->current_select);
|
||||
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
|
||||
unit->include_neighbour(lex->current_select);
|
||||
else
|
||||
unit->include_down(lex->current_select);
|
||||
unit->link_next= 0;
|
||||
unit->link_prev= 0;
|
||||
unit->return_to= lex->current_select;
|
||||
select_lex->include_down(unit);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user