summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMithun C Y <mithun.c.y@oracle.com>2015-10-12 12:56:36 +0530
committerMithun C Y <mithun.c.y@oracle.com>2015-10-12 12:56:36 +0530
commitf92dd6ae6fb8922122049957b6ab7e07b6518bc2 (patch)
tree98754fee1fba2be5f5fd36c614d6d1fa43ec1df8 /sql
parentecfc7c26166687d4ffb0ae13f518f44f256b9d65 (diff)
downloadmariadb-git-f92dd6ae6fb8922122049957b6ab7e07b6518bc2.tar.gz
Bug #20007383: HANDLE_FATAL_SIGNAL (SIG=11) IN UPDATE_REF_AND_KEYS.
Issue: ====== The fulltext predicate is inside a subquery and involves an outer reference; it thus cannot be used for FT index look-up, but MySQL does not see it, which causes a illegal access. Solution: ========= Solution is backported from bug#21140088. Outer reference can not be used as argument of the MATCH function. Added check for outer reference.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 67fe15a7f0d..363745d7fd6 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -5900,12 +5900,12 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
const_item_cache=0;
for (uint i=1 ; i < arg_count ; i++)
{
- item=args[i];
- if (item->type() == Item::REF_ITEM)
- args[i]= item= *((Item_ref *)item)->ref;
- if (item->type() != Item::FIELD_ITEM)
+ item= args[i]= args[i]->real_item();
+ if (item->type() != Item::FIELD_ITEM ||
+ /* Cannot use FTS index with outer table field */
+ (item->used_tables() & OUTER_REF_TABLE_BIT))
{
- my_error(ER_WRONG_ARGUMENTS, MYF(0), "AGAINST");
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "MATCH");
return TRUE;
}
}