Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Fix issue #15 .
Browse files Browse the repository at this point in the history
Add support for internal `[integer(), binary()]` form of the sequence in
fabric_view_changes:unpack_seqs/2 .

Passing the internal form to since in fabric:changes/4 was causing the
error for some values. This patch fix it.
  • Loading branch information
benoitc committed Sep 13, 2011
1 parent 42a8c84 commit 8e8a886
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fabric_view_changes.erl
Expand Up @@ -248,9 +248,15 @@ unpack_seqs(0, DbName) ->
unpack_seqs("0", DbName) ->
fabric_dict:init(mem3:shards(DbName), 0);

unpack_seqs([_SeqNum, Opaque], DbName) ->
do_unpack_seqs(Opaque, DbName);

unpack_seqs(Packed, DbName) ->
{match, [Opaque]} = re:run(Packed, "(?<opaque>[a-zA-Z0-9-_]+)([\"\\]])*$",
[{capture, [opaque], binary}]),
do_unpack_seqs(Opaque, DbName).

do_unpack_seqs(Opaque, DbName) ->
% TODO relies on internal structure of fabric_dict as keylist
lists:map(fun({Node, [A,B], Seq}) ->
Match = #shard{node=Node, range=[A,B], dbname=DbName, _ = '_'},
Expand Down

0 comments on commit 8e8a886

Please sign in to comment.