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

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to