v.23.8Improvement

Ignore Foreign Keys in Table Definitions for MySQL Compatibility

Ignore foreign keys in tables definition to improve compatibility with MySQL, so a user wouldn't need to rewrite his SQL of the foreign key part, ref #53380. #53864 (jsc0218).
ClickHouse now ignores foreign key definitions in table schemas to enhance compatibility with MySQL.

Why it matters

This feature addresses the challenge of migrating or integrating SQL queries from MySQL to ClickHouse by allowing users to retain foreign key clauses in their table definitions without causing errors. It simplifies the transition process and avoids the need to rewrite SQL statements that include foreign keys, improving user experience and reducing migration effort.

How to use it

Users do not need to change their existing SQL schema definitions containing foreign keys. ClickHouse automatically ignores foreign key constraints during table parsing, allowing SQL statements with foreign keys to work without modification.