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

Projects
None yet
5 participants
@tiancaiamao
Copy link
Contributor

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
executor: fix show create table for partitioned table
Show create table result for
          create table ... auto_increment = xx partition by ...
should not be
          create table ... partition by ... auto_increment = xx
@codecov

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

/run-all-tests

@tiancaiamao

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

@zimulala
Copy link
Member

left a comment

LGTM

@shenli

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

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

@tiancaiamao

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2019

@shenli Updated

@winkyao

winkyao approved these changes Jun 4, 2019

Copy link
Member

left a comment

LGTM

@jackysp jackysp merged commit 8bc5553 into pingcap:master Jun 4, 2019

8 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 0%)
Details
codecov/project 78.3437% (+0.0018%) compared to 38e32f7
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

tiancaiamao added a commit to tiancaiamao/tidb that referenced this pull request Jun 4, 2019

@tiancaiamao tiancaiamao deleted the tiancaiamao:show-partition branch Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.