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: support constraint in create table. #9

Merged
merged 1 commit into from
Jun 3, 2020

Conversation

AilinKid
Copy link

@AilinKid AilinKid commented Jun 2, 2020

Signed-off-by: Arenatlx 314806019@qq.com

What problem does this PR solve?

Close issue: pingcap#17406
Problem Summary:
Implement check constraints in TiDB
For example:

create table t(a int constraint haha check(a>1), constraint hehe check(a<10));

the column-level haha check constraint and table-level hehe constraint now can be checked and attach-stored in tableInfo.

What is changed and how it works?

What's Changed:
1: modify tableInfo add constraint field.
2: handle the constraint from parser, do dependency check in ddl, and store it.
3: do some test about it

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Breaking backward compatibility

Release note

  • implement the check constraints in create table

Signed-off-by: AilinKid <314806019@qq.com>
Copy link

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133 bb7133 merged commit a0503ca into bb7133:4.0-itai Jun 3, 2020
CbcWestwolf added a commit to CbcWestwolf/tidb that referenced this pull request Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants