ddl: error or skip unsupported partition-related DDLs#10672
Merged
kennytm merged 5 commits intopingcap:masterfrom Jun 11, 2019
Merged
ddl: error or skip unsupported partition-related DDLs#10672kennytm merged 5 commits intopingcap:masterfrom
kennytm merged 5 commits intopingcap:masterfrom
Conversation
a34a853 to
2cd158a
Compare
This comment has been minimized.
This comment has been minimized.
e52446c to
fb1db96
Compare
Contributor
Author
|
/run-integration-tests |
Contributor
|
/run-all-tests |
tiancaiamao
reviewed
Jun 10, 2019
|
|
||
| if len(validSpecs) != 1 { | ||
| // TODO: Hanlde len(validSpecs) == 0. | ||
| if len(validSpecs) > 1 { |
Contributor
There was a problem hiding this comment.
Will len(validSpecs) == 0?
Contributor
Author
There was a problem hiding this comment.
Yes, ALTER TABLE t; is len(validSpecs) == 0.
Contributor
|
LGTM |
Contributor
|
PTAL @crazycs520 @winkyao @zimulala |
Contributor
Author
|
/run-all-tests |
crazycs520
reviewed
Jun 11, 2019
Contributor
Author
|
/run-integration-common-test |
Contributor
Author
|
/run-all-tests |
Contributor
|
@kennytm Can you cherry pick this pr to v3.0.0, I found there was bug fix in this PR: create table t (a int,b int) partition by hash(a) partitions 10;
truncate table t;
select * from t partition (p0)
(1735, u"Unknown partition 'p0' in table 't'")
mysql>select tidb_version();
+--------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------+
| Release Version: v3.0.1-19-g8dd4a277d |
| Git Commit Hash: 8dd4a277d2a844aaaf03b6d90792baade8adea70 |
| Git Branch: release-3.0 |
| UTC Build Time: 2019-07-22 01:04:07 |
| GoVersion: go version go1.12 darwin/amd64 |
| Race Enabled: false |
| TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e |
| Check Table Before Drop: false |
+--------------------------------------------------------------------------+
|
kennytm
added a commit
to kennytm/tidb
that referenced
this pull request
Jul 22, 2019
* ddl: error or skip unsupported partition-related DDLs * go.mod: stop replacing parser since the PR is merged * ddl: addressed comment
marsishandsome
added a commit
that referenced
this pull request
Jul 24, 2019
sre-bot
pushed a commit
that referenced
this pull request
Aug 5, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Update parser to include pingcap/parser#345, which involved some changes in the DDL component.
What is changed and how it works?
Make sure code which checks PartitionType recognizes all 5 partition types:
ALTER TABLE ... ADD PARTITION, reject all types ("unsupported") except RANGEIn a HASH partition, if the partitions are explicitly named (and maybe contains comments), they will be saved into the model. The comments are kept even after
ALTER TABLE ... TRUNCATE PARTITION.ALTER TABLE ... PARTITION BYwill raise an error (instead of silently ignoring).ALTER TABLE ... DROP PARTITIONandALTER TABLE ... TRUNCATE PARTITIONwill raise "multiple schema changes" error if multiple partition names are supplied.Check List
Tests
Code changes
Side effects
Related changes