MySQL Forums
Forum List  »  General

Re: AUTO_INCREMENT seeding not working intermittently
Posted by: Prashant Tekriwal
Date: October 17, 2014 01:11AM

Rick James Wrote:
-------------------------------------------------------
> InnoDB? MyISAM? (It may make a difference.)

InnoDB


> Was the server restarted between the ALTER and the first INSERT? (It probably makes a difference.)

No

> Did you DELETE or REPLACE any rows? (It may make a difference.)

No. Our tool does not delete or replace any rows.

> Are you ROLLBACKing any transactions? (That 'burns' an id.)

Rollbacking is possible but that should not effect the seeding of AUTO_INCREMENT as per my understanding.

>
> I ask all those questions (and more?) because they
> have an impact on AI calculation, and in an
> ENGINE-dependent manner. For example:
> After a restart, the next AI will be MAX(id)+1.
>



> As a workaround:
> Skip the ALTER. Instead, INSERT a row with an
> explicit id=499999 just before doing the real
> INSERTs. Optionally DELETE it, but not until
> after some INSERTs have been done.

This is what I have in place currently. But I am just trying to understand
why the ALTER command was not honoured properly.

It may give us some insight regarding any potential future issue.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.