summary refs log tree commit diff
path: root/synapse/storage/room.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r--synapse/storage/room.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index be3e28c2ea..a1a76280fe 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -72,6 +72,7 @@ class RoomStore(SQLBaseStore):
             keyvalues={"room_id": room_id},
             retcols=RoomsTable.fields,
             desc="get_room",
+            allow_none=True,
         )
 
     @defer.inlineCallbacks
@@ -102,10 +103,10 @@ class RoomStore(SQLBaseStore):
                 "ON c.event_id = room_names.event_id "
             )
 
-            # We use non printing ascii character US () as a seperator
+            # We use non printing ascii character US (\x1F) as a separator
             sql = (
                 "SELECT r.room_id, n.name, t.topic, "
-                "group_concat(a.room_alias, '') "
+                "group_concat(a.room_alias, '\x1F') "
                 "FROM rooms AS r "
                 "LEFT JOIN (%(topic)s) AS t ON t.room_id = r.room_id "
                 "LEFT JOIN (%(name)s) AS n ON n.room_id = r.room_id "
@@ -117,9 +118,9 @@ class RoomStore(SQLBaseStore):
                 "name": name_subquery,
             }
 
-            c = txn.execute(sql, (is_public,))
+            txn.execute(sql, (is_public,))
 
-            return c.fetchall()
+            return txn.fetchall()
 
         rows = yield self.runInteraction(
             "get_rooms", f
@@ -130,7 +131,7 @@ class RoomStore(SQLBaseStore):
                 "room_id": r[0],
                 "name": r[1],
                 "topic": r[2],
-                "aliases": r[3].split(""),
+                "aliases": r[3].split("\x1F"),
             }
             for r in rows
         ]