You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2016/03/30 13:13:54 UTC
couch-mrview commit: updated refs/heads/2849-update_seq_view to
2e7f0d9
Repository: couchdb-couch-mrview
Updated Branches:
refs/heads/2849-update_seq_view [created] 2e7f0d9a1
Print update_seq properly if packed
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/commit/2e7f0d9a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/2e7f0d9a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/2e7f0d9a
Branch: refs/heads/2849-update_seq_view
Commit: 2e7f0d9a1c761170202202ac2fec4519df2b8981
Parents: 6ec3597
Author: Robert Newson <rn...@apache.org>
Authored: Wed Mar 30 12:13:38 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Mar 30 12:13:38 2016 +0100
----------------------------------------------------------------------
src/couch_mrview_http.erl | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/2e7f0d9a/src/couch_mrview_http.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_http.erl b/src/couch_mrview_http.erl
index 9eb306b..0d05a8e 100644
--- a/src/couch_mrview_http.erl
+++ b/src/couch_mrview_http.erl
@@ -343,13 +343,16 @@ view_cb({meta, Meta}, #vacc{}=Acc) ->
% Sending metadata
Parts = case couch_util:get_value(total, Meta) of
undefined -> [];
- Total -> [io_lib:format("\"total_rows\":~p", [Total])]
+ Total -> [io_lib:format("\"total_rows\":~B", [Total])]
end ++ case couch_util:get_value(offset, Meta) of
undefined -> [];
- Offset -> [io_lib:format("\"offset\":~p", [Offset])]
+ Offset -> [io_lib:format("\"offset\":~B", [Offset])]
end ++ case couch_util:get_value(update_seq, Meta) of
undefined -> [];
- UpdateSeq -> [io_lib:format("\"update_seq\":~p", [UpdateSeq])]
+ UpdateSeq when is_integer(UpdateSeq) ->
+ [io_lib:format("\"update_seq\":~B", [UpdateSeq])];
+ UpdateSeq when is_binary(UpdateSeq) ->
+ [io_lib:format("\"update_seq\":\"~s\"", [UpdateSeq])]
end ++ ["\"rows\":["],
Chunk = [prepend_val(Acc), "{", string:join(Parts, ","), "\r\n"],
{ok, AccOut} = maybe_flush_response(Acc, Chunk, iolist_size(Chunk)),