Skip to content

Commit

Permalink
updated documentation with latest update on default collations
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui committed Nov 17, 2021
1 parent fd3cf8f commit 897da3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
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

0 comments on commit 897da3f

Please sign in to comment.