anchor.diff:  -record(mqtt_sub, {
       filter,
       subs,
  -    topic,
  -    client_id,
  -    qos
  +    pid,
  +    seq = 1
   }).
   
   
  
positive.code:         orddict:new(), AllSubs),
      orddict:to_list(Merged).
  
  %% ======================================================================
  %% Misc
  %% ======================================================================
  
  mnesia_do(Fun) ->
  
negative.code:                     case orddict:is_key(ClientId,Subs) of
                          true ->
                              ok = mnesia:write(S#mqtt_sub{subs = orddict:erase(ClientId,Subs)});
                          false ->
                              ok
                      end
              end
          end,
      mnesia_do(Fun).
  
  
  load(Filter) ->
      load(self(),Filter).
  
  load(Pid,Filter) ->
      Fun =
          fun() ->
              R =
                  case mnesia:read(?SUB_RECORD, Filter, write) of
                      [] ->   new(Filter);
                      [S]->   S
                  end,
              NewSeq = R#mqtt_sub.seq,
              mnesia:write(R#mqtt_sub{pid = Pid,seq = NewSeq+1}),
              R#mqtt_sub.subs
          end,
      Subs = mnesia_do(Fun),
      orddict:to_list(Subs).
  
  %% @doc
  %% Gets a list of ALL subscriptions matching a topic, selecting the one with the highest QoS
  