You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mo-dump 导出并恢复带 AUTO_INCREMENT 的表后,已有行内容完全一致,但下一次自动生成的 ID 会回退到“已存最大值 + 1”,没有保留源表通过 ALTER TABLE ... AUTO_INCREMENT=N 设置的当前计数器。这会改变后续写入结果,并可能重用源库按业务预留的 ID 区间。
此时在源表执行 INSERT INTO d.t(v) VALUES('source_next'),实际生成 id=2000。接着将导出的 d.sql 导入同一个隔离实例(dump 自带 DROP DATABASE/重建),再执行 INSERT INTO d.t(v) VALUES('restored_next')。
修复后建议覆盖默认起点、显式 CREATE TABLE ... AUTO_INCREMENT=N、运行中 ALTER ... AUTO_INCREMENT=N、已存最大 ID 小于/等于/大于目标计数器,以及跨 DB 导出。每次恢复后都实际插入一行,比对下一 ID,不能只检查旧行和 SHOW CREATE TABLE。
This report is now tracked together with #30666. The canonical issue retains explicit acceptance cases for the behavior described here. This is an administrative duplicate/consolidation closure only; the underlying defect is not claimed fixed. The original description and discussion remain available on this issue.
Activity
XuPeng-SH commentedon Oct 22, 2026
This report is now tracked together with #30666. The canonical issue retains explicit acceptance cases for the behavior described here. This is an administrative duplicate/consolidation closure only; the underlying defect is not claimed fixed. The original description and discussion remain available on this issue.