statistics: fix panic when using wrong globalStats.Indices key (#35424)#35543
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
|
[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. DetailsReviewer can indicate their review by submitting an approval review. |
|
/run-all-tests |
|
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/8947f8c94eb7df004be982b071dbf5ff6d7ca14b |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 8947f8c |
|
/run-all-tests |
|
/run-all-tests |
|
/run-check_dev |
1 similar comment
|
/run-check_dev |
|
/run-check_dev |
|
@ti-srebot: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
cherry-pick #35424 to release-6.1
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/35543After apply modifications, you can push your change to this PR via:
Signed-off-by: lilinghai lilinghai@pingcap.com
What problem does this PR solve?
Issue Number: close #35421
Problem Summary:
Before the fix, The idx in the expression
for idx := range tblInfo.Indicesstart from 0, and the expressionglobalStats.Indices[idx]will get nil. We should use model.IndexInfo.ID as the key to access the content of globalStats.Indices.What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.