v.20.12Improvement

Fix stack overflow risk in materialized views loop

Fix possible stack overflow if a loop of materialized views is created. This closes #15732. #16048 (alexey-milovidov).
Fix for stack overflow caused by loops in materialized views.

Why it matters

This update resolves an issue where creating a loop between materialized views could trigger a stack overflow error. The fix enhances stability by preventing infinite recursion between dependent materialized views, avoiding server crashes and improving reliability.

How to use it

Users should update ClickHouse to the fixed version. No additional configuration is required; the fix automatically prevents stack overflow when materialized view loops occur.