From f75028b0c3203b05a1c71e2059abc2c3383d1eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Sun, 27 Jun 2021 23:06:49 +0200 Subject: [PATCH 1/6] system-variables: Add charset documentation --- system-variables.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/system-variables.md b/system-variables.md index a9cf9acd24cc5..29879f7fee13d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -83,6 +83,36 @@ 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. +### character_set_client + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4` +- Character set for data send by the client. See [Character Set and Collation](/character-set-and-collation.md) for details on the use of character sets and collations in TiDB. It is recommended to use [`SET NAMES`](/sql-statements/sql-statement-set-names.md) to change the character set when needed. + +### character_set_connection + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4` +- Character set for string literals that don't have a character set specified. + +### character_set_database + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4` +- This indicates the character set of the default database that is in use. Setting this variable is not recommended. The server changes this varible when a new default database is selected. + +### character_set_results + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4` +- The character set that is used when data is sent to the client. + +### character_set_server + +- Scope: SESSION | GLOBAL +- Default value: `utf8mb4` +- The collation used for new schemas in case none is provided by the `CREATE SCHEMA` statement. + ### `cte_max_recursion_depth` - Scope:SESSION | GLOBAL From 43156ab15429a0ccd491e200b9bfb932f5e8747d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Tue, 29 Jun 2021 11:55:39 +0200 Subject: [PATCH 2/6] Update system-variables.md Co-authored-by: bb7133 --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 29879f7fee13d..197f0accf1b5a 100644 --- a/system-variables.md +++ b/system-variables.md @@ -111,7 +111,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4` -- The collation used for new schemas in case none is provided by the `CREATE SCHEMA` statement. +- The character set used for new schemas in case none is provided by the `CREATE SCHEMA` statement. ### `cte_max_recursion_depth` From 7d24e53d82057086d779961e843c7735ac8fe1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 1 Jul 2021 09:29:41 +0200 Subject: [PATCH 3/6] 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 197f0accf1b5a..e83f1a6ad5479 100644 --- a/system-variables.md +++ b/system-variables.md @@ -87,7 +87,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4` -- Character set for data send by the client. See [Character Set and Collation](/character-set-and-collation.md) for details on the use of character sets and collations in TiDB. It is recommended to use [`SET NAMES`](/sql-statements/sql-statement-set-names.md) to change the character set when needed. +- The character set for data sent from the client. See [Character Set and Collation](/character-set-and-collation.md) for details on the use of character sets and collations in TiDB. It is recommended to use [`SET NAMES`](/sql-statements/sql-statement-set-names.md) to change the character set when needed. ### character_set_connection From e1a7b97410429c5d816d9a9a2b8d1d1b349ec12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 1 Jul 2021 09:29:56 +0200 Subject: [PATCH 4/6] 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 e83f1a6ad5479..bfa73e566d5b7 100644 --- a/system-variables.md +++ b/system-variables.md @@ -93,7 +93,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4` -- Character set for string literals that don't have a character set specified. +- The character set for string literals that do not have a specified character set. ### character_set_database From 947dbae28f35e23d0d595a897523d9c22c511601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 1 Jul 2021 09:30:09 +0200 Subject: [PATCH 5/6] 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 bfa73e566d5b7..9b12982324d69 100644 --- a/system-variables.md +++ b/system-variables.md @@ -99,7 +99,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4` -- This indicates the character set of the default database that is in use. Setting this variable is not recommended. The server changes this varible when a new default database is selected. +- This variable indicates the character set 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. ### character_set_results From 024c450fe72d5ee8793228dec3af2afb4cfe70f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Thu, 1 Jul 2021 09:30:22 +0200 Subject: [PATCH 6/6] 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 9b12982324d69..9e68f97ff5f34 100644 --- a/system-variables.md +++ b/system-variables.md @@ -111,7 +111,7 @@ mysql> SELECT * FROM t1; - Scope: SESSION | GLOBAL - Default value: `utf8mb4` -- The character set used for new schemas in case none is provided by the `CREATE SCHEMA` statement. +- The character set used for new schemas when no character set is specified in the `CREATE SCHEMA` statement. ### `cte_max_recursion_depth`