v.19.14Improvement

Correct Implementation of Ternary Logic for And/or

Correct implementation of ternary logic for AND/OR. #6048 (Alexander Kazakov)
Implemented correct ternary logic handling for AND and OR operators in ClickHouse.

Why it matters

This feature addresses the proper evaluation of logical expressions involving three-valued (ternary) logic: TRUE, FALSE, and UNKNOWN (NULL). It ensures that AND and OR operators correctly handle NULL values following ternary logic rules, improving query accuracy when dealing with nullable data.

How to use it

Users benefit from this improvement transparently without needing configuration changes. Simply use logical expressions with AND and OR in queries, and ClickHouse applies correct ternary logic semantics automatically.