From f57e3f61029cd34d96702aaa905d99de702224ba 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 64f208a39cc14..0b9b3b60c997c 100644 --- a/functions-and-operators/aggregate-group-by-functions.md +++ b/functions-and-operators/aggregate-group-by-functions.md @@ -153,3 +153,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 c96bce09f0032..dedfc8ed534a3 100644 --- a/functions-and-operators/date-and-time-functions.md +++ b/functions-and-operators/date-and-time-functions.md @@ -73,3 +73,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 811a38d19f6d2..eafc162993c39 100644 --- a/functions-and-operators/encryption-and-compression-functions.md +++ b/functions-and-operators/encryption-and-compression-functions.md @@ -31,6 +31,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 7a59e80716b8b..b4db9e52f077c 100644 --- a/system-variables.md +++ b/system-variables.md @@ -83,6 +83,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 @@ -111,7 +117,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 @@ -141,12 +165,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 @@ -174,6 +230,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 f5ed4955d13a1d9b99e64f66ded8998258eb8c13 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 b4db9e52f077c..a7c32a9f27ed4 100644 --- a/system-variables.md +++ b/system-variables.md @@ -165,7 +165,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 b9642f05d6ef0eb8dd35ab3b4d129765c6684b97 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 a7c32a9f27ed4..363b215c59511 100644 --- a/system-variables.md +++ b/system-variables.md @@ -189,7 +189,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 a924eb503821cc73dc970c459674b834581cc4c4 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 363b215c59511..7e848f6b6d229 100644 --- a/system-variables.md +++ b/system-variables.md @@ -254,6 +254,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 @@ -292,6 +306,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 75bb152773050c7eb7aca6433bdaa1d6333919e0 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 7e848f6b6d229..841fed2026871 100644 --- a/system-variables.md +++ b/system-variables.md @@ -172,12 +172,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 @@ -230,12 +224,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 730145b0c610a810a067c5cb1038c1d42f7d127e 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 841fed2026871..e44a421328e53 100644 --- a/system-variables.md +++ b/system-variables.md @@ -249,13 +249,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 4d3dce33b8d12b8fdd9fbb1f5f7608c0c67deb51 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 0b9b3b60c997c..dc2ff5229d6d6 100644 --- a/functions-and-operators/aggregate-group-by-functions.md +++ b/functions-and-operators/aggregate-group-by-functions.md @@ -156,4 +156,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 cc1b1fe4973ddbd63fc7ba2a9727a8eeed9558c2 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 e44a421328e53..1bac9191a5040 100644 --- a/system-variables.md +++ b/system-variables.md @@ -123,7 +123,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 abfc462cfdac1d365edc71ad0b3759e22394c72f 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 1bac9191a5040..436bb467f259c 100644 --- a/system-variables.md +++ b/system-variables.md @@ -129,7 +129,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 ea8450f5a468e8bf80c6a22e1deee747dc11ce78 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 436bb467f259c..c5dc32095496d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -170,7 +170,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 5ceef629efce109c556837ad0522a2fe6ba3c2a6 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 c5dc32095496d..e28be5ea1dfcb 100644 --- a/system-variables.md +++ b/system-variables.md @@ -247,7 +247,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 01d6bc62d9f0e9f16f296648c1924bbc485a005a 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 e28be5ea1dfcb..377ef8d10ffba 100644 --- a/system-variables.md +++ b/system-variables.md @@ -297,7 +297,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 3b1a4baf4090edfdeb7e6787d76676c0c6534d51 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 377ef8d10ffba..69e7635d31753 100644 --- a/system-variables.md +++ b/system-variables.md @@ -303,7 +303,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 828f921dc4686f6181bcec291e63803d38e3141b 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 69e7635d31753..dd9c84497f885 100644 --- a/system-variables.md +++ b/system-variables.md @@ -291,7 +291,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 93669b85d46b755e9bcfa3b4fc82a03642deed83 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 dd9c84497f885..c00ca772a0cea 100644 --- a/system-variables.md +++ b/system-variables.md @@ -189,13 +189,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 @@ -291,19 +291,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