summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-08-27 17:15:58 +0100
committerMark Haines <mark.haines@matrix.org>2014-08-27 17:15:58 +0100
commit2aeaa7b77c0c39f12c89b0054049970faad28406 (patch)
treef3022ab73ea75827dfec17de532fb07b0949196f /synapse/storage/stream.py
parentReturn the store_id from persist_event (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-2aeaa7b77c0c39f12c89b0054049970faad28406.tar.xz
Merge branch 'develop' into storage_transactions
Conflicts:
	synapse/handlers/room.py
	synapse/storage/stream.py
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index ac887e2957..4f42afc015 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -174,7 +174,7 @@ class StreamStore(SQLBaseStore):
             "SELECT * FROM events as e WHERE "
             "((room_id IN (%(current)s)) OR "
             "(event_id IN (%(invites)s))) "
-            "AND e.stream_ordering > ? AND e.stream_ordering < ? "
+            "AND e.stream_ordering > ? AND e.stream_ordering <= ? "
             "AND e.outlier = 0 "
             "ORDER BY stream_ordering ASC LIMIT %(limit)d "
         ) % {
@@ -296,5 +296,5 @@ class StreamStore(SQLBaseStore):
         if not res or not res[0] or not res[0]["m"]:
             return "s1"
 
-        key = res[0]["m"] + 1
+        key = res[0]["m"]
         return "s%d" % (key,)