diff options
author | Erik Johnston <erik@matrix.org> | 2018-05-25 12:05:47 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-05-25 12:05:47 +0100 |
commit | e717693d77f2dca9c9039feeb1b0b8c5f5082a58 (patch) | |
tree | 8b59c349f227354622115ca15b8f6a971bed7f38 | |
parent | Implement background update for chunks (diff) | |
download | synapse-e717693d77f2dca9c9039feeb1b0b8c5f5082a58.tar.xz |
fix insert
-rw-r--r-- | synapse/storage/events.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py index 85d7fd0910..65d5c1a370 100644 --- a/synapse/storage/events.py +++ b/synapse/storage/events.py @@ -1535,9 +1535,11 @@ class EventsStore(EventsWorkerStore): # We now need to update the backwards extremities for the chunks. txn.executemany(""" - INSERT INTO chunk_backwards_extremities (chunk_id, event_id) - SELECT ?, ? WHERE ? NOT IN (SELECT event_id FROM events) - """, [(chunk_id, eid, eid) for eid in prev_event_ids]) + INSERT INTO chunk_backwards_extremities (chunk_id, event_id) + SELECT ?, ? WHERE NOT EXISTS ( + SELECT event_id FROM events WHERE event_id = ? + ) + """, [(chunk_id, eid, eid) for eid in prev_event_ids]) self._simple_delete_txn( txn, |