From 490aa17114e011a4563bb6b6b60ccdff6d4e1d86 Mon Sep 17 00:00:00 2001 From: ZhangCheng Date: Mon, 21 Oct 2024 11:59:01 +0800 Subject: [PATCH 1/2] Add kill query documentation --- .../shardingsphere-proxy/session/_index.cn.md | 9 +++++---- .../shardingsphere-proxy/session/_index.en.md | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/document/content/user-manual/shardingsphere-proxy/session/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/session/_index.cn.md index 0bf6179ad48c0..ccc73bc718447 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/session/_index.cn.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/session/_index.cn.md @@ -3,7 +3,7 @@ title = "会话管理" weight = 7 +++ -ShardingSphere 支持会话管理,可通过原生数据库的 SQL 查看当前会话或杀掉会话。目前此功能仅限于存储节点为 MySQL 的情况,支持 MySQL `SHOW PROCESSLIST` 命令和 `KILL` 命令。 +ShardingSphere 支持会话管理,可通过原生数据库的 SQL 查看当前会话或终止会话里面执行的 SQL。目前此功能仅限于存储节点为 MySQL 的情况,支持 MySQL `SHOW PROCESSLIST` 命令和 `KILL QUERY` 命令。 ## 相关操作 @@ -25,12 +25,13 @@ mysql> show processlist; 模拟原生 MySQL 的输出,但 `Id` 字段较为特殊为随机字符串。 -### 杀掉会话 +### 终止会话语句 -用户根据 `SHOW PROCESSLIST` 返回的结果,判断是否需要执行 `KILL` 语句,ShardingSphere 会根据 `KILL` 语句中的 ID 取消正在执行中的 SQL。 +用户根据 `SHOW PROCESSLIST` 返回的结果,判断是否需要执行 `KILL QUERY` 语句,ShardingSphere 会根据 `KILL QUERY` 语句中的 ID 取消该 PROCESS ID 正在执行中的 SQL。 ```sql -mysql> kill 05ede3bd584fd4a429dcaac382be2973; +-- 取消指定会话里正在执行中的 SQL 语句。 +mysql> KILL QUERY 05ede3bd584fd4a429dcaac382be2973; Query OK, 0 rows affected (0.04 sec) mysql> show processlist; diff --git a/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md index c72a552d619b7..00aa8a761d180 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md @@ -3,7 +3,7 @@ title = "Session Management" weight = 7 +++ -ShardingSphere supports session management. You can view the current session or kill the session through the SQL of the native database. At present, this function is only available when the storage node is MySQL. MySQL `SHOW PROCESSLIST` and `KILL` commands are supported. +ShardingSphere supports session management. You can view the current session or terminate the SQL executed in the session through the SQL of the native database. At present, this function is only available when the storage node is MySQL. MySQL `SHOW PROCESSLIST` and `KILL QUERY` commands are supported. ## Usage ### View Session @@ -24,14 +24,15 @@ mysql> show processlist; Simulates the output of native MySQL, but the `Id` field is a special random string. -### Kill Session +### KILL THE SQL IN THE SESSION -The user determines whether the `KILL` statement needs to be executed according to the results returned by `SHOW PROCESSLIST`. ShardingSphere cancels the SQL being executed according to the ID in the `KILL` statement. +The user determines whether the `KILL QUERY` statement needs to be executed according to the results returned by `SHOW PROCESSLIST`. ShardingSphere cancels the SQL being executed according to the ID in the `KILL QUERY` statement. ```sql -mysql> kill 05ede3bd584fd4a429dcaac382be2973; +--Cancel the SQL statement currently executing in the specified session. +mysql> KILL QUERY 05ede3bd584fd4a429dcaac382be2973; Query OK, 0 rows affected (0.04 sec) -mysql> show processlist; +mysql> SHOW PROCESSLIST; Empty set (0.02 sec) ``` From 59829e5cf9735811675447ab31a2e058acad66e5 Mon Sep 17 00:00:00 2001 From: ZhangCheng Date: Mon, 21 Oct 2024 13:46:14 +0800 Subject: [PATCH 2/2] Add kill query documentation --- .../user-manual/shardingsphere-proxy/session/_index.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md b/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md index 00aa8a761d180..53791350989b4 100644 --- a/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md +++ b/docs/document/content/user-manual/shardingsphere-proxy/session/_index.en.md @@ -29,7 +29,7 @@ Simulates the output of native MySQL, but the `Id` field is a special random str The user determines whether the `KILL QUERY` statement needs to be executed according to the results returned by `SHOW PROCESSLIST`. ShardingSphere cancels the SQL being executed according to the ID in the `KILL QUERY` statement. ```sql ---Cancel the SQL statement currently executing in the specified session. +-- Cancel the SQL statement currently executing in the specified session. mysql> KILL QUERY 05ede3bd584fd4a429dcaac382be2973; Query OK, 0 rows affected (0.04 sec)