Add LIMIT to scalar subquery
This commit is contained in:
parent
24e4c48468
commit
c818aa13eb
|
@ -255,7 +255,8 @@ class DataStore(RoomMemberStore, RoomStore,
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def get_current_state(self, room_id, event_type=None, state_key=""):
|
def get_current_state(self, room_id, event_type=None, state_key=""):
|
||||||
del_sql = (
|
del_sql = (
|
||||||
"SELECT event_id FROM redactions WHERE redacts = e.event_id"
|
"SELECT event_id FROM redactions WHERE redacts = e.event_id "
|
||||||
|
"LIMIT 1"
|
||||||
)
|
)
|
||||||
|
|
||||||
sql = (
|
sql = (
|
||||||
|
|
|
@ -183,7 +183,8 @@ class RoomMemberStore(SQLBaseStore):
|
||||||
|
|
||||||
def _get_members_query_txn(self, txn, where_clause, where_values):
|
def _get_members_query_txn(self, txn, where_clause, where_values):
|
||||||
del_sql = (
|
del_sql = (
|
||||||
"SELECT event_id FROM redactions WHERE redacts = e.event_id"
|
"SELECT event_id FROM redactions WHERE redacts = e.event_id "
|
||||||
|
"LIMIT 1"
|
||||||
)
|
)
|
||||||
|
|
||||||
sql = (
|
sql = (
|
||||||
|
|
|
@ -158,7 +158,8 @@ class StreamStore(SQLBaseStore):
|
||||||
)
|
)
|
||||||
|
|
||||||
del_sql = (
|
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:
|
if limit:
|
||||||
|
@ -230,7 +231,8 @@ class StreamStore(SQLBaseStore):
|
||||||
limit_str = ""
|
limit_str = ""
|
||||||
|
|
||||||
del_sql = (
|
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 = (
|
sql = (
|
||||||
|
@ -272,7 +274,8 @@ class StreamStore(SQLBaseStore):
|
||||||
# TODO (erikj): Handle compressed feedback
|
# TODO (erikj): Handle compressed feedback
|
||||||
|
|
||||||
del_sql = (
|
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 = (
|
sql = (
|
||||||
|
|
Loading…
Reference in New Issue