diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_func.cc | 12 |
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; } } |