24.8.14 Backport of #99119 - Fix LOGICAL_ERROR exception in ASTColumnsExceptTransformer::transform#2011
Open
ilejn wants to merge 1 commit into
Open
24.8.14 Backport of #99119 - Fix LOGICAL_ERROR exception in ASTColumnsExceptTransformer::transform#2011ilejn wants to merge 1 commit into
ilejn wants to merge 1 commit into
Conversation
…mer-bad-cast Fix LOGICAL_ERROR exception in `ASTColumnsExceptTransformer::transform` Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
Collaborator
|
This is an automated comment for commit bc5d458 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
|
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.
Linked issues
Fix LOGICAL_ERROR exception in ASTColumnsExceptTransformer::transform when EXCEPT column name matches an alias
When a query uses
SELECT * EXCEPT (col), expr AS col FROM tinside a subquery (e.g., in a JOIN), theQueryNormalizerruns beforetranslateQualifiedNames(due toremove_duplicatesbeing set byinterpretSubquery). The normalizer replaces theASTIdentifierforcolinside the EXCEPT transformer's children with the alias expression (ASTFunction), causing a subsequenttypeid_cast<ASTIdentifier &>to fail with LOGICAL_ERROR.Two fixes applied:
Prevent QueryNormalizer from descending into column transformer children (IASTColumnsTransformer), since their identifiers are column name references that should not be substituted with aliases.
Defensively handle non-
ASTIdentifier children inASTColumnsExceptTransformer::transformby falling back togetColumnName().Closes https://github.com/ClickHouse/clickhouse-core-incidents/issues/1433
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix LOGICAL_ERROR exception in ASTColumnsExceptTransformer::transform
CI/CD Options
Exclude tests:
Regression jobs to run: