landed fixseen and got rid of all explicit LOCK TABLES operations (not needed in modern MySQL, especially with transaction semantics)
This commit is contained in:
@@ -694,13 +694,6 @@ func AmCreateNewUser(ctx context.Context, username string, password string, remi
|
||||
tx.Rollback()
|
||||
}
|
||||
}()
|
||||
unlock := true
|
||||
tx.ExecContext(ctx, "LOCK TABLES users WRITE, userprefs WRITE, propuser WRITE, commmember WRITE, sideboxes WRITE, confhotlist WRITE;")
|
||||
defer func() {
|
||||
if unlock {
|
||||
tx.ExecContext(ctx, "UNLOCK TABLES;")
|
||||
}
|
||||
}()
|
||||
|
||||
// Test if the user name is already taken.
|
||||
row := tx.QueryRowContext(ctx, "SELECT uid FROM users WHERE username = ?", username)
|
||||
@@ -749,9 +742,6 @@ func AmCreateNewUser(ctx context.Context, username string, password string, remi
|
||||
return nil, err
|
||||
}
|
||||
|
||||
tx.ExecContext(ctx, "UNLOCK TABLES;")
|
||||
unlock = false
|
||||
|
||||
if err = tx.Commit(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user