Will Holley created COUCHDB-3240:
------------------------------------

             Summary: latest=true fails when the specified rev belongs to 
multiple branches
                 Key: COUCHDB-3240
                 URL: https://issues.apache.org/jira/browse/COUCHDB-3240
             Project: CouchDB
          Issue Type: Bug
          Components: Database Core
            Reporter: Will Holley
         Attachments: docs.json

Using a document with a revision tree:

{code}
        2-b1
     /
1-a 
     \
        2-b2
{code}

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

To reproduce:

{code}
$ 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}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to