From 30bd2bf106415caadcfdbdd1b234ef2b106cc394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20So=C5=9Bnierz?= Date: Tue, 18 Oct 2022 10:39:47 +0200 Subject: [PATCH] Use USING when joining erased_users --- synapse/storage/databases/main/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/storage/databases/main/__init__.py b/synapse/storage/databases/main/__init__.py index e6d35e0708ac..5b9e3eba6861 100644 --- a/synapse/storage/databases/main/__init__.py +++ b/synapse/storage/databases/main/__init__.py @@ -261,7 +261,7 @@ def get_users_paginate_txn( sql_base = f""" FROM users as u LEFT JOIN profiles AS p ON u.name = '@' || p.user_id || ':' || ? - LEFT JOIN erased_users AS eu ON u.name = eu.user_id + LEFT JOIN erased_users AS eu USING(user_id) {where_clause} """ sql = "SELECT COUNT(*) as total_users " + sql_base