-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check cyclic dependencies on CREATE/REPLACE/RENAME/EXCHANGE queries #65405
Check cyclic dependencies on CREATE/REPLACE/RENAME/EXCHANGE queries #65405
Conversation
This is an automated comment for commit 52721ad with description of existing statuses. It's updated for the latest CI running ✅ Click here to open a full report in a separate page Successful checks
|
|
||
if (!exchange_tables) | ||
if (exchange_tables) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we updated dependencies only for RENAME
, but not for EXCHANGE
- it was a bug, during EXCHANGE
we need also to exchange the dependencies
@@ -1624,6 +1647,9 @@ BlockIO InterpreterCreateQuery::doCreateOrReplaceTable(ASTCreateQuery & create, | |||
assert(done); | |||
created = true; | |||
|
|||
/// If table has dependencies - add them to the graph | |||
addTableDependencies(create, query_ptr, getContext()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we didn't add dependencies for tables created with CREATE OR REPLACE
when table didn't exist before.
…m_tables_columns, use global context + current database in getDependenciesFromCreateQuery
Wow, it's all green! |
…RENAME/EXCHANGE queries
Backport #65405 to 24.6: Check cyclic dependencies on CREATE/REPLACE/RENAME/EXCHANGE queries
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Check cyclic dependencies on CREATE/REPLACE/RENAME/EXCHANGE queries and throw an exception if there is a cyclic dependency. Previously such cyclic dependencies could lead to a deadlock during server startup. Closes #65355. Also fix some bugs in dependencies creation.
Documentation entry for user-facing changes
CI Settings (Only check the boxes if you know what you are doing):