Fix style and add low-level check

This commit is contained in:
alesapin 2021-02-25 17:43:58 +03:00
parent 5c6c318737
commit 653d962cdd
2 changed files with 4 additions and 1 deletions

View File

@ -520,7 +520,7 @@ public:
void checkAlterIsPossible(const AlterCommands & commands, const Settings & settings) const override;
/// Checks if the Mutation can be performed.
/// (currenly no additional checks: always ok)
/// (currently no additional checks: always ok)
void checkMutationIsPossible(const MutationCommands & commands, const Settings & settings) const override;
/// Checks that partition name in all commands is valid

View File

@ -105,6 +105,9 @@ void StorageView::read(
static ASTTableExpression * getFirstTableExpression(ASTSelectQuery & select_query)
{
if (!select_query.tables() || select_query.tables()->children.empty())
throw Exception("Logical error: no table expression in view select AST", ErrorCodes::LOGICAL_ERROR);
auto * select_element = select_query.tables()->children[0]->as<ASTTablesInSelectQueryElement>();
if (!select_element->table_expression)