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

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.2, 1.2.1
    • Component/s: None
    • Labels:
      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. 0001-Fix-fold-reduce-with-non-inclusive-end-key.patch
          22 kB
          Filipe Manana
        2. 0001-Fix-fold-reduce-with-non-inclusive-end-key.patch
          18 kB
          Filipe Manana
        3. COUCHDB-1413.sh
          1 kB
          Filipe Manana

          Activity

            People

            • Assignee:
              fdmanana Filipe Manana
              Reporter:
              fdmanana Filipe Manana
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: