summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-04-21 17:37:42 +0100
committerErik Johnston <erik@matrix.org>2016-04-21 17:37:42 +0100
commit3b0fa77f5050bb54dccc5140a76b171d6603f2e7 (patch)
tree894b5af6603b1cb8316383291c9b336a7e22ff97 /synapse
parentCreate index must be on a conn (diff)
downloadsynapse-3b0fa77f5050bb54dccc5140a76b171d6603f2e7.tar.xz
Fix SQL statement
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/search.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index 05641fb579..f7730f5d7c 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -164,10 +164,10 @@ class SearchStore(BackgroundUpdateStore):
 
         def reindex_search_txn(txn):
             sql = (
-                "SELECT stream_ordering, origin_server_ts, event_id FROM events"
+                "SELECT e.stream_ordering, e.origin_server_ts, event_id FROM events as e"
                 " INNER JOIN event_search USING (room_id, event_id)"
-                " WHERE ? <= stream_ordering AND stream_ordering < ?"
-                " ORDER BY stream_ordering DESC"
+                " WHERE ? <= e.stream_ordering AND e.stream_ordering < ?"
+                " ORDER BY e.stream_ordering DESC"
                 " LIMIT ?"
             )