List:General Discussion« Previous MessageNext Message »
From:过客 Date:January 7 2008 7:54am
Subject:why in procedure truncate table do not reset auto_increment?
View as plain text  
*hi everyone: *

I've some puzzle with the following test:

CREATE TABLE `demo` (
          `id` int(11) NOT NULL auto_increment,
          PRIMARY KEY  (`id`)
        ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
INSERT INTO demo VALUES(100);
delimiter //
create procedure test()
 DETERMINISTIC
begin
        TRUNCATE table demo;
        show table status like 'demo';
END//
delimiter ;

when call test() I got auto_increment=101, why in procedure TRUNCATE table
demo do not reset auto_increment?

any help much appreciate !

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