diff options
author | Robert Newson <rnewson@apache.org> | 2018-08-06 19:21:49 +0100 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2018-10-08 09:51:20 +0100 |
commit | c40304b7d2a1e38878f72e3815780c7dffd6456c (patch) | |
tree | 8130f600694309aa43df536f38a31521aa2b3fa8 | |
parent | 1b382dead8cec19499cf22d71fffc7155172f764 (diff) | |
download | couchdb-c40304b7d2a1e38878f72e3815780c7dffd6456c.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 23db8f7cf..986f8ef79 100644 --- a/src/couch_mrview/src/couch_mrview_util.erl +++ b/src/couch_mrview/src/couch_mrview_util.erl @@ -612,6 +612,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} -> + couch_doc:validate_docid(Partition); + {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, |