diff options
author | Erik Johnston <erik@matrix.org> | 2019-10-29 12:41:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-29 12:41:11 +0100 |
commit | 1652c8c1fc821dc1d53816c8295e225ddbc0aaf4 (patch) | |
tree | 7517544b0e5e407bee834158abc688cb8506779a /synapse/storage | |
parent | 1.5.0rc2 (diff) | |
parent | Add comment as to why we're pinning black in tests (diff) | |
download | synapse-1652c8c1fc821dc1d53816c8295e225ddbc0aaf4.tar.xz |
Merge pull request #6268 from matrix-org/erikj/case_insensitive_room_dir
Make room directory search case insensitive
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/data_stores/main/room.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/storage/data_stores/main/room.py b/synapse/storage/data_stores/main/room.py index 4428e5c55d..67bb1b6f60 100644 --- a/synapse/storage/data_stores/main/room.py +++ b/synapse/storage/data_stores/main/room.py @@ -201,13 +201,17 @@ class RoomWorkerStore(SQLBaseStore): where_clauses.append( """ ( - name LIKE ? - OR topic LIKE ? - OR canonical_alias LIKE ? + LOWER(name) LIKE ? + OR LOWER(topic) LIKE ? + OR LOWER(canonical_alias) LIKE ? ) """ ) - query_args += [search_term, search_term, search_term] + query_args += [ + search_term.lower(), + search_term.lower(), + search_term.lower(), + ] where_clause = "" if where_clauses: |