**Describe the bug**
Under certain conditions the equals comparison between String and Date yields the wrong result. Range Comparisons with greather-than-equals returns the correct result set.

**How to reproduce**
* Which ClickHouse server version to use: 21.2.5.5 (latest at the time of this issue)
* Which interface to use, if matters: HTTP (but should not matter)

```sql
CREATE TABLE default.myTable (
	myDay Date,
	myOrder Int32,
	someData String
) 
ENGINE = ReplacingMergeTree
PARTITION BY floor(toYYYYMMDD(myDay), -1)
ORDER BY (myOrder)
;

INSERT INTO default.myTable (myDay, myOrder) VALUES ('2021-01-01', 1);
INSERT INTO default.myTable (myDay, myOrder) VALUES ('2021-01-02', 2); // This row should be returned
INSERT INTO default.myTable (myDay, myOrder) VALUES ('2021-01-03', 3);

SELECT * FROM default.myTable mt
WHERE myDay = '2021-01-02';
```

**Expected behavior**
The last query in the example should yield the marked row. Instead it returns a empty result set.

There must be a connection to the used `PARTITION KEY`. The issue fails to reproduce as soon as I do any changes to the `PARTITION KEY` setting.

rpn_stack.emplace_back(Frame{.can_be_true = std::move(can_be_true), .can_be_false = std::move(can_be_false)});
        }
        else if (
               element.function == RPNElement::FUNCTION_IN_RANGE
            || element.function == RPNElement::FUNCTION_NOT_IN_RANGE
            || element.function == RPNElement::FUNCTION_IN_SET
            || element.function == RPNElement::FUNCTION_NOT_IN_SET)
        {
            auto can_be_true = std::make_unique<Node>(Node{.type = Node::Type::Leaf, .element = &element, .negate = false});
            auto can_be_false = std::make_unique<Node>(Node{.type = Node::Type::Leaf, .element = &element, .negate = true});
            rpn_stack.emplace_back(Frame{.can_be_true = std::move(can_be_true), .can_be_false = std::move(can_be_false)});
        }
        else if (element.function == RPNElement::FUNCTION_NOT)
        {
            assert(!rpn_stack.empty());
            std::swap(rpn_stack.back().can_be_true, rpn_stack.back().can_be_false);
        }
        else if (element.function == RPNElement::FUNCTION_AND)
        {
            assert(!rpn_stack.empty());
            auto arg1 = std::move(rpn_stack.back());
            rpn_stack.pop_back();
            assert(!rpn_stack.empty());
            auto arg2 = std::move(rpn_stack.back());
            Frame frame;
            frame.can_be_true = combine(std::move(arg1.can_be_true), std::move(arg2.can_be_true), Node::Type::And);
            frame.can_be_false = combine(std::move(arg1.can_be_false), std::move(arg2.can_be_false), Node::Type::Or);
            rpn_stack.back() = std::move(frame);
        }
        else if (element.function == RPNElement::FUNCTION_OR)