summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/www/script/test/view_include_docs.js5
-rw-r--r--src/couchdb/couch_httpd_view.erl4
2 files changed, 8 insertions, 1 deletions
diff --git a/share/www/script/test/view_include_docs.js b/share/www/script/test/view_include_docs.js
index 2c47b696..4d19bf55 100644
--- a/share/www/script/test/view_include_docs.js
+++ b/share/www/script/test/view_include_docs.js
@@ -79,6 +79,11 @@ couchTests.view_include_docs = function(debug) {
resp = db.view('test/summate', {reduce: false, include_docs: true});
T(resp.rows.length == 100);
+ // Not an error with include_docs=false&reduce=true
+ resp = db.view('test/summate', {reduce: true, include_docs: false});
+ T(resp.rows.length == 1);
+ T(resp.rows[0].value == 4950);
+
// Check emitted _rev controls things
resp = db.allDocs({include_docs: true}, ["0"]);
var before = resp.rows[0].doc;
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl
index 7f875051..7907f68f 100644
--- a/src/couchdb/couch_httpd_view.erl
+++ b/src/couchdb/couch_httpd_view.erl
@@ -409,7 +409,7 @@ validate_view_query(reduce, _, Args) ->
_ ->
Args
end;
-validate_view_query(include_docs, _Value, Args) ->
+validate_view_query(include_docs, true, Args) ->
case Args#view_query_args.view_type of
reduce ->
Msg = <<"Query paramter `include_docs` "
@@ -418,6 +418,8 @@ validate_view_query(include_docs, _Value, Args) ->
_ ->
Args#view_query_args{include_docs=true}
end;
+validate_view_query(include_docs, _Value, Args) ->
+ Args;
validate_view_query(extra, {Key, _}, Args) ->
case Args#view_query_args.ignore of
strict ->