List:Commits« Previous MessageNext Message »
From:ahristov Date:February 15 2006 5:12pm
Subject:bk commit into 5.1 tree (andrey:1.2109) BUG#16410
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2109 06/02/15 17:12:27 andrey@lmy004. +4 -0
  fix for bug#16410 (Events: CREATE EVENT is legal in a CREATE TRIGGER statement)
  WL#1034 (Internal CRON)
  (post-post-review updates)
  

  sql/sql_parse.cc
    1.522 06/02/15 17:12:20 andrey@lmy004. +6 -0
    - end active transaction for CREATE/ALTER/DROP EVENT because
      they are DDL statements.

  sql/sp_head.cc
    1.202 06/02/15 17:12:20 andrey@lmy004. +3 -0
    CREATE/ALTER/DROP event mean explicit commit, so they are not allowed in
    a FUNCTION/TRIGGER. Fixes bug#16410

  mysql-test/t/events.test
    1.17 06/02/15 17:12:20 andrey@lmy004. +11 -0
    add test for Bug #16410  Events: CREATE EVENT is legal in a CREATE TRIGGER statement

  mysql-test/r/events.result
    1.16 06/02/15 17:12:19 andrey@lmy004. +4 -0
    update results file

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	andrey
# Host:	lmy004.
# Root:	/work/mysql-5.1-bug16410

--- 1.521/sql/sql_parse.cc	2006-02-14 16:27:35 +01:00
+++ 1.522/sql/sql_parse.cc	2006-02-15 17:12:20 +01:00
@@ -3773,6 +3773,12 @@ end_with_restore_list:
                        is_schema_db(lex->et->dbname.str)))
         break;
 
+      if (end_active_trans(thd))
+      {
+        res= -1;
+        break;
+      }
+
       switch (lex->sql_command) {
       case SQLCOM_CREATE_EVENT:
         res= evex_create_event(thd, lex->et, (uint) lex->create_info.options,

--- 1.15/mysql-test/r/events.result	2006-02-14 20:10:43 +01:00
+++ 1.16/mysql-test/r/events.result	2006-02-15 17:12:19 +01:00
@@ -361,4 +361,8 @@ show processlist;
 Id	User	Host	db	Command	Time	State	Info
 #	root	localhost	events_test	Query	#	NULL	show processlist
 drop event закачка21;
+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;
 drop database events_test;

--- 1.16/mysql-test/t/events.test	2006-02-14 20:10:43 +01:00
+++ 1.17/mysql-test/t/events.test	2006-02-15 17:12:20 +01:00
@@ -323,6 +323,17 @@ select release_lock("test_lock2_1");
 show processlist;
 drop event закачка21;
 
+####
+# Bug #16410  Events: CREATE EVENT is legal in a CREATE TRIGGER statement
+#
+create table t_16 (s1 int);
+--error 1422
+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;
+#
+# end of test case
+####
+
 ##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);

--- 1.201/sql/sp_head.cc	2006-02-09 11:34:35 +01:00
+++ 1.202/sql/sp_head.cc	2006-02-15 17:12:20 +01:00
@@ -255,6 +255,9 @@ sp_get_flags_for_command(LEX *lex)
   case SQLCOM_ALTER_FUNCTION:
   case SQLCOM_DROP_PROCEDURE:
   case SQLCOM_DROP_FUNCTION:
+  case SQLCOM_CREATE_EVENT:
+  case SQLCOM_ALTER_EVENT:
+  case SQLCOM_DROP_EVENT:
     flags= sp_head::HAS_COMMIT_OR_ROLLBACK;
     break;
   default:
Thread
bk commit into 5.1 tree (andrey:1.2109) BUG#16410ahristov15 Feb