Skip to content

Conversation

@shenyv1
Copy link

@shenyv1 shenyv1 commented Dec 1, 2025

What problem does this PR solve?

Issue Number: close #64731

Problem Summary:
The verifyIndexSideQuery function didn't recognize PointGet and BatchPointGet
as valid index access methods, causing ADMIN CHECK to fail when checking indexes
on enum columns or unique indexes.

What changed and how does it work?

Modified the verifyIndexSideQuery function to accept PointGet and BatchPointGet
operators as valid index access plans, in addition to IndexFullScan and IndexRangeScan.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Fixed admin check failure for enum columns with unique indexes

@ti-chi-bot ti-chi-bot bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. contribution This PR is from a community contributor. labels Dec 1, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 1, 2025

Hi @shenyv1. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions 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 kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. labels Dec 1, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 1, 2025

Welcome @shenyv1!

It looks like this is your first PR to pingcap/tidb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tidb. 😃

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 1, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign benjamin2037 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pingcap-cla-assistant
Copy link

pingcap-cla-assistant bot commented Dec 1, 2025

CLA assistant check
All committers have signed the CLA.

@tiprow
Copy link

tiprow bot commented Dec 1, 2025

Hi @shenyv1. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions 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 kubernetes-sigs/prow repository.

The verifyIndexSideQuery function verifies index-side queries use
index access instead of table scan. It previously only recognized
IndexFullScan and IndexRangeScan, causing admin check to fail when
PointGet or BatchPointGet plans are generated for enum columns or
unique indexes.

Add PointGet and BatchPointGet recognition to fix this issue.

Close pingcap#64731
@shenyv1 shenyv1 force-pushed the fix-admin-check-pointget-issue-64731 branch from 14883ae to 3c865a9 Compare December 1, 2025 11:19
@shenyv1
Copy link
Author

shenyv1 commented Dec 1, 2025

/release-note

@ti-chi-bot
Copy link

ti-chi-bot bot commented Dec 1, 2025

@shenyv1: the /release-note and /release-note-action-required commands have been deprecated.
Please edit the release-note block in the PR body text to include the release note. If the release note requires additional action include the string action required in the release note. For example:

```release-note
Some release note with action required.
```

In response to this:

/release-note

Instructions 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 kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 1, 2025
@lance6716
Copy link
Contributor

Please consider that point get may not be a index access

mysql> use test
Database changed
mysql> create table t (c int key, c2 int unique key);
Query OK, 0 rows affected (0.057 sec)

mysql> insert into t values (1,1);
Query OK, 1 row affected (0.005 sec)

mysql> explain select c from t where c = 1;
+-------------+---------+------+---------------+---------------+
| id          | estRows | task | access object | operator info |
+-------------+---------+------+---------------+---------------+
| Point_Get_1 | 1.00    | root | table:t       | handle:1      |
+-------------+---------+------+---------------+---------------+
1 row in set (0.001 sec)

mysql> explain select c2 from t where c2 = 1;
+-------------+---------+------+-----------------------+---------------+
| id          | estRows | task | access object         | operator info |
+-------------+---------+------+-----------------------+---------------+
| Point_Get_1 | 1.00    | root | table:t, index:c2(c2) |               |
+-------------+---------+------+-----------------------+---------------+
1 row in set (0.001 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADMIN CHECK plan checking doesn't work because it may use BatchPointGet or PointGet.

2 participants