MySQL Auto-Increment: What Happens If Insert Fails?

Pretty random question, almost like a trivia/pubquiz thing. Let's say I'm doing insert SQL query, and if it fails - for example, some foreign or unique key is violated. What would be the ID of the next successful inserted record? Will it increase?

Let's find out in this short video experiment.

For more videos like this (though this one is pretty untypical for me), subscribe to our YouTube channel!

No comments or questions yet...

Like our articles?

Become a Premium Member for $129/year or $29/month

Written by