Commit 6e2da8d1 authored by unknown's avatar unknown

Merge fixes


sql/sql_union.cc:
  Some further merge fixes
parent d59c4576
...@@ -187,34 +187,31 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result, ...@@ -187,34 +187,31 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result,
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
{ {
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) JOIN *join= new JOIN(thd, sl->item_list,
{ sl->options | thd->options | SELECT_NO_UNLOCK,
JOIN *join= new JOIN(thd, sl->item_list, union_result);
sl->options | thd->options | SELECT_NO_UNLOCK, thd->lex.current_select= sl;
union_result); offset_limit_cnt= sl->offset_limit;
thd->lex.current_select= sl; select_limit_cnt= sl->select_limit+sl->offset_limit;
offset_limit_cnt= sl->offset_limit; if (select_limit_cnt < sl->select_limit)
select_limit_cnt= sl->select_limit+sl->offset_limit; select_limit_cnt= HA_POS_ERROR; // no limit
if (select_limit_cnt < sl->select_limit) if (select_limit_cnt == HA_POS_ERROR || sl->braces)
select_limit_cnt= HA_POS_ERROR; // no limit sl->options&= ~OPTION_FOUND_ROWS;
if (select_limit_cnt == HA_POS_ERROR || sl->braces)
sl->options&= ~OPTION_FOUND_ROWS; res= join->prepare(&sl->ref_pointer_array,
(TABLE_LIST*) sl->table_list.first, sl->with_wild,
res= join->prepare(&sl->ref_pointer_array, sl->where,
(TABLE_LIST*) sl->table_list.first, sl->with_wild, ((sl->braces) ? sl->order_list.elements : 0) +
sl->where, sl->group_list.elements,
((sl->braces) ? sl->order_list.elements : 0) + (sl->braces) ?
sl->group_list.elements, (ORDER *)sl->order_list.first : (ORDER *) 0,
(sl->braces) ? (ORDER*) sl->group_list.first,
(ORDER *)sl->order_list.first : (ORDER *) 0, sl->having,
(ORDER*) sl->group_list.first, (ORDER*) NULL,
sl->having, sl, this, t_and_f);
(ORDER*) NULL, t_and_f= 0;
sl, this, t_and_f); if (res || thd->is_fatal_error)
t_and_f= 0; goto err;
if (res || thd->is_fatal_error)
goto err;
}
} }
item_list.empty(); item_list.empty();
......
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