Closed
Description
Describe the issue
A table that includes a field with UInt64 and uses that field to create partition using toYYYYMMDD fails to return values when doing a query for values larger than -1. This used to work in ClickHouse version 20.8.7.15 and it is currently broken in version 22.2.3.1 resulting in broken code.
Which ClickHouse server versions are incompatible
Versions 20.8.7.15 and 22.2.3.1
How to reproduce
Create table and insert data:
CREATE TABLE broken ( time UInt64 ) ENGINE = MergeTree PARTITION BY toYYYYMMDD(toDate(time / 1000)) ORDER BY time;
INSERT INTO broken (time) VALUES (1647353101000), (1647353101001), (1647353101002), (1647353101003);
Run the following queries:
SELECT * FROM broken WHERE time>0;
SELECT * FROM broken WHERE time>-1;
The first query returns all records, the second one returns empty result.
Activity