You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2018/10/18 16:01:09 UTC
[couchdb] branch avoid-hard-crash-on-mango-reduce updated (fcfdc04
-> f1f12a1)
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a change to branch avoid-hard-crash-on-mango-reduce
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
discard fcfdc04 Avoid crashing if a mango query is reduced
new f1f12a1 Avoid crashing if a mango query is reduced
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (fcfdc04)
\
N -- N -- N refs/heads/avoid-hard-crash-on-mango-reduce (f1f12a1)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
[couchdb] 01/01: Avoid crashing if a mango query is reduced
Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch avoid-hard-crash-on-mango-reduce
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f1f12a11e2f3e5d31294a5cd311b649d4c5364a2
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Thu Oct 18 11:43:42 2018 -0400
Avoid crashing if a mango query is reduced
Previously returning null from mango native proc lead to case clause error in
couch_query_servers. Instead return a proper shape but with null results for
each reduction.
---
src/mango/src/mango_native_proc.erl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mango/src/mango_native_proc.erl b/src/mango/src/mango_native_proc.erl
index 6150e1d..d6b50a4 100644
--- a/src/mango/src/mango_native_proc.erl
+++ b/src/mango/src/mango_native_proc.erl
@@ -89,8 +89,8 @@ handle_call({prompt, [<<"add_fun">>, IndexInfo]}, _From, St) ->
handle_call({prompt, [<<"map_doc">>, Doc]}, _From, St) ->
{reply, map_doc(St, mango_json:to_binary(Doc)), St};
-handle_call({prompt, [<<"reduce">>, _, _]}, _From, St) ->
- {reply, null, St};
+handle_call({prompt, [<<"reduce">>, RedSrcs, _]}, _From, St) ->
+ {reply, [true, [null || _ <- RedSrcs]], St};
handle_call({prompt, [<<"rereduce">>, _, _]}, _From, St) ->
{reply, null, St};