diff options
author | Richard van der Hoff <richard@matrix.org> | 2015-12-17 12:47:26 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2015-12-17 12:50:46 +0000 |
commit | a64f9bbfe0fc592043a3da8979b7f2545187dbb6 (patch) | |
tree | f157a395605381da7d931fd89de9d350d13ca2e7 | |
parent | Fix typo (diff) | |
download | synapse-a64f9bbfe0fc592043a3da8979b7f2545187dbb6.tar.xz |
Fix 500 error when back-paginating search results
We were mistakenly adding pagination clauses to the count query, which then failed because the count query doesn't join to the events table.
-rw-r--r-- | synapse/storage/search.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py index 57c9cc1c5f..6cb5e73b6e 100644 --- a/synapse/storage/search.py +++ b/synapse/storage/search.py @@ -286,8 +286,10 @@ class SearchStore(BackgroundUpdateStore): "(%s)" % (" OR ".join(local_clauses),) ) - count_args = args - count_clauses = clauses + # take copies of the current args and clauses lists, before adding + # pagination clauses to main query. + count_args = list(args) + count_clauses = list(clauses) if pagination_token: try: |