diff options
author | Erik Johnston <erik@matrix.org> | 2017-06-09 13:01:23 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-06-09 13:01:23 +0100 |
commit | 935e588799cac738d808faa8024bcba5fd5c6c06 (patch) | |
tree | 4aa8a0045d1f080aab88c7509ee9131998f6cd3f /synapse/storage | |
parent | Fix replication (diff) | |
download | synapse-935e588799cac738d808faa8024bcba5fd5c6c06.tar.xz |
Tweak SQL
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/roommember.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index 447c6364e7..e38bbd22a3 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -507,9 +507,12 @@ class RoomMemberStore(SQLBaseStore): raise Exception("Invalid host name") sql = """ - SELECT state_key FROM current_state_events - INNER JOIN room_memberships USING (room_id, event_id) - WHERE membership = 'join' AND room_id = ? AND state_key LIKE ? + SELECT state_key FROM current_state_events AS c + INNER JOIN room_memberships USING (event_id) + WHERE membership = 'join' + AND type = 'm.room.member' + AND c.room_id = ? + AND state_key LIKE ? LIMIT 1 """ |