use test;
drop table if exists t_in_def;
CREATE TABLE t_in_def (a serial key, b text) ;
INSERT INTO t_in_def(b) VALUES(repeat("a short string - ",5));
INSERT INTO t_in_def(b) VALUES(repeat("a long string - ",50));
INSERT INTO t_in_def(b) SELECT b FROM t_in_def;
SELECT a, left(b,50) FROM t_in_def;
SHOW CREATE TABLE t_in_def;
ALTER TABLE t_in_def ADD COLUMN (c int);
SHOW CREATE TABLE t_in_def;
description
To alter table instantly, InnoDB
forgot to remember the latest AUTOINC counter in dd::Table, thus after
reopening the table, it picked a stale AUTOINC value which was already
used.
how to fix
percona/percona-server@217c404#diff-908f0a52dfd64b4b26b052a5260840db33e12fcc322904fcb68ca9a6e8204d06
how to reproduce