Commit 908bc222 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

avoiding coping tmptable_param

parent 5a751464
...@@ -128,14 +128,14 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, ...@@ -128,14 +128,14 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
cursor->table->clear_query_id= 1; cursor->table->clear_query_id= 1;
} }
bzero((char*) &tmp_table_param,sizeof(tmp_table_param)); bzero((char*) &derived_result->tmp_table_param, sizeof(tmp_table_param));
tmp_table_param.field_count= unit->types.elements; derived_result->tmp_table_param.field_count= unit->types.elements;
/* /*
Temp table is created so that it hounours if UNION without ALL is to be Temp table is created so that it hounours if UNION without ALL is to be
processed processed
*/ */
if (!(table= create_tmp_table(thd, &tmp_table_param, unit->types, if (!(table= create_tmp_table(thd, &derived_result->tmp_table_param,
(ORDER*) 0, unit->types, (ORDER*) 0,
is_union && !unit->union_option, 1, is_union && !unit->union_option, 1,
(first_select->options | thd->options | (first_select->options | thd->options |
TMP_TABLE_ALL_COLUMNS), TMP_TABLE_ALL_COLUMNS),
...@@ -146,7 +146,6 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, ...@@ -146,7 +146,6 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
goto exit; goto exit;
} }
derived_result->set_table(table); derived_result->set_table(table);
derived_result->tmp_table_param=tmp_table_param;
unit->offset_limit_cnt= first_select->offset_limit; unit->offset_limit_cnt= first_select->offset_limit;
unit->select_limit_cnt= first_select->select_limit+ unit->select_limit_cnt= first_select->select_limit+
......
...@@ -144,7 +144,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result) ...@@ -144,7 +144,7 @@ int st_select_lex_unit::prepare(THD *thd, select_result *sel_result)
first_select->braces= 1; first_select->braces= 1;
tmp_table_param= &tmp_table_param_storage; tmp_table_param= &tmp_table_param_storage;
} }
bzero((char *)tmp_table_param,sizeof(TMP_TABLE_PARAM)); bzero((char *)tmp_table_param, sizeof(TMP_TABLE_PARAM));
for (;sl; sl= sl->next_select()) for (;sl; sl= sl->next_select())
......
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