anchor.diff:          S?SQL_SELECT.'WHERE'
       ).
   
  +greater_than_filter_added_to_start_key_if_it_part_of_local_key_when_start_inclusive_false_test() ->
  +    DDL = get_ddl(
  +        "CREATE TABLE table1("
  +        "a TIMESTAMP NOT NULL, "
  +        "b SINT64 NOT NULL, "
  +        "PRIMARY KEY ((quantum(a,1,'s')),a,b))"),
  +    {ok, Q} = get_query(
  +        "SELECT * FROM table1 "
  +        "WHERE b > 1 AND a > 4200 AND a <= 4600"),
  +    {ok, [S|_]} = compile(DDL, Q),
  +    ?assertPropsEqual(
  +        [{startkey,[{<<"a">>,timestamp,4201},{<<"b">>,sint64,1}]},
  +         {endkey,[{<<"a">>,timestamp,4600}]},
  +         {filter,{'>',{field,<<"b">>,sint64},{const, 1}}},
  +         {end_inclusive,true}],
  +        S?SQL_SELECT.'WHERE'
  +    ).
  +
  +greater_than_or_equal_filter_added_to_start_key_if_it_part_of_local_key_test() ->
  +    DDL = get_ddl(
  +        "CREATE TABLE table1("
  +        "a TIMESTAMP NOT NULL, "
  +        "b SINT64 NOT NULL, "
  +        "PRIMARY KEY ((quantum(a,1,'s')),a,b))"),
  +    {ok, Q} = get_query(
  +        "SELECT * FROM table1 "
  +        "WHERE b >= 1 AND a >= 4200 AND a <= 4600"),
  +    {ok, [S|_]} = compile(DDL, Q),
  +    ?assertPropsEqual(
  +        [{startkey,[{<<"a">>,timestamp,4200},{<<"b">>,sint64,1}]},
  +         {endkey,[{<<"a">>,timestamp,4600}]},
  +         {filter,{'>=',{field,<<"b">>,sint64},{const, 1}}},
  +         {start_inclusive,true},
  +         {end_inclusive,true}],
  +        S?SQL_SELECT.'WHERE'
  +    ).
  +
   %% if the pk is (a) and lk is (a,b,c) then b AND c must have filters for c
   %% to be added to the key. If b does not have a filter but c does, then neither
   %% is added.
  
positive.code:         "CREATE TABLE table1("
          "a TIMESTAMP NOT NULL, "
          "b SINT64 NOT NULL, "
          "PRIMARY KEY ((a),a,b))"),
      {ok, Q} = get_query(
          "SELECT * FROM table1 "
          "WHERE a = 5 AND b > 10 AND b >= 10"),
  
negative.code:         "CREATE TABLE table1("
          "a TIMESTAMP NOT NULL, "
          "b SINT64 NOT NULL, "
          "PRIMARY KEY ((a),a))"),
      {ok, Q} = get_query(
          "SELECT * FROM table1 "
          "WHERE a = 5 AND b >= 10 AND b > 10"),
  