mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 13:54:47 -04:00
Workaround for non-uniqueness of room member events in the database confusing HAVING COUNT() test of room membership intersection (with thanks to Tom Molesworth)
This commit is contained in:
parent
274d137b00
commit
10eb8f070c
1 changed files with 3 additions and 1 deletions
|
@ -218,7 +218,9 @@ class RoomMemberStore(SQLBaseStore):
|
||||||
"ON m.event_id = c.event_id "
|
"ON m.event_id = c.event_id "
|
||||||
"WHERE m.membership = 'join' "
|
"WHERE m.membership = 'join' "
|
||||||
"AND (%(clause)s) "
|
"AND (%(clause)s) "
|
||||||
"GROUP BY m.room_id HAVING COUNT(m.room_id) = ?"
|
# TODO(paul): We've got duplicate rows in the database somewhere
|
||||||
|
# so we have to DISTINCT m.user_id here
|
||||||
|
"GROUP BY m.room_id HAVING COUNT(DISTINCT m.user_id) = ?"
|
||||||
) % {"clause": user_list_clause}
|
) % {"clause": user_list_clause}
|
||||||
|
|
||||||
args = list(user_id_list)
|
args = list(user_id_list)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue