> 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}.

So, it always begins from 1 again, if no conflicts?
 
--
Yours truly,
Nikita Malyavin