21.5.1
```sql

create table test(d Date, k Int64, s String) 
Engine=MergeTree partition by (toYYYYMM(d),k) order by (d, k)

insert into test values ('2020-01-01', 1, '');
insert into test values ('2020-01-02', 1, '');

SELECT * FROM test WHERE d != '2020-01-01'
0 rows in set. Elapsed: 0.003 sec.


SELECT * FROM test WHERE identity(d) !=  '2020-01-01';
┌──────────d─┬─k─┬─s─┐
│ 2020-01-02 │ 1 │   │
└────────────┴───┴───┘

SELECT * FROM test WHERE toDate(d) != '2020-01-01';
┌──────────d─┬─k─┬─s─┐
│ 2020-01-02 │ 1 │   │
└────────────┴───┴───┘
```

size_t used_key_size,
    const FieldRef * left_key,
    const FieldRef * right_key,
    const DataTypes & data_types,
    BoolMask initial_mask) const
{
    return checkInRange(used_key_size, left_key, right_key, data_types, true, initial_mask);
}
bool KeyCondition::mayBeTrueInRange(
    size_t used_key_size,
    const FieldRef * left_key,
    const FieldRef * right_key,
    const DataTypes & data_types) const
{
    return checkInRange(used_key_size, left_key, right_key, data_types, true, BoolMask::consider_only_can_be_true).can_be_true;
}
BoolMask KeyCondition::checkAfter(