From a2ff9391ad0c099cd90263e0ff53c12804ca0730 Mon Sep 17 00:00:00 2001 From: chertus Date: Thu, 14 Feb 2019 17:25:55 +0300 Subject: [PATCH] fix UB --- dbms/src/Interpreters/TranslateQualifiedNamesVisitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Interpreters/TranslateQualifiedNamesVisitor.cpp b/dbms/src/Interpreters/TranslateQualifiedNamesVisitor.cpp index febc9753366..35aa9461709 100644 --- a/dbms/src/Interpreters/TranslateQualifiedNamesVisitor.cpp +++ b/dbms/src/Interpreters/TranslateQualifiedNamesVisitor.cpp @@ -75,7 +75,8 @@ std::vector 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 {};