Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Correctly clear table and reset auto increment #11333

Conversation

GuySartorelli
Copy link
Member

Follow-on from #11309 and #11319

We can't use the ID value as the existing implementation does, because if we created some records and then deleted them all, the max ID will be 0 or null (depending on how MySQL reads that), which means we won't reset the auto increment.

We also can't rely on fetching the current auto increment value like the original implementation did because that's cached in MySQL 8.0 which is what caused the original failure.

Instead, we just always reset the auto increment. It'll be faster than a truncate, and it's better than trying to mess with the cache settings for the table stats or running ANALYZE TABLE (which I did try but it caused other problems).

Issue

@emteknetnz
Copy link
Member

Closed in favor of #11334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants