Skip to content

Commit

Permalink
修复修改列名bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zongfei.fu committed Sep 23, 2022
1 parent 9056d57 commit 8bbcbd8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/process/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ func CheckColsTypeChanged(col ColOptions, vCol ColOptions, auditConfig *config.A
if bytes.IndexByte(stringTp, col.Tp) < bytes.IndexByte(stringTp, vCol.Tp) {
return fmt.Errorf("列`%s`不允许变更数据类型(%s -> %s)[表`%s`]%s", oriColumn, stringMap[vCol.Tp], stringMap[col.Tp], table, tidbTips)
}
} else {
if col.Tp != vCol.Tp {
return fmt.Errorf("列`%s`不允许变更数据类型[表`%s`]", col.Column, table)
}
}
return nil
}
Expand All @@ -236,7 +240,8 @@ func CheckColsTypeChanged(col ColOptions, vCol ColOptions, auditConfig *config.A
if auditConfig.ENABLE_COLUMN_TYPE_CHANGE_COMPATIBLE {
// 启用兼容模式
return funcCheck()
} else {
}
if !auditConfig.ENABLE_COLUMN_TYPE_CHANGE_COMPATIBLE {
// 禁用兼容模式
if col.Tp != vCol.Tp {
return fmt.Errorf("列`%s`不允许变更数据类型[表`%s`]", col.Column, table)
Expand Down

0 comments on commit 8bbcbd8

Please sign in to comment.