Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75B42CD77 for ; Thu, 7 Aug 2014 17:35:07 +0000 (UTC) Received: (qmail 11523 invoked by uid 500); 7 Aug 2014 17:35:07 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 11470 invoked by uid 500); 7 Aug 2014 17:35:07 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 11434 invoked by uid 99); 7 Aug 2014 17:35:07 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2014 17:35:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 06C989C2F7A; Thu, 7 Aug 2014 17:35:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org Message-Id: <9fffefd70f324513bdcf8c9ecf731c65@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: couch commit: updated refs/heads/windsor-merge to 53faa74 Date: Thu, 7 Aug 2014 17:35:06 +0000 (UTC) Repository: couchdb-couch Updated Branches: refs/heads/windsor-merge 71335c8d5 -> 53faa743d [WIP] Fix decompression of attachment info Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/53faa743 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/53faa743 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/53faa743 Branch: refs/heads/windsor-merge Commit: 53faa743d62a06e6279a4fa87b4b9723f3810303 Parents: 71335c8 Author: Paul J. Davis Authored: Thu Aug 7 12:34:44 2014 -0500 Committer: Paul J. Davis Committed: Thu Aug 7 12:34:44 2014 -0500 ---------------------------------------------------------------------- src/couch_db.erl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/53faa743/src/couch_db.erl ---------------------------------------------------------------------- diff --git a/src/couch_db.erl b/src/couch_db.erl index baaed37..8a9f9e4 100644 --- a/src/couch_db.erl +++ b/src/couch_db.erl @@ -1304,7 +1304,18 @@ make_doc(_Db, Id, Deleted, nil = _Bp, RevisionPath) -> deleted = Deleted }; make_doc(#db{fd=Fd}=Db, Id, Deleted, Bp, RevisionPath) -> - {ok, {BodyData, Atts0}} = read_doc(Db, Bp), + {BodyData, Atts0} = case Bp of + nil -> + {[], []}; + _ -> + case read_doc(Db, Bp) of + {ok, {BodyData0, Atts1}} when is_binary(Atts1) -> + {BodyData0, couch_compress:decompress(Atts1)}; + {ok, {BodyData0, Atts1}} when is_list(Atts1) -> + % pre 1.2 format + {BodyData0, Atts1} + end + end, Atts = [couch_att:from_disk_term(Fd, T) || T <- Atts0], Doc = #doc{ id = Id,