summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mysql.com>2009-02-12 13:49:44 +0400
committerSergey Vojtovich <svoj@mysql.com>2009-02-12 13:49:44 +0400
commit5803e106282eddbfed171f5d76f5357418d32af7 (patch)
tree620ef9dd8ce2966b58d01d3b068774d591629171 /sql/item_func.cc
parent7df0e72c7ffe41e50da38ff0730c2668156a9f48 (diff)
downloadmariadb-git-5803e106282eddbfed171f5d76f5357418d32af7.tar.gz
BUG#36737 - having + full text operator crashes mysql
MATCH() function accepts column list as an argument. It was possible to override this requirement with aliased non-column select expression. Which results in server crash. With this fix aliased non-column select expressions are not accepted by MATCH() function, returning an error. mysql-test/r/fulltext.result: A test case for BUG#36737. mysql-test/t/fulltext.test: A test case for BUG#36737. sql/item_func.cc: Only accept fields as arguments to MATCH().
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 913b32ccb88..55324923fe2 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4961,7 +4961,10 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
if (item->type() == Item::REF_ITEM)
args[i]= item= *((Item_ref *)item)->ref;
if (item->type() != Item::FIELD_ITEM)
- key=NO_SUCH_KEY;
+ {
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "AGAINST");
+ return TRUE;
+ }
}
/*
Check that all columns come from the same table.