v.24.1Improvement

Fix bug in _block_number column causing logical errors during ALTERs and merges

Fix bug in the experimental _block_number column which could lead to logical error during complex combination of ALTERs and merges. Fixes #56202. Replaces #58601. #59295 (alesapin).
Fix a bug in the experimental _block_number column that caused logical errors during complex combinations of ALTER operations and merge processes.

Why it matters

The fix addresses correctness issues arising when using the experimental _block_number column in scenarios involving multiple ALTER commands combined with merge operations, ensuring data consistency and logical correctness.

How to use it

This fix is applied automatically in the updated ClickHouse version. Users leveraging the experimental _block_number column with complex ALTER and merge scenarios will benefit from this correction without any additional action.