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

ddl: table meta should store column without db and table name #50978

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

lcwangchao
Copy link
Collaborator

@lcwangchao lcwangchao commented Feb 5, 2024

What problem does this PR solve?

Issue Number: close #50972

What changed and how does it work?

When storing an expression in table meta, the column name should be restored without db and table name to make sure the meta is still valid after renaming a table.

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.

fix a issue that some DDL will hang in some some cases.

@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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 5, 2024
Copy link

tiprow bot commented Feb 5, 2024

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

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

Merging #50978 (849103c) into master (aa00ae2) will increase coverage by 2.0834%.
Report is 3 commits behind head on master.
The diff coverage is 57.1428%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #50978        +/-   ##
================================================
+ Coverage   70.5650%   72.6484%   +2.0834%     
================================================
  Files          1466       1466                
  Lines        434758     434871       +113     
================================================
+ Hits         306787     315927      +9140     
+ Misses       108704      98980      -9724     
- Partials      19267      19964       +697     
Flag Coverage Δ
integration 49.0020% <50.0000%> (?)
unit 70.2941% <57.1428%> (-0.0814%) ⬇️

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

Components Coverage Δ
dumpling 54.2940% <ø> (ø)
parser ∅ <ø> (∅)
br 51.2026% <ø> (+5.4558%) ⬆️

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 5, 2024
if expr == nil {
return nil
}

e, err := expression.RewriteSimpleExprWithTableInfo(ctx, tblInfo, expr, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we modify RewriteSimpleExprWithTableInfo directly? RewriteSimpleExprWithTableInfo is used in one other place besides here, can that place be changed in the same way? This will remove the duplicate code here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will refactor those expression methods later in another PR. We can just make it a quick fix for this issue.

Copy link

ti-chi-bot bot commented Feb 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fzzf678, zimulala

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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 5, 2024
Copy link

ti-chi-bot bot commented Feb 5, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-05 07:02:15.964448823 +0000 UTC m=+167461.531218713: ☑️ agreed by fzzf678.
  • 2024-02-05 07:20:40.632295892 +0000 UTC m=+168566.199065779: ☑️ agreed by zimulala.

@ti-chi-bot ti-chi-bot bot merged commit 5c8b559 into pingcap:master Feb 5, 2024
23 checks passed
@lcwangchao lcwangchao deleted the fix_ddl_hang branch February 5, 2024 08:35
@lcwangchao lcwangchao added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Feb 7, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #51018.

@lcwangchao lcwangchao added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Feb 7, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #51019.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Feb 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #51020.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Feb 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

some partition/constraints expressions will cause DDL hangs forever
4 participants