Merge branch 'stable-3.4' into stable-3.5

* stable-3.4:
  Reset pageResultSize when PaginationType NONE back-fill results

Release-Notes: skip
Change-Id: I32a22fcbd7c84d07ff96df44975dd4c53259b94e
diff --git a/java/com/google/gerrit/index/query/PaginatingSource.java b/java/com/google/gerrit/index/query/PaginatingSource.java
index 0ce0cc9..84572d7 100644
--- a/java/com/google/gerrit/index/query/PaginatingSource.java
+++ b/java/com/google/gerrit/index/query/PaginatingSource.java
@@ -103,6 +103,7 @@
               int nextStart = pageResultSize;
               while (pageResultSize == limit && r.size() < limit) {
                 ResultSet<T> next = p.restart(nextStart);
+                pageResultSize = 0;
                 for (T data : buffer(next)) {
                   if (match(data)) {
                     r.add(data);