That is normal and you do NOT want it to display numbers in sequence.
Lets say I use auto-increment column for primary key, lets also say that
I made a mistake while coding and deleted someone's account (account #3)
from the account table, but forgot to delete the corresponding entry
from the balance table (where account 3's balance of $1,000,000 was not
deleted when the account was closed). If the auto_increment went back
and re-used deleted values, then the next time someone opens an account
they get a free $1,000,000! 

Now that is an extreme case, but my point is simple; re-using
auto_increment values can cause all kinds of trouble. Besides, an
unsigned BIGINT can store so much data there is really no need to get
into auto_increment reuse.

Regards,
Mike Hillyer
www.vbmysql.com


-----Original Message-----
From: Daniel Crompton [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2003 10:19 AM
To: [EMAIL PROTECTED]
Subject: Why does auto increment not take into account deleted rows?


I have one column as an auto increment for adding numbers:

1
2
3
4
5

If i delete row 3 then add a new row and view the results i get:

1
2
4
5
6

As you can see 3 has been deleted and its now added 6!

Is this normal?.  How can i get it to always display numbers in this
column
in sequence.
TIA




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to