summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2010-03-30 18:16:57 +0200
committerunknown <knielsen@knielsen-hq.org>2010-03-30 18:16:57 +0200
commit5a3b3d9afb6233ff785eab2a9679374ae274a75c (patch)
tree875f73a5e544d5081679d47586ae25b90498fb86 /sql/sql_union.cc
parent205baff9ab39cc030b950ae751118561918f3e83 (diff)
parentd904739cc1d98107f67e76a67b0ea6eb2af326ec (diff)
downloadmariadb-git-5a3b3d9afb6233ff785eab2a9679374ae274a75c.tar.gz
automerge
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 1a7e171edf3..61f47bee799 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -335,6 +335,35 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
}
+ /*
+ Disable the usage of fulltext searches in the last union branch.
+ This is a temporary 5.x limitation because of the way the fulltext
+ search functions are handled by the optimizer.
+ This is manifestation of the more general problems of "taking away"
+ parts of a SELECT statement post-fix_fields(). This is generally not
+ doable since various flags are collected in various places (e.g.
+ SELECT_LEX) that carry information about the presence of certain
+ expressions or constructs in the parts of the query.
+ When part of the query is taken away it's not clear how to "divide"
+ the meaning of these accumulated flags and what to carry over to the
+ recipient query (SELECT_LEX).
+ */
+ if (global_parameters->ftfunc_list->elements &&
+ global_parameters->order_list.elements &&
+ global_parameters != fake_select_lex)
+ {
+ ORDER *ord;
+ Item_func::Functype ft= Item_func::FT_FUNC;
+ for (ord= (ORDER*)global_parameters->order_list.first; ord; ord= ord->next)
+ if ((*ord->item)->walk (&Item::find_function_processor, FALSE,
+ (uchar *) &ft))
+ {
+ my_error (ER_CANT_USE_OPTION_HERE, MYF(0), "MATCH()");
+ goto err;
+ }
+ }
+
+
create_options= (first_sl->options | thd_arg->options |
TMP_TABLE_ALL_COLUMNS);
/*
@@ -669,7 +698,7 @@ bool st_select_lex_unit::cleanup()
{
ORDER *ord;
for (ord= (ORDER*)global_parameters->order_list.first; ord; ord= ord->next)
- (*ord->item)->cleanup();
+ (*ord->item)->walk (&Item::cleanup_processor, 0, 0);
}
}