summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2014-11-20 18:17:46 +0000
committerDavid Baker <dbkr@matrix.org>2014-11-20 18:17:46 +0000
commit23465a30b65808a75afa5cb98bcd1131a2a2c984 (patch)
treedcd987034fefbb2649da8346bf36c9d9ded25acc /synapse/storage/stream.py
parentMerge branch 'http_client_refactor' into pushers (diff)
parentFix pep8 codestyle warnings (diff)
downloadsynapse-23465a30b65808a75afa5cb98bcd1131a2a2c984.tar.xz
Merge branch 'develop' into pushers
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index a954024678..b84735e61c 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -213,8 +213,8 @@ class StreamStore(SQLBaseStore):
         # Tokens really represent positions between elements, but we use
         # the convention of pointing to the event before the gap. Hence
         # we have a bit of asymmetry when it comes to equalities.
-        from_comp = '<=' if direction =='b' else '>'
-        to_comp = '>' if direction =='b' else '<='
+        from_comp = '<=' if direction == 'b' else '>'
+        to_comp = '>' if direction == 'b' else '<='
         order = "DESC" if direction == 'b' else "ASC"
 
         args = [room_id]
@@ -235,9 +235,10 @@ class StreamStore(SQLBaseStore):
         )
 
         sql = (
-            "SELECT *, (%(redacted)s) AS redacted FROM events "
-            "WHERE outlier = 0 AND room_id = ? AND %(bounds)s "
-            "ORDER BY topological_ordering %(order)s, stream_ordering %(order)s %(limit)s "
+            "SELECT *, (%(redacted)s) AS redacted FROM events"
+            " WHERE outlier = 0 AND room_id = ? AND %(bounds)s"
+            " ORDER BY topological_ordering %(order)s,"
+            " stream_ordering %(order)s %(limit)s"
         ) % {
             "redacted": del_sql,
             "bounds": bounds,