Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-1413

Reduce queries with ?inclusive_end=false and endkey/endkey_docid or startkey/startkey_docid (if ?descending=true) produce incorrect reductions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.1
    • 1.2, 1.2.1
    • None
    • None

    Description

      COUCHDB-1047 attempted to fix endkey being ignored for reduce queries. It works but it's busted when endkey_docid is also present, as it produces wrong results. Using end_key_gt as an endkey in the btree fold reduce operation is not enough to guarantee correct results for all cases.

      The following script reproduces the issue and the following patch fixes it.

      Attachments

        1. COUCHDB-1413.sh
          1 kB
          Filipe David Borba Manana
        2. 0001-Fix-fold-reduce-with-non-inclusive-end-key.patch
          18 kB
          Filipe David Borba Manana
        3. 0001-Fix-fold-reduce-with-non-inclusive-end-key.patch
          22 kB
          Filipe David Borba Manana

        Activity

          People

            fdmanana Filipe David Borba Manana
            fdmanana Filipe David Borba Manana
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: