diff options
-rw-r--r-- | mysql-test/r/events_bugs.result | 16 | ||||
-rw-r--r-- | mysql-test/t/events.test | 4 | ||||
-rw-r--r-- | mysql-test/t/events_bugs.test | 2 | ||||
-rw-r--r-- | sql/share/errmsg.txt | 2 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 15 |
5 files changed, 26 insertions, 13 deletions
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index c06af6cc22b..38f3eb37902 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -5,10 +5,10 @@ CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2; ERROR HY000: Event 'Lower_case' already exists DROP EVENT Lower_case; SET NAMES cp1251; -CREATE EVENT äîëåí_ðåãèñòúð_1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100; -CREATE EVENT ÄîËåÍ_ðåãèñòúð_1251 ON SCHEDULE EVERY 2 YEAR DO SELECT 200; +CREATE EVENT __1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100; +CREATE EVENT __1251 ON SCHEDULE EVERY 2 YEAR DO SELECT 200; ERROR HY000: Event 'ДоЛеН_регистър_1251' already exists -DROP EVENT ÄîËåÍ_ðåãèñòúð_1251; +DROP EVENT __1251; SET NAMES utf8; CREATE EVENT долен_регистър_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300; CREATE EVENT ДОЛЕН_регистър_утф8 ON SCHEDULE EVERY 4 YEAR DO SELECT 400; @@ -109,9 +109,9 @@ events_test ee_16407_4 select /*2*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; user host db info event_scheduler localhost NULL NULL -root localhost events_test select get_lock('ee_16407_2', 60) /*ee_16407_2*/ -root localhost events_test select get_lock('ee_16407_2', 60) /*ee_16407_3*/ -root localhost events_test select get_lock('ee_16407_2', 60) /*ee_16407_4*/ +root localhost events_test select get_lock('ee_16407_2', 60) +root localhost events_test select get_lock('ee_16407_2', 60) +root localhost events_test select get_lock('ee_16407_2', 60) select release_lock('ee_16407_2'); release_lock('ee_16407_2') 1 @@ -159,8 +159,8 @@ end| select /*4*/ user, host, db, info from information_schema.processlist where info is null or info not like '%processlist%' order by info; user host db info event_scheduler localhost NULL NULL -root localhost events_test select get_lock('ee_16407_5', 60) /*ee_16407_5*/ -root localhost events_test select get_lock('ee_16407_5', 60) /*ee_16407_6*/ +root localhost events_test select get_lock('ee_16407_5', 60) +root localhost events_test select get_lock('ee_16407_5', 60) select release_lock('ee_16407_5'); release_lock('ee_16407_5') 1 diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index 2a27144bc27..161f4c1aefe 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -83,7 +83,7 @@ DROP EVENT event_starts_test; # create table test_nested(a int); create event e_43 on schedule every 1 second do set @a = 5; ---error 1562 +--error ER_EVENT_RECURSIVITY_FORBIDDEN alter event e_43 do alter event e_43 do set @a = 4; delimiter |; alter event e_43 do @@ -339,7 +339,7 @@ drop event закачка21; # Bug #16410 Events: CREATE EVENT is legal in a CREATE TRIGGER statement # create table t_16 (s1 int); ---error 1562 +--error ER_EVENT_RECURSIVITY_FORBIDDEN create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5; drop table t_16; # diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 692e85255ef..1fcf527c2fc 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -30,7 +30,7 @@ SET NAMES latin1; # START - BUG#16408: Events: crash for an event in a procedure # set @a=3; ---error 1562 +--error ER_EVENT_RECURSIVITY_FORBIDDEN CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5; # # END - BUG#16408: Events: crash for an event in a procedure 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; |