Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
jiawen li
tidb
Commits
6fe68d67
Unverified
Commit
6fe68d67
authored
3 years ago
by
Mattias Jonsson
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
ddl: increasing value of partition by range columns fix (#32748) (#33643)
close pingcap/tidb#32748
parent
f5965a16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ddl/db_partition_test.go
+15
-0
ddl/db_partition_test.go
ddl/ddl_api.go
+0
-5
ddl/ddl_api.go
with
15 additions
and
5 deletions
+15
-5
ddl/db_partition_test.go
+
15
-
0
View file @
6fe68d67
...
...
@@ -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),
...
...
This diff is collapsed.
Click to expand it.
ddl/ddl_api.go
+
0
-
5
View file @
6fe68d67
...
...
@@ -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')
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help