goInception icon indicating copy to clipboard operation
goInception copied to clipboard

对自增列的约束进行校验

Open dbadylan opened this issue 2 years ago • 2 comments

goInception 对自增列加 check 约束时校验能通过:

`id` bigint(22) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键' check (id between 2100000000 and 2150000000)

但真正执行时是会报错的:

ERROR 3818 (HY000): Check constraint 'xxxx' cannot refer to an auto-increment column.

查了下官方文档,确实是有限制的:

Nongenerated and generated columns are permitted, except columns with the AUTO_INCREMENT attribute and columns in other tables.

能否完善一下此类场景的校验规则,谢谢!

dbadylan avatar Jul 25 '22 04:07 dbadylan

这个场景确实需要审核, 稍后会添加该检查.

hanchuanchuan avatar Jul 28 '22 14:07 hanchuanchuan

由于此问题没有最近的活动,因此已被自动标记为陈旧。如果没有进一步的活动,会作为不活跃issue关闭。感谢你对本项目的贡献。 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 07:08 stale[bot]