Don't delete account_id row on MySQL

If the table is an InnoDB table deleting the row after allocation
may cause the sequence to reset when the server restarts, giving
out duplicate account_ids later.

Change-Id: I3e81df92a2a09c2024e047d5eef349f6524f83db
This commit is contained in:
Shawn O. Pearce 2011-10-11 11:26:52 -07:00
parent ac7d2f3448
commit 813123b520

View File

@ -9,7 +9,6 @@ CREATE FUNCTION nextval_account_id ()
MODIFIES SQL DATA
BEGIN
INSERT INTO account_id (s) VALUES (NULL);
DELETE FROM account_id WHERE s = LAST_INSERT_ID();
RETURN LAST_INSERT_ID();
END;
//