anchor.diff:          compile(DDL, Q)
       ).
   
  -greater_than_or_equal_to_that_is_less_than_previous_greater_than_clause_removes_greater_than_clause_test() ->
  +greater_than_or_equal_to_is_less_than_previous_greater_than_clause_removes_greater_than_clause_test() ->
       DDL = get_ddl(
           "CREATE TABLE table1("
           "a TIMESTAMP NOT NULL, "
  
positive.code:         #filtercheck{'=' = {_,_,{const,EqVal}}} when GteVal > EqVal ->
              %% query like `a = 10 AND a >= 11` cannot be satisfied
              throw({error, {impossible_where_clause, << >>}});
          #filtercheck{'>' = {_,_,{const,GtVal}} = F_x} = Check1 when GtVal >= GteVal ->
              %% we already have a filter that is higher than the second one,
              %% which we can eliminate. Store it and eliminate it on the second
  
negative.code:         S?SQL_SELECT.'WHERE'
      ).
  
  greater_than_is_less_than_previous_greater_than_or_equal_to_clause_removes_greater_than_or_equal_to_clause_test() ->
      DDL = get_ddl(
          "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 > 9 AND b >= 10"),
      {ok, [S|_]} = compile(DDL, Q),
      ?assertPropsEqual(
          [{startkey,[{<<"a">>,timestamp,5}]},
           {endkey,  [{<<"a">>,timestamp,5}]},
           {filter, {'>',{field,<<"b">>,sint64},{const, 9}}},
           {end_inclusive,true}],
          S?SQL_SELECT.'WHERE'
      ).
  
  greater_than_is_less_than_previous_greater_than_or_equal_to_clause_removes_greater_than_or_equal_to_clause_swap_lhs_rhs_test() ->
      DDL = get_ddl(
          "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 > 9"),
      {ok, [S|_]} = compile(DDL, Q),
      ?assertPropsEqual(
          [{startkey,[{<<"a">>,timestamp,5}]},
           {endkey,  [{<<"a">>,timestamp,5}]},
           {filter, {'>',{field,<<"b">>,sint64},{const, 9}}},
           {end_inclusive,true}],
          S?SQL_SELECT.'WHERE'
      ).
  
  -endif.
  