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: fix compatibility for OnDelete,OnUpdate clauses #393

Merged
merged 6 commits into from
Jul 25, 2019

Conversation

zier-one
Copy link
Contributor

@zier-one zier-one commented Jul 22, 2019

What problem does this PR solve?

fix compatibility for OnDelete,OnUpdate clauses

this pr support following syntax:
reference_definition:
REFERENCES tbl_name (key_part,...)
[MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]
[ON DELETE reference_option]
[ON UPDATE reference_option]

reference_option:
RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT

What is changed and how it works?

Check List

Tests

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

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to be included in the release note

@zier-one
Copy link
Contributor Author

I realized a similar PR has been already merged when I tried to fix merge conflict.
191583a
what do you think about these two kinds of implements.

@zier-one
Copy link
Contributor Author

@kennytm @zz-jason PTAL

@zz-jason zz-jason requested review from kennytm and tiancaiamao and removed request for kennytm July 25, 2019 03:19
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 LGT1 label Jul 25, 2019
@zz-jason zz-jason requested a review from kennytm July 25, 2019 03:20
@codecov
Copy link

codecov bot commented Jul 25, 2019

Codecov Report

Merging #393 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
+ Coverage   70.17%   70.22%   +0.04%     
==========================================
  Files          32       32              
  Lines        7437     7448      +11     
==========================================
+ Hits         5219     5230      +11     
  Misses       1703     1703              
  Partials      515      515
Impacted Files Coverage Δ
parser.go 70.58% <ø> (ø) ⬆️
misc.go 96.42% <ø> (ø) ⬆️
ast/ddl.go 77.91% <100%> (+0.17%) ⬆️

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 57e1f3b...a822211. Read the comment docs.

Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

LGTM

@kennytm kennytm merged commit e6a8bfd into pingcap:master Jul 25, 2019
@zier-one zier-one deleted the fix_alter_table_add_column branch July 25, 2019 06:07
@zier-one zier-one added status/LGT2 LGT2 and removed status/LGT1 LGT1 labels Aug 14, 2019
tangenta pushed a commit to tangenta/parser that referenced this pull request Nov 18, 2019
tangenta pushed a commit to tangenta/parser that referenced this pull request Nov 20, 2019
)

* fix

* fix check for ColumnOption

* add test for match

* use array
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
)

* fix

* fix check for ColumnOption

* add test for match

* use array
lyonzhi pushed a commit to lyonzhi/parser that referenced this pull request Apr 25, 2024
)

* fix

* fix check for ColumnOption

* add test for match

* use array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants