pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.34k stars 5.85k forks source link

planner: fix `count(*)` return wrong value for `information_schema.tables` (#57506) #57549

Closed ti-chi-bot closed 2 days ago

ti-chi-bot commented 2 days ago

This is an automated cherry-pick of #57506

What problem does this PR solve?

Issue Number: close #56987

Problem Summary:

InfoSchemaBaseExtractor wrongly filter table names for the fast path introduced by https://github.com/pingcap/tidb/pull/55574

What changed and how does it work?

Introduce a new variable extractLowerString to dertermine whether to do case-insensitive comparisons for specific columns.

Test case is not added in integration test because we don't want to write some hardcoded value. (ref #57306)

Check List

Tests

Side effects

Documentation

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None
ti-chi-bot[bot] commented 2 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, hawkingrei

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/pingcap/tidb/blob/release-8.5/OWNERS)~~ [Benjamin2037,hawkingrei] - ~~[pkg/planner/OWNERS](https://github.com/pingcap/tidb/blob/release-8.5/pkg/planner/OWNERS)~~ [hawkingrei] 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[bot] commented 2 days ago

[LGTM Timeline notifier]

Timeline:

codecov[bot] commented 2 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (release-8.5@03a5897). Learn more about missing BASE report.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release-8.5 #57549 +/- ## ================================================ Coverage ? 56.8208% ================================================ Files ? 1770 Lines ? 625980 Branches ? 0 ================================================ Hits ? 355687 Misses ? 246236 Partials ? 24057 ``` | [Flag](https://app.codecov.io/gh/pingcap/tidb/pull/57549/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/pingcap/tidb/pull/57549/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `36.6959% <100.0000%> (?)` | | | [unit](https://app.codecov.io/gh/pingcap/tidb/pull/57549/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `72.5106% <100.0000%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/pingcap/tidb/pull/57549/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [dumpling](https://app.codecov.io/gh/pingcap/tidb/pull/57549/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `52.9478% <0.0000%> (?)` | | | [parser](https://app.codecov.io/gh/pingcap/tidb/pull/57549/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `∅ <0.0000%> (?)` | | | [br](https://app.codecov.io/gh/pingcap/tidb/pull/57549/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `52.3160% <0.0000%> (?)` | |

🚨 Try these New Features:

joechenrh commented 2 days ago

/retest