diff options
author | bell@sanja.is.com.ua <> | 2003-03-15 14:16:57 +0200 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2003-03-15 14:16:57 +0200 |
commit | 1a8227d1c1a58f67bc6dc0e2763b45b5ff68af97 (patch) | |
tree | d2d9f7472307e59e72df71efdbbfee659a56c4a0 /sql/item_subselect.cc | |
parent | 113dc05655807d40d65c3f89423c668cdc93faaa (diff) | |
parent | 1e733bb8abc620a69ac23b408b00b33e9b907bb9 (diff) | |
download | mariadb-git-1a8227d1c1a58f67bc6dc0e2763b45b5ff68af97.tar.gz |
Merge
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 8925c6d8981..76451680b59 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -88,7 +88,14 @@ bool Item_subselect::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) if (have_to_be_excluded) engine->exclude(); substitution= 0; - return (*ref)->fix_fields(thd, tables, ref); + int ret= (*ref)->fix_fields(thd, tables, ref); + // We can't substitute aggregate functions (like (SELECT (max(i))) + if ((*ref)->with_sum_func) + { + my_error(ER_INVALID_GROUP_FUNC_USE, MYF(0)); + return 1; + } + return ret; } char const *save_where= thd->where; |