[Commits] Rev 3584: MDEV-3885 - connection suicide via mysql_kill() causes assertion in server in file:///H:/bzr/5.5/

Vladislav Vaintroub wlad at montyprogram.com
Tue Nov 27 01:46:38 EET 2012


At file:///H:/bzr/5.5/

------------------------------------------------------------
revno: 3584
revision-id: wlad at montyprogram.com-20121126234529-c3u6o3e95z8sq3px
parent: sergii at pisem.net-20121126175029-zjir5eo2kbx42rqv
committer: Vladislav Vaintroub <wlad at montyprogram.com>
branch nick: 5.5
timestamp: Tue 2012-11-27 00:45:29 +0100
message:
  MDEV-3885 - connection suicide via mysql_kill() causes assertion in server
  
  Assertion happened because sql_kill did not set OK status in diagnostic area
  in the case of connection suicide (id to kill == thd->thread_id), issued 
  via  COM_PROCESS_KILL , e.g using mysql_kill()
  
  This patch ensures that diagnostic area is initialized in this specific case.
-------------- next part --------------
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2012-09-18 20:34:16 +0000
+++ b/sql/sql_parse.cc	2012-11-26 23:45:29 +0000
@@ -6717,7 +6717,7 @@
   uint error;
   if (!(error= kill_one_thread(thd, id, state)))
   {
-    if (! thd->killed)
+    if ((!thd->killed) || (thd->thread_id == id))
       my_ok(thd);
   }
   else

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2012-10-16 11:04:42 +0000
+++ b/tests/mysql_client_test.c	2012-11-26 23:45:29 +0000
@@ -18554,6 +18554,22 @@
   mysql_close(conn);
 }
 
+/**
+  MDEV-3885 - connection suicide via mysql_kill() causes assertion in server
+*/
+
+static void test_mdev3885() 
+{
+  int rc;
+  MYSQL *conn;
+
+  myheader("test_mdev3885");
+  conn= client_connect(0, MYSQL_PROTOCOL_TCP, 0);
+  rc= mysql_kill(conn, mysql_thread_id(conn));
+  DIE_UNLESS(rc == 0);
+  mysql_close(conn);
+}
+
 
 /**
   Bug#57058 SERVER_QUERY_WAS_SLOW not wired up.
@@ -19056,6 +19072,7 @@
   { "test_bug58036", test_bug58036 },
   { "test_bug57058", test_bug57058 },
   { "test_bug56976", test_bug56976 },
+  { "test_mdev3855", test_mdev3885 },
   { "test_bug11766854", test_bug11766854 },
   { "test_bug12337762", test_bug12337762 },
   { "test_progress_reporting", test_progress_reporting },



More information about the commits mailing list