>>>>> "Rick" == Rick Moore <lrmoore@stripped> writes:
Rick> It does not wrap to 0-- I had the same misconception.
Rick> create table test2 (
Rick> id tinyint unsigned not null auto_increment );
Rick> insert into test2( id ) values( 253 );
Rick> insert into test2( id ) values (NULL);
Rick> insert into test2( id ) values (NULL);
Rick> insert into test2( id ) values (NULL);
Rick> Error 1062: Duplicate key entry '255' for key 1.
Yes; MyISAM does not wrap but stops at the last possible key value.
Rick> Another interesting thing:
Rick> show columns from test2;
Rick> +-------+---------------------+------+-----+---------+----------------+-----
Rick> ----
Rick> ------------------------+
Rick> | Field | Type | Null | Key | Default | Extra |
Rick> Privileg
Rick> es |
Rick> +-------+---------------------+------+-----+---------+----------------+-----
Rick> ----
Rick> ------------------------+
Rick> | id | tinyint(3) unsigned | | PRI | NULL | auto_increment |
Rick> select,i
Rick> nsert,update,references |
Rick> +-------+---------------------+------+-----+---------+----------------+-----
Rick> ----
Rick> ------------------------+
Rick> 1 row in set (0.00 sec)
Rick> I thought I specified "not null?" I haven't researched the manual
Rick> thoroughly, but I assume this is an intentional silent column change...
The above 'Default' is ok as NULL for an auto_increment value means
'next value'.
Regards,
Monty