-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: invalid multiple MAXVALUE partitions (#36329) #36345
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc @mjonss |
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 for single column RANGE COLUMNS (which is what we currently support), but it will not work for multi-column RANGE COLUMNS, like this:
create table t (a int, b int, c int) partition by range columns (a,b,c)
(partition p0 values less than (10, MAXVALUE, 0),
partition p1 values less than (10, MAXVALUE, 1000))
(which also fails in MySQL, but I consider it to be a bug.)
/run-all-tests |
ddl/db_partition_test.go
Outdated
"partition by range columns (d) (" + | ||
"partition p0 values less than ('2022-01-01')," + | ||
"partition p1 values less than (MAXVALUE), " + | ||
"partition p2 values less than (MAXVALUE));", |
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.
Please format this line, I think you can just do make dev
and it will reformat it for you.
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.
@mjonss reformatted with make dev
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/425eb8840e288a068799a03e4474e97fe63c72f8 |
ddl/ddl_api.go
Outdated
@@ -2762,8 +2762,10 @@ func checkTwoRangeColumns(ctx sessionctx.Context, curr, prev *model.PartitionDef | |||
for i := 0; i < len(pi.Columns); i++ { | |||
// Special handling for MAXVALUE. | |||
if strings.EqualFold(curr.LessThan[i], partitionMaxValue) { | |||
// If current is maxvalue, it certainly >= previous. | |||
return true, nil | |||
if !strings.EqualFold(prev.LessThan[i], partitionMaxValue) { |
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.
I think combine 2764 and 2765 in one line is better.
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.
@Defined2014 Exactly, fixed.
ddl/ddl_api.go
Outdated
// If current is maxvalue, it certainly >= previous. | ||
return true, 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.
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.
@Defined2014 my bad.. Fixed.
Signed-off-by: u5surf <[email protected]>
cherry pick to release-5.3 in PR #36444 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.4 in PR #36445 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-6.0 in PR #36446 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-6.1 in PR #36447 |
cherry pick to release-6.2 failed |
TiDB MergeCI notify🔴 Bad News! New failing [5] after this pr merged.
|
…ip-init * upstream/master: (125 commits) infoschema: fix PromQL for `tidb_distsql_copr_cache` (pingcap#36450) test: stabilize TestTopSQLCPUProfile (pingcap#36468) parser: add support of 'ADMIN SHOW DDL JOB QUERIES LIMIT m OFFSET n' transferring to AST (pingcap#36285) *: enable flaky test for all test (pingcap#36385) expression: fix return type of agg func `bit_or` when handling varbinary column (pingcap#36415) executor: fix aggregating enum zero value gets different results from mysql (pingcap#36208) server: skip check tiflash version (pingcap#36451) *: Minor update to SECURITY.md to improved clarity (pingcap#36346) table partition: add telemetry for partition table (pingcap#36204) ddl: invalid multiple MAXVALUE partitions (pingcap#36329) (pingcap#36345) planner: Fixed `Merge` hint in nested CTE (pingcap#36432) metric: impove concurrency ddl metrics (pingcap#36405) planner: add more test cases for leading outer join (pingcap#36409) ddl: only set concurrent variable if no error (pingcap#36437) ddl: fix update panic in the middle of multi-schema change (pingcap#36421) session: Mising OptimizeWithPlanAndThenWarmUp in prepare-execute path (pingcap#36347) executor,metrics: add a metric for observing execution phases (pingcap#35906) br: unified docker image align with tidb (pingcap#36016) ddl: skip to close nil sessPool (pingcap#36425) log-backup: remove the timezone from log-date (pingcap#36369) ...
* upstream/master: (280 commits) infoschema: fix PromQL for `tidb_distsql_copr_cache` (pingcap#36450) test: stabilize TestTopSQLCPUProfile (pingcap#36468) parser: add support of 'ADMIN SHOW DDL JOB QUERIES LIMIT m OFFSET n' transferring to AST (pingcap#36285) *: enable flaky test for all test (pingcap#36385) expression: fix return type of agg func `bit_or` when handling varbinary column (pingcap#36415) executor: fix aggregating enum zero value gets different results from mysql (pingcap#36208) server: skip check tiflash version (pingcap#36451) *: Minor update to SECURITY.md to improved clarity (pingcap#36346) table partition: add telemetry for partition table (pingcap#36204) ddl: invalid multiple MAXVALUE partitions (pingcap#36329) (pingcap#36345) planner: Fixed `Merge` hint in nested CTE (pingcap#36432) metric: impove concurrency ddl metrics (pingcap#36405) planner: add more test cases for leading outer join (pingcap#36409) ddl: only set concurrent variable if no error (pingcap#36437) ddl: fix update panic in the middle of multi-schema change (pingcap#36421) session: Mising OptimizeWithPlanAndThenWarmUp in prepare-execute path (pingcap#36347) executor,metrics: add a metric for observing execution phases (pingcap#35906) br: unified docker image align with tidb (pingcap#36016) ddl: skip to close nil sessPool (pingcap#36425) log-backup: remove the timezone from log-date (pingcap#36369) ...
…rimary-key * upstream/master: (104 commits) br: fix compatibility issue with concurrent ddl (pingcap#36474) infoschema: fix PromQL for `tidb_distsql_copr_cache` (pingcap#36450) test: stabilize TestTopSQLCPUProfile (pingcap#36468) parser: add support of 'ADMIN SHOW DDL JOB QUERIES LIMIT m OFFSET n' transferring to AST (pingcap#36285) *: enable flaky test for all test (pingcap#36385) expression: fix return type of agg func `bit_or` when handling varbinary column (pingcap#36415) executor: fix aggregating enum zero value gets different results from mysql (pingcap#36208) server: skip check tiflash version (pingcap#36451) *: Minor update to SECURITY.md to improved clarity (pingcap#36346) table partition: add telemetry for partition table (pingcap#36204) ddl: invalid multiple MAXVALUE partitions (pingcap#36329) (pingcap#36345) planner: Fixed `Merge` hint in nested CTE (pingcap#36432) metric: impove concurrency ddl metrics (pingcap#36405) planner: add more test cases for leading outer join (pingcap#36409) ddl: only set concurrent variable if no error (pingcap#36437) ddl: fix update panic in the middle of multi-schema change (pingcap#36421) session: Mising OptimizeWithPlanAndThenWarmUp in prepare-execute path (pingcap#36347) executor,metrics: add a metric for observing execution phases (pingcap#35906) br: unified docker image align with tidb (pingcap#36016) ddl: skip to close nil sessPool (pingcap#36425) ...
TiDB MergeCI notify🔴 Bad News! New failing [5] after this pr merged.
|
TiDB MergeCI notify🔴 Bad News! New failing [5] after this pr merged.
|
TiDB MergeCI notify🔴 Bad News! New failing [5] after this pr merged.
|
TiDB MergeCI notify🔴 Bad News! New failing [5] after this pr merged.
|
TiDB MergeCI notify🔴 Bad News! New failing [5] after this pr merged.
|
TiDB MergeCI notify🔴 Bad News! New failing [5] after this pr merged.
|
Hi, @Defined2014. The CI failed alert won't stop ringing now, what should I do? |
@u5surf I think you can ignore this. We cherry-pick this commit to other release branch with broken CI. |
Signed-off-by: u5surf [email protected]
What problem does this PR solve?
Issue Number: close #36329
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release-note