OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
why in procedure truncate table do not reset auto_increment?

From: ¹ý¿Í (xiaozhiwengmail.com)
Date: Mon Jan 07 2008 - 01:54:13 CST


*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 !