Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default collations docs #881

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion content/en/docs/reference/programs/vtgate.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ The following global options apply to `vtgate`:
| -buffer_window | duration | Duration for how long a request should be buffered at most. (default 10s) |
| -cell | string | cell to use (default "test_nj") |
| -cells_to_watch | string | comma-separated list of cells for watching tablets |
| -collation | string | Collation to use between VTGate and VTTablet. If this flag is not defined, the default collation of utf8mb4 for your backend database will be used. |
| -consul_auth_static_file | string | JSON File to read the topos/tokens from. |
| -cpu_profile | string | write cpu profile to file |
| -datadog-agent-host | string | host to send spans to. if empty, no tracing will be done |
Expand Down
15 changes: 7 additions & 8 deletions content/en/docs/user-guides/vschema-guide/collations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ Vitess uses collations to compare strings the same way that MySQL uses `@collati

#### VTGate

At the VTGate level we use the `-collation` flag to specify which collation we want to use.
Leaving this flag empty will result in VTGate picking the default collation of the `utf8mb4` charset.

The default collation of charsets varies depending on the backend database and its version.
For instance, the default collation for `utf8mb4` is `utf8mb4_general_ci` on MySQL57 and `utf8mb4_0900_ai_ci` on MySQL80.
For this reason, VTTablet is responsible for notifying VTGate which backend version of MySQL/MariaDB we are using.
This is done through health-check at start time.
The default collation of VTGate depends on VTTablet.
Through health-checks, VTGate receives the collation it needs to use.

#### VTTablet

VTTablet's collation and charset can respectively be set with `-db_collation` and `-db_charset`.
In a similar fashion as what we do in VTGate, using the backend database version, the charset defaults to `utf8mb4`, while the collation can be left empty, in which case the default collation of the charset will be picked.
If the `-db_collation` flag is empty, we choose the collation using the charset based on the backend database version (MySQL80, MySQL57, ...), the charset defaults to `utf8mb4`.

> The default collation of charsets varies depending on the backend database and its version.
>
> For instance, the default collation for `utf8mb4` is `utf8mb4_general_ci` on MySQL57 and `utf8mb4_0900_ai_ci` on MySQL80.

### Internals

Expand Down