-
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
*: differentiate types for user variables (#18973) #21107
*: differentiate types for user variables (#18973) #21107
Conversation
/run-all-tests |
@eurekaka you're already a collaborator in bot's repo. |
/run-all-tests |
db28976
to
3f52a67
Compare
/run-all-tests |
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
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
/run-all-tests |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@ti-srebot merge failed. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
272dce7
to
1a1b177
Compare
cherry-pick #18973 to release-4.0
What problem does this PR solve?
Issue Number: close #16820 , close #11212
#16603 and #16362 can be closed by this PR as well.
Problem Summary:
We treated all user variables as string types, so there would be cast functions added which prevent the planner to choose better plans, such as PointGet. The problem is more frequent when plan cache is enabled.
What is changed and how it works?
What's Changed:
Infer types for user variables, if the user variable is not set before, we treat it as string type. The behaviors reference https://dev.mysql.com/doc/refman/8.0/en/user-variables.html.
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note