summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/share/errmsg.txt2
-rw-r--r--sql/sql_yacc.yy15
2 files changed, 15 insertions, 2 deletions
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 64cf018e03b..1d4c53a7620 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -5849,3 +5849,5 @@ ER_BAD_LOG_ENGINE
eng "One can use only CSV and MyISAM engines for the log tables"
ER_CANT_DROP_LOG_TABLE
eng "Cannot drop log table if log is enabled"
+ER_EVENT_RECURSIVITY_FORBIDDEN
+ eng "Recursivity of EVENT DDL statements is forbidden when body is present"
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 25d804f18b5..aa8d1dab53c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1429,6 +1429,7 @@ ev_sql_stmt:
lex->sphead->reset_thd_mem_root(YYTHD);
lex->sphead->init(lex);
+ lex->sphead->init_sp_name(YYTHD, Lex->event_parse_data->identifier);
lex->sphead->m_type= TYPE_ENUM_PROCEDURE;
@@ -1445,8 +1446,7 @@ ev_sql_stmt:
LEX *lex=Lex;
// return back to the original memory root ASAP
- lex->sphead->init_strings(YYTHD, lex,
- Lex->event_parse_data->identifier);
+ lex->sphead->init_strings(YYTHD, lex);
lex->sphead->restore_thd_mem_root(YYTHD);
lex->sp_chistics.suid= SP_IS_SUID;//always the definer!
@@ -1523,6 +1523,17 @@ create_function_tail:
RETURNS_SYM udf_type SONAME_SYM TEXT_STRING_sys
{
LEX *lex=Lex;
+ if (lex->definer != NULL)
+ {
+ /*
+ DEFINER is a concept meaningful when interpreting SQL code.
+ UDF functions are compiled.
+ Using DEFINER with UDF has therefore no semantic,
+ and is considered a parsing error.
+ */
+ my_error(ER_WRONG_USAGE, MYF(0), "SONAME", "DEFINER");
+ YYABORT;
+ }
lex->sql_command = SQLCOM_CREATE_FUNCTION;
lex->udf.name = lex->spname->m_name;
lex->udf.returns=(Item_result) $2;