Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit f10caa7

Browse files
author
David Robertson
committed
Disambiguate get_ex_outlier_stream_rows query
A backwards-compatible piece of #14979 that's safe to land now.
1 parent 9cd7610 commit f10caa7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

synapse/storage/databases/main/events_worker.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ def get_ex_outlier_stream_rows_txn(
17791779
txn: LoggingTransaction,
17801780
) -> List[Tuple[int, str, str, str, str, str, str, str, bool, bool]]:
17811781
sql = (
1782-
"SELECT event_stream_ordering, e.event_id, e.room_id, e.type,"
1782+
"SELECT out.event_stream_ordering, e.event_id, e.room_id, e.type,"
17831783
" se.state_key, redacts, relates_to_id, membership, rejections.reason IS NOT NULL,"
17841784
" e.outlier"
17851785
" FROM events AS e"
@@ -1791,10 +1791,10 @@ def get_ex_outlier_stream_rows_txn(
17911791
" LEFT JOIN event_relations USING (event_id)"
17921792
" LEFT JOIN room_memberships USING (event_id)"
17931793
" LEFT JOIN rejections USING (event_id)"
1794-
" WHERE ? < event_stream_ordering"
1795-
" AND event_stream_ordering <= ?"
1794+
" WHERE ? < out.event_stream_ordering"
1795+
" AND out.event_stream_ordering <= ?"
17961796
" AND out.instance_name = ?"
1797-
" ORDER BY event_stream_ordering ASC"
1797+
" ORDER BY out.event_stream_ordering ASC"
17981798
)
17991799

18001800
txn.execute(sql, (last_id, current_id, instance_name))

0 commit comments

Comments
 (0)