-
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
executor: fix wrong key range of index scan when filter is comparing year column with NULL (#23079) #23104
executor: fix wrong key range of index scan when filter is comparing year column with NULL (#23079) #23104
Conversation
Signed-off-by: ti-srebot <[email protected]>
/run-all-tests |
@guo-shaoge you're already a collaborator in bot's repo. |
/run-check_dev |
1 similar comment
/run-check_dev |
/run-check_dev |
/run-check_dev |
Rely on this PR |
/run-check_dev |
4f2cf60
to
f820429
Compare
/LGTM |
/lgtm |
[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 writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b060836
|
/run-unit-test |
cherry-pick #23079 to release-4.0
You can switch your code base to this Pull Request by using git-extras:
# In tidb repo: git pr https://github.com/pingcap/tidb/pull/23104
After apply modifications, you can push your change to this PR via:
Signed-off-by: guo-shaoge [email protected]
What problem does this PR solve?
Issue Number: close #23038
Problem Summary: use following case:
Output should be empty, but TiDB give result.
What is changed and how it works?
What's Changed: change datum.go:convertToMysqlYear(), when arg is NULL, this function accidentally set result tobe zero year.
How it Works: go:convertToMysqlYear() is called by ranger.(*builder).buildFormBinOp(), which will build key range. So if go:convertToMysqlYear() change NULL to zero, the key range for index scan is wrong.
Related changes
Check List
Tests
Side effects: no
Release note