Disambiguate queries on state_key (#11497)

We're going to add a `state_key` column to the `events` table, so we need to
add some disambiguation to queries which use it.
This commit is contained in:
Richard van der Hoff 2021-12-02 22:42:58 +00:00 committed by GitHub
parent d26808dd85
commit 5640992d17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 16 deletions

View file

@ -1552,9 +1552,9 @@ class EventFederationStore(EventFederationWorkerStore):
DELETE FROM event_auth
WHERE event_id IN (
SELECT event_id FROM events
LEFT JOIN state_events USING (room_id, event_id)
LEFT JOIN state_events AS se USING (room_id, event_id)
WHERE ? <= stream_ordering AND stream_ordering < ?
AND state_key IS null
AND se.state_key IS null
)
"""