在 MySQL 命令行客户端 (Linux) 中,当我通过按CTRL+终止查询时,c这通常工作正常。
mysql (slave) > select sleep(5);
^CCtrl-C -- sending "KILL QUERY 117920686" to server ...
Ctrl-C -- query aborted.
+----------+
| sleep(5) |
+----------+
+----------+
1 row in set (0.78 sec)
然而,当我在我的实时主服务器(在所有服务器中,它必须是这一个......)上做同样的事情时,它以某种方式发送了错误的线程 ID。
mysql (master) > select sleep(5);
^CCtrl-C -- sending "KILL QUERY 770543254" to server ...
Ctrl-C -- query aborted.
+----------+
| sleep(5) |
+----------+
+----------+
1 row in set (5.00 sec) /* <- it obviously hasn't aborted at all */
ID太低了 其他线程的 ID 类似于 26534760326。所有服务器的版本相同:
# yum list installed mysql*
Loaded plugins: dellsysid, rhnplugin, security, ulninfo
This system is receiving updates from RHN Classic or Red Hat Satellite.
Installed Packages
MySQL-python.x86_64 1.2.3-0.3.c1.1.el6 @public_ol6_latest
mysql-community-client.x86_64 5.6.27-2.el6 @mysql56-community
mysql-community-common.x86_64 5.6.27-2.el6 @mysql56-community
mysql-community-libs.x86_64 5.6.27-2.el6 @mysql56-community
mysql-community-libs-compat.x86_64 5.6.27-2.el6 @mysql56-community
mysql-community-release.noarch el6-5 @/mysql-community-release-el6-5.noarch
mysql-community-server.x86_64 5.6.27-2.el6 @mysql56-community
附加信息:
然而,该connection_id()
函数返回正确的值。
root@ods01:(none) > select connection_id();
+-----------------+
| connection_id() |
+-----------------+
| 26542310314 |
+-----------------+
1 row in set (0.00 sec)
root@ods01:(none) > select sleep(5);
^CCtrl-C -- sending "KILL QUERY 772506538" to server ...
Ctrl-C -- query aborted.
+----------+
| sleep(5) |
+----------+
+----------+
1 row in set (5.00 sec)
有谁知道如何解决这一问题?