List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:July 7 1999 9:17am
Subject:MySQL 3.23 & autoincrement
View as plain text  
>>>>> "Barry" == Barry  <barry@stripped> writes:

Barry> Hello All,
Barry> I just downloaded the WinNT 3.22.24 and was looking through the new manual
Barry> at the Changes in 3.22.24 section. I came upon the following statement
Barry> about the MyISAM tables planned for 3.23.x.

Barry> "Internal handling of one AUTO_INCREMENT column. MyISAM will automatically
Barry> update this on INSERT/UPDATE. The AUTO_INCREMENT value can be reset with
Barry> myisamchk. This will make AUTO_INCREMENT columns faster and old numbers
Barry> will not be reused."

Barry> I am happy to see that old numbers will not be re-used, but am I
Barry> miss-reading this? Will an Update on an existing row modify the
Barry> Auto_Increment value? Using an Auto_Increment value as a static db record
Barry> identifier, I would not want this value to be modified once the row is
Barry> Inserted.

Hi!

The above means that if you do into an empty table:

INSERT INTO test (auto_column) values (NULL);
UPDATE test set auto_column=3 where auto_column=1;

MyISAM will notice that the next auto_increment it should use should
be 4.

MySQL will of course not change any existing value by it's own accord.

Regards,
Monty
Thread
SQL join questionWillem Bison11 Mar
  • Re: SQL join questionChristian Mack11 Mar
  • Re: MySQL 3.23 alpha released (problems/fixes)Paul DuBois5 Jul
    • MySQL 3.23 & autoincrementBarry5 Jul
      • Re: MySQL 3.23 & autoincrementPaul DuBois5 Jul
        • Re: MySQL 3.23 & autoincrementMartin Ramsch5 Jul
          • Re: MySQL 3.23 & autoincrementPaul DuBois5 Jul
            • Re: MySQL 3.23 & autoincrementMichael Widenius7 Jul
        • Re: MySQL 3.23 & autoincrementDick Griffin5 Jul
        • Re: MySQL 3.23 & autoincrementMichael Widenius7 Jul
      • MySQL 3.23 & autoincrementMichael Widenius7 Jul