diff --git a/enginetest/queries/script_queries.go b/enginetest/queries/script_queries.go index 5eceb66ae9..35f4896643 100644 --- a/enginetest/queries/script_queries.go +++ b/enginetest/queries/script_queries.go @@ -132,7 +132,7 @@ var ScriptTests = []ScriptTest{ }, { Query: "alter table xy modify y enum('a')", - ExpectedErr: sql.ErrEnumTypeTruncated, + ExpectedErr: types.ErrConvertingToEnum, }, }, }, @@ -7511,7 +7511,7 @@ where }, { Query: "alter table t modify column e enum('abc');", - ExpectedErr: sql.ErrEnumTypeTruncated, + ExpectedErr: types.ErrConvertingToEnum, }, }, }, diff --git a/sql/analyzer/validate_create_table.go b/sql/analyzer/validate_create_table.go index 68a523d59d..fdb45e5dec 100644 --- a/sql/analyzer/validate_create_table.go +++ b/sql/analyzer/validate_create_table.go @@ -470,15 +470,6 @@ func validateModifyColumn(ctx *sql.Context, initialSch sql.Schema, schema sql.Sc return nil, err } - if e1, ok := newCol.Type.(sql.EnumType); ok { - oldCol := initialSch[initialSch.IndexOfColName(oldColName)] - if e2, ok := oldCol.Type.(sql.EnumType); ok { - if len(e1.Values()) < len(e2.Values()) { - return nil, sql.ErrEnumTypeTruncated.New() - } - } - } - // TODO: When a column is being modified, we should ideally check that any existing table check constraints // are still valid (e.g. if the column type changed) and throw an error if they are invalidated. // That would be consistent with MySQL behavior.