Commit e5a2cb50 authored by unknown's avatar unknown

post-merge and testing fixes


mysql-test/r/events_bugs.result:
  update results after merge
mysql-test/t/events.test:
  num to name
mysql-test/t/events_bugs.test:
  num to name
sql/sql_yacc.yy:
  post-merge fixes regarding init_sp_name
  put back code which I unintentionally removed during merg
sql/share/errmsg.txt:
  add the message back
parent b68723a1
...@@ -5,10 +5,10 @@ CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2; ...@@ -5,10 +5,10 @@ CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2;
ERROR HY000: Event 'Lower_case' already exists ERROR HY000: Event 'Lower_case' already exists
DROP EVENT Lower_case; DROP EVENT Lower_case;
SET NAMES cp1251; SET NAMES cp1251;
CREATE EVENT äîëåí_ðåãèñòúð_1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100; 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 2 YEAR DO SELECT 200;
ERROR HY000: Event 'ДоЛеН_регистър_1251' already exists ERROR HY000: Event 'ДоЛеН_регистър_1251' already exists
DROP EVENT ÄîËåÍ_ðåãèñòúð_1251; DROP EVENT __1251;
SET NAMES utf8; SET NAMES utf8;
CREATE EVENT долен_регистър_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300; CREATE EVENT долен_регистър_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300;
CREATE EVENT ДОЛЕН_регистър_утф8 ON SCHEDULE EVERY 4 YEAR DO SELECT 400; CREATE EVENT ДОЛЕН_регистър_утф8 ON SCHEDULE EVERY 4 YEAR DO SELECT 400;
...@@ -109,9 +109,9 @@ events_test ee_16407_4 ...@@ -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; 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 user host db info
event_scheduler localhost NULL NULL 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)
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)
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)
select release_lock('ee_16407_2'); select release_lock('ee_16407_2');
release_lock('ee_16407_2') release_lock('ee_16407_2')
1 1
...@@ -159,8 +159,8 @@ end| ...@@ -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; 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 user host db info
event_scheduler localhost NULL NULL 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)
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)
select release_lock('ee_16407_5'); select release_lock('ee_16407_5');
release_lock('ee_16407_5') release_lock('ee_16407_5')
1 1
......
...@@ -83,7 +83,7 @@ DROP EVENT event_starts_test; ...@@ -83,7 +83,7 @@ DROP EVENT event_starts_test;
# #
create table test_nested(a int); create table test_nested(a int);
create event e_43 on schedule every 1 second do set @a = 5; 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; alter event e_43 do alter event e_43 do set @a = 4;
delimiter |; delimiter |;
alter event e_43 do alter event e_43 do
...@@ -339,7 +339,7 @@ drop event закачка21; ...@@ -339,7 +339,7 @@ drop event закачка21;
# Bug #16410 Events: CREATE EVENT is legal in a CREATE TRIGGER statement # Bug #16410 Events: CREATE EVENT is legal in a CREATE TRIGGER statement
# #
create table t_16 (s1 int); 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; 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; drop table t_16;
# #
......
...@@ -30,7 +30,7 @@ SET NAMES latin1; ...@@ -30,7 +30,7 @@ SET NAMES latin1;
# START - BUG#16408: Events: crash for an event in a procedure # START - BUG#16408: Events: crash for an event in a procedure
# #
set @a=3; 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; 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 # END - BUG#16408: Events: crash for an event in a procedure
......
...@@ -5849,3 +5849,5 @@ ER_BAD_LOG_ENGINE ...@@ -5849,3 +5849,5 @@ ER_BAD_LOG_ENGINE
eng "One can use only CSV and MyISAM engines for the log tables" eng "One can use only CSV and MyISAM engines for the log tables"
ER_CANT_DROP_LOG_TABLE ER_CANT_DROP_LOG_TABLE
eng "Cannot drop log table if log is enabled" 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"
...@@ -1429,6 +1429,7 @@ ev_sql_stmt: ...@@ -1429,6 +1429,7 @@ ev_sql_stmt:
lex->sphead->reset_thd_mem_root(YYTHD); lex->sphead->reset_thd_mem_root(YYTHD);
lex->sphead->init(lex); lex->sphead->init(lex);
lex->sphead->init_sp_name(YYTHD, Lex->event_parse_data->identifier);
lex->sphead->m_type= TYPE_ENUM_PROCEDURE; lex->sphead->m_type= TYPE_ENUM_PROCEDURE;
...@@ -1445,8 +1446,7 @@ ev_sql_stmt: ...@@ -1445,8 +1446,7 @@ ev_sql_stmt:
LEX *lex=Lex; LEX *lex=Lex;
// return back to the original memory root ASAP // return back to the original memory root ASAP
lex->sphead->init_strings(YYTHD, lex, lex->sphead->init_strings(YYTHD, lex);
Lex->event_parse_data->identifier);
lex->sphead->restore_thd_mem_root(YYTHD); lex->sphead->restore_thd_mem_root(YYTHD);
lex->sp_chistics.suid= SP_IS_SUID;//always the definer! lex->sp_chistics.suid= SP_IS_SUID;//always the definer!
...@@ -1523,6 +1523,17 @@ create_function_tail: ...@@ -1523,6 +1523,17 @@ create_function_tail:
RETURNS_SYM udf_type SONAME_SYM TEXT_STRING_sys RETURNS_SYM udf_type SONAME_SYM TEXT_STRING_sys
{ {
LEX *lex=Lex; 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->sql_command = SQLCOM_CREATE_FUNCTION;
lex->udf.name = lex->spname->m_name; lex->udf.name = lex->spname->m_name;
lex->udf.returns=(Item_result) $2; lex->udf.returns=(Item_result) $2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment