Fix several LOGICAL_ERRORs around setting alias of invalid AST nodes#77445
Merged
Algunenano merged 4 commits intoClickHouse:masterfrom Mar 13, 2025
Merged
Fix several LOGICAL_ERRORs around setting alias of invalid AST nodes#77445Algunenano merged 4 commits intoClickHouse:masterfrom
Algunenano merged 4 commits intoClickHouse:masterfrom
Conversation
Contributor
novikd
reviewed
Mar 12, 2025
Comment on lines
+75
to
+76
| if (array_join_expression->hasAlias()) | ||
| array_join_expression_ast->setAlias(array_join_expression->getAlias()); |
Member
There was a problem hiding this comment.
There's not difference. I'd remove if
Member
Author
There was a problem hiding this comment.
Member
Author
There was a problem hiding this comment.
Without the if it tries to set an empty alias to the ast. Even if it's empty, it's not allowed to set aliases to things like ASTAsterisk.
Member
There was a problem hiding this comment.
Okay, I see the problem. Let's then add a comment with an explanation. It's not obvious why it's so important.
Comment on lines
+19
to
+23
| $CLICKHOUSE_CLIENT -q "CREATE VIEW x AS (SELECT $FUNCTION_NAME(*)); -- { serverError BAD_ARGUMENTS }" | ||
| $CLICKHOUSE_CLIENT -q "CREATE VIEW x AS (SELECT $FUNCTION_NAME(t.*) FROM t); -- { serverError BAD_ARGUMENTS }" | ||
| $CLICKHOUSE_CLIENT -q "CREATE VIEW x AS (SELECT $FUNCTION_NAME(COLUMNS(''))); -- { serverError BAD_ARGUMENTS }" | ||
| $CLICKHOUSE_CLIENT -q "CREATE VIEW x AS (SELECT $FUNCTION_NAME(COLUMNS('t.*'))); -- { serverError BAD_ARGUMENTS }" | ||
| $CLICKHOUSE_CLIENT -q "CREATE VIEW x AS (SELECT $FUNCTION_NAME(COLUMNS('t.t*')) FROM t); -- { serverError BAD_ARGUMENTS }" |
Member
There was a problem hiding this comment.
It's probably possible to support it with enabled analyzer, but i'm ok to forbit it.
64d55a9 to
5d13c64
Compare
novikd
approved these changes
Mar 13, 2025
Comment on lines
+75
to
+76
| if (array_join_expression->hasAlias()) | ||
| array_join_expression_ast->setAlias(array_join_expression->getAlias()); |
Member
There was a problem hiding this comment.
Okay, I see the problem. Let's then add a comment with an explanation. It's not obvious why it's so important.
Algunenano
commented
Mar 13, 2025
Merged
via the queue into
ClickHouse:master
with commit Mar 13, 2025
87b81d9
123 of 126 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix several LOGICAL_ERRORs around setting alias of invalid AST nodes
Consciously not marking this as critical since a) it's impact is minimal and b) my impression is that is has some risks related to the validation (maybe something that was allowed before it's now disallowed by mistake and we don't notice it).
Closes #72537
Documentation entry for user-facing changes