mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-20 03:11:35 -05:00
Merge pull request #2803 from matrix-org/matthew/fix-userdir-sql
fix SQL when searching all users
This commit is contained in:
commit
06db5c4b76
@ -641,8 +641,13 @@ class UserDirectoryStore(SQLBaseStore):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if self.hs.config.user_directory_search_all_users:
|
if self.hs.config.user_directory_search_all_users:
|
||||||
join_clause = ""
|
# dummy to keep the number of binds & aliases the same
|
||||||
where_clause = "?<>''" # naughty hack to keep the same number of binds
|
join_clause = """
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT NULL as user_id WHERE NULL = ?
|
||||||
|
) AS s USING (user_id)"
|
||||||
|
"""
|
||||||
|
where_clause = ""
|
||||||
else:
|
else:
|
||||||
join_clause = """
|
join_clause = """
|
||||||
LEFT JOIN users_in_public_rooms AS p USING (user_id)
|
LEFT JOIN users_in_public_rooms AS p USING (user_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user