mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -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"
|
"SELECT algorithm, auth_data, etag, deleted FROM account_e2e_room_keys_versions WHERE user_id = $1 AND version = $2"
|
||||||
|
|
||||||
const selectLatestVersionSQL = "" +
|
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 {
|
type keyBackupVersionStatements struct {
|
||||||
insertKeyBackupStmt *sql.Stmt
|
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"
|
"SELECT algorithm, auth_data, etag, deleted FROM account_e2e_room_keys_versions WHERE user_id = $1 AND version = $2"
|
||||||
|
|
||||||
const selectLatestVersionSQL = "" +
|
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 {
|
type keyBackupVersionStatements struct {
|
||||||
insertKeyBackupStmt *sql.Stmt
|
insertKeyBackupStmt *sql.Stmt
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue