mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-23 01:55:53 +03:00
Correctly order when selecting before stream ordering
This commit is contained in:
parent
8363588237
commit
066b9f52b8
1 changed files with 5 additions and 2 deletions
|
@ -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 a new issue