You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2013/12/24 02:22:56 UTC

git commit: updated refs/heads/1843-feature-bigcouch-fix-views to cbdb06f

Updated Branches:
  refs/heads/1843-feature-bigcouch-fix-views [created] cbdb06ffb


Fix ddoc_to_mrst expecting an Erlang term


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/cbdb06ff
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cbdb06ff
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cbdb06ff

Branch: refs/heads/1843-feature-bigcouch-fix-views
Commit: cbdb06ffb6202af8e14ed80bbcb10b7b4eb20e0d
Parents: da8caa1
Author: Russell Branca <ch...@gmail.com>
Authored: Mon Dec 23 17:22:35 2013 -0800
Committer: Russell Branca <ch...@gmail.com>
Committed: Mon Dec 23 17:22:35 2013 -0800

----------------------------------------------------------------------
 src/couch_mrview/src/couch_mrview_util.erl | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/cbdb06ff/src/couch_mrview/src/couch_mrview_util.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview/src/couch_mrview_util.erl b/src/couch_mrview/src/couch_mrview_util.erl
index 27baa4a..acda8ee 100644
--- a/src/couch_mrview/src/couch_mrview_util.erl
+++ b/src/couch_mrview/src/couch_mrview_util.erl
@@ -59,6 +59,8 @@ get_view(Db, DDoc, ViewName, Args0) ->
     {ok, {Type, View, Ref}, Sig, Args3}.
 
 
+ddoc_to_mrst(DbName, #doc{body=Body}=Doc) when is_binary(Body) ->
+    ddoc_to_mrst(DbName, Doc#doc{body=binary_to_term(Body)});
 ddoc_to_mrst(DbName, #doc{id=Id, body={Fields}}) ->
     MakeDict = fun({Name, {MRFuns}}, DictBySrcAcc) ->
         case couch_util:get_value(<<"map">>, MRFuns) of