-
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: fix should not use point get plan (#21124) #21244
planner: fix should not use point get plan (#21124) #21244
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
/run-all-tests |
@blacktear23 you're already a collaborator in bot's repo. |
Fix conflicts
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
/merge |
Sorry @lzmhhh123, this branch cannot be merged without an approval of release maintainers |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
cherry-pick #21124 to release-4.0
What problem does this PR solve?
Issue Number: close #21123 , close #21204
Problem Summary:
In MySQL string convert to numbers it will use number prefix to convert to number, for example:
So if we create a table like
create table t (id varchar(10) primary key)
, then insert ('asdf'), ('1asdf') into this table. When we execute a query like:the plan should be convert column id into int and compare with number 0, so we should get 'asdf' as the result. But in TiDB it will convert number 0 to string '0' and use point get plan to fetch
id = '0'
rows, so we will get an empty set result.What is changed and how it works?
What's Changed:
Add type check for TryFastPlan, if column type is string like and
in
or=
value is number just return empty plan.Related changes
Check List
Tests
Side effects
Release note