mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-21 12:14:29 +03:00
fix sqlite where clause
This commit is contained in:
parent
8713365265
commit
97c0496cfa
1 changed files with 3 additions and 2 deletions
|
@ -277,13 +277,14 @@ class StateGroupWorkerStore(SQLBaseStore):
|
||||||
results[group][key] = event_id
|
results[group][key] = event_id
|
||||||
else:
|
else:
|
||||||
if types is not None:
|
if types is not None:
|
||||||
where_clause = "AND (%s)" % (
|
where_clause = "AND (%s" % (
|
||||||
" OR ".join(["(type = ? AND state_key = ?)"] * len(types)),
|
" OR ".join(["(type = ? AND state_key = ?)"] * len(types)),
|
||||||
)
|
)
|
||||||
if include_other_types:
|
if include_other_types:
|
||||||
where_clause += " AND (%s)" % (
|
where_clause += " OR (%s)" % (
|
||||||
" AND ".join(["type <> ?"] * len(types)),
|
" AND ".join(["type <> ?"] * len(types)),
|
||||||
)
|
)
|
||||||
|
where_clause += ")"
|
||||||
else:
|
else:
|
||||||
where_clause = ""
|
where_clause = ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue