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

latest=true fails when the specified rev belongs to multiple branches

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.0.0, 1.6.1
    • None
    • Database Core
    • None

    Description

      Using a document with a revision tree:

      	2-b1
           /
      1-a 
           \
      	2-b2
      

      GET /mydb/mydoc?rev=1-a&latest=true fails with a 500 error. This occurs on CouchDB 1.6 and 2.0.

      To reproduce:

      $ export COUCH_HOST="http://127.0.0.1:15984"
      
      $ curl -XPUT "$COUCH_HOST/rev_test"
      {"ok":true}
      
      $ curl "$COUCH_HOST/rev_test/_bulk_docs" -H "Content-Type:application/json" -XPOST -d @docs.json
      []
      
      $ curl -H "Accept:application/json" "$COUCH_HOST/rev_test/mydoc?rev=1-a&latest=true"
      {"error":"case_clause","reason":"{ok,[{ok,{doc,<<\"mydoc\">>,\n              {2,[<<\"b1\">>,<<\"a\">>]},\n              {[{<<\"value\">>,<<\"x-winning\">>}]},\n              [],false,[]}},\n     {ok,{doc,<<\"mydoc\">>,\n              {2,[<<\"b2\">>,<<\"a\">>]},\n              {[{<<\"value\">>,<<\"x-losing\">>}]},\n              [],false,[]}}]}","ref":2757334056}
      

      Attachments

        1. docs.json
          0.6 kB
          Will Holley

        Activity

          People

            Unassigned Unassigned
            wilhol Will Holley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: