Commit d820a09a authored by sergefp@mysql.com's avatar sergefp@mysql.com

BUG#11869: part2: post-review fixes:

In init_prepare_fake_select_lex() don't empty ftfunc_list. UNION's ORDER BY clause may 
contain MATCH(...), for which fix_index() should be called.
parent 047c34e5
...@@ -163,6 +163,10 @@ text id betreff ...@@ -163,6 +163,10 @@ text id betreff
(select b.id, b.betreff from t3 b) (select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc' in boolean mode) desc; order by match(betreff) against ('+abc' in boolean mode) desc;
id betreff id betreff
(select b.id, b.betreff from t3 b) union
(select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc') desc;
ERROR HY000: Can't find FULLTEXT index matching the column list
select distinct b.id, b.betreff from t3 b select distinct b.id, b.betreff from t3 b
order by match(betreff) against ('+abc' in boolean mode) desc; order by match(betreff) against ('+abc' in boolean mode) desc;
id betreff id betreff
......
...@@ -138,6 +138,11 @@ order by ...@@ -138,6 +138,11 @@ order by
(select b.id, b.betreff from t3 b) (select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc' in boolean mode) desc; order by match(betreff) against ('+abc' in boolean mode) desc;
--error 1191
(select b.id, b.betreff from t3 b) union
(select b.id, b.betreff from t3 b)
order by match(betreff) against ('+abc') desc;
select distinct b.id, b.betreff from t3 b select distinct b.id, b.betreff from t3 b
order by match(betreff) against ('+abc' in boolean mode) desc; order by match(betreff) against ('+abc' in boolean mode) desc;
......
...@@ -132,8 +132,6 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd) ...@@ -132,8 +132,6 @@ st_select_lex_unit::init_prepare_fake_select_lex(THD *thd)
options_tmp&= ~OPTION_FOUND_ROWS; options_tmp&= ~OPTION_FOUND_ROWS;
else if (found_rows_for_union && !thd->lex->describe) else if (found_rows_for_union && !thd->lex->describe)
options_tmp|= OPTION_FOUND_ROWS; options_tmp|= OPTION_FOUND_ROWS;
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, fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
(byte **) (byte **)
&result_table_list.next); &result_table_list.next);
...@@ -302,7 +300,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, ...@@ -302,7 +300,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
/* /*
Force the temporary table to be a MyISAM table if we're going to use Force the temporary table to be a MyISAM table if we're going to use
fullext functions (MATCH ... AGAINST .. IN BOOLEAN MODE) when reading fullext functions (MATCH ... AGAINST .. IN BOOLEAN MODE) when reading
from it. from it (this should be removed in 5.2 when fulltext search is moved
out of MyISAM).
*/ */
if (global_parameters->ftfunc_list->elements) if (global_parameters->ftfunc_list->elements)
create_options= create_options | TMP_TABLE_FORCE_MYISAM; create_options= create_options | TMP_TABLE_FORCE_MYISAM;
......
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