mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-25 14:16:51 -05:00
Correctly order when selecting before stream ordering
This commit is contained in:
parent
8363588237
commit
066b9f52b8
@ -580,9 +580,12 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
|
||||
" FROM events"
|
||||
" WHERE room_id = ? AND stream_ordering %s ?"
|
||||
" AND NOT outlier"
|
||||
" ORDER BY stream_ordering"
|
||||
" ORDER BY stream_ordering %s"
|
||||
" LIMIT 1"
|
||||
) % ("<=" if dir == "b" else ">=",)
|
||||
) % (
|
||||
"<=" if dir == "b" else ">=",
|
||||
"DESC" if dir == "b" else "ASC",
|
||||
)
|
||||
txn.execute(sql, (room_id, stream_ordering))
|
||||
return txn.fetchone()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user