Unverified Commit 6fe68d67 authored by Mattias Jonsson's avatar Mattias Jonsson Committed by GitHub
Browse files

ddl: increasing value of partition by range columns fix (#32748) (#33643)

close pingcap/tidb#32748
parent f5965a16
Showing with 15 additions and 5 deletions
+15 -5
......@@ -545,6 +545,13 @@ create table log_message_1 (
"partition p1 values less than ('G'));",
dbterror.ErrRangeNotIncreasing,
},
{
"create table t(a char(10) collate utf8mb4_bin) " +
"partition by range columns (a) (" +
"partition p0 values less than ('g'), " +
"partition p1 values less than ('A'));",
dbterror.ErrRangeNotIncreasing,
},
{
"CREATE TABLE t1(c0 INT) PARTITION BY HASH((NOT c0)) PARTITIONS 2;",
dbterror.ErrPartitionFunctionIsNotAllowed,
......@@ -617,6 +624,14 @@ create table log_message_1 (
partition p0 values less than ('a'),
partition p1 values less than ('G'));`)
tk.MustExec("drop table if exists t;")
tk.MustExec(`create table t (a varchar(255) charset utf8mb4 collate utf8mb4_bin) ` +
`partition by range columns (a) ` +
`(partition pnull values less than (""),` +
`partition puppera values less than ("AAA"),` +
`partition plowera values less than ("aaa"),` +
`partition pmax values less than (MAXVALUE))`)
tk.MustExec("drop table if exists t;")
tk.MustExec(`create table t(a int) partition by range columns (a) (
partition p0 values less than (10),
......
......@@ -2681,11 +2681,6 @@ func checkTwoRangeColumns(ctx sessionctx.Context, curr, prev *model.PartitionDef
return false, nil
}
// Current and previous is the same.
if strings.EqualFold(curr.LessThan[i], prev.LessThan[i]) {
continue
}
// The tuples of column values used to define the partitions are strictly increasing:
// PARTITION p0 VALUES LESS THAN (5,10,'ggg')
// PARTITION p1 VALUES LESS THAN (10,20,'mmm')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment