v.23.2Improvement

Add check_referential_table_dependencies Setting for DROP TABLE Referential Checks

Add setting check_referential_table_dependencies to check referential dependencies on DROP TABLE. This PR solves #38326. #45936 (Vitaly Baranov).
Introduced the check_referential_table_dependencies setting to enable checking of referential dependencies when executing DROP TABLE commands.

Why it matters

This feature prevents accidental dropping of tables that other tables depend on via referential integrity constraints, thereby avoiding data inconsistency and ensuring database integrity.

How to use it

Users can enable the feature by setting check_referential_table_dependencies = 1 before executing a DROP TABLE statement. This causes ClickHouse to verify that no referential dependencies exist before allowing the table to be dropped.