0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-16 15:01:23 +01:00

fix SQL when searching all users

This commit is contained in:
Matthew Hodgson 2018-01-17 15:58:52 +00:00
parent a7e4ff9cca
commit 2d9ab533f9

View file

@ -641,8 +641,13 @@ class UserDirectoryStore(SQLBaseStore):
"""
if self.hs.config.user_directory_search_all_users:
join_clause = ""
where_clause = "?<>''" # naughty hack to keep the same number of binds
# dummy to keep the number of binds & aliases the same
join_clause = """
LEFT JOIN (
SELECT NULL as user_id WHERE NULL = ?
) AS s USING (user_id)"
"""
where_clause = ""
else:
join_clause = """
LEFT JOIN users_in_public_rooms AS p USING (user_id)