use REPLACE INTO

This commit is contained in:
Up 2024-05-07 22:58:24 +02:00
parent ec65e0eb4a
commit 1c659d4fd2
No known key found for this signature in database
GPG Key ID: 3B75CD7439FEB388

View File

@ -87,7 +87,7 @@ func StoreSessionSaveData(uuid []byte, data defs.SessionSaveData, slot int) erro
return err
}
_, err = handle.Exec("INSERT INTO sessionSaveData (uuid, data, slot, timestamp) VALUES (?, ?, ?, UTC_TIMESTAMP()) ON DUPLICATE KEY UPDATE data = VALUES(data), timestamp = VALUES(timestamp)", uuid, buf.Bytes(), slot)
_, err = handle.Exec("REPLACE INTO sessionSaveData (uuid, slot, data, timestamp) VALUES (?, ?, ?, UTC_TIMESTAMP())", uuid, slot, buf.Bytes())
return err
}