List:Internals« Previous MessageNext Message »
From:pem Date:January 9 2004 8:36am
Subject:bk commit into 5.0 tree (pem:1.1648)
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://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1648 04/01/09 09:36:37 pem@stripped +3 -0
  Fix BUG#2269: Lost connect if stored procedure called before USE
  (And some minor correction of cursor open)

  sql/sp_rcontext.h
    1.9 04/01/09 09:36:35 pem@stripped +1 -1
    Corrected the semantics of cursor post_open().

  sql/sp_rcontext.cc
    1.8 04/01/09 09:36:35 pem@stripped +6 -3
    Corrected the semantics of cursor post_open().

  sql/sp_head.cc
    1.62 04/01/09 09:36:35 pem@stripped +6 -4
    Detect some errors that doesn't result in a non-zero return code in
    the SP execution loop.
    (Also corrected the cursor post_open() call.)

# 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:	mysql.comhem.se
# Root:	/home/pem/work/mysql-5.0

--- 1.61/sql/sp_head.cc	Sun Dec 21 01:07:21 2003
+++ 1.62/sql/sp_head.cc	Fri Jan  9 09:36:35 2004
@@ -286,6 +286,7 @@
 
   if (ctx)
     ctx->clear_handler();
+  thd->query_error= 0;
   do
   {
     sp_instr *i;
@@ -318,10 +319,11 @@
 	continue;
       }
     }
-  } while (ret == 0 && !thd->killed);
+  } while (ret == 0 && !thd->killed && !thd->query_error);
 
-  DBUG_PRINT("info", ("ret=%d killed=%d", ret, thd->killed));
-  if (thd->killed)
+  DBUG_PRINT("info", ("ret=%d killed=%d query_error=%d",
+		      ret, thd->killed, thd->query_error));
+  if (thd->killed || thd->query_error)
     ret= -1;
   /* If the DB has changed, the pointer has changed too, but the
      original thd->db will then have been freed */
@@ -1032,7 +1034,7 @@
       res= -1;
     else
       res= exec_stmt(thd, lex);
-    c->post_open(thd, (res == 0 ? TRUE : FALSE));
+    c->post_open(thd, (lex ? TRUE : FALSE));
   }
 
   *nextp= m_ip+1;

--- 1.7/sql/sp_rcontext.cc	Thu Jan  8 10:55:07 2004
+++ 1.8/sql/sp_rcontext.cc	Fri Jan  9 09:36:35 2004
@@ -153,12 +153,15 @@
 }
 
 void
-sp_cursor::post_open(THD *thd, my_bool isopen)
+sp_cursor::post_open(THD *thd, my_bool was_opened)
 {
   thd->net.no_send_eof= m_nseof; // Restore the originals
   thd->protocol= m_oprot;
-  m_isopen= isopen;
-  m_current_row= m_prot->data;
+  if (was_opened)
+  {
+    m_isopen= was_opened;
+    m_current_row= m_prot->data;
+  }
 }
 
 int

--- 1.8/sql/sp_rcontext.h	Thu Jan  8 10:37:28 2004
+++ 1.9/sql/sp_rcontext.h	Fri Jan  9 09:36:35 2004
@@ -220,7 +220,7 @@
   LEX *
   pre_open(THD *thd);
   void
-  post_open(THD *thd, my_bool isopen);
+  post_open(THD *thd, my_bool was_opened);
 
   int
   close(THD *thd);
Thread
bk commit into 5.0 tree (pem:1.1648)pem9 Jan