More join conditions

This commit is contained in:
Erik Johnston 2015-04-30 18:41:05 +01:00
parent 6ead27ddda
commit 61d05daab1
1 changed files with 6 additions and 2 deletions

View File

@ -155,6 +155,8 @@ class RoomMemberStore(SQLBaseStore):
" FROM room_memberships as m"
" INNER JOIN current_state_events as c"
" ON m.event_id = c.event_id "
" AND m.room_id = c.room_id "
" AND m.user_id = c.state_key"
" WHERE %s"
) % (where_clause,)
@ -212,7 +214,9 @@ class RoomMemberStore(SQLBaseStore):
sql = (
"SELECT m.* FROM room_memberships as m"
" INNER JOIN current_state_events as c"
" ON m.event_id = c.event_id AND m.room_id = c.room_id "
" ON m.event_id = c.event_id "
" AND m.room_id = c.room_id "
" AND m.user_id = c.state_key"
" WHERE %(where)s"
) % {
"where": where_clause,