From e20f18a76680bc16fd8299a61dd81dc07f1a3ffd Mon Sep 17 00:00:00 2001
From: Jason Robinson <jasonr@matrix.org>
Date: Tue, 26 Jan 2021 10:13:35 +0200
Subject: [PATCH] Make natural join inner join

Co-authored-by: Erik Johnston <erik@matrix.org>
---
 synapse/storage/databases/main/events_forward_extremities.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/synapse/storage/databases/main/events_forward_extremities.py b/synapse/storage/databases/main/events_forward_extremities.py
index 84aaa919fb..68b64838bb 100644
--- a/synapse/storage/databases/main/events_forward_extremities.py
+++ b/synapse/storage/databases/main/events_forward_extremities.py
@@ -88,8 +88,8 @@ class EventForwardExtremitiesStore(SQLBaseStore):
             sql = """
                 SELECT event_id, state_group, depth, received_ts
                 FROM event_forward_extremities
-                NATURAL JOIN event_to_state_groups
-                NATURAL JOIN events
+                INNER JOIN event_to_state_groups USING (event_id)
+                INNER JOIN events INNER JOIN USING (event_id)
                 WHERE room_id = ?
             """
 
-- 
GitLab