diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index f41adfb8d56..0fc3168db41 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -397,4 +397,24 @@ create table t_16 (s1 int); 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; ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. drop table t_16; +create event white_space +on schedule every 10 hour +disable +do +select 1; +select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +event_schema event_name definer event_body +events_test white_space root@localhost select 1 +drop event white_space; +create event white_space on schedule every 10 hour disable do +select 2; +select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +event_schema event_name definer event_body +events_test white_space root@localhost select 2 +drop event white_space; +create event white_space on schedule every 10 hour disable do select 3; +select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +event_schema event_name definer event_body +events_test white_space root@localhost select 3 +drop event white_space; drop database events_test; diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index 6cad9991c44..bde8747a4ef 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -374,6 +374,27 @@ drop table t_16; # end of test case #### +# +# START: BUG #17453: Creating Event crash the server +# +create event white_space +on schedule every 10 hour +disable +do +select 1; +select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +drop event white_space; +create event white_space on schedule every 10 hour disable do + select 2; +select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +drop event white_space; +create event white_space on schedule every 10 hour disable do select 3; +select event_schema, event_name, definer, event_body from information_schema.events where event_name='white_space'; +drop event white_space; +# +# END: BUG #17453: Creating Event crash the server +# + ##set global event_scheduler=1; ##select get_lock("test_lock3", 20); ##create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20); diff --git a/sql/event_timed.cc b/sql/event_timed.cc index 6440e221732..47e82d555ab 100644 --- a/sql/event_timed.cc +++ b/sql/event_timed.cc @@ -117,7 +117,7 @@ event_timed::init_body(THD *thd) body.length--; //the first is always space which I cannot skip in the parser - DBUG_ASSERT(*body_begin == ' '); + DBUG_ASSERT(my_isspace(thd->variables.character_set_client, *body_begin)); body.length--; body.str= strmake_root(root, (char *)body_begin + 1, body.length);