You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/02/03 13:59:53 UTC
[14/27] couchdb commit: updated refs/heads/1843-feature-bigcouch to
465d1ad
The default value for keys is undefined, not nil
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/cbbef5c5
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cbbef5c5
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cbbef5c5
Branch: refs/heads/1843-feature-bigcouch
Commit: cbbef5c51c56929bbd09c56ec1b25185b014e7e7
Parents: e879c67
Author: Robert Newson <rn...@apache.org>
Authored: Mon Dec 23 11:35:55 2013 +0000
Committer: Robert Newson <rn...@apache.org>
Committed: Mon Feb 3 12:54:09 2014 +0000
----------------------------------------------------------------------
src/chttpd/src/chttpd_db.erl | 2 +-
src/fabric/src/fabric_rpc.erl | 6 +++---
src/fabric/src/fabric_view.erl | 2 +-
src/fabric/src/fabric_view_all_docs.erl | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cbbef5c5/src/chttpd/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index de38d40..de99828 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -365,7 +365,7 @@ db_req(#httpd{method='GET',path_parts=[_,<<"_all_docs">>]}=Req, Db) ->
Keys when is_list(Keys) ->
all_docs_view(Req, Db, Keys);
nil ->
- all_docs_view(Req, Db, nil);
+ all_docs_view(Req, Db, undefined);
_ ->
throw({bad_request, "`keys` parameter must be an array."})
end;
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cbbef5c5/src/fabric/src/fabric_rpc.erl
----------------------------------------------------------------------
diff --git a/src/fabric/src/fabric_rpc.erl b/src/fabric/src/fabric_rpc.erl
index 2685cd7..9ca4f62 100644
--- a/src/fabric/src/fabric_rpc.erl
+++ b/src/fabric/src/fabric_rpc.erl
@@ -39,7 +39,7 @@
%% rpc endpoints
%% call to with_db will supply your M:F with a #db{} and then remaining args
-all_docs(DbName, #mrargs{keys=nil} = QueryArgs) ->
+all_docs(DbName, #mrargs{keys=undefined} = QueryArgs) ->
{ok, Db} = get_or_create_db(DbName, []),
#mrargs{
start_key = StartKey,
@@ -122,7 +122,7 @@ map_view(DbName, DDoc, ViewName, QueryArgs) ->
reduce_fun = fun couch_view:reduce_to_count/1
},
case Keys of
- nil ->
+ undefined ->
Options = couch_httpd_view:make_key_options(QueryArgs),
{ok, _, Acc} = couch_view:fold(View, fun view_fold/3, Acc0, Options);
_ ->
@@ -163,7 +163,7 @@ reduce_view(DbName, Group0, ViewName, QueryArgs) ->
ReduceView = {reduce, NthRed, Lang, View},
Acc0 = #view_acc{group_level = GroupLevel, limit = Limit+Skip},
case Keys of
- nil ->
+ undefined ->
Options0 = couch_httpd_view:make_key_options(QueryArgs),
Options = [{key_group_fun, GroupFun} | Options0],
couch_view:fold_reduce(ReduceView, fun reduce_fold/3, Acc0, Options);
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cbbef5c5/src/fabric/src/fabric_view.erl
----------------------------------------------------------------------
diff --git a/src/fabric/src/fabric_view.erl b/src/fabric/src/fabric_view.erl
index 9cb4b03..942231f 100644
--- a/src/fabric/src/fabric_view.erl
+++ b/src/fabric/src/fabric_view.erl
@@ -178,7 +178,7 @@ possibly_embed_doc(#collector{db_name=DbName, query_args=Args},
end.
-keydict(nil) ->
+keydict(undefined) ->
undefined;
keydict(Keys) ->
{Dict,_} = lists:foldl(fun(K, {D,I}) -> {dict:store(K,I,D), I+1} end,
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cbbef5c5/src/fabric/src/fabric_view_all_docs.erl
----------------------------------------------------------------------
diff --git a/src/fabric/src/fabric_view_all_docs.erl b/src/fabric/src/fabric_view_all_docs.erl
index 1745fc4..1f9f460 100644
--- a/src/fabric/src/fabric_view_all_docs.erl
+++ b/src/fabric/src/fabric_view_all_docs.erl
@@ -19,7 +19,7 @@
-include_lib("mem3/include/mem3.hrl").
-include_lib("couch/include/couch_db.hrl").
-go(DbName, #view_query_args{keys=nil} = QueryArgs, Callback, Acc0) ->
+go(DbName, #view_query_args{keys=undefined} = QueryArgs, Callback, Acc0) ->
Workers = fabric_util:submit_jobs(mem3:shards(DbName),all_docs,[QueryArgs]),
#view_query_args{limit = Limit, skip = Skip} = QueryArgs,
State = #collector{