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
Fix crash when using input() in INSERT SELECT JOIN #60765
Fix crash when using input() in INSERT SELECT JOIN #60765
Conversation
This is an automated comment for commit d7de634 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
|
@@ -1790,7 +1790,7 @@ StoragePtr Context::executeTableFunction(const ASTPtr & table_expression, const | |||
} | |||
|
|||
uint64_t use_structure_from_insertion_table_in_table_functions = getSettingsRef().use_structure_from_insertion_table_in_table_functions; | |||
if (use_structure_from_insertion_table_in_table_functions && table_function_ptr->needStructureHint() && hasInsertionTable()) | |||
if (select_query_hint && use_structure_from_insertion_table_in_table_functions && table_function_ptr->needStructureHint() && hasInsertionTable()) |
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.
Probably some comment would be helpful.
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.
I think the condition is self-describing, if use_structure_from_insertion_table_in_table_functions
is enabled, table function needs structure hint and we have both insertion table and select query, we go to the logic of using structure from insertion table in table function. Previously we just didn't check that we actually have select query AST (it could be nullptr).
I can write it in a comment, but imo it will just repeat what is written in the condition. Maybe I just don't see what part is confusing and requires a comment
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.
This is new code to me, I need more context to get it straight. One way to simplify the complex condition is to assign it to a variable with a self-explanatory name. Probably, it can help
…e31da7228fcb09f17e5bf7411cac8 Cherry pick #60765 to 23.8: Fix crash when using input() in INSERT SELECT JOIN
…de31da7228fcb09f17e5bf7411cac8 Cherry pick #60765 to 23.12: Fix crash when using input() in INSERT SELECT JOIN
…e31da7228fcb09f17e5bf7411cac8 Cherry pick #60765 to 24.1: Fix crash when using input() in INSERT SELECT JOIN
…e31da7228fcb09f17e5bf7411cac8 Cherry pick #60765 to 24.2: Fix crash when using input() in INSERT SELECT JOIN
Backport #60765 to 24.1: Fix crash when using input() in INSERT SELECT JOIN
Backport #60765 to 24.2: Fix crash when using input() in INSERT SELECT JOIN
Backport #60765 to 23.12: Fix crash when using input() in INSERT SELECT JOIN
Backport #60765 to 23.8: Fix crash when using input() in INSERT SELECT JOIN
…e31da7228fcb09f17e5bf7411cac8 Cherry pick #60765 to 23.3: Fix crash when using input() in INSERT SELECT JOIN
Backport #60765 to 23.3: Fix crash when using input() in INSERT SELECT JOIN
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix crash when using input() in INSERT SELECT JOIN. Closes #60035
Documentation entry for user-facing changes