I believe this is normal, if annoying, mysql behavior: auto increment
fields only ever go up. There may be an easier solution, but you
should be able to do something like:
ALTER TABLE table_name SET AUTO_INCREMENT=100;
to reset the counter. In practice, of course, you'd use the result of
something like "SELECT MAX(key_field) FROM table;" instead of "100".
Philip
On Sep 30, 2008, at 6:39 PM, Michael Hall wrote:
On Sep 30, 2008, at 3:41 PM, Kevin Muldoon wrote:
I'm able to rollback unwanted edits to a mySQL table with Java but
I notice that the primary key ( id INT UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY) does increment although the rollback
is successful.
In other words, if the PRIMARY KEY is 100 and user rollsback on
three records then the next insert will generate 104 rather than a
nice and neat 101. I wanted to know if this behavior can be
handled or do us developers just "live with it".
Does it work any different from Terminal if you just enter the SQL
there, is it mysql or java?
Your primary key should just ensure uniqueness shouldn't it? It
wouldn't be anything you would select or report on so it doesn't
really matter much does it?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden