From c76746ad358d4a8294fdc87602e39d642ae8a623 Mon Sep 17 00:00:00 2001 From: maru Date: Fri, 24 May 2024 01:41:50 -0400 Subject: [PATCH] Replace REPLACE INTO usage --- db/account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/account.go b/db/account.go index 513803e..0d2cd8a 100644 --- a/db/account.go +++ b/db/account.go @@ -237,7 +237,7 @@ func IsActiveSession(uuid []byte, clientSessionId string) (bool, error) { } func UpdateActiveSession(uuid []byte, clientSessionId string) error { - _, err := handle.Exec("REPLACE INTO activeClientSessions VALUES (?, ?)", uuid, clientSessionId) + _, err := handle.Exec("INSERT INTO activeClientSessions (uuid, clientSessionId) VALUES (?, ?) ON DUPLICATE KEY UPDATE clientSessionId = ?", uuid, clientSessionId, clientSessionId) if err != nil { return err }