diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-25 15:51:21 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-25 15:51:21 +0100 |
commit | c818aa13eb47c9d30da26645850a2af2672edf68 (patch) | |
tree | 891724e680cb6343de4a4d948ca5795d122cf842 /synapse/storage/stream.py | |
parent | More tests. (diff) | |
download | synapse-c818aa13eb47c9d30da26645850a2af2672edf68.tar.xz |
Add LIMIT to scalar subquery
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r-- | synapse/storage/stream.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py index 91baa18319..d61f909939 100644 --- a/synapse/storage/stream.py +++ b/synapse/storage/stream.py @@ -158,7 +158,8 @@ class StreamStore(SQLBaseStore): ) del_sql = ( - "SELECT event_id FROM redactions WHERE redacts = e.event_id" + "SELECT event_id FROM redactions WHERE redacts = e.event_id " + "LIMIT 1" ) if limit: @@ -230,7 +231,8 @@ class StreamStore(SQLBaseStore): limit_str = "" del_sql = ( - "SELECT event_id FROM redactions WHERE redacts = events.event_id" + "SELECT event_id FROM redactions WHERE redacts = events.event_id " + "LIMIT 1" ) sql = ( @@ -272,7 +274,8 @@ class StreamStore(SQLBaseStore): # TODO (erikj): Handle compressed feedback del_sql = ( - "SELECT event_id FROM redactions WHERE redacts = events.event_id" + "SELECT event_id FROM redactions WHERE redacts = events.event_id " + "LIMIT 1" ) sql = ( |