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

executor: support show create sequence #14674

Merged
merged 11 commits into from
Feb 10, 2020
Merged

Conversation

AilinKid
Copy link
Contributor

@AilinKid AilinKid commented Feb 7, 2020

What problem does this PR solve?

Support show create sequence syntax.
After this PR, It goes like as follows:

mysql> create sequence seq;
Query OK, 0 rows affected (0.01 sec)

mysql> show create sequence seq;
+-------+----------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                               |
+-------+----------------------------------------------------------------------------------------------------------------------------+
| seq   | CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB |
+-------+----------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

What is changed and how it works?

  1. add the fetchShowCreateSequence logic in show.go
  2. append the ast.ShowCreateSequence case to the ast.ShowCreateTable case in planbuilder.go (in most case, sequence are treated as a table)
  3. add some show create sequence test in sequence_test.go

Check List

Tests

  • Unit test
  • Integration test

Related changes

  • Need to update the documentation

Release note

  • Support the show create sequence in TiDB.

@AilinKid AilinKid requested a review from a team as a code owner February 7, 2020 08:16
@ghost ghost requested review from francis0407 and alivxxx and removed request for a team February 7, 2020 08:16
@AilinKid AilinKid requested review from XuHuaiyu, crazycs520 and tangenta and removed request for francis0407 and alivxxx February 7, 2020 08:17
@AilinKid AilinKid added the sig/execution SIG execution label Feb 7, 2020
@AilinKid AilinKid added this to the v4.0.0-beta.1 milestone Feb 7, 2020
@AilinKid
Copy link
Contributor Author

AilinKid commented Feb 7, 2020

/run-unit-test

@AilinKid
Copy link
Contributor Author

AilinKid commented Feb 7, 2020

/build

1 similar comment
@AilinKid
Copy link
Contributor Author

AilinKid commented Feb 7, 2020

/build

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

BTW

test> show create sequence tt
(1146, u"Table 'test.tt' doesn't exist")  -- shoud be Sequence xxx doesn't exist ?

@AilinKid
Copy link
Contributor Author

AilinKid commented Feb 10, 2020

BTW

test> show create sequence tt
(1146, u"Table 'test.tt' doesn't exist")  -- shoud be Sequence xxx doesn't exist ?

It behaviors like MariaDB... I think it's temporary ok here.

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

The rest of the code almost LGTM.

ddl/sequence.go Show resolved Hide resolved
@AilinKid
Copy link
Contributor Author

/build

@AilinKid AilinKid added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 10, 2020
Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@AilinKid AilinKid added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Feb 10, 2020
@crazycs520
Copy link
Contributor

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 10, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 10, 2020

/run-all-tests

@sre-bot sre-bot merged commit 4cfe178 into pingcap:master Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants