mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Resolved #891. Fixed aliases for empty scalar subqueries. [#CLICKHOUSE-3]
This commit is contained in:
parent
1cd217ba56
commit
b772eaa3a8
@ -1146,7 +1146,9 @@ void ExpressionAnalyzer::executeScalarSubqueriesImpl(ASTPtr & ast)
|
||||
if (!block)
|
||||
{
|
||||
/// Interpret subquery with empty result as Null literal
|
||||
ast = std::make_unique<ASTLiteral>(ast->range, Null());
|
||||
auto ast_new = std::make_unique<ASTLiteral>(ast->range, Null());
|
||||
ast_new->setAlias(ast->tryGetAlias());
|
||||
ast = std::move(ast_new);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5,3 +5,5 @@
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
a b
|
||||
\N 1
|
||||
|
@ -5,3 +5,4 @@ SELECT (SELECT Null WHERE nuLL IS NOT NULL);
|
||||
SELECT (SELECT Null WHERE 1);
|
||||
SELECT CAST(NULL as Null);
|
||||
SELECT (SELECT CAST(NULL as Null) WHERE 0);
|
||||
SELECT (SELECT 1 WHERE 0) AS a, (SELECT 1 WHERE 1) AS b FORMAT TSVWithNames;
|
||||
|
Loading…
Reference in New Issue
Block a user