From 90dfb9e20566d2f86ee78f7e28bcb847deb8d6b6 Mon Sep 17 00:00:00 2001 From: Shuaipeng Yu Date: Mon, 15 Jun 2020 14:43:04 +0800 Subject: [PATCH 1/3] add shutdown statement Signed-off-by: Shuaipeng Yu --- sql-statement-shutdown.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 sql-statement-shutdown.md diff --git a/sql-statement-shutdown.md b/sql-statement-shutdown.md new file mode 100644 index 0000000000000..25f6b217aee47 --- /dev/null +++ b/sql-statement-shutdown.md @@ -0,0 +1,35 @@ +--- +title: SHUTDOWN +summary: Overview of the use of SHUTDOWN in the TiDB database. +category: reference +--- + +# SHUTDOWN + +The `SHUTDOWN` statement is used to perform a shutdown operation in TiDB. Execution of the `SHUTDOWN` statement requires the user to have `SHUTDOWN privilege`. + +## Synopsis + +**Statement:** + +![Statement](/media/sqlgram/ShutdownStmt.png) + +## Examples + +{{< copyable "sql" >}} + +```sql +SHUTDOWN; +``` + +``` +Query OK, 0 rows affected (0.00 sec) +``` + +## MySQL compatibility + +> **Attention:** +> +> Since TiDB is a distributed database, the shutdown operation in TiDB stops the client-connected TiDB instance, not the entire TiDB cluster. + +The `SHUTDOWN` statement is partly compatible with MySQL. Any compatibility differences should be [reported via an issue](/report-issue.md) on GitHub. From eb55e8627121070f62fa48c02acde9cbec7b84e0 Mon Sep 17 00:00:00 2001 From: Shuaipeng Yu Date: Mon, 15 Jun 2020 21:31:12 +0800 Subject: [PATCH 2/3] add to toc Signed-off-by: Shuaipeng Yu --- TOC.md | 1 + .../sql-statement-shutdown.md | 0 2 files changed, 1 insertion(+) rename sql-statement-shutdown.md => sql-statements/sql-statement-shutdown.md (100%) diff --git a/TOC.md b/TOC.md index 4bc43cce47ee5..b75a1ad970463 100644 --- a/TOC.md +++ b/TOC.md @@ -283,6 +283,7 @@ + [`SHOW [FULL] TABLES`](/sql-statements/sql-statement-show-tables.md) + [`SHOW [GLOBAL|SESSION] VARIABLES`](/sql-statements/sql-statement-show-variables.md) + [`SHOW WARNINGS`](/sql-statements/sql-statement-show-warnings.md) + + [`SHUTDOWN`](/sql-statements/sql-statement-shutdown.md) + [`SPLIT REGION`](/sql-statements/sql-statement-split-region.md) + [`START TRANSACTION`](/sql-statements/sql-statement-start-transaction.md) + [`TRACE`](/sql-statements/sql-statement-trace.md) diff --git a/sql-statement-shutdown.md b/sql-statements/sql-statement-shutdown.md similarity index 100% rename from sql-statement-shutdown.md rename to sql-statements/sql-statement-shutdown.md From f3f5b70823ad98d6212b0f7c3e3fc5fdc56ac428 Mon Sep 17 00:00:00 2001 From: Shuaipeng Yu Date: Mon, 15 Jun 2020 21:33:01 +0800 Subject: [PATCH 3/3] address comments Signed-off-by: Shuaipeng Yu --- sql-statements/sql-statement-shutdown.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql-statements/sql-statement-shutdown.md b/sql-statements/sql-statement-shutdown.md index 25f6b217aee47..e6743b9810aef 100644 --- a/sql-statements/sql-statement-shutdown.md +++ b/sql-statements/sql-statement-shutdown.md @@ -1,6 +1,6 @@ --- title: SHUTDOWN -summary: Overview of the use of SHUTDOWN in the TiDB database. +summary: An overview of the usage of SHUTDOWN for the TiDB database. category: reference --- @@ -28,8 +28,8 @@ Query OK, 0 rows affected (0.00 sec) ## MySQL compatibility -> **Attention:** +> **Note:** > -> Since TiDB is a distributed database, the shutdown operation in TiDB stops the client-connected TiDB instance, not the entire TiDB cluster. +> Because TiDB is a distributed database, the shutdown operation in TiDB stops the client-connected TiDB instance, not the entire TiDB cluster. -The `SHUTDOWN` statement is partly compatible with MySQL. Any compatibility differences should be [reported via an issue](/report-issue.md) on GitHub. +The `SHUTDOWN` statement is partly compatible with MySQL. If you encounter any compatibility issues, you can report the issues [on GitHub](/report-issue.md).