summary refs log tree commit diff
diff options
context:
space:
mode:
authorLuke Barnard <luke@matrix.org>2017-11-06 16:16:24 +0000
committerLuke Barnard <luke@matrix.org>2017-11-06 16:16:24 +0000
commitb8da5d07908d49e5402e016e2ad7433e69912c43 (patch)
tree6cd72cc934d45052271582702dbeffe0dbaaf823
parentWIP: Return admins of a group first in the list of group users (diff)
downloadsynapse-b8da5d07908d49e5402e016e2ad7433e69912c43.tar.xz
Use static column name insertion
Otherwise we end up trying to ORDER BY "is_admin", the literal string.
-rw-r--r--synapse/storage/_base.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py

index 35ded73f25..73a66e28b0 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py
@@ -670,8 +670,9 @@ class SQLBaseStore(object): ) if order: - sql = sql + " ORDER BY ? %s" % ("ASC" if order_asc else "DESC") - query_values.append(order) + sql = sql + " ORDER BY %s %s" % ( + order, "ASC" if order_asc else "DESC" + ) txn.execute(sql, query_values)