List:General Discussion« Previous MessageNext Message »
From:Sebastian Mendel Date:January 10 2008 8:13am
Subject:Re: why in procedure truncate table do not reset auto_increment?
View as plain text  
x schrieb:
> thanks
> 
> may you point out which chapter says?
>  From manual I get the following answer agaist to my result(my server 
> version 5.0.45),
> For |InnoDB| before version 5.0.3, |TRUNCATE TABLE| is mapped to 
> |DELETE|, so there is no difference. Starting with MySQL 5.0.3, fast 
> |TRUNCATE TABLE| is available. However, the operation is still mapped to 
> |DELETE| if there are foreign key constraints that reference the table. 
> (When fast truncate is used, it resets any |AUTO_INCREMENT| counter. 
>  From MySQL 5.0.13 on, the |AUTO_INCREMENT| counter is reset by 
> |TRUNCATE TABLE|, regardless of whether there is a foreign key constraint.)
> 
> The table handler does not remember the last used |AUTO_INCREMENT| 
> value, but starts counting from the beginning. This is true even for 
> |MyISAM| and |InnoDB|, which normally do not reuse sequence values.
> 
> See:
> http://dev.mysql.com/doc/refman/5.0/en/truncate.html 
> http://dev.mysql.com/doc/refman/5.1/en/truncate.html

oh sorry, yes, i was confused, somehow i mixed some old behavior and InnoDB 
behavior ...

Martijn Tonies, sorry too

-- 
Sebastian
Thread
why in procedure truncate table do not reset auto_increment?过客7 Jan
  • Re: why in procedure truncate table do not reset auto_increment?Sebastian Mendel9 Jan
    • Re: why in procedure truncate table do not reset auto_increment?x9 Jan
      • Re: why in procedure truncate table do not reset auto_increment?Sebastian Mendel10 Jan
  • Re: why in procedure truncate table do not reset auto_increment?Martijn Tonies9 Jan
    • Re: why in procedure truncate table do not reset auto_increment?Sebastian Mendel9 Jan
  • Re: why in procedure truncate table do not reset auto_increment?Martijn Tonies9 Jan
    • Re: why in procedure truncate table do not reset auto_increment?Sebastian Mendel9 Jan
  • Re: why in procedure truncate table do not reset auto_increment?Martijn Tonies9 Jan
    • Re: why in procedure truncate table do not reset auto_increment?Sebastian Mendel9 Jan