Skip to content

planner: add regression coverage for issue 67345#67390

Open
hawkingrei wants to merge 1 commit intopingcap:masterfrom
hawkingrei:issue-67345-repro-20260329
Open

planner: add regression coverage for issue 67345#67390
hawkingrei wants to merge 1 commit intopingcap:masterfrom
hawkingrei:issue-67345-repro-20260329

Conversation

@hawkingrei
Copy link
Copy Markdown
Member

@hawkingrei hawkingrei commented Mar 28, 2026

What problem does this PR solve?

Issue Number: ref #67345

Problem Summary:

#67345 reports an internal error for a query that combines a VIEW with a coercion-heavy WHERE predicate.
Fresh current master no longer reproduces the panic, and the strongest overlap points to the merged fix in #66893.
This PR adds regression coverage so the non-repro behavior stays locked in.

What changed and how does it work?

  • add an issue:67345 regression block to pkg/planner/core/issuetest/planner_issue_test.go
  • cover the three issue shapes:
    • EXPLAIN
    • direct SELECT
    • derived-table SELECT ... WHERE ref2
  • assert the queries execute successfully and return the expected empty result on current master

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.

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

None

Summary by CodeRabbit

  • Tests
    • Added regression test for issue 67345 to validate query execution with complex predicates and null-related operations.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 28, 2026
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 28, 2026

[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 king-dylan 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 sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3d04210c-3d0b-43ae-9432-572ea7461200

📥 Commits

Reviewing files that changed from the base of the PR and between 25eacc4 and c221a1b.

📒 Files selected for processing (1)
  • pkg/planner/core/issuetest/planner_issue_test.go

📝 Walkthrough

Walkthrough

A new regression test case for issue 67345 was added to verify correct query planning behavior with complex NOT LIKE predicates involving casts and null-related constants. The test validates EXPLAIN output and SELECT result correctness with derived-table subquery filters.

Changes

Cohort / File(s) Summary
Regression Test for Issue 67345
pkg/planner/core/issuetest/planner_issue_test.go
Added test case verifying query planner behavior with boolean tables, views, and complex NOT LIKE predicates involving casts and null constants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

size/M

Suggested reviewers

  • qw4990
  • guo-shaoge

Poem

🐰 A test hops forth to catch the bug,
With NOT LIKE cast in snug embrace,
The planner's path now verified true,
No stone unturned in logic's space! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding regression test coverage for issue 67345 to the planner module.
Description check ✅ Passed The description is comprehensive and follows the template structure with all required sections filled, including issue number (ref #67345), problem summary, detailed explanation of changes, completed checklist with unit test marked, and release note.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Command failed


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot bot commented Mar 28, 2026

@hawkingrei: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/mysql-test c221a1b link true /test mysql-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.5076%. Comparing base (25eacc4) to head (c221a1b).

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #67390        +/-   ##
================================================
- Coverage   77.7922%   77.5076%   -0.2846%     
================================================
  Files          2023       1943        -80     
  Lines        556481     543256     -13225     
================================================
- Hits         432899     421065     -11834     
- Misses       121834     122189       +355     
+ Partials       1748          2      -1746     
Flag Coverage Δ
integration 40.9383% <ø> (-7.1888%) ⬇️
unit 76.6686% <ø> (+0.3220%) ⬆️

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

Components Coverage Δ
dumpling 61.5065% <ø> (ø)
parser ∅ <ø> (∅)
br 48.8826% <ø> (-11.9552%) ⬇️
🚀 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.

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

Labels

do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant