上游库做过把主键的自增取消又添加自增的操作,dm同步时先是报错 不能移除自增,后设置 tidb_allow_remove_auto_inc=1后, 又报错
“errors”: [
{
“Type”: “ExecSQL”,
“msg”: “”,
“error”: {
“ErrCode”: 10006,
“ErrClass”: 1,
“ErrScope”: 2,
“ErrLevel”: 3,
“Message”: “execute statement failed: ALTER TABLE shared_product
.prd_price_system_detail
MODIFY COLUMN id
BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT ‘主键id’: Error 8200: Unsupported modify column: can’t set auto_increment”,
“RawCause”: “Error 8200: Unsupported modify column: can’t set auto_increment”
}
}
在 tidb 与 mysql 兼容中描述。
add column
- 不支持设置
PRIMARY KEY
及UNIQUE KEY
,不支持设置AUTO_INCREMENT
属性。可能输出的错误信息:unsupported add column '%s' constraint PRIMARY/UNIQUE/AUTO_INCREMENT KEY
tidb_allow_remove_auto_inc 仅作为移除自增列使用
此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。