Skip to content

Conversation

@wddevries
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #65979
Problem Summary:

  1. The getPotentialEqOrInColOffset function has duplicated code, and the two versions are inconsistent with each other.
  2. The MockOnlyEnableIndexHashJoin failpoint in pkg/planner/core/exhaust_physical_plans.go is unused.

What changed and how does it work?

This pull request makes two changes:

  1. The duplicated code in the getPotentialEqOrInColOffset function has been removed, and the inconsistencies between the two versions have been removed.
  2. The unused MockOnlyEnableIndexHashJoin failpoint have been removed.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
  • I checked and no code files have been changed.
  • This is a refactoring that preserves existing behavior (with a minor bug fix for edge cases involving generated columns). Existing tests cover this functionality.

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

Please refer to Release Notes Language Style Guide (​https://pingcap.github.io/tidb-dev-guide/contrbute-to-tidb/release-notes-style-guide.html) to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added the release-note-none Denotes a PR that doesn't merit a release note. label Feb 2, 2026
@pantheon-ai
Copy link

pantheon-ai bot commented Feb 2, 2026

Hi @wddevries,

I noticed you mentioned me, but I couldn't find your Pantheon account linked to your GitHub account. Please connect your GitHub account to Pantheon first, and then try again.

Thank you!

Learn more about Pantheon AI

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/planner SIG: Planner labels Feb 2, 2026
@tiprow
Copy link

tiprow bot commented Feb 2, 2026

Hi @wddevries. 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.

Details

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.

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.5191%. Comparing base (85389ef) to head (cb9581e).
⚠️ Report is 24 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #65980        +/-   ##
================================================
- Coverage   77.7818%   77.5191%   -0.2628%     
================================================
  Files          2001       1923        -78     
  Lines        545618     537796      -7822     
================================================
- Hits         424392     416895      -7497     
- Misses       119564     120889      +1325     
+ Partials       1662         12      -1650     
Flag Coverage Δ
integration 41.5209% <100.0000%> (-6.6390%) ⬇️
unit 76.7200% <100.0000%> (+0.3065%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 56.7974% <ø> (ø)
parser ∅ <ø> (∅)
br 48.8730% <ø> (-12.1083%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@terry1purcell
Copy link
Contributor

@pantheon-bot please review.

@pantheon-ai
Copy link

pantheon-ai bot commented Feb 4, 2026

✅ Code looks good. No issues found.

@terry1purcell
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Feb 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request cleans up and simplifies ranger code by removing duplicated logic and unused failpoints.

Changes:

  • Refactored getPotentialEqOrInColOffset function in pkg/util/ranger/detacher.go to eliminate duplicated code branches and fix inconsistencies in column comparison logic
  • Removed unused MockOnlyEnableIndexHashJoin failpoint from pkg/planner/core/exhaust_physical_plans.go

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/util/ranger/detacher.go Consolidated duplicated code in getPotentialEqOrInColOffset function, fixing bugs where one branch used EqualColumn instead of EqualByExprAndID and was missing null checks for ast.NullEQ
pkg/planner/core/exhaust_physical_plans.go Removed three instances of unused MockOnlyEnableIndexHashJoin failpoint (replaced by MockOnlyEnableIndexHashJoinV2 in current codebase)

Copy link
Contributor

@henrybw henrybw left a comment

Choose a reason for hiding this comment

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

Nice, much simpler and easier to read now. Thanks for cleaning this up.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 4, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: henrybw
Once this PR has been reviewed and has the lgtm label, please assign guo-shaoge 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.

Details 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

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 4, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Feb 4, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-02-04 01:34:51.018437426 +0000 UTC m=+230762.119836135: ☑️ agreed by henrybw.

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

Labels

needs-1-more-lgtm Indicates a PR needs 1 more LGTM. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants