[Commits] Rev 3994: MDEV-5138 Numerous test failures in "mtr --ps --embedded". in file:///home/hf/wmar/mdev-5138/

holyfoot at askmonty.org holyfoot at askmonty.org
Sun Dec 8 17:54:21 EET 2013


At file:///home/hf/wmar/mdev-5138/

------------------------------------------------------------
revno: 3994
revision-id: holyfoot at askmonty.org-20131208143921-3veatgg9wngyzb47
parent: holyfoot at askmonty.org-20131202104753-srqqm7hv1rtcurx4
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: mdev-5138
timestamp: Sun 2013-12-08 18:39:21 +0400
message:
  MDEV-5138 Numerous test failures in "mtr --ps --embedded".
          Thread can be disconnected internally for example after COMMIT statements.
          So we should check this for the statement execution.
-------------- next part --------------
=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc	2013-11-30 13:24:32 +0000
+++ b/libmysqld/lib_sql.cc	2013-12-08 14:39:21 +0000
@@ -40,6 +40,7 @@ C_MODE_START
 extern unsigned int mysql_server_last_errno;
 extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
 static my_bool emb_read_query_result(MYSQL *mysql);
+static void emb_free_embedded_thd(MYSQL *mysql);
 
 
 extern "C" void unireg_clear(int exit_code)
@@ -107,6 +108,17 @@ emb_advanced_command(MYSQL *mysql, enum 
   NET *net= &mysql->net;
   my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
 
+  if (thd->killed != NOT_KILLED)
+  {
+    if (thd->killed < KILL_CONNECTION)
+      thd->killed= NOT_KILLED;
+    else
+    {
+      emb_free_embedded_thd(mysql);
+      thd= 0;
+    }
+  }
+
   if (!thd)
   {
     /* Do "reconnect" if possible */



More information about the commits mailing list