mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merging 4.1->5.0
This commit is contained in:
@@ -115,7 +115,7 @@ bool select_union::flush()
|
||||
int st_select_lex_unit::prepare(THD *thd, select_result *sel_result,
|
||||
bool tables_and_fields_initied)
|
||||
{
|
||||
SELECT_LEX *lex_select_save= thd->lex.current_select;
|
||||
SELECT_LEX *lex_select_save= thd->lex->current_select;
|
||||
SELECT_LEX *select_cursor,*sl;
|
||||
DBUG_ENTER("st_select_lex_unit::prepare");
|
||||
|
||||
@@ -129,7 +129,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result,
|
||||
t_and_f= tables_and_fields_initied;
|
||||
|
||||
bzero((char *)&tmp_table_param,sizeof(TMP_TABLE_PARAM));
|
||||
thd->lex.current_select= sl= select_cursor= first_select_in_union();
|
||||
thd->lex->current_select= sl= select_cursor= first_select_in_union();
|
||||
/* Global option */
|
||||
if (t_and_f)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result,
|
||||
JOIN *join= new JOIN(thd, sl->item_list,
|
||||
sl->options | thd->options | SELECT_NO_UNLOCK,
|
||||
union_result);
|
||||
thd->lex.current_select= sl;
|
||||
thd->lex->current_select= sl;
|
||||
offset_limit_cnt= sl->offset_limit;
|
||||
select_limit_cnt= sl->select_limit+sl->offset_limit;
|
||||
if (select_limit_cnt < sl->select_limit)
|
||||
@@ -217,7 +217,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result,
|
||||
}
|
||||
|
||||
item_list.empty();
|
||||
thd->lex.current_select= lex_select_save;
|
||||
thd->lex->current_select= lex_select_save;
|
||||
{
|
||||
List_iterator<Item> it(select_cursor->item_list);
|
||||
Field **field;
|
||||
@@ -232,14 +232,14 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result,
|
||||
|
||||
DBUG_RETURN(res || thd->is_fatal_error ? 1 : 0);
|
||||
err:
|
||||
thd->lex.current_select= lex_select_save;
|
||||
thd->lex->current_select= lex_select_save;
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
|
||||
int st_select_lex_unit::exec()
|
||||
{
|
||||
SELECT_LEX *lex_select_save= thd->lex.current_select;
|
||||
SELECT_LEX *lex_select_save= thd->lex->current_select;
|
||||
SELECT_LEX *select_cursor=first_select_in_union();
|
||||
ulonglong add_rows=0;
|
||||
DBUG_ENTER("st_select_lex_unit::exec");
|
||||
@@ -259,7 +259,7 @@ int st_select_lex_unit::exec()
|
||||
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
|
||||
{
|
||||
ha_rows records_at_start= 0;
|
||||
thd->lex.current_select= sl;
|
||||
thd->lex->current_select= sl;
|
||||
|
||||
if (optimized)
|
||||
res= sl->join->reinit();
|
||||
@@ -331,13 +331,13 @@ int st_select_lex_unit::exec()
|
||||
offset_limit_cnt= sl->offset_limit;
|
||||
if (!res && union_result->flush())
|
||||
{
|
||||
thd->lex.current_select= lex_select_save;
|
||||
thd->lex->current_select= lex_select_save;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
if (res)
|
||||
{
|
||||
thd->lex.current_select= lex_select_save;
|
||||
thd->lex->current_select= lex_select_save;
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
/* Needed for the following test and for records_at_start in next loop */
|
||||
@@ -368,7 +368,7 @@ int st_select_lex_unit::exec()
|
||||
if (!thd->is_fatal_error) // Check if EOM
|
||||
{
|
||||
ulong options= thd->options;
|
||||
thd->lex.current_select= fake_select_lex;
|
||||
thd->lex->current_select= fake_select_lex;
|
||||
offset_limit_cnt= global_parameters->offset_limit;
|
||||
select_limit_cnt= global_parameters->select_limit +
|
||||
global_parameters->offset_limit;
|
||||
@@ -422,7 +422,7 @@ int st_select_lex_unit::exec()
|
||||
*/
|
||||
}
|
||||
}
|
||||
thd->lex.current_select= lex_select_save;
|
||||
thd->lex->current_select= lex_select_save;
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user