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: fix show create table for partitioned table #10682

Merged
merged 2 commits into from
Jun 4, 2019

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Jun 3, 2019

What problem does this PR solve?

Show create table result:

CREATE TABLE `log` (
  `LOG_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ROUND_ID` bigint(20) unsigned NOT NULL,
  `USER_ID` int(10) unsigned NOT NULL,
  `USER_IP` int(10) unsigned DEFAULT NULL,
  `END_TIME` datetime NOT NULL,
  `USER_TYPE` int(11) DEFAULT NULL,
  `APP_ID` int(11) DEFAULT NULL,
  PRIMARY KEY (`LOG_ID`,`END_TIME`),
  KEY `IDX_EndTime` (`END_TIME`),
  KEY `IDX_RoundId` (`ROUND_ID`),
  KEY `IDX_UserId_EndTime` (`USER_ID`,`END_TIME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
PARTITION BY RANGE ( month(`end_time`) ) (
  PARTITION p1 VALUES LESS THAN (2),
  PARTITION p2 VALUES LESS THAN (3),
  PARTITION p3 VALUES LESS THAN (4),
  PARTITION p4 VALUES LESS THAN (5),
  PARTITION p5 VALUES LESS THAN (6),
  PARTITION p6 VALUES LESS THAN (7),
  PARTITION p7 VALUES LESS THAN (8),
  PARTITION p8 VALUES LESS THAN (9),
  PARTITION p9 VALUES LESS THAN (10),
  PARTITION p10 VALUES LESS THAN (11),
  PARTITION p11 VALUES LESS THAN (12),
  PARTITION p12 VALUES LESS THAN (MAXVALUE)
) AUTO_INCREMENT=505488

AUTO_INCREMENT=505488 should not be after PARTITION definitions.
If there is a COMMENT=xxx, it would meet the same problem as AUTO_INCREMENT=xxx.

What is changed and how it works?

Fix the order, let the PARTITION definitions come last

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Show create table result for
          create table ... auto_increment = xx partition by ...
should not be
          create table ... partition by ... auto_increment = xx
@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #10682 into master will increase coverage by 0.0018%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #10682        +/-   ##
================================================
+ Coverage   78.3419%   78.3437%   +0.0018%     
================================================
  Files           414        414                
  Lines         87704      87656        -48     
================================================
- Hits          68709      68673        -36     
+ Misses        13852      13845         -7     
+ Partials       5143       5138         -5

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@tiancaiamao
Copy link
Contributor Author

PTAL @lysu @jackysp

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@shenli
Copy link
Member

shenli commented Jun 3, 2019

The description is not clear. You not only handle the AUTO_INCREMENT part, but also the COMMENT part.

@tiancaiamao
Copy link
Contributor Author

@shenli Updated

Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants