summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index c414f5e9e72..cdbe8a986b2 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -119,8 +119,6 @@ void
st_select_lex_unit::init_prepare_fake_select_lex(THD *thd)
{
thd->lex->current_select= fake_select_lex;
- fake_select_lex->ftfunc_list_alloc.empty();
- fake_select_lex->ftfunc_list= &fake_select_lex->ftfunc_list_alloc;
fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
(byte **)
&result_table_list.next_local);
@@ -301,15 +299,24 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
goto err;
}
}
+
+ ulong create_options= (first_select_in_union()->options | thd_arg->options |
+ TMP_TABLE_ALL_COLUMNS) & ~TMP_TABLE_FORCE_MYISAM;
+ /*
+ Force the temporary table to be a MyISAM table if we're going to use
+ fullext functions (MATCH ... AGAINST .. IN BOOLEAN MODE) when reading
+ from it (this should be removed in 5.2 when fulltext search is moved
+ out of MyISAM).
+ */
+ if (global_parameters->ftfunc_list->elements)
+ create_options= create_options | TMP_TABLE_FORCE_MYISAM;
union_result->tmp_table_param.field_count= types.elements;
if (!(table= create_tmp_table(thd_arg,
&union_result->tmp_table_param, types,
(ORDER*) 0, (bool) union_distinct, 1,
- (first_select_in_union()->options |
- thd_arg->options |
- TMP_TABLE_ALL_COLUMNS),
- HA_POS_ERROR, (char *) tmp_table_alias)))
+ create_options, HA_POS_ERROR,
+ (char *) tmp_table_alias)))
goto err;
table->file->extra(HA_EXTRA_WRITE_CACHE);
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);