From d08e521e078d90c0db2f95f4f795dabf678ae44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 15 Sep 2021 08:47:44 +0200 Subject: [PATCH 01/15] Document missing sysvars --- .../aggregate-group-by-functions.md | 4 ++ .../date-and-time-functions.md | 4 ++ .../encryption-and-compression-functions.md | 4 ++ system-variables.md | 64 ++++++++++++++++++- 4 files changed, 75 insertions(+), 1 deletion(-) diff --git a/functions-and-operators/aggregate-group-by-functions.md b/functions-and-operators/aggregate-group-by-functions.md index 4094fa9522903..95fd59488474b 100644 --- a/functions-and-operators/aggregate-group-by-functions.md +++ b/functions-and-operators/aggregate-group-by-functions.md @@ -154,3 +154,7 @@ group by id, val; The following aggregate functions are currently unsupported in TiDB. You can track our progress in [TiDB #7623](https://github.com/pingcap/tidb/issues/7623): - `JSON_ARRAYAGG` + +## Related system variables + +The `group_concat_max_len` sets the maximum numbre of items for the `GROUP_CONCAT()` function. \ No newline at end of file diff --git a/functions-and-operators/date-and-time-functions.md b/functions-and-operators/date-and-time-functions.md index eeef80249f96a..32c2d2353c053 100644 --- a/functions-and-operators/date-and-time-functions.md +++ b/functions-and-operators/date-and-time-functions.md @@ -74,3 +74,7 @@ TiDB supports all of the [date and time functions](https://dev.mysql.com/doc/ref | [`YEARWEEK()`](https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_yearweek) | Return the year and week | For details, see [Date and Time Functions](https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html). + +## Related system variables + +The `default_week_format` variable affects the `WEEK()` function. \ No newline at end of file diff --git a/functions-and-operators/encryption-and-compression-functions.md b/functions-and-operators/encryption-and-compression-functions.md index 837b051aa82a5..d52b7ea790687 100644 --- a/functions-and-operators/encryption-and-compression-functions.md +++ b/functions-and-operators/encryption-and-compression-functions.md @@ -32,6 +32,10 @@ TiDB supports most of the [encryption and compression functions](https://dev.mys | [`ASYMMETRIC_SIGN()`](https://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html#function_asymmetric-sign) | Generate signature from digest | | [`ASYMMETRIC_VERIFY()`](https://dev.mysql.com/doc/refman/5.7/en/enterprise-encryption-functions.html#function_asymmetric-verify) | Verify that signature matches digest | +## Related system variables + +The `block_encryption_mode` variable sets the encryption mode that is used for `AES_ENCRYPT()` and `AES_DECRYPT()`. + ## Unsupported functions * `DES_DECRYPT()`, `DES_ENCRYPT()`, `OLD_PASSWORD()`, `ENCRYPT()`: these functions were deprecated in MySQL 5.7 and removed in 8.0. diff --git a/system-variables.md b/system-variables.md index 5ff123d7570c1..ec65980b6352f 100644 --- a/system-variables.md +++ b/system-variables.md @@ -84,6 +84,12 @@ mysql> SELECT * FROM t1; - Default value: `ON` - Controls whether statements should automatically commit when not in an explicit transaction. See [Transaction Overview](/transaction-overview.md#autocommit) for more information. +### block_encryption_mode + +- Scope: SESSION | GLOBAL +- Default value: `aes-128-ecb` +- Defines the encryption mode for the `AES_ENCRYPT()` and `AES_DECRYPT()` functions. + ### character_set_client - Scope: SESSION | GLOBAL @@ -112,7 +118,25 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4` -- The character set used for new schemas when no character set is specified in the `CREATE SCHEMA` statement. +- The default character set for the server. + +### collation_connection + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4_bin` +- The collation for string literals that do not have a specified collation. + +### collation_database + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4_bin` +- This variable indicates the collation of the default database that is in use. **It is NOT recommended to set this variable**. When a new default database is selected, the server changes the variable value. + +### collation_server + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4_bin` +- The default collation for the server. ### cte_max_recursion_depth @@ -142,12 +166,44 @@ mysql> SELECT * FROM t1; - This variable sets the authentication method that the server advertises when the server-client connection is being established. Possible values for this variable are documented in [Authentication plugin status](/security-compatibility-with-mysql.md#authentication-plugin-status). - Value options: `mysql_native_password` and `caching_sha2_password`. For more details, see [Authentication plugin status](/security-compatibility-with-mysql.md#authentication-plugin-status). +### default_week-format + +- Scope: SESSION | GLOBAL +- Default value: `0` +- Range: `[0, 7]` +- Set the week format used by the `WEEK()` function + +### error_count + +- Scope: SESSION +- Default value: `0` +- This variable exists only for MySQL compatibility and is always `0` in TiDB. + ### foreign_key_checks - Scope: SESSION | GLOBAL - Default value: `OFF` - For compatibility, TiDB returns foreign key checks as `OFF`. +### group_concat_max_len + +- Scope: SESSION | GLOBAL +- Default value: `1024` +- Range: `[4, 18446744073709551615]` +- The maximum number of elements for the `GROUP_CONCAT()` function. + +### have_openssl + +- Scope: NONE +- Default value: `DISABLED` +- MySQL compatibiltiy read-only variable. Set to `YES` when the server has TLS enabled. + +### have_ssl + +- Scope: NONE +- Default value: `DISABLED` +- MySQL compatibiltiy read-only variable. Set to `YES` when the server has TLS enabled. + ### hostname - Scope: NONE @@ -175,6 +231,12 @@ mysql> SELECT * FROM t1; - Unit: Seconds - This variable represents the idle timeout of the interactive user session, which is measured in seconds. Interactive user session refers to the session established by calling [`mysql_real_connect()`](https://dev.mysql.com/doc/c-api/5.7/en/mysql-real-connect.html) API using the `CLIENT_INTERACTIVE` option (for example, MySQL shell client). This variable is fully compatible with MySQL. +### last_insert_id + +- Scope: SESSION +- Default value: "" +- MySQL Compatibility variable. Not used in TiDB. Use the `LAST_INSERT_ID()` function instead. + ### last_plan_from_binding New in v4.0 - Scope: SESSION From f6f82b360567b9f80766284c86a2406583dd5a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 15 Sep 2021 16:15:39 +0200 Subject: [PATCH 02/15] Update system-variables.md Co-authored-by: Morgan Tocker --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index ec65980b6352f..a601a937a6fe0 100644 --- a/system-variables.md +++ b/system-variables.md @@ -166,7 +166,7 @@ mysql> SELECT * FROM t1; - This variable sets the authentication method that the server advertises when the server-client connection is being established. Possible values for this variable are documented in [Authentication plugin status](/security-compatibility-with-mysql.md#authentication-plugin-status). - Value options: `mysql_native_password` and `caching_sha2_password`. For more details, see [Authentication plugin status](/security-compatibility-with-mysql.md#authentication-plugin-status). -### default_week-format +### default_week_format - Scope: SESSION | GLOBAL - Default value: `0` From 42b72ff680e91d41d5832c171ef8812460c42095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 15 Sep 2021 16:15:49 +0200 Subject: [PATCH 03/15] Update system-variables.md Co-authored-by: Morgan Tocker --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index a601a937a6fe0..a8493f0663515 100644 --- a/system-variables.md +++ b/system-variables.md @@ -190,7 +190,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `1024` - Range: `[4, 18446744073709551615]` -- The maximum number of elements for the `GROUP_CONCAT()` function. +- The maximum buffer size for items in the `GROUP_CONCAT()` function. ### have_openssl From aaf6871237fd127eef1be42baa1bdd76fd5ad30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 15 Sep 2021 16:56:16 +0200 Subject: [PATCH 04/15] A few more --- system-variables.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/system-variables.md b/system-variables.md index ec65980b6352f..9ef13fcb2d6be 100644 --- a/system-variables.md +++ b/system-variables.md @@ -255,6 +255,20 @@ mysql> SELECT * FROM t1; - Default value: `Apache License 2.0` - This variable indicates the license of your TiDB server installation. +### max_allowed_packet + +- Scope: GLOBAL | SESSION +- Default value: `67108864` +- Range: `[1024, 1073741824]` +- Maximum size of a packet for the MySQL protocol + +### max_connections + +- Scope: GLOBAL +- Default value: `151 +- Range: `[1, 100000]` +- MySQL Compatibility variable. Not used in TiDB. + ### max_execution_time - Scope: SESSION | GLOBAL @@ -293,6 +307,24 @@ mysql> SELECT * FROM t1; - Range: `[0, 18446744073709551615]` - The maximum number of rows returned by the `SELECT` statements. +### ssl_ca + +- Scope: NONE +- Default value: "" +- The location of the certificate authority file if specified on startup. + +### ssl_cert + +- Scope: NONE +- Default value: "" +- The location of the certificate file that is used for SSL/TLS connections if specified on startup. + +### ssl_key + +- Scope: NONE +- Default value: "" +- The location of the private key file that is used for SSL/TLS connections if specified on startup. + ### system_time_zone - Scope: NONE From b97a73bf732a03e4716e3e74a7de05b23ef1c287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 16 Sep 2021 07:42:36 +0200 Subject: [PATCH 05/15] Don't document `error_count` and `last_insert_id` at this momment --- system-variables.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/system-variables.md b/system-variables.md index 647207fd34537..b06c76bce4769 100644 --- a/system-variables.md +++ b/system-variables.md @@ -173,12 +173,6 @@ mysql> SELECT * FROM t1; - Range: `[0, 7]` - Set the week format used by the `WEEK()` function -### error_count - -- Scope: SESSION -- Default value: `0` -- This variable exists only for MySQL compatibility and is always `0` in TiDB. - ### foreign_key_checks - Scope: SESSION | GLOBAL @@ -231,12 +225,6 @@ mysql> SELECT * FROM t1; - Unit: Seconds - This variable represents the idle timeout of the interactive user session, which is measured in seconds. Interactive user session refers to the session established by calling [`mysql_real_connect()`](https://dev.mysql.com/doc/c-api/5.7/en/mysql-real-connect.html) API using the `CLIENT_INTERACTIVE` option (for example, MySQL shell client). This variable is fully compatible with MySQL. -### last_insert_id - -- Scope: SESSION -- Default value: "" -- MySQL Compatibility variable. Not used in TiDB. Use the `LAST_INSERT_ID()` function instead. - ### last_plan_from_binding New in v4.0 - Scope: SESSION From 0782e62744984233d57f71c3350ebf65eef639ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 16 Sep 2021 17:20:58 +0200 Subject: [PATCH 06/15] Don't document max_connections as it is/should be a noop --- system-variables.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/system-variables.md b/system-variables.md index b06c76bce4769..25b1b024def97 100644 --- a/system-variables.md +++ b/system-variables.md @@ -250,13 +250,6 @@ mysql> SELECT * FROM t1; - Range: `[1024, 1073741824]` - Maximum size of a packet for the MySQL protocol -### max_connections - -- Scope: GLOBAL -- Default value: `151 -- Range: `[1, 100000]` -- MySQL Compatibility variable. Not used in TiDB. - ### max_execution_time - Scope: SESSION | GLOBAL From 2fa1d69100629f77101026c09cedbebd59596f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:46:09 +0200 Subject: [PATCH 07/15] Update functions-and-operators/aggregate-group-by-functions.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- functions-and-operators/aggregate-group-by-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/aggregate-group-by-functions.md b/functions-and-operators/aggregate-group-by-functions.md index 95fd59488474b..7e8094ce82fdf 100644 --- a/functions-and-operators/aggregate-group-by-functions.md +++ b/functions-and-operators/aggregate-group-by-functions.md @@ -157,4 +157,4 @@ The following aggregate functions are currently unsupported in TiDB. You can tra ## Related system variables -The `group_concat_max_len` sets the maximum numbre of items for the `GROUP_CONCAT()` function. \ No newline at end of file +The `group_concat_max_len` variable sets the maximum number of items for the `GROUP_CONCAT()` function. \ No newline at end of file From d2d9c427baddb55da041f6142d3eb5f92379baa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:46:21 +0200 Subject: [PATCH 08/15] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 25b1b024def97..d3cb2058e22c2 100644 --- a/system-variables.md +++ b/system-variables.md @@ -124,7 +124,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4_bin` -- The collation for string literals that do not have a specified collation. +- This variable indicates the collation for string literals that do not have a specified collation. ### collation_database From 8f192a419e6debb5018c285e12ac921e7ed7b5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:46:39 +0200 Subject: [PATCH 09/15] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index d3cb2058e22c2..1bd02077b541e 100644 --- a/system-variables.md +++ b/system-variables.md @@ -130,7 +130,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4_bin` -- This variable indicates the collation of the default database that is in use. **It is NOT recommended to set this variable**. When a new default database is selected, the server changes the variable value. +- This variable indicates the collation of the default database in use. **It is NOT recommended to set this variable**. When a new default database is selected, the server changes the variable value. ### collation_server From 13121452aa2771f783da74c40aba0a9a2642cad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:46:51 +0200 Subject: [PATCH 10/15] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 1bd02077b541e..9bee86e3851fb 100644 --- a/system-variables.md +++ b/system-variables.md @@ -171,7 +171,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `0` - Range: `[0, 7]` -- Set the week format used by the `WEEK()` function +- Sets the week format used by the `WEEK()` function. ### foreign_key_checks From cabe8563c7aedf8c9ae1711cd1ba37e43a02474d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:47:23 +0200 Subject: [PATCH 11/15] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 9bee86e3851fb..8b536ae95981a 100644 --- a/system-variables.md +++ b/system-variables.md @@ -248,7 +248,7 @@ mysql> SELECT * FROM t1; - Scope: GLOBAL | SESSION - Default value: `67108864` - Range: `[1024, 1073741824]` -- Maximum size of a packet for the MySQL protocol +- The maximum size of a packet for the MySQL protocol. ### max_execution_time From 0d1e339d532a8087a51923daa73ebba58a7c2cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:47:57 +0200 Subject: [PATCH 12/15] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 8b536ae95981a..a345811d0338b 100644 --- a/system-variables.md +++ b/system-variables.md @@ -298,7 +298,7 @@ mysql> SELECT * FROM t1; - Scope: NONE - Default value: "" -- The location of the certificate file that is used for SSL/TLS connections if specified on startup. +- The location of the certificate file (if there is a file) that is used for SSL/TLS connections when TiDB is started. ### ssl_key From 403ed695edb9cfd6cc972fe93558d20ee2334be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:48:03 +0200 Subject: [PATCH 13/15] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index a345811d0338b..efeb53e537aa6 100644 --- a/system-variables.md +++ b/system-variables.md @@ -304,7 +304,7 @@ mysql> SELECT * FROM t1; - Scope: NONE - Default value: "" -- The location of the private key file that is used for SSL/TLS connections if specified on startup. +- The location of the private key file (if there is one) that is used for SSL/TLS connections when TiDB is started. ### system_time_zone From 2e3050eeaeae1c7dcc65859b3ee4c1a717320795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:48:16 +0200 Subject: [PATCH 14/15] Update system-variables.md Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index efeb53e537aa6..55e5f43d86972 100644 --- a/system-variables.md +++ b/system-variables.md @@ -292,7 +292,7 @@ mysql> SELECT * FROM t1; - Scope: NONE - Default value: "" -- The location of the certificate authority file if specified on startup. +- The location of the certificate authority file (if there is one) when TiDB is started. ### ssl_cert From b67319652de8c7c76adbb002f34c159d9e42a224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 29 Sep 2021 14:51:25 +0200 Subject: [PATCH 15/15] Update SSL/TLS vars --- system-variables.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system-variables.md b/system-variables.md index 55e5f43d86972..96bf2c216b7a2 100644 --- a/system-variables.md +++ b/system-variables.md @@ -190,13 +190,13 @@ mysql> SELECT * FROM t1; - Scope: NONE - Default value: `DISABLED` -- MySQL compatibiltiy read-only variable. Set to `YES` when the server has TLS enabled. +- A read-only variable for MySQL compatibility. Set to `YES` by the server when the server has TLS enabled. ### have_ssl - Scope: NONE - Default value: `DISABLED` -- MySQL compatibiltiy read-only variable. Set to `YES` when the server has TLS enabled. +- A read-only variable for MySQL compatibility. Set to `YES` by the server when the server has TLS enabled. ### hostname @@ -292,19 +292,19 @@ mysql> SELECT * FROM t1; - Scope: NONE - Default value: "" -- The location of the certificate authority file (if there is one) when TiDB is started. +- The location of the certificate authority file (if there is one). ### ssl_cert - Scope: NONE - Default value: "" -- The location of the certificate file (if there is a file) that is used for SSL/TLS connections when TiDB is started. +- The location of the certificate file (if there is a file) that is used for SSL/TLS connections. ### ssl_key - Scope: NONE - Default value: "" -- The location of the private key file (if there is one) that is used for SSL/TLS connections when TiDB is started. +- The location of the private key file (if there is one) that is used for SSL/TLS connections. ### system_time_zone