Skip to content
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) #9093

Merged
merged 5 commits into from
Jan 17, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ddl/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,12 @@ func onTruncateTablePartition(t *meta.Meta, job *model.Job) (int64, error) {
}
tblInfo, err := getTableInfo(t, job, job.SchemaID)
if err != nil {
job.State = model.JobStateCancelled
zimulala marked this conversation as resolved.
Show resolved Hide resolved
return ver, errors.Trace(err)
}
pi := tblInfo.GetPartitionInfo()
if pi == nil {
zimulala marked this conversation as resolved.
Show resolved Hide resolved
job.State = model.JobStateCancelled
return ver, errors.Trace(ErrPartitionMgmtOnNonpartitioned)
}

Expand All @@ -369,7 +371,8 @@ func onTruncateTablePartition(t *meta.Meta, job *model.Job) (int64, error) {
}
}
if !find {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do it in master ?

return ver, errUnknownPartition.GenWithStackByArgs("drop?", tblInfo.Name.O)
job.State = model.JobStateCancelled
return ver, table.ErrUnknownPartition.GenWithStackByArgs("drop?", tblInfo.Name.O)
}

ver, err = updateVersionAndTableInfo(t, job, tblInfo, true)
Expand Down