summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-02-06 13:28:06 +0300
committerKonstantin Osipov <kostja@sun.com>2010-02-06 13:28:06 +0300
commit9c030fe5081163babdc8ef24395d108a394107fe (patch)
tree16fe2efa0a3d5e40e00972a1dc3bc4e13f71170c /sql/sql_union.cc
parent0b2f51664d38ed24f3f8b237877520e45bfe83f6 (diff)
parent19df110369d4cef5303176a8aedca34cd0e2d271 (diff)
downloadmariadb-git-9c030fe5081163babdc8ef24395d108a394107fe.tar.gz
Merge next-mr -> next-4284.
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 5bdff4dc9bf..ad14d2e4ecd 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->variables.option_bits |
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);
}
}