Hello. Today I am faced with an interesting moment: there is a certain table of some essence. It contains the fields id NOT NULL AUTO_INCREMENT PRIMARY KEY , name . Before that, I created two entries in it, but seeing that I had written the wrong thing, I deleted them using TRUNCATE . SELECT tables showed that it is empty. But after entering the new two entries, they received id 3, 4 . I understand the problem with the remaining indices, or not, what then to do? I used to think when deleting / updating records and, accordingly, id will be updated accordingly, and this is the essence of auto-increment. Or is it a bug, client version 4.1.22-community-nt .
- not. the counters do not behave like this anywhere, and this is good. Of course, if you want, you can "twist" the counter, but this is abnormal behavior for him - 4per
- as it will fix, besides how to delete a DB. - Muscled Boy
- Why fix it? the system must be built so that the specific id value doesn’t matter - Mike
- why fix it? - 4per
- And the essence of autoincrement is only that it would be guaranteed to issue a unique value for the next id. But what exactly it will not matter - Mike
|