mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Update selectStateInRange to not return irrelevant events
This commit is contained in:
parent
4a0461378a
commit
e50273cfe6
|
|
@ -106,7 +106,7 @@ const updateEventJSONSQL = "" +
|
||||||
const selectStateInRangeSQL = "" +
|
const selectStateInRangeSQL = "" +
|
||||||
"SELECT id, headered_event_json, exclude_from_sync, add_state_ids, remove_state_ids" +
|
"SELECT id, headered_event_json, exclude_from_sync, add_state_ids, remove_state_ids" +
|
||||||
" FROM syncapi_output_room_events" +
|
" FROM syncapi_output_room_events" +
|
||||||
" WHERE (id > $1 AND id <= $2) AND (add_state_ids IS NOT NULL OR remove_state_ids IS NOT NULL)" +
|
" WHERE (id > $1 AND id <= $2) AND (cardinality (add_state_ids) > 0 OR cardinality (remove_state_ids) > 0)" +
|
||||||
" AND ( $3::text[] IS NULL OR sender = ANY($3) )" +
|
" AND ( $3::text[] IS NULL OR sender = ANY($3) )" +
|
||||||
" AND ( $4::text[] IS NULL OR NOT(sender = ANY($4)) )" +
|
" AND ( $4::text[] IS NULL OR NOT(sender = ANY($4)) )" +
|
||||||
" AND ( $5::text[] IS NULL OR type LIKE ANY($5) )" +
|
" AND ( $5::text[] IS NULL OR type LIKE ANY($5) )" +
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue