summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorNeeraj Bisht <neeraj.x.bisht@oracle.com>2013-04-20 12:36:11 +0530
committerNeeraj Bisht <neeraj.x.bisht@oracle.com>2013-04-20 12:36:11 +0530
commitd5cb6649207fedd32565ae86605a485615bae66a (patch)
tree27c836a0773acff5188efd87264dc972746614cf /sql
parentbb70b07d983a8e16f87730d640e0d9f19660fb25 (diff)
parent89b1b508448813e66994bf36c35169ac0558b250 (diff)
downloadmariadb-git-d5cb6649207fedd32565ae86605a485615bae66a.tar.gz
Bug#16073689 : CRASH IN ITEM_FUNC_MATCH::INIT_SEARCH
Problem: In query like select 1 from .. order by match .. against ...; causes a debug assert failue. Analysis: In union type query like (select * from order by a) order by b; or (select * from order by a) union (select * from order by b); We skip resolving of order by a for 1st query and order by of a and b in 2nd query. This means that, in case when our order by have Item_func_match class, we skip resolving it. But we maintain a ft_func_list and at the time of optimization, when we Perform FULLTEXT search before all regular searches on the bases of the list we call Item_func_match::init_search() which will cause debug assert as the item is not resolved. Solution: We will skip execution if the item is not fixed and we will not fix index(Item_func_match::fix_index()) for which Item_func_match::fix_field() is not called so that on later changes we can check the dependency on fix field. bz sql/item_func.cc: skiping execution, if item is not resolved.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index d832bdac6e3..39c05d63150 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -5790,6 +5790,13 @@ void Item_func_match::init_search(bool no_order)
{
DBUG_ENTER("Item_func_match::init_search");
+ /*
+ We will skip execution if the item is not fixed
+ with fix_field
+ */
+ if (!fixed)
+ DBUG_VOID_RETURN;
+
/* Check if init_search() has been called before */
if (ft_handler)
{
@@ -5920,6 +5927,13 @@ bool Item_func_match::fix_index()
uint ft_to_key[MAX_KEY], ft_cnt[MAX_KEY], fts=0, keynr;
uint max_cnt=0, mkeys=0, i;
+ /*
+ We will skip execution if the item is not fixed
+ with fix_field
+ */
+ if (!fixed)
+ return false;
+
if (key == NO_SUCH_KEY)
return 0;