1
0

split out 3792 back whence it came

This commit is contained in:
Matthew Hodgson
2018-09-10 17:18:11 +01:00
parent 1e73d6c00d
commit 47a3d7ca24
2 changed files with 6 additions and 6 deletions

View File

@@ -1 +0,0 @@
Fix get_filtered_current_state_ids()s usage of filtered_type

View File

@@ -175,7 +175,6 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore):
# Turns out that postgres doesn't like doing a list of OR's and
# is about 1000x slower, so we just issue a query for each specific
# type seperately.
additional_args = ()
if types:
clause_to_args = [
(
@@ -190,17 +189,19 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore):
if include_other_types:
unique_types = set(filtered_types)
sql += " AND type <> ? " * len(unique_types)
additional_args = list(unique_types)
clause_to_args.append(
(
"AND type <> ? " * len(unique_types),
list(unique_types)
)
)
else:
# If types is None we fetch all the state, and so just use an
# empty where clause with no extra args.
clause_to_args = [("", [])]
for where_clause, where_args in clause_to_args:
args = [room_id]
args.extend(where_args)
args.extend(additional_args)
txn.execute(sql % (where_clause,), args)
for row in txn:
typ, state_key, event_id = row