From 7afd63cdfcd87c602ee43a3b239255cd067d986c Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 4 Sep 2018 23:14:33 +0100 Subject: [PATCH] this will never have worked due to the query being split up into separate queries. --- synapse/storage/state.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/synapse/storage/state.py b/synapse/storage/state.py index 4b971efdba..bca0630970 100644 --- a/synapse/storage/state.py +++ b/synapse/storage/state.py @@ -189,12 +189,8 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore): if include_other_types: unique_types = set(filtered_types) - clause_to_args.append( - ( - "AND type <> ? " * len(unique_types), - list(unique_types) - ) - ) + sql += " AND type <> ? " * len(unique_types) + additional_args = 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. @@ -202,6 +198,7 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore): 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