mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
More fixes
This commit is contained in:
parent
d69b6307b5
commit
fb473e6f9c
@ -57,7 +57,7 @@ public:
|
||||
return;
|
||||
|
||||
bool is_table = false;
|
||||
ASTPtr subquery_or_table_name = ast; /// ASTIdentifier | ASTSubquery | ASTTableExpression
|
||||
ASTPtr subquery_or_table_name = ast; /// ASTTableIdentifier | ASTSubquery | ASTTableExpression
|
||||
|
||||
if (const auto * ast_table_expr = ast->as<ASTTableExpression>())
|
||||
{
|
||||
@ -69,7 +69,7 @@ public:
|
||||
is_table = true;
|
||||
}
|
||||
}
|
||||
else if (ast->as<ASTIdentifier>())
|
||||
else if (ast->as<ASTTableIdentifier>())
|
||||
is_table = true;
|
||||
|
||||
if (!subquery_or_table_name)
|
||||
|
@ -8,7 +8,6 @@ namespace DB
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int SYNTAX_ERROR;
|
||||
extern const int AMBIGUOUS_COLUMN_NAME;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ void MarkTableIdentifiersMatcher::visit(const ASTFunction & func, ASTPtr & ptr,
|
||||
{
|
||||
auto ast = func.arguments->children.at(1);
|
||||
auto opt_name = tryGetIdentifierName(ast);
|
||||
if (opt_name && !data.aliases.count(*opt_name))
|
||||
if (opt_name && !data.aliases.count(*opt_name) && ast->as<ASTIdentifier>())
|
||||
{
|
||||
ptr = func.clone();
|
||||
ptr->as<ASTFunction>()->arguments->children[1] = ast->as<ASTIdentifier>()->createTable();
|
||||
@ -48,7 +48,7 @@ void MarkTableIdentifiersMatcher::visit(const ASTFunction & func, ASTPtr & ptr,
|
||||
return;
|
||||
auto & ast = func.arguments->children.at(0);
|
||||
auto opt_name = tryGetIdentifierName(ast);
|
||||
if (opt_name && !data.aliases.count(*opt_name))
|
||||
if (opt_name && !data.aliases.count(*opt_name) && ast->as<ASTIdentifier>())
|
||||
{
|
||||
ptr = func.clone();
|
||||
ptr->as<ASTFunction>()->arguments->children[0] = ast->as<ASTIdentifier>()->createTable();
|
||||
|
@ -13,7 +13,6 @@ namespace DB
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int UNEXPECTED_AST_STRUCTURE;
|
||||
extern const int SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
ASTIdentifier::ASTIdentifier(const String & short_name, ASTPtr && name_param)
|
||||
@ -221,7 +220,7 @@ bool tryGetIdentifierNameInto(const IAST * ast, String & name)
|
||||
{
|
||||
if (ast)
|
||||
{
|
||||
if (const auto * node = ast->as<ASTIdentifier>())
|
||||
if (const auto * node = dynamic_cast<const ASTIdentifier *>(ast))
|
||||
{
|
||||
name = node->name();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user