List:Commits« Previous MessageNext Message »
From:pem Date:April 18 2006 11:07am
Subject:bk commit into 5.0 tree (pem:1.2138) BUG#18949
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of pem. When pem 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.2138 06/04/18 11:07:34 pem@stripped +9 -0
  Fixed BUG#18949: Test case sp-goto is disabled
    Removed sp-goto.test, sp-goto.result and all (disabled) GOTO code.
    Also removed some related code that's not needed any more (no possible
    unresolved label references any more, so no need to check for them).
    NB: Keeping the ER_SP_GOTO_IN_HNDLR in errmsg.txt; it might become useful
        in the future, and removing it (and thus re-enumerating error codes)
        might upset things. (Anything referring to explicit error codes.)

  sql/sql_yacc.yy
    1.464 06/04/18 11:07:30 pem@stripped +0 -90
    Removed GOTO symbols and (disabled) code, and the no longer needed
    sp_head::check_backpatch() calls.

  sql/sp_pcontext.h
    1.29 06/04/18 11:07:30 pem@stripped +3 -4
    Removed SP_LAB_REF (no longer needed) and renamed SP_LAB_GOTO
    to SP_LAB_IMPL, since it's only used for implicit labels now.

  sql/sp_pcontext.cc
    1.31 06/04/18 11:07:30 pem@stripped +1 -1
    SP_LAB_GOTO was renamed to SP_LAB_IMPL

  sql/sp_head.h
    1.82 06/04/18 11:07:30 pem@stripped +0 -7
    Removed sp_head::check_backpatch(). (Not needed with no GOTO)

  sql/sp_head.cc
    1.207 06/04/18 11:07:30 pem@stripped +2 -35
    Removed sp_head::check_backpatch() and simplified sp_head::backpatch().
    Without GOTO, unresolved label references are not possible, so no need
    to check for them.

  sql/lex.h
    1.144 06/04/18 11:07:30 pem@stripped +0 -7
    Removed (disabled) GOTO definitions.

  mysql-test/t/disabled.def
    1.25 06/04/18 11:07:30 pem@stripped +0 -1
    sp-goto.test no longer exists.

  BitKeeper/deleted/.del-sp-goto.test~5054d3f729692d3d
    1.2 06/04/18 09:27:27 pem@stripped +0 -0
    Delete: mysql-test/t/sp-goto.test

  BitKeeper/deleted/.del-sp-goto.result~f343103c63f64b7a
    1.2 06/04/18 09:27:27 pem@stripped +0 -0
    Delete: mysql-test/r/sp-goto.result

# 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:	pem
# Host:	pem.mysql.com
# Root:	/extern/mysql/5.0/bug18949/mysql-5.0-runtime

--- 1.143/sql/lex.h	2006-02-17 07:51:10 +01:00
+++ 1.144/sql/lex.h	2006-04-18 11:07:30 +02:00
@@ -215,9 +215,6 @@
   { "GEOMETRYCOLLECTION",SYM(GEOMETRYCOLLECTION)},
   { "GET_FORMAT",       SYM(GET_FORMAT)},
   { "GLOBAL",		SYM(GLOBAL_SYM)},
-#ifdef SP_GOTO
-  { "GOTO",             SYM(GOTO_SYM)},
-#endif
   { "GRANT",		SYM(GRANT)},
   { "GRANTS",	        SYM(GRANTS)},
   { "GROUP",		SYM(GROUP)},
@@ -265,10 +262,6 @@
   { "KEY",		SYM(KEY_SYM)},
   { "KEYS",		SYM(KEYS)},
   { "KILL",		SYM(KILL_SYM)},
-#ifdef SP_GOTO
-  /* QQ This will go away when the GOTO label syntax is fixed */
-  { "LABEL",            SYM(LABEL_SYM)},
-#endif
   { "LANGUAGE",         SYM(LANGUAGE_SYM)},
   { "LAST",		SYM(LAST_SYM)},
   { "LEADING",		SYM(LEADING)},

--- 1.463/sql/sql_yacc.yy	2006-04-07 16:53:11 +02:00
+++ 1.464/sql/sql_yacc.yy	2006-04-18 11:07:30 +02:00
@@ -301,7 +301,6 @@
 %token  GEOMFROMWKB
 %token  GET_FORMAT
 %token  GLOBAL_SYM
-%token  GOTO_SYM
 %token  GRANT
 %token  GRANTS
 %token  GREATEST_SYM
@@ -1332,8 +1331,6 @@
             if (sp->is_not_allowed_in_function("function"))
               YYABORT;
 
-	    if (sp->check_backpatch(YYTHD))
-	      YYABORT;
 	    lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
 	    sp->init_strings(YYTHD, lex, lex->spname);
             if (!(sp->m_flags & sp_head::HAS_RETURN))
@@ -2054,91 +2051,6 @@
               sp->add_instr(i);
 	    }
 	  }
-	| LABEL_SYM IDENT
-	  {
-#ifdef SP_GOTO
-	    LEX *lex= Lex;
-	    sp_head *sp= lex->sphead;
-	    sp_pcontext *ctx= lex->spcont;
-	    sp_label_t *lab= ctx->find_label($2.str);
-
-	    if (lab)
-	    {
-	      my_error(ER_SP_LABEL_REDEFINE, MYF(0), $2.str);
-	      YYABORT;
-	    }
-	    else
-	    {
-	      lab= ctx->push_label($2.str, sp->instructions());
-	      lab->type= SP_LAB_GOTO;
-	      lab->ctx= ctx;
-              sp->backpatch(lab);
-	    }
-#else
-	    yyerror(ER(ER_SYNTAX_ERROR));
-	    YYABORT;
-#endif
-	  }
-	| GOTO_SYM IDENT
-	  {
-#ifdef SP_GOTO
-	    LEX *lex= Lex;
-	    sp_head *sp= lex->sphead;
-	    sp_pcontext *ctx= lex->spcont;
-	    uint ip= lex->sphead->instructions();
-	    sp_label_t *lab;
-	    sp_instr_jump *i;
-	    sp_instr_hpop *ih;
-	    sp_instr_cpop *ic;
-
-	    if (sp->m_in_handler)
-	    {
-	      my_message(ER_SP_GOTO_IN_HNDLR, ER(ER_SP_GOTO_IN_HNDLR), MYF(0));
-	      YYABORT;
-	    }
-	    lab= ctx->find_label($2.str);
-	    if (! lab)
-	    {
-	      lab= (sp_label_t *)YYTHD->alloc(sizeof(sp_label_t));
-	      lab->name= $2.str;
-	      lab->ip= 0;
-	      lab->type= SP_LAB_REF;
-	      lab->ctx= ctx;
-
-	      ih= new sp_instr_hpop(ip++, ctx, 0);
-	      sp->push_backpatch(ih, lab);
-	      sp->add_instr(ih);
-	      ic= new sp_instr_cpop(ip++, ctx, 0);
-	      sp->add_instr(ic);
-	      sp->push_backpatch(ic, lab);
-	      i= new sp_instr_jump(ip, ctx);
-	      sp->push_backpatch(i, lab);  /* Jumping forward */
-	      sp->add_instr(i);
-	    }
-	    else
-	    {
-	      uint n;
-
-	      n= ctx->diff_handlers(lab->ctx);
-	      if (n)
-	      {
-	        ih= new sp_instr_hpop(ip++, ctx, n);
-	        sp->add_instr(ih);
-	      }
-	      n= ctx->diff_cursors(lab->ctx);
-	      if (n)
-	      {
-	        ic= new sp_instr_cpop(ip++, ctx, n);
-	        sp->add_instr(ic);
-	      }
-	      i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */
-	      sp->add_instr(i);
-	    }
-#else
-	    yyerror(ER(ER_SYNTAX_ERROR));
-	    YYABORT;
-#endif
-	  }
 	| OPEN_SYM ident
 	  {
 	    LEX *lex= Lex;
@@ -9228,8 +9140,6 @@
 	  LEX *lex= Lex;
 	  sp_head *sp= lex->sphead;
 
-	  if (sp->check_backpatch(YYTHD))
-	    YYABORT;
 	  sp->init_strings(YYTHD, lex, $3);
 	  lex->sql_command= SQLCOM_CREATE_PROCEDURE;
 	  /* Restore flag if it was cleared above */

--- 1.24/mysql-test/t/disabled.def	2006-03-28 04:25:30 +02:00
+++ 1.25/mysql-test/t/disabled.def	2006-04-18 11:07:30 +02:00
@@ -10,6 +10,5 @@
 #
 ##############################################################################
 
-sp-goto         : GOTO is currently is disabled - will be fixed in the future
 ndb_load        : Bug#17233
 udf             : Bug#18564 (Permission by Brian)

--- 1.206/sql/sp_head.cc	2006-04-07 16:53:11 +02:00
+++ 1.207/sql/sp_head.cc	2006-04-18 11:07:30 +02:00
@@ -1670,43 +1670,10 @@
 
   while ((bp= li++))
   {
-    if (bp->lab == lab ||
-	(bp->lab->type == SP_LAB_REF &&
-	 my_strcasecmp(system_charset_info, bp->lab->name, lab->name) == 0))
-    {
-      if (bp->lab->type != SP_LAB_REF)
-	bp->instr->backpatch(dest, lab->ctx);
-      else
-      {
-	sp_label_t *dstlab= bp->lab->ctx->find_label(lab->name);
-
-	if (dstlab)
-	{
-	  bp->lab= lab;
-	  bp->instr->backpatch(dest, dstlab->ctx);
-	}
-      }
-    }
+    if (bp->lab == lab)
+      bp->instr->backpatch(dest, lab->ctx);
   }
 }
