summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index ebb97cde3e4..4f4ec5e92de 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1326,6 +1326,16 @@ create_function_tail:
LEX *lex= Lex;
sp_head *sp;
+ /*
+ First check if AGGREGATE was used, in that case it's a
+ syntax error.
+ */
+ if (lex->udf.type == UDFTYPE_AGGREGATE)
+ {
+ my_error(ER_SP_NO_AGGREGATE, MYF(0));
+ YYABORT;
+ }
+
if (lex->sphead)
{
my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "FUNCTION");