Skip to content

Field response packets MySQL consistency improvements#2266

Merged
fulghum merged 8 commits intomainfrom
fulghum/max_allowed_packet
Jan 17, 2024
Merged

Field response packets MySQL consistency improvements#2266
fulghum merged 8 commits intomainfrom
fulghum/max_allowed_packet

Conversation

@fulghum
Copy link
Contributor

@fulghum fulghum commented Jan 17, 2024

While debugging a customer issue, I noticed that Dolt/GMS has several details in the field metadata packets that differ from MySQL's behavior. This PR fixes the following differences:

  • flags are now populated for nullability, unsigned types, blobs
  • column names for projected system variables now only include the variable scope when it was explicitly specified in the query
  • @@max_allowed_packet should be an unsigned integer type

Vitess PR: dolthub/vitess#302

…onsistency with MySQL, and ensuring column names for system variables are returned in the same format that the user specified, when used in a select expression.
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!

Expected: []sql.Row{{1073741824}},
ExpectedColumns: sql.Schema{
{
Name: "@@SESSION.max_allowed_packet",
Copy link
Member

Choose a reason for hiding this comment

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

Is the difference in case going to be an issue? If so might need a deeper fix

Copy link
Member

Choose a reason for hiding this comment

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

Could mean we need to add an alias in the select exprs, similar to what we do with other expressions today.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not including the scope is enough to fix the immediate customer issue, but the casing difference was sticking out to me, too. Instead of returning a boolean value for whether the scope was explicitly specified or not, we could return the explicitly specified scope and then we'd have the original casing that we could preserve.

@fulghum fulghum requested a review from zachmu January 17, 2024 20:23
@fulghum fulghum merged commit d6ef8bb into main Jan 17, 2024
@Hydrocharged Hydrocharged deleted the fulghum/max_allowed_packet branch February 7, 2024 13:45
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