-
-int
-sp_head::check_backpatch(THD *thd)
-{
-  bp_t *bp;
-  List_iterator_fast<bp_t> li(m_backpatch);
-
-  while ((bp= li++))
-  {
-    if (bp->lab->type == SP_LAB_REF)
-    {
-      my_error(ER_SP_LILABEL_MISMATCH, MYF(0), "GOTO", bp->lab->name);
-      return -1;
-    }
-  }
-  return 0;
-}
-
 
 /*
   Prepare an instance of create_field for field creation (fill all necessary

--- 1.81/sql/sp_head.h	2006-04-07 16:53:11 +02:00
+++ 1.82/sql/sp_head.h	2006-04-18 11:07:30 +02:00
@@ -263,13 +263,6 @@
   void
   backpatch(struct sp_label *);
 
-  // Check that no unresolved references exist.
-  // If none found, 0 is returned, otherwise errors have been issued
-  // and -1 is returned.
-  // This is called by the parser at the end of a create procedure/function.
-  int
-  check_backpatch(THD *thd);
-
   // Start a new cont. backpatch level. If 'i' is NULL, the level is just incr.
   void
   new_cont_backpatch(sp_instr_opt_meta *i);

--- 1.30/sql/sp_pcontext.cc	2006-04-07 16:53:11 +02:00
+++ 1.31/sql/sp_pcontext.cc	2006-04-18 11:07:30 +02:00
@@ -241,7 +241,7 @@
   {
     lab->name= name;
     lab->ip= ip;
-    lab->type= SP_LAB_GOTO;
+    lab->type= SP_LAB_IMPL;
     lab->ctx= this;
     m_label.push_front(lab);
   }

--- 1.28/sql/sp_pcontext.h	2006-04-07 16:53:11 +02:00
+++ 1.29/sql/sp_pcontext.h	2006-04-18 11:07:30 +02:00
@@ -48,10 +48,9 @@
 } sp_variable_t;
 
 
-#define SP_LAB_REF   0		// Unresolved reference (for goto)
-#define SP_LAB_GOTO  1		// Free goto label
-#define SP_LAB_BEGIN 2		// Label at BEGIN
-#define SP_LAB_ITER  3		// Label at iteration control
+#define SP_LAB_IMPL  0		// Implicit label generated by parser
+#define SP_LAB_BEGIN 1		// Label at BEGIN
+#define SP_LAB_ITER  2		// Label at iteration control
 
 /*
   An SQL/PSM label. Can refer to the identifier used with the
Thread
bk commit into 5.0 tree (pem:1.2138) BUG#18949pem18 Apr