-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add default collation to VTGate and VTTablet #9097
Conversation
6251078
to
9392c57
Compare
collation
flag to vtgate and vttablet to set the default collation
c7ff0ca
to
5d17a45
Compare
@@ -289,6 +279,28 @@ func (c *Conn) clientHandshake(characterSet uint8, params *ConnParams) error { | |||
c.Capabilities = capabilities & (CapabilityClientDeprecateEOF) | |||
} | |||
|
|||
// The MySQL handshake package uses the "character set" field to define |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ these comments
8a8c624
to
935d49d
Compare
0d69c32
to
6110fc5
Compare
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
…mation all the way to the tablet Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
…ol with MySQL Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
…ion ID overflow in SSLRequest Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
ceead90
to
d8baa6f
Compare
collation
flag to vtgate and vttablet to set the default collationd8baa6f
to
fee30e8
Compare
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
fee30e8
to
303c3d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great Floflo. I don't like the collation environment in the Conn Params though. It doesn't feel right, again, because it doesn't serialize as JSON, which the conn params must do. Let's come up with a different place to store it. Hit me up in Slack if you need help.
…arams Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Your two comments are addressed via a56fe1d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paired on this with @frouioui this morning. Lookin' gucci. 🇫🇷👑
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
3afe19c
to
cb5bf71
Compare
Signed-off-by: Vicent Marti <vmg@strn.cat>
9602fd9
to
5936dff
Compare
Description
This pull request does two things:
utf8
toutf8mb4
We are changing the default charset from
utf8
(utf8mb3
) toutf8mb4
becauseutf8mb4
is way more optimized than its predecessorutf8mb3
. Another reason,utf8mb4
supports more characters. Withutf8mb4
being a superset ofutf8mb3
, queries that were previously relying onutf8mb3
should not have a problem with this new charset.Default Collation
We are adding a default collation to both VTGate and VTTablet, this is done to let us do string comparisons at the VTGate level. It also ensures that we are using the same
connection collation
as the one between VTTablet and MySQL. For both components, the collation can be set using the-collation
(for VTGate) and-db_collation
(for VTTablet). If the flag is not specified, it will default to the default collation ofutf8mb4
in regards to the underlying database version we are running (MySQL57, MySQL80, etc).The default collation for certain charset varies depending on the MySQL version we are running, for this reason, the VTTablet is responsible for telling VTGate which MySQL version is being used.
VTGate
At start time, VTGate subscribes to a health check and waits until a VTTablet indicates which MySQL version is used. Once the MySQL version is known in VTGate, VTGate will create its own collation environment that contains the default collation to use and the
collations.Environment
that will allow us to lookup other collations when planning/executing queries.Before each execution, the default collation is added to the
ExecuteOptions
so the VTTablet can make sure collations are all the same from the client to MySQL.VTTablet
When opening a new connection with a MySQL server, VTTablet is responsible for setting the connection collation properly using the collation/charset the user has defined, and again, in regards to the underlying MySQL version we are connecting to.
Documentation
Checklist