fix: add warning for AlterTableRepairPartition (#18454)

This commit is contained in:
wangggong
2020-07-10 16:48:31 +08:00
committed by GitHub
parent 563f2c92d7
commit fe59fd4e92
3 changed files with 4 additions and 0 deletions

View File

@ -2175,6 +2175,7 @@ func (s *testIntegrationSuite3) TestPartitionErrorCode(c *C) {
tk.MustGetErrCode("alter table t_part optimize partition p0,p1;", tmysql.ErrUnsupportedDDLOperation)
tk.MustGetErrCode("alter table t_part rebuild partition p0,p1;", tmysql.ErrUnsupportedDDLOperation)
tk.MustGetErrCode("alter table t_part remove partitioning;", tmysql.ErrUnsupportedDDLOperation)
tk.MustGetErrCode("alter table t_part repair partition p1;", tmysql.ErrUnsupportedDDLOperation)
}
func (s *testIntegrationSuite5) TestConstAndTimezoneDepent(c *C) {

View File

@ -2212,6 +2212,8 @@ func (d *ddl) AlterTable(ctx sessionctx.Context, ident ast.Ident, specs []*ast.A
err = errors.Trace(errUnsupportedOptimizePartition)
case ast.AlterTableRemovePartitioning:
err = errors.Trace(errUnsupportedRemovePartition)
case ast.AlterTableRepairPartition:
err = errors.Trace(errUnsupportedRepairPartition)
case ast.AlterTableDropColumn:
err = d.DropColumn(ctx, ident, spec)
case ast.AlterTableDropIndex:

View File

@ -90,6 +90,7 @@ var (
errUnsupportedOptimizePartition = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "optimize partition"))
errUnsupportedRebuildPartition = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "rebuild partition"))
errUnsupportedRemovePartition = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "remove partitioning"))
errUnsupportedRepairPartition = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "repair partition"))
errUnsupportedExchangePartition = terror.ClassDDL.New(mysql.ErrUnsupportedDDLOperation, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrUnsupportedDDLOperation], "exchange partition"))
// ErrGeneratedColumnFunctionIsNotAllowed returns for unsupported functions for generated columns.
ErrGeneratedColumnFunctionIsNotAllowed = terror.ClassDDL.New(mysql.ErrGeneratedColumnFunctionIsNotAllowed, mysql.MySQLErrName[mysql.ErrGeneratedColumnFunctionIsNotAllowed])