mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 03:23:54 +01:00
Handle lack of filter
This commit is contained in:
parent
4f519d556e
commit
15a1a02e70
1 changed files with 3 additions and 5 deletions
|
@ -876,11 +876,9 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
|
||||||
# table. We only need to use it when we're filtering on more than two labels,
|
# table. We only need to use it when we're filtering on more than two labels,
|
||||||
# because that's the only scenario in which we can possibly to get multiple times
|
# because that's the only scenario in which we can possibly to get multiple times
|
||||||
# the same event ID in the results.
|
# the same event ID in the results.
|
||||||
if event_filter.labels and len(event_filter.labels) > 1:
|
select_keywords = "SELECT"
|
||||||
select_keywords = "SELECT DISTINCT"
|
if event_filter and event_filter.labels and len(event_filter.labels) > 1:
|
||||||
|
select_keywords += "DISTINCT"
|
||||||
else:
|
|
||||||
select_keywords = "SELECT"
|
|
||||||
|
|
||||||
sql = (
|
sql = (
|
||||||
"%(select_keywords)s event_id, topological_ordering, stream_ordering"
|
"%(select_keywords)s event_id, topological_ordering, stream_ordering"
|
||||||
|
|
Loading…
Reference in a new issue