anchor.diff:  rewrite_where_with_additional_filters_key([], _, StartKey, EndKey, SInc, EInc, _) ->
       [{startkey, StartKey}, {endkey, EndKey} | rewrite_where_with_additional_filters_inclusivity_props(SInc, EInc)];
   rewrite_where_with_additional_filters_key([Field|Tail], ToKeyTypeFn, StartKey, EndKey, SInc, EInc, Filter) ->
  -    case lists:keyfind(Field,    2, Filter) of
  +    case lists:keyfind(Field, 2, Filter) of
           false ->
               %% there is no filter for the next additional field so give up! The
               %% filters must be consecutive, we can't have a '_' inbetween
  
positive.code:     {Field, FieldType, _OldVal} = lists:keyfind(Field, 1, TupleList),
      lists:keyreplace(Field, 1, TupleList, {Field, FieldType, NewVal}).
  
  -record(filtercheck, {name,'='}).
  
  check_where_clause_is_possible(DDL, WhereProps) ->
      Filter1 = proplists:get_value(filter, WhereProps),
  
negative.code:             %% this can never be satisfied.
              throw({error, {impossible_where_clause, << >>}})
      end;
  check_where_clause_is_possible_fold(_, _, {'>',{field,FieldName,_},_} = F, Acc) ->
      case find_filter_check(FieldName, Acc) of
          #filtercheck{'=' = F} ->
              %% this filter has been specified twice so remove the second occurence
              {eliminate, Acc};
          #filtercheck{'=' = undefined} = Check1 ->
              %% this is the first equality check so just record it
              Check2 = Check1#filtercheck{'=' = F},
              {F, lists:keystore(FieldName, #filtercheck.name, Acc, Check2)};
          #filtercheck{'=' = F_x} when F_x < F ->
              %% we already have a filter that is a lower value than 
              {eliminate, Acc}
      end;
  check_where_clause_is_possible_fold(_, _, Filter, Acc) ->
      {Filter, Acc}.
  
  %% TODO put this in the table helper module
  is_field_nullable(FieldName, ?DDL{fields = Fields}) when is_binary(FieldName)->
      #riak_field_v1{optional = Optional} = lists:keyfind(FieldName, #riak_field_v1.name, Fields),
      (Optional == true).
  