diff options
author | Robert Newson <rnewson@apache.org> | 2018-08-06 19:21:49 +0100 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2018-08-07 15:45:47 +0100 |
commit | 5d54d40cf070012d5e299803e237161757809aa2 (patch) | |
tree | d80572f447599b992b063e55981fd94ba5839c7c | |
parent | 0af921b17b66037b5d742b2e2e00f793a694d92c (diff) | |
download | couchdb-5d54d40cf070012d5e299803e237161757809aa2.tar.gz |
validate new partition arguments
-rw-r--r-- | src/couch_mrview/src/couch_mrview_util.erl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/couch_mrview/src/couch_mrview_util.erl b/src/couch_mrview/src/couch_mrview_util.erl index a63701f8f..592bfb518 100644 --- a/src/couch_mrview/src/couch_mrview_util.erl +++ b/src/couch_mrview/src/couch_mrview_util.erl @@ -577,6 +577,17 @@ validate_args(Args) -> _ -> mrverror(<<"Invalid value for `sorted`.">>) end, + case {get_extra(Args, partitioned, false), get_extra(Args, partition)} of + {true, undefined} -> + mrverror(<<"`partition` parameter is mandatory for queries to this view.">>); + {true, _Partition} -> + ok; + {false, undefined} -> + ok; + {false, _Partition} -> + mrverror(<<"`partition` parameter is not supported in this view.">>) + end, + Args#mrargs{ start_key_docid=SKDocId, end_key_docid=EKDocId, |