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,7 +75,8 @@ 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.
if (best_table_pos && data.source_columns.count(identifier.shortName()))
IdentifierSemantic::setNeedLongName(identifier, true);
IdentifierSemantic::setColumnNormalName(identifier, data.tables[best_table_pos].first);
if (!data.tables.empty())
IdentifierSemantic::setColumnNormalName(identifier, data.tables[best_table_pos].first);
}
return {};