Skip to content

Comments

parser: support SUBPARTITION grammar for table partition#7470

Merged
imtbkcat merged 2 commits intopingcap:masterfrom
tiancaiamao:subpartition
Aug 23, 2018
Merged

parser: support SUBPARTITION grammar for table partition#7470
imtbkcat merged 2 commits intopingcap:masterfrom
tiancaiamao:subpartition

Conversation

@tiancaiamao
Copy link
Contributor

What problem does this PR solve?

There are many test cases in mysql-test use subpartition.
If we parse the subpartition grammar, it would be more convenient for us to use the test cases.

CREATE TABLE t1 (
    ID int(11) NOT NULL,
    `aaaa,aaaaa` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
    ddddddddd int(11) NOT NULL DEFAULT '0',
    new_field0 varchar(50),
    PRIMARY KEY(ID, `aaaa,aaaaa`, ddddddddd))
PARTITION BY RANGE(ID)
PARTITIONS 3
SUBPARTITION BY LINEAR KEY(ID,`aaaa,aaaaa`)
SUBPARTITIONS 2 (
    PARTITION p01 VALUES LESS THAN(100),
    PARTITION p11 VALUES LESS THAN(200),
    PARTITION p21 VALUES LESS THAN MAXVALUE);

What is changed and how it works?

Parser will parse create table ... partition by range ... subpartition ...

Check List

Tests

  • Unit test

Code changes

  • update parser.y add the rules
  • add "subpartition" and "subpartitions" to lexer
  • add test

@coocood @zhexuany @winkyao

Copy link
Contributor

@jackysp jackysp 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

@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

@imtbkcat
Copy link

/run-all-tests

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.

LGTM

@imtbkcat imtbkcat merged commit 2ac2faf into pingcap:master Aug 23, 2018
@tiancaiamao tiancaiamao deleted the subpartition branch August 23, 2018 08:45
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