diff options
author | Robert Newson <rnewson@apache.org> | 2018-08-06 19:21:49 +0100 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2018-09-03 17:43:04 +0100 |
commit | f78e3f8415d70ab2f4df3c2538d6ee4a428bfb47 (patch) | |
tree | d3edc3554a7eb7364a65e80648d78b1cdc0e7d76 | |
parent | 59b597e76b355015893887b0325d8edfaaefa1bb (diff) | |
download | couchdb-f78e3f8415d70ab2f4df3c2538d6ee4a428bfb47.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, |