summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-12 14:56:20 +0000
committerErik Johnston <erik@matrix.org>2015-02-12 14:56:20 +0000
commita268c317374b4ce64fca2e4df54de7431da47a2d (patch)
tree64f05ff96a9a1bb60374ea803d921f5256903e51 /synapse/storage
parentMerge branch 'release-v0.7.0' of github.com:matrix-org/synapse (diff)
parentBump version (diff)
downloadsynapse-a268c317374b4ce64fca2e4df54de7431da47a2d.tar.xz
Merge pull request #69 from matrix-org/hotfixes-v0.7.0a v0.7.0a
Hotfixes v0.7.0a
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/event_federation.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 0cbcdd1b55..3fbc090224 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -55,17 +55,16 @@ class EventFederationStore(SQLBaseStore):
         results = set()
 
         base_sql = (
-            "SELECT auth_id FROM event_auth WHERE %s"
+            "SELECT auth_id FROM event_auth WHERE event_id = ?"
         )
 
         front = set(event_ids)
         while front:
-            sql = base_sql % (
-                " OR ".join(["event_id=?"] * len(front)),
-            )
-
-            txn.execute(sql, list(front))
-            front = [r[0] for r in txn.fetchall()]
+            new_front = set()
+            for f in front:
+                txn.execute(base_sql, (f,))
+                new_front.update([r[0] for r in txn.fetchall()])
+            front = new_front
             results.update(front)
 
         return list(results)