summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2021-09-15 22:22:43 +0100
committerRobert Newson <rnewson@apache.org>2021-09-15 22:22:43 +0100
commit4e158bbe136d02c81bad8e928fb9febe1777df17 (patch)
tree777e710b1f79da736c9de93251e521ceee94eeb0
parent064db6ff21fab2baa8254b7eba90c0a2a79b0b88 (diff)
downloadcouchdb-4e158bbe136d02c81bad8e928fb9febe1777df17.tar.gz
Restrict the limit=0 clause to the sorted=false case as originally intended
The limit=0 clause was introduced in commit 4e0c97bf which added sorted=false support. It accidentally matches when the user specifies limit=0 and causes us not to apply the logic that ensures we collect a {meta, Meta} message from each shard range and then send the total_rows and offset fields.
-rw-r--r--src/fabric/src/fabric_view_map.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fabric/src/fabric_view_map.erl b/src/fabric/src/fabric_view_map.erl
index b8d0d392a..ff6aa8b69 100644
--- a/src/fabric/src/fabric_view_map.erl
+++ b/src/fabric/src/fabric_view_map.erl
@@ -146,7 +146,7 @@ handle_message({meta, Meta0}, {Worker, From}, State) ->
}}
end;
-handle_message(#view_row{}, {_, _}, #collector{limit=0} = State) ->
+handle_message(#view_row{}, {_, _}, #collector{sorted=false, limit=0} = State) ->
#collector{callback=Callback} = State,
{_, Acc} = Callback(complete, State#collector.user_acc),
{stop, State#collector{user_acc=Acc}};