List:Commits« Previous MessageNext Message »
From:Marc Alff Date:August 15 2008 5:35pm
Subject:bzr push into mysql-6.0-bugteam branch (marc.alff:2768 to 2769) Bug#38824
View as plain text  
 2769 Marc Alff	2008-08-15
      Bug#38824 (Unused memory in sp_handler_t::foffset, in stored procedures)
      
      This is a minor code cleanup, to remove dead code in stored procedures.
      
      Removed:
      - unused member sp_handler_t::foffset
      - unused parameter f in push_handler()
      - unused parameter fp in found_handler(),
      adjusted the calling code.
modified:
  sql/sp_head.cc
  sql/sp_rcontext.cc
  sql/sp_rcontext.h

 2768 Ramil Kalimullin	2008-08-15
        Fix for bug #33702: accessing a federated table with a non existing server 
        returns random error code
        
        Problem: accessing a federated table through a non existing server leads to
        wrong error number returned.
        
        Fix: return a proper error.
modified:
  mysql-test/r/federated.result
  mysql-test/t/federated.test
  storage/federated/ha_federated.cc

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2008-08-13 16:25:48 +0000
+++ b/sql/sp_head.cc	2008-08-15 17:31:50 +0000
@@ -1263,9 +1263,7 @@ sp_head::execute(THD *thd)
     */
     if (ctx)
     {
-      uint hf;
-
-      switch (ctx->found_handler(&hip, &hf)) {
+      switch (ctx->found_handler(&hip)) {
       case SP_HANDLER_NONE:
         break;
       case SP_HANDLER_CONTINUE:
@@ -3218,7 +3216,7 @@ sp_instr_hpush_jump::execute(THD *thd, u
   sp_cond_type_t *p;
 
   while ((p= li++))
-    thd->spcont->push_handler(p, m_ip+1, m_type, m_frame);
+    thd->spcont->push_handler(p, m_ip+1, m_type);
 
   *nextp= m_dest;
   DBUG_RETURN(0);
@@ -3470,9 +3468,9 @@ sp_instr_copen::execute(THD *thd, uint *
     */
     if (!res)
     {
-      uint dummy1, dummy2;
+      uint dummy1;
 
-      if (thd->spcont->found_handler(&dummy1, &dummy2))
+      if (thd->spcont->found_handler(&dummy1))
         res= -1;
     }
     /* TODO: Assert here that we either have an error or a cursor */

=== modified file 'sql/sp_rcontext.cc'
--- a/sql/sp_rcontext.cc	2008-01-23 22:36:57 +0000
+++ b/sql/sp_rcontext.cc	2008-08-15 17:31:50 +0000
@@ -335,7 +335,7 @@ sp_rcontext::pop_cursors(uint count)
 }
 
 void
-sp_rcontext::push_handler(struct sp_cond_type *cond, uint h, int type, uint f)
+sp_rcontext::push_handler(struct sp_cond_type *cond, uint h, int type)
 {
   DBUG_ENTER("sp_rcontext::push_handler");
   DBUG_ASSERT(m_hcount < m_root_parsing_ctx->max_handler_index());
@@ -343,7 +343,6 @@ sp_rcontext::push_handler(struct sp_cond
   m_handler[m_hcount].cond= cond;
   m_handler[m_hcount].handler= h;
   m_handler[m_hcount].type= type;
-  m_handler[m_hcount].foffset= f;
   m_hcount+= 1;
 
   DBUG_PRINT("info", ("m_hcount: %d", m_hcount));

=== modified file 'sql/sp_rcontext.h'
--- a/sql/sp_rcontext.h	2008-01-23 20:26:41 +0000
+++ b/sql/sp_rcontext.h	2008-08-15 17:31:50 +0000
@@ -37,7 +37,6 @@ typedef struct
   struct sp_cond_type *cond;
   uint handler;			// Location of handler
   int type;
-  uint foffset;			// Frame offset for the handlers declare level
 } sp_handler_t;
 
 
@@ -107,7 +106,7 @@ class sp_rcontext : public Sql_alloc
     return m_return_value_set;
   }
 
-  void push_handler(struct sp_cond_type *cond, uint h, int type, uint f);
+  void push_handler(struct sp_cond_type *cond, uint h, int type);
 
   void pop_handlers(uint count);
 
@@ -123,12 +122,11 @@ class sp_rcontext : public Sql_alloc
 
   // Returns handler type and sets *ip to location if one was found
   inline int
-  found_handler(uint *ip, uint *fp)
+  found_handler(uint *ip)
   {
     if (m_hfound < 0)
       return SP_HANDLER_NONE;
     *ip= m_handler[m_hfound].handler;
-    *fp= m_handler[m_hfound].foffset;
     return m_handler[m_hfound].type;
   }
 

Thread
bzr push into mysql-6.0-bugteam branch (marc.alff:2768 to 2769) Bug#38824Marc Alff15 Aug