There are a few questions about this on SO, but none of them applies here. The questions are all about knowing an ID before inserting a row (and the answers are all "insert your stuff, then get the ID"). In my case, I don't want to insert anything, I just want to know the current state of an auto increment column.
- I have a table with an auto increment column.
- If I add a row, it will get id = 1.
- If I delete this row and add another one, the table will have only 1 entry, but it will get id = 2.
I want to know which ID will be used next by this column.
Since I can't rely on the table to know this, I searched in the information_schema table, but didn't find such data.
Is there a place where the next (or current) auto increment value is stored ?