summaryrefslogtreecommitdiff
path: root/mysql-test/r/kill.result
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@station.>2007-11-15 15:35:35 +0300
committerunknown <anozdrin/alik@station.>2007-11-15 15:35:35 +0300
commit91f001398654238fb98d7c82e1be18e11ef53138 (patch)
treed8b742889e9b1796277e17a4ef5fdf79756809dc /mysql-test/r/kill.result
parent26b5030487f92667c03bae8f8ab32f654f1de9c6 (diff)
downloadmariadb-git-91f001398654238fb98d7c82e1be18e11ef53138.tar.gz
A patch for BUG#19723: kill of active connection yields
different error code depending on platform. On Mac OS X, KILL statement issued to kill the current connection would return a different error code and message than on other platforms ('MySQL server has gone away' instead of 'Shutdown in progress'). The reason for this difference was that on Mac OS X we have macro SIGNAL_WITH_VIO_CLOSE defined. This macro forces KILL implementation to close the communication socket of the thread that is being killed. SIGNAL_WITH_VIO_CLOSE macro is defined on platforms where just sending a signal is not a reliable mechanism to interrupt the thread from sleeping on a blocking system call. In a nutshell, closing the socket is a hack to work around an operating system bug and awake the blocked thread no matter what. However, if the thread that is being killed is the same thread that issued KILL statement, closing the socket leads to a prematurely lost connection. At the same time it is not necessary to close the socket in this case, since the thread in question is not inside a blocking system call. The fix, therefore, is to not close the socket if the thread that is being killed is the same that issued KILL statement, even with defined SIGNAL_WITH_VIO_CLOSE. mysql-test/r/kill.result: Update result file. mysql-test/t/kill.test: Added a test case for BUG#19723: kill of active connection yields different error code depending on platform. sql/sql_class.cc: Call close_active_vio() only if we're killing another thread.
Diffstat (limited to 'mysql-test/r/kill.result')
-rw-r--r--mysql-test/r/kill.result9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result
index a08be429a83..8376eb7c0de 100644
--- a/mysql-test/r/kill.result
+++ b/mysql-test/r/kill.result
@@ -125,3 +125,12 @@ drop function bug27563;
drop procedure proc27563;
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 ';
EXECUTE stmt;
+#
+# Bug#19723: kill of active connection yields different error code
+# depending on platform.
+#
+
+# Connection: con2.
+KILL CONNECTION_ID();
+SELECT 1;
+ERROR HY000: Lost connection to MySQL server during query