fix bug for query "select *, abc.*" should failed. (#11753)

This commit is contained in:
hexiaoting 2020-06-23 17:16:42 +08:00 committed by GitHub
parent 2f877815fe
commit 9135cb1bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -210,13 +210,11 @@ void TranslateQualifiedNamesMatcher::visit(ASTExpressionList & node, const ASTPt
if (tables_with_columns.empty())
throw Exception("An asterisk cannot be replaced with empty columns.", ErrorCodes::LOGICAL_ERROR);
has_asterisk = true;
break;
}
else if (const auto * qa = child->as<ASTQualifiedAsterisk>())
{
visit(*qa, child, data); /// check if it's OK before rewrite
has_asterisk = true;
break;
}
}

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,6 @@
select *;
--error: should be failed for abc.*;
select abc.*; --{serverError 47}
select *, abc.*; --{serverError 47}
select abc.*, *; --{serverError 47}