From 4e789ab46a901d73ac70a55b3a2a4b1b055cbbf4 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Wed, 2 Mar 2022 16:31:50 +0100 Subject: [PATCH] Fix queries --- syncapi/storage/postgres/stats.go | 2 +- userapi/storage/postgres/stats_table.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syncapi/storage/postgres/stats.go b/syncapi/storage/postgres/stats.go index 04ebd0a8f..2b5e1a940 100644 --- a/syncapi/storage/postgres/stats.go +++ b/syncapi/storage/postgres/stats.go @@ -85,8 +85,8 @@ func (s *statsStatements) DailyMessages(ctx context.Context, txn *sql.Tx, prevID func (s *statsStatements) DailySentMessages(ctx context.Context, txn *sql.Tx, prevID int64) (result int64, err error) { stmt := sqlutil.TxStmt(txn, s.countTypesStmt) err = stmt.QueryRowContext(ctx, - prevID, "m.room.message", + prevID, fmt.Sprintf("%%:%s", s.serverName), ).Scan(&result) return diff --git a/userapi/storage/postgres/stats_table.go b/userapi/storage/postgres/stats_table.go index 752b22ace..04a285325 100644 --- a/userapi/storage/postgres/stats_table.go +++ b/userapi/storage/postgres/stats_table.go @@ -104,7 +104,7 @@ GROUP BY client_type ` const countUserByAccountTypeSQL = ` -SELECT COUNT(*) FROM account_accounts WHERE account_type IN $1 +SELECT COUNT(*) FROM account_accounts WHERE account_type = $1 ` const countRegisteredUserByTypeStmt = `