v.18.16Improvement
Removed Numeric Comparison for Date Type to Prevent Errors
Removed the ability to compare theDatetype with a number to avoid potential errors likedate = 2018-12-17, where quotes around the date are omitted by mistake. #3687
Why it matters
This change addresses the common mistake where users write comparisons likedate = 2018-12-17 without quotes around the date, which can lead to incorrect query results or confusion. By disallowing direct comparison between Date and numbers, ClickHouse helps ensure that date values are always compared correctly with properly typed literals.How to use it
Users should always compareDate columns with properly quoted date literals, e.g., date = '2018-12-17', ensuring the date is provided as a string literal rather than a raw number.