[
https://issues.apache.org/jira/browse/COUCHDB-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15388503#comment-15388503
]
ASF GitHub Bot commented on COUCHDB-3070:
-----------------------------------------
GitHub user nickva opened a pull request:
https://github.com/apache/couchdb-chttpd/pull/133
In a view multi-query request, set view type for each query
View type can be overridden if user explicitly sets reduce=false, for
example.
This can happen for individual query.
Previously this didn't happen and view_type was set once at the top, just
based on the view itself. For for example, a query like this:
```
{
"queries": [{
"include_docs": true,
"reduce": false
}]
}
```
would fail with:
```
{"error":"query_parse_error","reason":"`include_docs` is invalid for
reduce"}
```
But it shouldn't fail because user explicitly disabled `reduce` for that
one.
To fix, make sure to call `set_view_type` for each query's args.
Jira: COUCHDB-3070
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/couchdb-chttpd
couchdb-3070-fix-multi-query-view-type
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-chttpd/pull/133.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #133
----
commit 12af1697bcc40e40eec1aef1b96c0afb85cce2bd
Author: Nick Vatamaniuc <[email protected]>
Date: 2016-07-21T21:48:15Z
In a view multi-query request, set view type for each query
View type can be overridden if user explicitly sets reduce=false, for
example.
This can happen for individual query.
Previously this didn't happen and view_type was set once at the top, just
based on the view itself. For for example, a query like this:
```
{
"queries": [{
"include_docs": true,
"reduce": false
}]
}
```
would fail with:
```
{"error":"query_parse_error","reason":"`include_docs` is invalid for
reduce"}
```
But it shouldn't fail because user explicitly disabled `reduce` for that
one.
To fix, make sure to call `set_view_type` for each query's args.
Jira: COUCHDB-3070
----
> Incorrect view argument valudation for multi-query (POST) view
> --------------------------------------------------------------
>
> Key: COUCHDB-3070
> URL: https://issues.apache.org/jira/browse/COUCHDB-3070
> Project: CouchDB
> Issue Type: Bug
> Components: Database Core
> Reporter: Nick Vatamaniuc
>
> This query
> {code}
> {
> "queries": [{
> "include_docs": true,
> "reduce": false
> }]
> }
> {code}
> fails for instance with:
> {code}
> curl -XPOST 'http://adm:pass@localhost:15984/d/_design/d1/_view/v1' -H
> "Content-Type: application/json" -d @q2.json
> {"error":"query_parse_error","reason":"`include_docs` is invalid for reduce"}
> {code}
> But it shouldn't since user explicitly passed reduce as false.
> This should be a 2.0 issue as it prevents queries from working correctly
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)