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

Respect character_set_results when emitting field metadata #2140

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

fulghum
Copy link
Contributor

@fulghum fulghum commented Nov 9, 2023

For non-binary types, we need to respect the value for the character_set_results session var (when not NULL) and use that for the field metadata returned in the MySQL wire protocol.

The unexpected charset/collation metadata is causing DataGrip to be unable to work with some types in the table editor ( see dolthub/dolt#6970 for more details).

I've validated this behavior with MySQL by inspecting packets with Wireshark. For testing, we were already testing the behavior of character_set_results and the charset translation, but we weren't testing the field metadata. I added support to check against the expect charset field metadata, but had to use reflection to get that data from the MySQL driver, since it's not exposed through the standard golang sql database APIs.

@fulghum fulghum marked this pull request as ready for review November 9, 2023 19:31
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

enginetest/queries/charset_collation_wire.go Outdated Show resolved Hide resolved
@fulghum fulghum merged commit 942e176 into main Nov 9, 2023
7 checks passed
@fulghum fulghum deleted the fulghum/dolt-6970 branch November 9, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants