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:
parent
ac7d2f3448
commit
813123b520
@ -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;
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user