jiangphcn commented on a change in pull request #560: Fix broken eunit test in 
changes_since_test_ test suite
URL: https://github.com/apache/couchdb/pull/560#discussion_r120069174
 
 

 ##########
 File path: src/couch_mrview/src/couch_mrview.erl
 ##########
 @@ -708,5 +708,5 @@ make_view_changes_opts(StartSeq, Options, Args) ->
         true ->
             couch_mrview_util:changes_key_opts(StartSeq, Args);
         false ->
-            [[{start_key, {StartSeq+1, <<>>}}] ++ Options]
+            [[{start_key, {StartSeq, <<>>}}] ++ Options]
 
 Review comment:
   Eric, thanks for your comments. 
   
   This is based on current understanding of query with only since.
   ```
   test_basic_since(_, Db) ->
       Result = run_query(Db, 5, []),
       Expect = {ok, [
                   {{6, 4, <<"4">>}, 4},
                   {{7, 5, <<"5">>}, 5},
                   {{8, 6, <<"6">>}, 6},
                   {{9, 7, <<"7">>}, 7},
                   {{10, 8, <<"8">>}, 8},
                   {{11, 9, <<"9">>}, 9}
       ]},
       ?_assertEqual(Result, Expect).
   ```
   If since is specified with 5, the expected returned document sequence should 
start from 6 instead of 7. Thus, there is change from [[{start_key, 
{StartSeq+1, <<>>}}] ++ Options] to [[{start_key, {StartSeq, <<>>}}] ++ Options]
   
   Today, I test using one local cluster, and can find some test result related 
to `startkey` and `endkey`.
   ```
   jiangphs-MacBook-Pro:geotest jiangph$ curl -u foo:bar -X GET 
'http://localhost:15984/sdb1/_design/bar/_view/baz?startkey=3&endkey=4'|jq .
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  
Current
                                    Dload  Upload   Total   Spent    Left  Speed
   100   101    0   101    0     0   8824      0 --:--:-- --:--:-- --:--:--  
9181
   {
     "total_rows": 6,
     "offset": 2,
     "rows": [
       {
         "id": "3",
         "key": 3,
         "value": 3
       },
       {
         "id": "4",
         "key": 4,
         "value": 4
       }
     ]
   }
   ```
   
   However, for `since`, I still work from eunit test case.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to