[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    bk commit into 5.1 tree (andrey:1.2011)
From:       ahristov () mysql ! com
Date:       2005-12-28 11:43:39
Message-ID: 20051228114339.4D9291D2B1 () andrey ! hristov ! com
[Download RAW message or body]

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.2011 05/12/28 13:43:27 andrey@lmy004. +1 -0
  WL#1034 update
  - fix crash of an event that alters itself
  - make "alter event xyz;" invalid because at least 1 clause is needed.

  sql/sql_yacc.yy
    1.430 05/12/28 13:43:16 andrey@lmy004. +35 -12
    - make "alter event xyz;" a syntax error. the user has to provide at least one clause

# 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-tt-copy-works

--- 1.429/sql/sql_yacc.yy	2005-12-28 13:00:01 +02:00
+++ 1.430/sql/sql_yacc.yy	2005-12-28 13:43:16 +02:00
@@ -1411,12 +1411,13 @@
           }
       ;
     
-ev_status: /* empty */
+ev_status: /* empty */ {$<ulong_num>$= 0;}
         | ENABLED_SYM
           {
             LEX *lex=Lex;
             if (!lex->et_compile_phase)
-              lex->et->status= MYSQL_EVENT_ENABLED;	   
+              lex->et->status= MYSQL_EVENT_ENABLED;
+            $<ulong_num>$= 1;	   
           }
         | DISABLED_SYM
           {
@@ -1424,6 +1425,7 @@
             
             if (!lex->et_compile_phase)
               lex->et->status= MYSQL_EVENT_DISABLED;
+            $<ulong_num>$= 1;
           }
       ;
 ev_starts: /* empty */
@@ -1453,21 +1455,23 @@
             }
           }
       ;
-ev_on_completion: /* empty */
+ev_on_completion: /* empty */ {$<ulong_num>$= 0;}
         | ON COMPLETION_SYM PRESERVE_SYM
           {
             LEX *lex=Lex;
             if (!lex->et_compile_phase)
-              lex->et->on_completion= MYSQL_EVENT_ON_COMPLETION_PRESERVE;  
+              lex->et->on_completion= MYSQL_EVENT_ON_COMPLETION_PRESERVE;
+            $<ulong_num>$= 1;
           }
         | ON COMPLETION_SYM NOT_SYM PRESERVE_SYM
           {
             LEX *lex=Lex;
             if (!lex->et_compile_phase)
-              lex->et->on_completion= MYSQL_EVENT_ON_COMPLETION_DROP;	    
+              lex->et->on_completion= MYSQL_EVENT_ON_COMPLETION_DROP;
+            $<ulong_num>$= 1;
           }
       ;
-ev_comment: /* empty */
+ev_comment: /* empty */ {$<ulong_num>$= 0;}
         | COMMENT_SYM TEXT_STRING_sys
           {
             LEX *lex= Lex;
@@ -1476,6 +1480,7 @@
               lex->comment= $2;
               lex->et->init_comment(YYTHD, &$2);
             }
+            $<ulong_num>$= 1;
           }
       ;
 
@@ -4270,24 +4275,42 @@
               sql_command is set here because some rules in ev_sql_stmt
               can overwrite it
             */
+            printf("5=%d 6=%d 7=%d 8=%d 9=%d 10=%d", $<ulong_num>5 , $<ulong_num>6 , $<ulong_num>7 ,
+                $<ulong_num>8 , $<ulong_num>9 , $<ulong_num>10);
+            if (!($<ulong_num>5 || $<ulong_num>6 || $<ulong_num>7 ||
+                $<ulong_num>8 || $<ulong_num>9 || $<ulong_num>10))
+            {
+	      yyerror(ER(ER_SYNTAX_ERROR));
+              YYABORT;
+            }
             Lex->sql_command= SQLCOM_ALTER_EVENT;
           }	  
       ;
 
-ev_on_schedule: /* empty */
-        | ON SCHEDULE_SYM ev_schedule_time;
-
-ev_opt_sql_stmt: /* empty*/
-        | DO_SYM ev_sql_stmt;
+ev_on_schedule: /* empty */ { $<ulong_num>$= 0;}
+        | ON SCHEDULE_SYM ev_schedule_time
+          {
+            $<ulong_num>$= 1;
+          }
+        ;
 
-ev_rename_to: /* empty */
+ev_rename_to: /* empty */ { $<ulong_num>$= 0;}
         | RENAME TO_SYM sp_name
           {
             LEX *lex=Lex;
             lex->spname= $3; //use lex's spname to hold the new name
 	                     //the original name is in the event_timed object
+            $<ulong_num>$= 1;
           }
       ;
+
+ev_opt_sql_stmt: /* empty*/ { $<ulong_num>$= 0;}
+        | DO_SYM ev_sql_stmt
+          {
+            $<ulong_num>$= 1;
+          }
+        ;
+
   
 ident_or_empty:
 	/* empty */  { $$= 0; }

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=mysql-internals@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic