← Back to team overview

maria-developers team mailing list archive

Re: f93af1f93e2: MDEV-12836 Avoid table rebuild when adding or removing of auto_increment settings

 

Hi, Eugene!

On Feb 04, Eugene Kosov wrote:
> 
> >   create table t1 (a int unique);
> >   insert t1 values (NULL),(NULL),(NULL);
> >   alter table t1 modify a int auto_increment;
> 
> create table t1 (a int not null, unique key a_key (a)) engine=innodb;
> insert into t1 values (19), (1), (100500);
> alter table t1 modify a int not null auto_increment,algorithm=instant;
> drop table t1;

You've missed the point. I wrote that in some cases ALTER TABLE has
to generate auto-increment values. Try this example:

  create table t1 (a int not null, index (a));
  insert t1 values (0),(0),(0);
  alter table t1 modify a int auto_increment;
  select * from t1;

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx


Follow ups

References