Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner: make pattern match case-insensitive for some infoschema tables #56378

Merged
merged 2 commits into from
Sep 27, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Sep 27, 2024

What problem does this PR solve?

Issue Number: close #56377

Problem Summary:

There are two problems with #55844:

What changed and how does it work?

  • Make memory table reader pattern match case-insensitive.
  • Consider pattern match when filtering schema object.
  • Sort the result returned from ListSchemasAndTables to make test stable.

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

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

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 27, 2024
Copy link

tiprow bot commented Sep 27, 2024

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

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.5318%. Comparing base (b520f61) to head (291d8cc).
Report is 10 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #56378        +/-   ##
================================================
+ Coverage   73.3867%   75.5318%   +2.1450%     
================================================
  Files          1620       1622         +2     
  Lines        447041     448501      +1460     
================================================
+ Hits         328069     338761     +10692     
+ Misses        98877      89230      -9647     
- Partials      20095      20510       +415     
Flag Coverage Δ
integration 49.0246% <69.2307%> (?)
unit 72.6470% <84.6153%> (+0.1688%) ⬆️

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

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 52.2777% <ø> (+6.7484%) ⬆️

@tangenta tangenta added the needs-cherry-pick-release-8.4 Should cherry pick this PR to release-8.4 branch. label Sep 27, 2024
@@ -661,6 +672,13 @@ func findTableAndSchemaByName(
schemaSlice = append(schemaSlice, st.schema)
tableSlice = append(tableSlice, st.table)
}
sort.Slice(schemaSlice, func(i, j int) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

We only need to sort by schema name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -721,6 +739,13 @@ func findSchemasForTables(
remains = append(remains, tbl)
}
}
sort.Slice(schemaSlice, func(i, j int) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create a new slice to store tables instead of directly modifing input slice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The input slice is not used by anyone else. Let me add some comments for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 27, 2024
Copy link

ti-chi-bot bot commented Sep 27, 2024

@joechenrh: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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/test-infra repository.

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 27, 2024
Copy link

ti-chi-bot bot commented Sep 27, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-27 09:53:15.353273063 +0000 UTC m=+2950.773486073: ☑️ agreed by tiancaiamao.
  • 2024-09-27 10:33:57.708529008 +0000 UTC m=+5393.128742019: ☑️ agreed by hawkingrei.

Copy link

tiprow bot commented Sep 27, 2024

@tangenta: 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
fast_test_tiprow 291d8cc link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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.

@tangenta
Copy link
Contributor Author

/approve

Copy link

ti-chi-bot bot commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, joechenrh, tangenta, tiancaiamao

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:

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 approved label Sep 27, 2024
@ti-chi-bot ti-chi-bot bot merged commit 828b461 into pingcap:master Sep 27, 2024
22 of 23 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: cannot checkout release-8.4: error checking out release-8.4: exit status 1. output: error: pathspec 'release-8.4' did not match any file(s) known to git

@tangenta tangenta removed the needs-cherry-pick-release-8.4 Should cherry pick this PR to release-8.4 branch. label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner 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.

information_schema.tables return wrong result
5 participants