mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Fix boundary queries
This commit is contained in:
parent
cdf8126254
commit
0f849288e4
|
|
@ -47,13 +47,13 @@ func UpStateBlocksRefactor(tx *sql.Tx) error {
|
||||||
var snapshotcount int
|
var snapshotcount int
|
||||||
var maxsnapshotid int
|
var maxsnapshotid int
|
||||||
var maxblockid int
|
var maxblockid int
|
||||||
if err := tx.QueryRow(`SELECT COUNT(DISTINCT state_snapshot_nid) FROM _roomserver_state_snapshots;`).Scan(&snapshotcount); err != nil {
|
if err := tx.QueryRow(`SELECT COUNT(DISTINCT state_snapshot_nid) FROM roomserver_state_snapshots;`).Scan(&snapshotcount); err != nil {
|
||||||
return fmt.Errorf("tx.QueryRow.Scan (count snapshots): %w", err)
|
return fmt.Errorf("tx.QueryRow.Scan (count snapshots): %w", err)
|
||||||
}
|
}
|
||||||
if err := tx.QueryRow(`SELECT MAX(state_snapshot_nid) FROM _roomserver_state_snapshots;`).Scan(&maxsnapshotid); err != nil {
|
if err := tx.QueryRow(`SELECT MAX(state_snapshot_nid) FROM roomserver_state_snapshots;`).Scan(&maxsnapshotid); err != nil {
|
||||||
return fmt.Errorf("tx.QueryRow.Scan (count snapshots): %w", err)
|
return fmt.Errorf("tx.QueryRow.Scan (count snapshots): %w", err)
|
||||||
}
|
}
|
||||||
if err := tx.QueryRow(`SELECT MAX(state_block_nid) FROM _roomserver_state_block;`).Scan(&maxblockid); err != nil {
|
if err := tx.QueryRow(`SELECT MAX(state_block_nid) FROM roomserver_state_block;`).Scan(&maxblockid); err != nil {
|
||||||
return fmt.Errorf("tx.QueryRow.Scan (count snapshots): %w", err)
|
return fmt.Errorf("tx.QueryRow.Scan (count snapshots): %w", err)
|
||||||
}
|
}
|
||||||
maxsnapshotid++
|
maxsnapshotid++
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue