summary refs log tree commit diff
path: root/synapse/storage/room.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--synapse/storage/room.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index 8f44b67d8c..22f2dcca45 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -87,19 +87,26 @@ class RoomStore(SQLBaseStore):
         """
 
         topic_subquery = (
-            "SELECT topics.event_id as event_id, topics.room_id as room_id, topic FROM topics "
+            "SELECT topics.event_id as event_id, "
+            "topics.room_id as room_id, topic "
+            "FROM topics "
             "INNER JOIN current_state_events as c "
             "ON c.event_id = topics.event_id "
         )
 
         name_subquery = (
-            "SELECT room_names.event_id as event_id, room_names.room_id as room_id, name FROM room_names "
+            "SELECT room_names.event_id as event_id, "
+            "room_names.room_id as room_id, name "
+            "FROM room_names "
             "INNER JOIN current_state_events as c "
             "ON c.event_id = room_names.event_id "
         )
 
+        # We use non printing ascii character US () as a seperator
         sql = (
-            "SELECT r.room_id, n.name, t.topic, group_concat(a.room_alias) FROM rooms AS r "
+            "SELECT r.room_id, n.name, t.topic, "
+            "group_concat(a.room_alias, '') "
+            "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 "
             "INNER JOIN room_aliases AS a ON a.room_id = r.room_id "
@@ -117,7 +124,7 @@ class RoomStore(SQLBaseStore):
                 "room_id": r[0],
                 "name": r[1],
                 "topic": r[2],
-                "aliases": r[3].split(","),
+                "aliases": r[3].split(""),
             }
             for r in rows
         ]