List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 7 1999 10:34pm
Subject:RE: auto_increment behaviour
View as plain text  
>>>>> "Indrek" == Indrek Siitan <tfr@stripped> writes:

Indrek> Hey,
>> For an AUTO_INCREMENT column, inserting 0 has the same effect as
>> inserting NULL.  So this generates a key with value 1. It does
>> (or if you insert 0).  But your column is a PRIMARY KEY, so it
>> cannot contain duplicate values and you already have a row with
>> a key value of 1.

Indrek> yep, i perfectly understand, what it does and why it gives an error.

Indrek> i was just wondering why it interpretes 0 the same way as NULL,
Indrek> and was surprised by the fact that i can produce a situation where
Indrek> the untouched output of mysqldump can not be imported back to 
Indrek> the database.


I agree;  We will in MySQL 4.0 change that only NULL (and not 0) will
generate a new AUTO_INCREMENT value to avoid this problem.

auto_increment behaviourIndrek Siitan27 Oct
  • Re: auto_increment behaviourPaul DuBois27 Oct
  • Re: auto_increment behaviourBob Kline27 Oct
RE: auto_increment behaviourIndrek Siitan27 Oct
  • RE: auto_increment behaviourMichael Widenius8 Nov