summary refs log tree commit diff
path: root/synapse/storage/state.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-03-13 22:31:41 +0000
committerMatthew Hodgson <matthew@matrix.org>2018-03-13 22:31:41 +0000
commitccca02846d07124f537b0c475308f9a26bfb3fb1 (patch)
treedea636e5eb99b5cbce0f38da99742eca2694bb31 /synapse/storage/state.py
parentremove comment now #2969 is fixed (diff)
downloadsynapse-ccca02846d07124f537b0c475308f9a26bfb3fb1.tar.xz
make it work
Diffstat (limited to '')
-rw-r--r--synapse/storage/state.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index 4291cde7ab..9c9994c073 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -257,10 +257,11 @@ class StateGroupWorkerStore(SQLBaseStore):
                 if include_other_types:
                     # XXX: check whether this slows postgres down like a list of
                     # ORs does too?
+                    unique_types = set([ t for (t, _) in types ])
                     clause_to_args.append(
                         (
-                            "AND type <> ? " * len(types),
-                            [t for (t, _) in types]
+                            "AND type <> ? " * len(unique_types),
+                            list(unique_types)
                         )
                     )
             else:
@@ -293,10 +294,11 @@ class StateGroupWorkerStore(SQLBaseStore):
                         where_args.extend([typ[0], typ[1]])
 
                 if include_other_types:
+                    unique_types = set([ t for (t, _) in types ])                    
                     where_clauses.append(
-                        "(" + " AND ".join(["type <> ?"] * len(types)) + ")"
+                        "(" + " AND ".join(["type <> ?"] * len(unique_types)) + ")"
                     )
-                    where_args.extend(t for (t, _) in types)
+                    where_args.extend(list(unique_types))
 
                 where_clause = "AND (%s)" % (" OR ".join(where_clauses))
             else: