Re: Autoincrement Question
| From: | (Miles Thompson) | Date: | Fri, 11 May 2001 14:17:33 +0000 |
| Subject: | Re: Autoincrement Question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9256@lists.php.net to get a copy of this message | ||
Angie,
Is there a bug here? How do you "re-add" a fourth record? Is 3.22.33 a development or a stable version?
With MySQL 3.22.32, and table type of MyISAM I did not get re-use of the auto_increment keys , no matter where the records were deleted or inserted.
Miles
At 03:24 PM 5/10/01 -0500, Angie Tollerson wrote:
I am also doing it on 3.23.33 with MyISAM recover options off, is that what is happening? like I said...if I delete record one, and add a fourth record, It DOES NOT add it as 1. But as 5. however, if I delete 4, then add a fourth again, it sets it as 4. I'm not sure if that has anything to do with my MyISAM settings or not..but there you go.[quotes restored to bottom-posting order, for clarity]CC Zona <cczona@nospam.invalid> 05/10/01 03:11PM >>>incrementIf I have a database that has three records and I delete the entire third record, when another record is then added will the autonumber be 3 or 4? Thanks.I will be 3 Jeff :)Only if the auto increment values started at zero. Otherwise, thenumberwill be 4.That is true if you delete a row in between other records..if you delete 2 the fourth record added would be 4, not 2. BUT..in the default installation of mysql, if you delete the last record the auto increment will fill it's place..trust me, I just tried it :) What version of MySQL and table type are you getting that on? I just tried it with a MyISAM table in 3.23.33 (insert, immediate delete, immediate insert), and the pk incremented as expected. No re-use of values. -- CC -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net