Fix edge condition when loading shards from disk BugzId: 13386
Project: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/commit/6469c355 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/tree/6469c355 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mem3/diff/6469c355 Branch: refs/heads/import Commit: 6469c355f927d758e35be1049522a61697525497 Parents: 8ca5c51 Author: Paul J. Davis <[email protected]> Authored: Fri May 11 18:31:18 2012 -0500 Committer: Paul J. Davis <[email protected]> Committed: Fri May 11 18:31:18 2012 -0500 ---------------------------------------------------------------------- src/mem3_shards.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-mem3/blob/6469c355/src/mem3_shards.erl ---------------------------------------------------------------------- diff --git a/src/mem3_shards.erl b/src/mem3_shards.erl index 9df4b9e..3cf35cf 100644 --- a/src/mem3_shards.erl +++ b/src/mem3_shards.erl @@ -250,7 +250,7 @@ load_shards_from_db(#db{} = ShardDb, DbName) -> load_shards_from_disk(DbName, DocId)-> Shards = load_shards_from_disk(DbName), HashKey = mem3_util:hash(DocId), - [S || #shard{range = [B,E]} = S <- Shards, B < HashKey, HashKey =< E]. + [S || #shard{range = [B,E]} = S <- Shards, B =< HashKey, HashKey =< E]. create_if_missing(Name) -> DbDir = couch_config:get("couchdb", "database_dir"),
