List:Commits« Previous MessageNext Message »
From:holyfoot Date:February 11 2008 11:59am
Subject:bk commit into 5.0 tree (holyfoot:1.2594) BUG#33334
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of holyfoot.  When holyfoot 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@stripped, 2008-02-11 15:59:01+04:00, holyfoot@stripped +1 -0
  Bug #33334 mysqltest_embedded crashes when disconnecting before reap.
  
  Before breaking the connection we have to check that there's no query
  executing at the moment. Otherwise it can lead to crash in embedded server.

  client/mysqltest.c@stripped, 2008-02-11 15:58:59+04:00, holyfoot@stripped +11 -1
    Bug #33334 mysqltest_embedded crashes when disconnecting before reap.
    
    Wait until the query thread is finished before we break the connection.

diff -Nrup a/client/mysqltest.c b/client/mysqltest.c
--- a/client/mysqltest.c	2007-12-17 17:17:02 +04:00
+++ b/client/mysqltest.c	2008-02-11 15:58:59 +04:00
@@ -3939,7 +3939,16 @@ void do_close_connection(struct st_comma
       con->mysql.net.vio = 0;
     }
   }
-#endif
+#else /*EMBEDDED_LIBRARY*/
+  /*
+   As query could be still executed in a separate theread
+   we need to check if the query's thread was finished and probably wait
+  */
+  pthread_mutex_lock(&con->mutex);
+  while (!con->query_done)
+    pthread_cond_wait(&con->cond, &con->mutex);
+  pthread_mutex_unlock(&con->mutex);
+#endif /*EMBEDDED_LIBRARY*/
   if (con->stmt)
     mysql_stmt_close(con->stmt);
   con->stmt= 0;
@@ -4229,6 +4238,7 @@ void do_connect(struct st_command *comma
           (int) (sizeof(connections)/sizeof(struct st_connection)));
   }
 
+  bzero(con_slot, sizeof(*con_slot));
   if (!mysql_init(&con_slot->mysql))
     die("Failed on mysql_init()");
   if (opt_compress || con_compress)
Thread
bk commit into 5.0 tree (holyfoot:1.2594) BUG#33334holyfoot11 Feb
  • Re: bk commit into 5.0 tree (holyfoot:1.2594) BUG#33334Alexey Kopytov20 Feb