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

holyfoot at askmonty.org holyfoot at askmonty.org
Tue Apr 15 17:35:55 EEST 2014


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

------------------------------------------------------------
revno: 4152
revision-id: holyfoot at askmonty.org-20140415131647-nnde8b059g1r2zgi
parent: holyfoot at askmonty.org-20140415131225-m0hlbz7lyzdoymry
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: mdev-5138-2
timestamp: Tue 2014-04-15 18:16:47 +0500
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	2014-04-15 13:08:33 +0000
+++ b/libmysqld/lib_sql.cc	2014-04-15 13:16:47 +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