Hi, Nikita,

On Jan 09, Nikita Malyavin wrote:
> 
> So, it's really not what's called *identity field* in the standard, since
> there's no connection with key, it's just always generated.

Exactly. That's why I mean that IDENTITY in the standard has no
knowledge of periods, so it cannot be "with" or "without" overlaps. And
auto-inc is a pair of {column, key} so it can be. Thus "auto-inc without
overlaps" is our extension, and we can select for it any behavior we
think is better, it doesn't conflict with the standard.

> One more question:
> 
> create table t1 (a int, b int not null auto_increment, unique uab (a,b));
> >   insert t1 (a) values (1),(2),(1),(3);
> >   select * from t1;
> >
> > prints:
> >   +------+---+
> >   | a    | b |
> >   +------+---+
> >   |    1 | 1 |
> >   |    1 | 2 |
> >   |    2 | 1 |
> >   |    3 | 1 |
> >   +------+---+
> 
> Why not 1 2 1 2 in column b?
> I understood the behavior as "generate a new value only if we have a
> conflict with the current value".
> And then in the insertion order the values for b would be 1, 1, 2, 2.

no, why, the pair {3,1} does not conflict with {2,1}.

Regards,
Sergei
Chief Architect, MariaDB Server
and secur...@mariadb.org
_______________________________________________
developers mailing list -- developers@lists.mariadb.org
To unsubscribe send an email to developers-le...@lists.mariadb.org

Reply via email to