-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
server: use max_allowed_packet to limit the packet size. #33651
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc mjonss dveeden |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/6fa6e27abdd1df0b79ddaf22545816fccaad07db |
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.
LGTM, but if possible please create a function for reuse code instead of copy/paste (see comment in SetSessionFromHook
sessionctx/variable/variable.go
Outdated
u, err := strconv.ParseUint(val, 10, 64) | ||
if err != nil { | ||
return errors.Trace(err) | ||
} | ||
// The value should be a multiple of 1024; nonmultiples are rounded down to the nearest multiple. | ||
if u%1024 != 0 { | ||
s.StmtCtx.AppendWarning(ErrTruncatedWrongValue.GenWithStackByArgs(MaxAllowedPacket, val)) | ||
u = (u / 1024) * 1024 | ||
val = strconv.FormatUint(u, 10) | ||
} |
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.
Please create a function and reuse the same code here and in SetGlobalSysVar.
/merge |
/unhold |
/run-mysql-test |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.0 in PR #34053 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.1 in PR #34054 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.2 in PR #34055 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.3 in PR #34056 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.4 in PR #34057 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-6.0 in PR #34059 |
TiDB MergeCI notify🔴 Bad News! New failing [2] after this pr merged.
|
See https://dev.mysql.com/doc/refman/8.0/en/packet-too-large.html |
What problem does this PR solve?
Issue Number: close #31422
Problem Summary:
The
max_allowed_packet
exists but did not work on previous versions.What is changed and how it works?
max_allowed_packet
if it is not a multiple of 1024max_allowed_packet
Check List
Tests
Side effects
Documentation
Release note