From: Konstantin Osipov Date: July 27 2009 5:02pm Subject: Re: Please advise [Re: Restore locking: TRUNCATE resets AUTO_INCREMENT on InnoDB] List-Archive: http://lists.mysql.com/backup/8 Message-Id: <20090727170255.GJ14621@shakti> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT * Ingo Strüwing [09/07/27 21:00]: > An idea to solve this was to retrieve the auto_increment value from the > tables before they are truncated. And then set these values after data > restore. > > This would improve the situation a lot, but still leave stray INSERTs a > chance to increment the values between CREATE TABLE and LOCK TABLES. You need to remember the value of the auto increment in the image, then you don't have to extract it, and don't rely on favourable concurrency. --