mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 17:23:09 -06:00
Fix selectLatestVersionSQL
This commit is contained in:
parent
bdde8c37ec
commit
6adbb6c936
|
|
@ -56,7 +56,7 @@ const selectKeyBackupSQL = "" +
|
|||
"SELECT algorithm, auth_data, etag, deleted FROM account_e2e_room_keys_versions WHERE user_id = $1 AND version = $2"
|
||||
|
||||
const selectLatestVersionSQL = "" +
|
||||
"SELECT MAX(version) FROM account_e2e_room_keys_versions WHERE user_id = $1"
|
||||
"SELECT COALESCE(MAX(version),0) FROM account_e2e_room_keys_versions WHERE user_id = $1"
|
||||
|
||||
type keyBackupVersionStatements struct {
|
||||
insertKeyBackupStmt *sql.Stmt
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ const selectKeyBackupSQL = "" +
|
|||
"SELECT algorithm, auth_data, etag, deleted FROM account_e2e_room_keys_versions WHERE user_id = $1 AND version = $2"
|
||||
|
||||
const selectLatestVersionSQL = "" +
|
||||
"SELECT MAX(version) FROM account_e2e_room_keys_versions WHERE user_id = $1"
|
||||
"SELECT IFNULL(MAX(version),0) FROM account_e2e_room_keys_versions WHERE user_id = $1"
|
||||
|
||||
type keyBackupVersionStatements struct {
|
||||
insertKeyBackupStmt *sql.Stmt
|
||||
|
|
|
|||
Loading…
Reference in a new issue