From 39681004a9c3a44a72fca545668aa7fefda42330 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Mon, 11 Apr 2022 14:07:40 +0200 Subject: [PATCH] Fix query params --- userapi/storage/sqlite3/stats_table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userapi/storage/sqlite3/stats_table.go b/userapi/storage/sqlite3/stats_table.go index 9298d1150..653fc1332 100644 --- a/userapi/storage/sqlite3/stats_table.go +++ b/userapi/storage/sqlite3/stats_table.go @@ -246,8 +246,8 @@ func (s *statsStatements) registeredUserByType(ctx context.Context, txn *sql.Tx) params := make([]interface{}, len(nonGuests)*2+2) // nonGuests is used twice for i, v := range nonGuests { - params[i] = v // i: 0 1 2 => ($1, $2, $3) - params[i+2] = v // i: 3 4 5 => ($5, $6, $7) + params[i] = v // i: 0 1 2 => ($1, $2, $3) + params[i+1+len(nonGuests)] = v // i: 4 5 6 => ($5, $6, $7) } params[3] = api.AccountTypeGuest // $4 params[7] = gomatrixserverlib.AsTimestamp(registeredAfter) // $8