From c6a35961c0b4a3e4a92467cf8125fe1a2aa9d139 Mon Sep 17 00:00:00 2001 From: Shuaipeng Yu Date: Mon, 15 Jun 2020 13:07:58 +0800 Subject: [PATCH 1/3] add show config statement Signed-off-by: Shuaipeng Yu --- sql-statements/sql-statement-show-config.md | 90 +++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sql-statements/sql-statement-show-config.md diff --git a/sql-statements/sql-statement-show-config.md b/sql-statements/sql-statement-show-config.md new file mode 100644 index 0000000000000..9d7877a33c77b --- /dev/null +++ b/sql-statements/sql-statement-show-config.md @@ -0,0 +1,90 @@ +--- +title: SHOW CONFIG +summary: Overview of the use of SHOW CONFIG in the TiDB database +category: reference +--- + +# SHOW CONFIG + +> **Warning:** +> +> This feature is currently an experimental feature and is not recommended for use in a production environment. + +The `SHOW CONFIG` statement is used to show the current configuration of various components of TiDB. Please note that the configuration and system variables act on different dimensions. Please do not confuse them. If you want to obtain system variable information, please use [SHOW VARIABLES](/sql-statements/sql-statement-show-variables.md) syntax. + +## Synopsis + +**ShowStmt:** + +![ShowStmt](/media/sqlgram/ShowStmt.png) + +**ShowTargetFilterable:** + +![ShowTargetFilterable](/media/sqlgram/ShowTargetFilterable.png) + +## Examples + +Show all configurations: + +{{< copyable "sql" >}} + +```sql +SHOW CONFIG; +``` + +``` ++------+----------------+-------------------------------------------------+---------------------------------------------------------------------+ +| Type | Instance | Name | Value | ++------+----------------+-------------------------------------------------+---------------------------------------------------------------------+ +| tidb | 127.0.0.1:4000 | advertise-address | 127.0.0.1 | +| tidb | 127.0.0.1:4000 | alter-primary-key | false | +| tidb | 127.0.0.1:4000 | binlog.binlog-socket | | +| tidb | 127.0.0.1:4000 | binlog.enable | false | +... +120 rows in set (0.01 sec) +``` + +Show the `type` of the configuration of `tidb`: + +{{< copyable "sql" >}} + +```sql +SHOW CONFIG WHERE type = 'tidb' AND name = 'advertise-address'; +``` + +``` ++------+----------------+-------------------+-----------+ +| Type | Instance | Name | Value | ++------+----------------+-------------------+-----------+ +| tidb | 127.0.0.1:4000 | advertise-address | 127.0.0.1 | ++------+----------------+-------------------+-----------+ +1 row in set (0.05 sec) +``` + +You can also use the `LIKE` clause to show the `type` of the configuration of `tidb`: + +{{< copyable "sql" >}} + +```sql +SHOW CONFIG LIKE 'tidb'; +``` + +``` ++------+----------------+-------------------------------------------------+---------------------------------------------------------------------+ +| Type | Instance | Name | Value | ++------+----------------+-------------------------------------------------+---------------------------------------------------------------------+ +| tidb | 127.0.0.1:4000 | advertise-address | 127.0.0.1 | +| tidb | 127.0.0.1:4000 | alter-primary-key | false | +| tidb | 127.0.0.1:4000 | binlog.binlog-socket | | +| tidb | 127.0.0.1:4000 | binlog.enable | false | +... +40 rows in set (0.01 sec) +``` + +## MySQL compatibility + +`SHOW CONFIG` is the extended syntax of TiDB, MySQL has no corresponding syntax. + +## See also + +* [SHOW VARIABLES](/sql-statements/sql-statement-show-variables.md) From 6a6d4190155b48e1968a77955b7fa145ebddbfa8 Mon Sep 17 00:00:00 2001 From: Shuaipeng Yu Date: Mon, 15 Jun 2020 21:27:39 +0800 Subject: [PATCH 2/3] add to toc Signed-off-by: Shuaipeng Yu --- TOC.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TOC.md b/TOC.md index 4bc43cce47ee5..883a3baa9fb83 100644 --- a/TOC.md +++ b/TOC.md @@ -262,6 +262,7 @@ + [`SHOW CHARACTER SET`](/sql-statements/sql-statement-show-character-set.md) + [`SHOW COLLATION`](/sql-statements/sql-statement-show-collation.md) + [`SHOW [FULL] COLUMNS FROM`](/sql-statements/sql-statement-show-columns-from.md) + + [`SHOW CONFIG`](/sql-statements/sql-statement-show-config.md) + [`SHOW CREATE SEQUENCE`](/sql-statements/sql-statement-show-create-sequence.md) + [`SHOW CREATE TABLE`](/sql-statements/sql-statement-show-create-table.md) + [`SHOW CREATE USER`](/sql-statements/sql-statement-show-create-user.md) From 5666cedb8ebe5f41eaa1df02a2c4d04412a6f04a Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Wed, 17 Jun 2020 10:00:10 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Ran --- sql-statements/sql-statement-show-config.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql-statements/sql-statement-show-config.md b/sql-statements/sql-statement-show-config.md index 9d7877a33c77b..601a930693bc3 100644 --- a/sql-statements/sql-statement-show-config.md +++ b/sql-statements/sql-statement-show-config.md @@ -8,9 +8,9 @@ category: reference > **Warning:** > -> This feature is currently an experimental feature and is not recommended for use in a production environment. +> This feature is currently an experimental feature. It is not recommended to use this feature in the production environment. -The `SHOW CONFIG` statement is used to show the current configuration of various components of TiDB. Please note that the configuration and system variables act on different dimensions. Please do not confuse them. If you want to obtain system variable information, please use [SHOW VARIABLES](/sql-statements/sql-statement-show-variables.md) syntax. +The `SHOW CONFIG` statement is used to show the current configuration of various components of TiDB. Note that the configuration and system variables act on different dimensions and should not be mixed up. If you want to obtain the system variable information, use the [SHOW VARIABLES](/sql-statements/sql-statement-show-variables.md) syntax. ## Synopsis @@ -44,7 +44,7 @@ SHOW CONFIG; 120 rows in set (0.01 sec) ``` -Show the `type` of the configuration of `tidb`: +Show the configuration where the `type` is `tidb`: {{< copyable "sql" >}} @@ -61,7 +61,7 @@ SHOW CONFIG WHERE type = 'tidb' AND name = 'advertise-address'; 1 row in set (0.05 sec) ``` -You can also use the `LIKE` clause to show the `type` of the configuration of `tidb`: +You can also use the `LIKE` clause to show the configuration where the `type` is `tidb`: {{< copyable "sql" >}} @@ -83,7 +83,7 @@ SHOW CONFIG LIKE 'tidb'; ## MySQL compatibility -`SHOW CONFIG` is the extended syntax of TiDB, MySQL has no corresponding syntax. +`SHOW CONFIG` is the extended syntax of TiDB, with no counterpart in MySQL. ## See also