0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-12 04:52:26 +01:00

fix sqlite where clause

This commit is contained in:
Matthew Hodgson 2018-03-12 00:27:06 +00:00
parent 8713365265
commit 97c0496cfa

View file

@ -277,13 +277,14 @@ class StateGroupWorkerStore(SQLBaseStore):
results[group][key] = event_id
else:
if types is not None:
where_clause = "AND (%s)" % (
where_clause = "AND (%s" % (
" OR ".join(["(type = ? AND state_key = ?)"] * len(types)),
)
if include_other_types:
where_clause += " AND (%s)" % (
where_clause += " OR (%s)" % (
" AND ".join(["type <> ?"] * len(types)),
)
where_clause += ")"
else:
where_clause = ""