diff options
author | Robert Newson <rnewson@apache.org> | 2018-08-06 19:21:49 +0100 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2018-10-01 17:33:13 +0100 |
commit | 745e8789b1c60e71087f36893b5ed5385fdd43dd (patch) | |
tree | 3063693a9b8d469013ba4d9525454853278b6f94 | |
parent | 9fabb7393c7d1ce8f9e137776ad9e81eb5394ae0 (diff) | |
download | couchdb-745e8789b1c60e71087f36893b5ed5385fdd43dd.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, |