-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
planner: restrict plan cache for decimal parameter types #31769
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. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/f196fe276de45e759740b78a0d279afc73d7b550 |
@@ -172,6 +172,11 @@ func (s FieldSlice) Equal(tps []*types.FieldType) bool { | |||
(s[i].EvalType() == types.ETInt && mysql.HasUnsignedFlag(s[i].Flag) != mysql.HasUnsignedFlag(tps[i].Flag)) { | |||
return false | |||
} | |||
// When the type is decimal, we should compare the Flen and Decimal. |
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.
Where do we call the FieldSlice.Equal
?
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.
Only used in Execute.getPhysicalPlan
in planner/core
package for plan cache.
Besides the comments for the function in line158 says Currently this is only used in plan cache to invalidate cache when types of variables are different.
� Conflicts: � planner/core/prepare_test.go
/merge |
This pull request has been accepted and is ready to merge. Commit hash: f196fe2
|
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.3 in PR #33542 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.4 in PR #33543 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-6.0 in PR #33544 |
What problem does this PR solve?
Issue Number: close #31730
ref #29565
Problem Summary:
The results are different if decimal column exist some larger value
What is changed and how it works?
For the
decimal
type, we can only use the plan when both Flen and Decimal should be less equal than the cached one.Check List
Tests
Side effects
Documentation
Release note