From 4cbf7444a21d8d62d5d7d3adb8bcb7059f49a5d6 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 36226e03e6af3..ef91d4502b72d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -84,6 +84,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 79ff3a781b8324e032dccc2a07e50a781f234afa 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 ef91d4502b72d..54677c49de227 100644 --- a/system-variables.md +++ b/system-variables.md @@ -112,7 +112,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 c773f94afa552d26608727d7ffa4ee583c652eb5 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 54677c49de227..e54d9b0827b8a 100644 --- a/system-variables.md +++ b/system-variables.md @@ -88,7 +88,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 6eb8dd740295a8374740606e9b9654550b4eaa2e 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 e54d9b0827b8a..fde9055cde365 100644 --- a/system-variables.md +++ b/system-variables.md @@ -94,7 +94,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 e7a495c0ee652303be968594efc71b6e6ef4a83c 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 fde9055cde365..dbc1edbb5cca9 100644 --- a/system-variables.md +++ b/system-variables.md @@ -100,7 +100,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 f950f6cd96a7ca71b6985ec4e9d36a9b1b4ab4e3 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 dbc1edbb5cca9..2d779b466c219 100644 --- a/system-variables.md +++ b/system-variables.md @@ -112,7 +112,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`