Fix _delete_old_forward_extrem_cache query

This commit is contained in:
Erik Johnston 2016-09-21 15:20:56 +01:00
parent 6f0c5e5d9b
commit 0b78d8adf2
1 changed files with 4 additions and 5 deletions

View File

@ -398,12 +398,11 @@ class EventFederationStore(SQLBaseStore):
sql = (""" sql = ("""
DELETE FROM stream_ordering_to_exterm DELETE FROM stream_ordering_to_exterm
WHERE WHERE
( room_id IN (
SELECT max(stream_ordering) AS stream_ordering SELECT room_id AS stream_ordering
FROM stream_ordering_to_exterm FROM stream_ordering_to_exterm
WHERE room_id = stream_ordering_to_exterm.room_id WHERE stream_ordering > ?
) > ? ) AND stream_ordering < ?
AND stream_ordering < ?
""") """)
txn.execute( txn.execute(
sql, sql,