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

*: differentiate types for user variables (#18973) #21107

Merged
merged 1 commit into from
Nov 26, 2020

Conversation

ti-srebot
Copy link
Contributor

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

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU

Release note

  • differentiate types for user variables

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@eurekaka you're already a collaborator in bot's repo.

@eurekaka
Copy link
Contributor

/run-all-tests

@eurekaka
Copy link
Contributor

/run-all-tests

lzmhhh123
lzmhhh123 previously approved these changes Nov 24, 2020
Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 24, 2020
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 25, 2020
qw4990
qw4990 previously approved these changes Nov 25, 2020
@qw4990
Copy link
Contributor

qw4990 commented Nov 25, 2020

/run-all-tests

@qw4990
Copy link
Contributor

qw4990 commented Nov 25, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 25, 2020
@ti-srebot
Copy link
Contributor Author

Your auto merge job has been accepted, waiting for:

  • 20413
  • 21283
  • 21283

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ti-srebot merge failed.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@eurekaka eurekaka merged commit 9cc0ea7 into pingcap:release-4.0 Nov 26, 2020
@eurekaka eurekaka deleted the release-4.0-de75e604ff2a branch November 26, 2020 03:45
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/executor component/expression sig/execution SIG execution sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants