Skip to content

Commit

Permalink
fix sql syntax for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Jan 30, 2025
1 parent 4e8dbd6 commit bc8f329
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -1621,10 +1621,14 @@ def _set_room_participation_txn(
sql = """
UPDATE room_memberships
SET participant = True
WHERE user_id = ?
AND room_id = ?
ORDER BY event_stream_ordering DESC
LIMIT 1
WHERE (user_id, room_id) IN (
SELECT user_id, room_id
FROM room_memberships
WHERE user_id = ?
AND room_id = ?
ORDER BY event_stream_ordering DESC
LIMIT 1
)
"""
txn.execute(sql, (user_id, room_id))

Expand Down

0 comments on commit bc8f329

Please sign in to comment.