diff options
-rw-r--r-- | mysql-test/r/events.result | 6 | ||||
-rw-r--r-- | mysql-test/r/sp-error.result | 7 | ||||
-rw-r--r-- | mysql-test/t/events.test | 10 | ||||
-rw-r--r-- | mysql-test/t/sp-error.test | 18 | ||||
-rw-r--r-- | sql/sp_head.cc | 2 |
5 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index ecaf1ec252e..ced21440686 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -465,4 +465,10 @@ select event_schema, event_name, definer, event_body from information_schema.eve event_schema event_name definer event_body events_test white_space root@localhost select 3 drop event white_space; +create event e1 on schedule every 1 year do set @a = 5; +create table t1 (s1 int); +create trigger t1_ai after insert on t1 for each row show create event e1; +ERROR 0A000: Not allowed to return a result set from a trigger +drop table t1; +drop event e1; drop database events_test; diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 5ab8779782a..40fe0b09814 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1166,3 +1166,10 @@ drop procedure bug15091; drop function if exists bug16896; create aggregate function bug16896() returns int return 1; ERROR 42000: AGGREGATE is not supported for stored functions +drop function if exists bug16164; +create function bug16164() returns int +begin +show authors; +return 42; +end| +ERROR 0A000: Not allowed to return a result set from a function diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index a261b3c0c11..d9d8d75ff8c 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -427,6 +427,16 @@ drop event white_space; # END: BUG #17453: Creating Event crash the server # +# +# Bug#17403 "Events: packets out of order with show create event" +# +create event e1 on schedule every 1 year do set @a = 5; +create table t1 (s1 int); +--error ER_SP_NO_RETSET +create trigger t1_ai after insert on t1 for each row show create event e1; +drop table t1; +drop event e1; + ##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/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 4b307de2ad0..da40cdf643a 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1691,6 +1691,24 @@ drop function if exists bug16896; --error ER_SP_NO_AGGREGATE create aggregate function bug16896() returns int return 1; +# +# End of 5.0 tests +# + +# +# Bug#16164 "Easter egg": check that SHOW AUTHORS is disabled in +# stored functions/triggers +# +--disable_warnings +drop function if exists bug16164; +--enable_warnings +delimiter |; +--error ER_SP_NO_RETSET +create function bug16164() returns int +begin + show authors; + return 42; +end| # # BUG#NNNN: New bug synopsis diff --git a/sql/sp_head.cc b/sql/sp_head.cc index d97dcc390ca..ea2f67b3ba5 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -176,6 +176,7 @@ sp_get_flags_for_command(LEX *lex) case SQLCOM_SHOW_CREATE_DB: case SQLCOM_SHOW_CREATE_FUNC: case SQLCOM_SHOW_CREATE_PROC: + case SQLCOM_SHOW_CREATE_EVENT: case SQLCOM_SHOW_DATABASES: case SQLCOM_SHOW_ERRORS: case SQLCOM_SHOW_FIELDS: @@ -200,6 +201,7 @@ sp_get_flags_for_command(LEX *lex) case SQLCOM_SHOW_WARNS: case SQLCOM_SHOW_PROC_CODE: case SQLCOM_SHOW_FUNC_CODE: + case SQLCOM_SHOW_AUTHORS: case SQLCOM_REPAIR: case SQLCOM_BACKUP_TABLE: case SQLCOM_RESTORE_TABLE: |