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 2014/04/25 02:38:45 UTC

chttpd commit: updated refs/heads/1993-bigcouch-couch-mrview to 793da96

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/1993-bigcouch-couch-mrview 93c771d6f -> 793da9600


Build query args from the provided ddoc, not by fetching the view

We can't assume the database shard containing the view will exist on
the local node, so rather than trying to fetch it directly, build up
the query args from the provided ddoc parameter.


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

Branch: refs/heads/1993-bigcouch-couch-mrview
Commit: 793da9600a4b371321772ea3d92d91b14a766d31
Parents: 93c771d
Author: Russell Branca <ch...@gmail.com>
Authored: Thu Apr 24 17:38:32 2014 -0700
Committer: Russell Branca <ch...@gmail.com>
Committed: Thu Apr 24 17:38:32 2014 -0700

----------------------------------------------------------------------
 src/chttpd_view.erl | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/793da960/src/chttpd_view.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_view.erl b/src/chttpd_view.erl
index 471c380..7e5f32f 100644
--- a/src/chttpd_view.erl
+++ b/src/chttpd_view.erl
@@ -18,11 +18,8 @@
 
 multi_query_view(Req, Db, DDoc, ViewName, Queries) ->
     Args0 = couch_mrview_http:parse_params(Req, undefined),
-    DbName = mem3:dbname(Db#db.name),
-    Args1 = couch_util:with_db(DbName, fun(WDb) ->
-        {ok, _, _, Args} = couch_mrview_util:get_view(WDb, DDoc, ViewName, Args0),
-        Args
-    end),
+    {ok, #mrst{views=Views}} = couch_mrview_util:ddoc_to_mrst(Db, DDoc),
+    Args1 = couch_mrview_util:set_view_type(Args0, ViewName, Views),
     ArgQueries = lists:map(fun({Query}) ->
         QueryArg = couch_mrview_http:parse_params(Query, undefined, Args1),
         couch_mrview_util:validate_args(QueryArg)