You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/04/23 13:31:03 UTC
svn commit: r1096132 - /couchdb/trunk/src/couchdb/couch_db_updater.erl
Author: fdmanana
Date: Sat Apr 23 11:31:03 2011
New Revision: 1096132
URL: http://svn.apache.org/viewvc?rev=1096132&view=rev
Log:
Add missing guard for leaf data size computation
This is necessary when dealing with pre 1.2 database files.
This could be reproduced by adding a conflict revision to an existing pre 1.2
database.
Modified:
couchdb/trunk/src/couchdb/couch_db_updater.erl
Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=1096132&r1=1096131&r2=1096132&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Sat Apr 23 11:31:03 2011
@@ -526,7 +526,7 @@ flush_trees(#db{updater_fd = Fd} = Db,
branch ->
{NewValue, Acc}
end;
- {_, _, _, LeafSize} when Type =:= leaf ->
+ {_, _, _, LeafSize} when Type =:= leaf, LeafSize =/= nil ->
{Value, Acc + LeafSize};
_ ->
{Value, Acc}