Boaz Yahav wrote:
>
> Hi
>
> Please have a look at this table creation :
>
> MySQL> create table mysql_seq (seq char(1) NOT NULL PRIMARY KEY, nextval
> bigint(20) unsigned NOT NULL auto_increment, Key(nextval));
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> desc mysql_seq;
> +---------+---------------------+------+-----+---------+----------------+
> | Field | Type | Null | Key | Default | Extra |
> +---------+---------------------+------+-----+---------+----------------+
> | seq | char(1) | | PRI | | |
> | nextval | bigint(20) unsigned | | MUL | 0 | auto_increment |
> +---------+---------------------+------+-----+---------+----------------+
> 2 rows in set (0.00 sec)
>
> Is this a bug? I mean the fact that the AUTO_INCREMENT field is not a
> primary key?
> or is my understanding of the AUTO_INCREMENT field wrong?
>
> thanks
>
> Regards,
>
> Boaz Yahav
Hi Boaz
The above is absolutely ok.
The only restrictions that have to be met are:
1) In each table there can only be one AUTO_INCREMENT column.
2) An AUTO_INCREMENT column must have a KEY defined on it.
You have met both.
Tschau
Christian
| Thread |
|---|
| • MySQL Bug? | Boaz Yahav | 11 Jun |
| • Re: MySQL Bug? | Christian Mack | 11 Jun |
| • MySQL Bug? | Michael Widenius | 11 Jun |