-
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: support alter table .. truncate partition #8624
Conversation
/run-all-tests |
/run-sqllogic-test tidb-test=pr/681 |
/run-all-tests |
/run-all-tests |
/run-all-tests |
ddl/partition.go
Outdated
// TODO: MySQL behavior for hash partition is weird, "create table .. partition by hash partition 4", | ||
// it use p0, p1, p2, p3 as partition names automatically. | ||
for _, def := range meta.Partition.Definitions { | ||
if strings.EqualFold(def.Name.L, strings.ToLower(parName)) { |
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.
save strings.ToLower(partName)
to local variable? ditto in line#399
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.
done
ddl/ddl_api.go
Outdated
TableID: meta.ID, | ||
Type: model.ActionTruncateTablePartition, | ||
BinlogInfo: &model.HistoryInfo{}, | ||
Args: []interface{}{spec.Name}, |
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.
Why not use partition id to remove. Before this job is handling, maybe the spec.Name partition is removed and added back with different partition id?
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.
/run-all-tests |
/rebuild |
947ab7f
to
33c5ea3
Compare
/run-all-tests |
/rebuild |
/run-circleci |
/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
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
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
097c556
to
7c06dbb
Compare
/run-all-tests |
/run-all-tests |
/run-unit-test |
/run-common-test |
/run-common-test tidb-test=pr/688 |
1 similar comment
/run-common-test tidb-test=pr/688 |
What problem does this PR solve?
Fix #8435
What is changed and how it works?
Support alter table truncate partition
Check List
Tests
@ciscoxll @winkyao @zimulala
This change is