Skip to content

Commit

Permalink
address comment: fix warning message if table partition is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bb7133 committed Dec 16, 2019
1 parent 0370b28 commit f9af11d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ var (
// ErrUnsupportedPartitionByRangeColumns returns for does unsupported partition by range columns.
ErrUnsupportedPartitionByRangeColumns = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "partition by range columns"))
errUnsupportedCreatePartition = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "partition type, treat as normal table"))
errTablePartitionDisabled = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, "Partitions are ignored because Table Partition is disabled, please set 'tidb_enable_table_partition' if you need to need to enable it")
errUnsupportedIndexType = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "index type"))

// ErrDupKeyName returns for duplicated key name
Expand Down
2 changes: 1 addition & 1 deletion ddl/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func buildTablePartitionInfo(ctx sessionctx.Context, d *ddl, s *ast.CreateTableS
}
}
if !enable {
ctx.GetSessionVars().StmtCtx.AppendWarning(errUnsupportedCreatePartition)
ctx.GetSessionVars().StmtCtx.AppendWarning(errTablePartitionDisabled)
}

pi := &model.PartitionInfo{
Expand Down

0 comments on commit f9af11d

Please sign in to comment.