v.18.16Improvement

Removed Numeric Comparison for Date Type to Prevent Errors

Removed the ability to compare the Date type with a number to avoid potential errors like date = 2018-12-17, where quotes around the date are omitted by mistake. #3687
Removed the ability to compare the Date type with a number to prevent unintended errors when the date literals are not quoted properly.

Why it matters

This change addresses the common mistake where users write comparisons like date = 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 compare Date 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.