From 7fea7a75cece35f85b7b41a5deea7d2be7c724d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 16 Sep 2021 08:32:49 +0200 Subject: [PATCH 1/4] Document a few more system variables --- system-variables.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/system-variables.md b/system-variables.md index 5ff123d7570c1..d94a659ec987d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -193,6 +193,12 @@ mysql> SELECT * FROM t1; - Default value: `Apache License 2.0` - This variable indicates the license of your TiDB server installation. +### log_bin + +- Scope: NONE +- Default value: `OFF` +- This variable indicates if [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) is used. + ### max_execution_time - Scope: SESSION | GLOBAL @@ -205,6 +211,18 @@ mysql> SELECT * FROM t1; > > Unlike in MySQL, the `max_execution_time` system variable currently works on all kinds of statements in TiDB, not only restricted to the `SELECT` statement. The precision of the timeout value is roughly 100ms. This means the statement might not be terminated in accurate milliseconds as you specify. +### plugin_dir + +- Scope: SESSION +- Default value: "" +- The directory to load plugins from as set by the commandline flag. + +### plugin_load + +- Scope: SESSION +- Default value: "" +- Wait for loading of named plugins on startup. Plugins are separated by commas. This is set by a commandline flag. + ### port - Scope: NONE @@ -218,6 +236,16 @@ mysql> SELECT * FROM t1; - Default value: "" - The local unix socket file that the `tidb-server` is listening on when speaking the MySQL protocol. +### sql_log_bin + +- Scope: SESSION | GLOBAL +- Default value: `ON` +- This indicates if changes should be written to the [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) or not. + +> **Note:** +> +> Setting `sql_log_bin` as a global variable is not recommended. Future versions may only allow setting this as a session variable. + ### sql_mode - Scope: SESSION | GLOBAL @@ -1381,6 +1409,18 @@ SET tidb_slow_log_threshold = 200; - This variable returns the current time zone. Values can be specified as either an offset such as '-8:00' or a named zone 'America/Los_Angeles'. - The value `SYSTEM` means that the time zone should be the same as the system host, which is available via the [`system_time_zone`](#system_time_zone) variable. +### timestamp + +- Scope: SESSION +- Default value: "" +- If set to a non-empty value this is the UNIX epoch that is used as timestamp for `CURRENT_TIMESTAMP()`, `NOW()` and other functions. This can be used when restoring or replicating data. + +### tmp_table_size + +- Scope: SESSION | GLOBAL +- Default value: 16777216 +- The maximum size of a temporary table in bytes + ### transaction_isolation - Scope: SESSION | GLOBAL From b02e35124892f1b297cca4ca90cebe4b8737e08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 16 Sep 2021 17:22:56 +0200 Subject: [PATCH 2/4] Plugin vars are instance scoped --- system-variables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index d94a659ec987d..e97217c62d5d1 100644 --- a/system-variables.md +++ b/system-variables.md @@ -213,13 +213,13 @@ mysql> SELECT * FROM t1; ### plugin_dir -- Scope: SESSION +- Scope: INSTANCE - Default value: "" - The directory to load plugins from as set by the commandline flag. ### plugin_load -- Scope: SESSION +- Scope: INSTANCE - Default value: "" - Wait for loading of named plugins on startup. Plugins are separated by commas. This is set by a commandline flag. From 696e734d696da77fb023c86018d6a24b4c0d3bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 16 Sep 2021 17:27:02 +0200 Subject: [PATCH 3/4] Update system-variables.md Co-authored-by: Morgan Tocker --- system-variables.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index e97217c62d5d1..63f171ee43436 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1419,7 +1419,8 @@ SET tidb_slow_log_threshold = 200; - Scope: SESSION | GLOBAL - Default value: 16777216 -- The maximum size of a temporary table in bytes +- Unit: Bytes +- The maximum size of a temporary table. ### transaction_isolation From cdaefbb2039872e61ac116162c15809975f2e295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:58:22 +0200 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/system-variables.md b/system-variables.md index 63f171ee43436..78a8a53e116c6 100644 --- a/system-variables.md +++ b/system-variables.md @@ -197,7 +197,7 @@ mysql> SELECT * FROM t1; - Scope: NONE - Default value: `OFF` -- This variable indicates if [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) is used. +- This variable indicates whether [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) is used. ### max_execution_time @@ -215,13 +215,13 @@ mysql> SELECT * FROM t1; - Scope: INSTANCE - Default value: "" -- The directory to load plugins from as set by the commandline flag. +- Indicates the directory to load plugins as specified by a command-line flag. ### plugin_load - Scope: INSTANCE - Default value: "" -- Wait for loading of named plugins on startup. Plugins are separated by commas. This is set by a commandline flag. +- Indicates the plugins to load when TiDB is started. These plugins are specified by a command-line flag and separated by commas. ### port @@ -240,11 +240,11 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `ON` -- This indicates if changes should be written to the [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) or not. +- Indicates whether to write changes to [TiDB Binlog](/tidb-binlog/tidb-binlog-overview.md) or not. > **Note:** > -> Setting `sql_log_bin` as a global variable is not recommended. Future versions may only allow setting this as a session variable. +> It is not recommended to set `sql_log_bin` as a global variable because the future versions of TiDB might only allow setting this as a session variable. ### sql_mode @@ -1413,14 +1413,14 @@ SET tidb_slow_log_threshold = 200; - Scope: SESSION - Default value: "" -- If set to a non-empty value this is the UNIX epoch that is used as timestamp for `CURRENT_TIMESTAMP()`, `NOW()` and other functions. This can be used when restoring or replicating data. +- A non-empty value of this variable indicates the UNIX epoch that is used as the timestamp for `CURRENT_TIMESTAMP()`, `NOW()`, and other functions. This variable might be used in data restore or replication. ### tmp_table_size - Scope: SESSION | GLOBAL -- Default value: 16777216 +- Default value: `16777216` - Unit: Bytes -- The maximum size of a temporary table. +- Indicates the maximum size of a temporary table. ### transaction_isolation