验证数据库主键越界问题
创建实验表
create table t_abc0001 (id bigint unsigned auto_increment primary key,col int);
desc t_abc0001;
写入最大值-1后的值,自增数已增加至最大值 18446744073709551615
insert into t_abc0001 values (18446744073709551614,1);
再次写入数据,不主动设置主键ID,报错!!!
insert into t_abc001 values (null,1);
报错信息为:
ERROR 1467 (HY000): Failed to read auto-increment value from storage engine
网友评论