1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fixes for bugs #2508 and #2552

mysql-test/r/union.result:
  Test cases for bugs #2508 and #2552
mysql-test/t/union.test:
  Test cases for bugs #2508 and #2552
sql/sql_class.h:
  A fix for a bug #2508
sql/sql_select.cc:
  A fix for a bug #2508
sql/sql_union.cc:
  a fix for a bug #2552
This commit is contained in:
unknown
2004-02-10 21:34:25 +02:00
parent 538e6e8cbd
commit 425ae9185d
5 changed files with 49 additions and 8 deletions

View File

@@ -206,6 +206,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
if (first_select->next_select())
{
union_result->tmp_table_param.field_count= types.elements;
union_result->tmp_table_param.all_nulls= true;
if (!(table= create_tmp_table(thd_arg,
&union_result->tmp_table_param, types,
(ORDER*) 0, !union_option, 1,
@@ -315,6 +316,7 @@ int st_select_lex_unit::exec()
if it use same tables
*/
uint tablenr=0;
ulong query_id= thd->query_id;
for (TABLE_LIST *table_list= (TABLE_LIST*) sl->table_list.first;
table_list;
table_list= table_list->next, tablenr++)
@@ -329,6 +331,8 @@ int st_select_lex_unit::exec()
*/
setup_table_map(table_list->table, table_list, tablenr);
}
for (unsigned int i=0; i < table_list->table->fields; i++)
table_list->table->field[i]->query_id= query_id;
}
res= sl->join->optimize();
}