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

parser: support ALTER TABLE ALTER CHECK, ALTER TABLE DROP CHECK syntax #505

Merged
merged 3 commits into from
Aug 20, 2019

Conversation

spongedu
Copy link
Contributor

@spongedu spongedu commented Aug 19, 2019

What problem does this PR solve?

for #497 , suport ALTER TABLE ALTER CHECK, ALTER TABLE DROP CHECK syntax.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Code changes

N / A

Side effects

N / A

Related changes

N / A

@spongedu spongedu changed the title parser: support ALTER TABLE ALTER CHECK, ALTER TABLE DROP CHECK s… parser: support ALTER TABLE ALTER CHECK, ALTER TABLE DROP CHECK syntax Aug 19, 2019
@codecov
Copy link

codecov bot commented Aug 19, 2019

Codecov Report

Merging #505 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #505      +/-   ##
=========================================
+ Coverage   71.56%   71.6%   +0.03%     
=========================================
  Files          32      32              
  Lines        7703    7712       +9     
=========================================
+ Hits         5513    5522       +9     
  Misses       1668    1668              
  Partials      522     522
Impacted Files Coverage Δ
parser.go 70.58% <ø> (ø) ⬆️
ast/ddl.go 80.29% <100%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d21ba7f...4f9dab7. Read the comment docs.

@zier-one
Copy link
Contributor

LGTM

@zier-one zier-one added the status/LGT1 LGT1 label Aug 20, 2019
@zier-one
Copy link
Contributor

@tangenta PTAL

Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

Rest LGTM

parser.y Outdated Show resolved Hide resolved
parser.y Outdated
@@ -1607,6 +1607,33 @@ AlterTableSpec:
yylex.AppendError(yylex.Errorf("The WITH/WITHOUT VALIDATION clause is parsed but ignored by all storage engines."))
parser.lastErrorAsWarn()
}
| "ALTER" "CHECK" Identifier EnforcedOrNot
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| "ALTER" "CHECK" Identifier EnforcedOrNot
| "ALTER" "CHECK" Identifier EnforcedOrNot

Sorry for my unclear suggestion. I mean here should be a tab, as most of the other productions.

parser_test.go Outdated
@@ -2284,6 +2284,13 @@ func (s *testParserSuite) TestDDL(c *C) {
{"ALTER TABLE t RENAME KEY a TO b;", true, "ALTER TABLE `t` RENAME INDEX `a` TO `b`"},
{"ALTER TABLE t RENAME INDEX a TO b;", true, "ALTER TABLE `t` RENAME INDEX `a` TO `b`"},

// For #497

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this blank line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please remove this blank line.

OK.

Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@tangenta tangenta merged commit a399620 into pingcap:master Aug 20, 2019
@zier-one zier-one added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Aug 21, 2019
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
lyonzhi pushed a commit to lyonzhi/parser that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants