You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/09/12 20:09:07 UTC

[couchdb] 24/28: ss - implement pse

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch COUCHDB-3287-pluggable-storage-engines
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit cd2070bca594cb21f73f7e539274a772849f4c08
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Tue Sep 12 13:38:38 2017 -0500

    ss - implement pse
---
 src/couch/src/couch_att.erl        | 4 ++--
 src/couch/src/couch_db.erl         | 2 +-
 src/couch/src/couch_db_updater.erl | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/couch/src/couch_att.erl b/src/couch/src/couch_att.erl
index 0e124d8..5f1699a 100644
--- a/src/couch/src/couch_att.erl
+++ b/src/couch/src/couch_att.erl
@@ -496,12 +496,12 @@ flush(Db, Att) ->
 
 
 flush_data(Db, Data, Att) when is_binary(Data) ->
-    AttName = fetch(name, Att),
-    MaxAttSize = max_attachment_size(),
     couch_db:with_stream(Db, Att, fun(OutputStream) ->
         couch_stream:write(OutputStream, Data)
     end);
 flush_data(Db, Fun, Att) when is_function(Fun) ->
+    AttName = fetch(name, Att),
+    MaxAttSize = max_attachment_size(),
     case fetch(att_len, Att) of
         undefined ->
             couch_db:with_stream(Db, Att, fun(OutputStream) ->
diff --git a/src/couch/src/couch_db.erl b/src/couch/src/couch_db.erl
index 387f205..f93c1e1 100644
--- a/src/couch/src/couch_db.erl
+++ b/src/couch/src/couch_db.erl
@@ -1171,7 +1171,7 @@ write_and_commit(#db{main_pid=Pid, user_ctx=Ctx}=Db, DocBuckets1,
 
 prepare_doc_summaries(Db, BucketList) ->
     [lists:map(
-        fun(#doc{atts = Atts} = Doc0) ->
+        fun(#doc{body = Body, atts = Atts} = Doc0) ->
             DiskAtts = [couch_att:to_disk_term(Att) || Att <- Atts],
             {ok, SizeInfo} = couch_att:size_info(Atts),
             AttsStream = case Atts of
diff --git a/src/couch/src/couch_db_updater.erl b/src/couch/src/couch_db_updater.erl
index b0fc25a..b10f759 100644
--- a/src/couch/src/couch_db_updater.erl
+++ b/src/couch/src/couch_db_updater.erl
@@ -729,7 +729,7 @@ pair_purge_info(Old, New) ->
     end, Old).
 
 
-get_meta_body_size(Meta, Summary) ->
+get_meta_body_size(Meta) ->
     {ejson_size, ExtSize} = lists:keyfind(ejson_size, 1, Meta),
     ExtSize.
 

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.