mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
ulternative bugfix for BUG#2508 and fix for BUG#2809 - every table has its own TABLE structure
mysql-test/r/union.result: fix for union test becuase now not all fields in UNION allow NULLS fix of test test suite for BUG#2809 mysql-test/t/union.test: test suite for BUG#2809 sql/mysql_priv.h: removed unused parameter of setup_tables() sql/sql_base.cc: removed unused parameter of setup_tables() cleanup of unused code sql/sql_class.h: removed unused field sql/sql_help.cc: removed unused parameter of setup_tables() sql/sql_insert.cc: removed unused parameter of setup_tables() sql/sql_lex.cc: excluded duplicate tables finding for UNION sql/sql_load.cc: removed unused parameter of setup_tables() sql/sql_olap.cc: removed unused parameter of setup_tables() sql/sql_prepare.cc: removed unused parameter of setup_tables() sql/sql_select.cc: removed unused parameter of setup_tables() revert old BUG#2508 patch sql/sql_union.cc: revert old BUG#2508 patch removed unused code sql/sql_update.cc: removed unused parameter of setup_tables() sql/table.h: shared used only for multi-update for now
This commit is contained in:
@@ -206,7 +206,6 @@ 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,
|
||||
@@ -310,30 +309,6 @@ int st_select_lex_unit::exec()
|
||||
sl->options|= found_rows_for_union;
|
||||
}
|
||||
sl->join->select_options=sl->options;
|
||||
/*
|
||||
As far as union share table space we should reassign table map,
|
||||
which can be spoiled by 'prepare' of JOIN of other UNION parts
|
||||
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++)
|
||||
{
|
||||
if (table_list->shared)
|
||||
{
|
||||
/*
|
||||
review notes: Check it carefully. I still can't understand
|
||||
why I should not touch table->used_keys. For my point of
|
||||
view we should do here same procedura as it was done by
|
||||
setup_table
|
||||
*/
|
||||
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();
|
||||
}
|
||||
if (!res)
|
||||
|
Reference in New Issue
Block a user