1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

fix for bug#17543 Creating Event crash the server

this problem affects only debug builds


mysql-test/r/events.result:
  update results
mysql-test/t/events.test:
  tests for bug#17543 Creating Event crash the server
sql/event_timed.cc:
  the delimiter between DO and the body could be not only a space
  but any other recognized white space, so use proper macro.
This commit is contained in:
unknown
2006-02-16 16:11:02 +01:00
parent 5cdf49f0ce
commit f39aca3f86
3 changed files with 42 additions and 1 deletions

View File

@@ -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; 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. ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop table t_16; 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; drop database events_test;

View File

@@ -374,6 +374,27 @@ drop table t_16;
# end of test case # 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; ##set global event_scheduler=1;
##select get_lock("test_lock3", 20); ##select get_lock("test_lock3", 20);

View File

@@ -117,7 +117,7 @@ event_timed::init_body(THD *thd)
body.length--; body.length--;
//the first is always space which I cannot skip in the parser //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.length--;
body.str= strmake_root(root, (char *)body_begin + 1, body.length); body.str= strmake_root(root, (char *)body_begin + 1, body.length);