v.25.10Improvement

Fix optimization pass

Fixed optimization pass for redundant equal expression when LowCardinality of the resulting type differs before and after optimization. #82651 (Yakov Olkhovskiy).
Fixed optimization for redundant equal expressions involving LowCardinality types with different resulting type changes.

Why it matters

This fix addresses an issue in the optimization pass where redundant equal expressions using LowCardinality columns could result in incorrect types after optimization. It ensures consistent handling of type changes, improving query correctness and stability when working with LowCardinality data.

How to use it

This fix is applied internally in ClickHouse's query optimizer. Users do not need to enable anything explicitly; it automatically improves the handling of redundant equal expressions with LowCardinality columns after upgrading to the version including this fix.