-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: check only the range type partition #7599
Conversation
Please fix conlicts。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset LGTM
19d3082
to
0a586a8
Compare
@winkyao PTAL. |
@tiancaiamao @zimulala @crazycs520 PTAL . |
ddl/db_test.go
Outdated
@@ -1711,6 +1711,54 @@ func (s *testDBSuite) TestCreateTableWithPartition(c *C) { | |||
partition p3 values less than (18446744073709551000 + 1), | |||
partition p4 values less than (18446744073709551000 + 10) | |||
);`) | |||
|
|||
// Support partitioned by range columns later "ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the relationship between the comment and the following case?
(partition p0 values less than (0));`) | ||
} | ||
|
||
func (s *testDBSuite) TestCreateTableWithHashPartition(c *C) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check grammar compatibility for different table partition type? @shenli
ddl/ddl_api.go
Outdated
} | ||
if pi != nil && pi.Type == model.PartitionTypeRange { | ||
// Check partition by range. | ||
if s.Partition.ColumnNames == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the title, I can tell there is only one constraint on the checking "restrict the check partition function to check only the rang partition". But I find another constraint here.
LGTM |
/run-all-tests |
bed6b62
to
3a48f55
Compare
@CaitinChen PTAL. |
ddl/db_test.go
Outdated
@@ -1711,6 +1711,55 @@ func (s *testDBSuite) TestCreateTableWithPartition(c *C) { | |||
partition p3 values less than (18446744073709551000 + 1), | |||
partition p4 values less than (18446744073709551000 + 10) | |||
);`) | |||
|
|||
// Only range type partition are now supported, range columns partition only implement parser so do not check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only range type partition is now supported. Range columns partition only implements the parser, so it will not be checked.
ddl/db_test.go
Outdated
@@ -1711,6 +1711,55 @@ func (s *testDBSuite) TestCreateTableWithPartition(c *C) { | |||
partition p3 values less than (18446744073709551000 + 1), | |||
partition p4 values less than (18446744073709551000 + 10) | |||
);`) | |||
|
|||
// Only range type partition are now supported, range columns partition only implement parser so do not check. | |||
// So executing the following sql can be executed successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the following SQL statements can be executed successfully.
ddl/ddl_api.go
Outdated
return errors.Trace(err) | ||
} | ||
if pi != nil && pi.Type == model.PartitionTypeRange { | ||
// Only range type partition are now supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only range type partition is now supported.
ddl/ddl_api.go
Outdated
} | ||
if pi != nil && pi.Type == model.PartitionTypeRange { | ||
// Only range type partition are now supported. | ||
// Range columns partition only implement parser so do not check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Range columns partition only implements the parser, so it will not be checked.
What is changed and how it works?Only range type partition is now supported. |
@CaitinChen Thanks for your guidance. |
@ciscoxll My pleasure |
@shenli PTAL. |
LGTM |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
Range columns
type partition error #7607What is changed and how it works?
Check List
Tests
@tiancaiamao @zimulala @crazycs520 PTAL .