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

*: modify the printing of column default expression in SHOW CREATE TABLE and Restore #52940

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

CbcWestwolf
Copy link
Member

@CbcWestwolf CbcWestwolf commented Apr 27, 2024

What problem does this PR solve?

Issue Number: close #52939

Problem Summary:

See the description of the issue.

What changed and how does it work?

If the column default expression is ast.FuncCallExpr except ast.CurrentTimestamp, wrap an outer parentheses in SHOW CREATE TABLE and Restore()

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.

Wrap some column default expressions within parentheses in SHOW CREATE TABLE and Restore

Copy link

ti-chi-bot bot commented Apr 27, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 27, 2024
Copy link

tiprow bot commented Apr 27, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@CbcWestwolf CbcWestwolf changed the title *: modify the printing of column default option *: modify the printing of column default expresion in SHOW CREATE TABLE and Restore Apr 27, 2024
@CbcWestwolf
Copy link
Member Author

/test all

@CbcWestwolf CbcWestwolf marked this pull request as ready for review April 28, 2024 02:48
@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. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. labels Apr 28, 2024
@CbcWestwolf CbcWestwolf changed the title *: modify the printing of column default expresion in SHOW CREATE TABLE and Restore *: modify the printing of column default expression in SHOW CREATE TABLE and Restore Apr 28, 2024
Copy link

codecov bot commented Apr 28, 2024

Codecov Report

Attention: Patch coverage is 65.00000% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 55.4486%. Comparing base (58bfd1c) to head (e94c799).
Report is 8 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #52940         +/-   ##
=================================================
- Coverage   72.3753%   55.4486%   -16.9268%     
=================================================
  Files          1481       1594        +113     
  Lines        428397     601663     +173266     
=================================================
+ Hits         310054     333614      +23560     
- Misses        99049     244825     +145776     
- Partials      19294      23224       +3930     
Flag Coverage Δ
integration 22.5728% <0.0000%> (?)
unit 71.2227% <65.0000%> (-0.0342%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 49.8593% <ø> (+8.6684%) ⬆️

@zimulala
Copy link
Contributor

/retest

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Apr 28, 2024
@zimulala zimulala requested a review from tangenta April 28, 2024 03:55
@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. labels Apr 28, 2024
@CbcWestwolf
Copy link
Member Author

/retest

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

ti-chi-bot bot commented Apr 28, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-28 03:55:34.453973041 +0000 UTC m=+156688.211108617: ☑️ agreed by zimulala.
  • 2024-04-28 05:10:10.531796493 +0000 UTC m=+161164.288932067: ☑️ agreed by tangenta.

@CbcWestwolf
Copy link
Member Author

/retest

@easonn7
Copy link

easonn7 commented Apr 28, 2024

/approve

Copy link

ti-chi-bot bot commented Apr 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: easonn7, tangenta, 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

@CbcWestwolf
Copy link
Member Author

/retest

@CbcWestwolf
Copy link
Member Author

/retest-required

@ti-chi-bot ti-chi-bot bot merged commit 66ba419 into pingcap:master Apr 28, 2024
21 of 23 checks passed
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Apr 28, 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-6.5: #52949.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Apr 28, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Apr 28, 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: #52950.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Apr 28, 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.5: #52951.

@ti-chi-bot
Copy link
Member

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

@CbcWestwolf CbcWestwolf deleted the fix-default-expr-parenthese branch April 28, 2024 08:56
ti-chi-bot bot pushed a commit that referenced this pull request Apr 28, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 29, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 29, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 29, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 29, 2024
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.1 Should cherry pick this PR to release-6.1 branch. 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. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SHOW CREATE TABLE and Restore of column default expressions should be enclosed within parentheses
5 participants