Merge pull request #4401 from 4ertus2/ast

fix UB in TranslateQualifiedNamesMatcher
This commit is contained in:
alexey-milovidov 2019-02-14 21:48:30 +03:00 committed by GitHub
commit 6d5bbd642a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,6 +75,7 @@ std::vector<ASTPtr *> TranslateQualifiedNamesMatcher::visit(ASTIdentifier & iden
/// In case if column from the joined table are in source columns, change it's name to qualified. /// In case if column from the joined table are in source columns, change it's name to qualified.
if (best_table_pos && data.source_columns.count(identifier.shortName())) if (best_table_pos && data.source_columns.count(identifier.shortName()))
IdentifierSemantic::setNeedLongName(identifier, true); IdentifierSemantic::setNeedLongName(identifier, true);
if (!data.tables.empty())
IdentifierSemantic::setColumnNormalName(identifier, data.tables[best_table_pos].first); IdentifierSemantic::setColumnNormalName(identifier, data.tables[best_table_pos].first);
} }