[ 
https://issues.apache.org/jira/browse/COUCHDB-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15390030#comment-15390030
 ] 

ASF subversion and git services commented on COUCHDB-3070:
----------------------------------------------------------

Commit 5b6d1b1dc2809af464fc11385d558631593f0614 in couchdb-chttpd's branch 
refs/heads/master from [~kzx]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb-chttpd.git;h=5b6d1b1 ]

In a multi-query view request, set view type for each query

Namely, a default `reduce` view type can be overridden to behave like a `map`,
if user explicitly sets `reduce=false`.

Previously this didn't happen. 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, because user explicitly disabled `reduce` and now
`include_docs` is valid for a map view.

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)

Reply via email to