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

Fix max_allowed_packet math #203

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Fix max_allowed_packet math #203

merged 1 commit into from
Oct 11, 2024

Conversation

composerinteralia
Copy link
Contributor

Prior to this commit our max_allowed_packed would fail any time the len of the data being written to the buffer was itself greater than the configured max_allowed_packet.

This is because both the len and the max_allowed_packet (aka builder->packet_max_length) are unsigned (size_t).

This commit bypasses the problem by adding to the left side instead of subtracting from the right.

Prior to this commit our `max_allowed_packed` would fail any time the
`len` of the data being written to the buffer was itself greater than
the configured `max_allowed_packet`.

This is because both the `len` and the `max_allowed_packet`
(aka `builder->packet_max_length`) are unsigned (`size_t`).

This commit bypasses the problem by adding to the left side instead of
subtracting from the right.
@jhawthorn jhawthorn merged commit 2010e23 into main Oct 11, 2024
12 checks passed
@jhawthorn jhawthorn deleted the fix_max_allowed_packet branch October 11, 2024 20:20
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