eiri commented on a change in pull request #1744: Fix total_rows value for 
queries on `_design_docs` handler
URL: https://github.com/apache/couchdb/pull/1744#discussion_r235503584
 
 

 ##########
 File path: src/fabric/src/fabric_view_all_docs.erl
 ##########
 @@ -82,24 +82,22 @@ go(DbName, Options, QueryArgs, Callback, Acc0) ->
         true -> lists:sublist(Keys2, Limit);
         false -> Keys2
     end,
-    Resp = case couch_util:get_value(namespace, Extra, <<"_all_docs">>) of
-        <<"_local">> ->
-            {ok, null};
-        _ ->
-            Timeout = fabric_util:all_docs_timeout(),
-            {_, Ref0} = spawn_monitor(fun() ->
-                exit(fabric:get_doc_count(DbName))
-            end),
-            receive {'DOWN', Ref0, _, _, Result} ->
-                Result
-            after Timeout ->
-                timeout
-            end
+    %% namespace can be _set_ to `undefined`, so we want simulate enum here
+    Namespace = case couch_util:get_value(namespace, Extra) of
 
 Review comment:
   No it is not, hence the comment.
   
   chttpd explicitly **sets** namespace to `undefined`  
[here](https://github.com/apache/couchdb/blob/master/src/chttpd/src/chttpd_db.erl#L1737)
 and namespace set to `undefined` surprisingly not the same thing as a 
namespace not set at all.

----------------------------------------------------------------
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