split out 3792 back whence it came
2 files changed, 6 insertions, 6 deletions
diff --git a/changelog.d/3792.bugfix b/changelog.d/3792.bugfix
deleted file mode 100644
index 26c1945020..0000000000
--- a/changelog.d/3792.bugfix
+++ /dev/null
@@ -1 +0,0 @@
-Fix get_filtered_current_state_ids()s usage of filtered_type
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 9886bd7f56..4b971efdba 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -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
|