List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:December 7 2009 12:09pm
Subject:bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2866) Bug#49269
View as plain text  
#At file:///home/bm136801/my/reapcrash-51/ based on revid:bjorn.munch@stripped

 2866 Bjorn Munch	2009-12-07
      Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
      Set a flag after send to trap the case

    modified:
      client/mysqltest.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2009-11-26 10:16:06 +0000
+++ b/client/mysqltest.cc	2009-12-07 12:08:14 +0000
@@ -225,6 +225,8 @@ struct st_connection
   char *name;
   size_t name_len;
   MYSQL_STMT* stmt;
+  /* Set after send to disallow other queries before reap */
+  my_bool pending;
 
 #ifdef EMBEDDED_LIBRARY
   const char *cur_query;
@@ -4685,7 +4687,8 @@ void do_close_connection(struct st_comma
   if (con->util_mysql)
     mysql_close(con->util_mysql);
   con->util_mysql= 0;
-
+  con->pending= FALSE;
+  
   my_free(con->name, MYF(0));
 
   /*
@@ -6458,6 +6461,9 @@ void run_query_normal(struct st_connecti
 
   if (flags & QUERY_SEND_FLAG)
   {
+    if (cn->pending)
+      die ("Cannot run query on connection between send and reap");
+    
     /*
       Send the query
     */
@@ -6477,8 +6483,11 @@ void run_query_normal(struct st_connecti
     wait_query_thread_end(cn);
 #endif /*EMBEDDED_LIBRARY*/
   if (!(flags & QUERY_REAP_FLAG))
+  {
+    cn->pending= TRUE;
     DBUG_VOID_RETURN;
-
+  }
+  
   do
   {
     /*
@@ -6567,6 +6576,7 @@ void run_query_normal(struct st_connecti
 
 end:
 
+  cn->pending= FALSE;
   /*
     We save the return code (mysql_errno(mysql)) from the last call sent
     to the server into the mysqltest builtin variable $mysql_errno. This


Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20091207120814-j647rx04p37g6mia.bundle
Thread
bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2866) Bug#49269Bjorn Munch7 Dec