Fixing incompatibilities [#METR-2944].

This commit is contained in:
Alexey Milovidov 2016-07-23 05:42:42 +03:00
parent dc665c67c5
commit 5f423e9023
2 changed files with 16 additions and 16 deletions

View File

@ -695,7 +695,8 @@ void ExpressionAnalyzer::normalizeTreeImpl(
{ {
auto & child = func_node->arguments->children[i]; auto & child = func_node->arguments->children[i];
if (typeid_cast<const ASTSelectQuery *>(child.get())) if (typeid_cast<const ASTSelectQuery *>(child.get())
|| typeid_cast<const ASTTableExpression *>(child.get()))
continue; continue;
normalizeTreeImpl(child, finished_asts, current_asts, current_alias); normalizeTreeImpl(child, finished_asts, current_asts, current_alias);
@ -705,7 +706,8 @@ void ExpressionAnalyzer::normalizeTreeImpl(
{ {
for (auto & child : ast->children) for (auto & child : ast->children)
{ {
if (typeid_cast<const ASTSelectQuery *>(child.get())) if (typeid_cast<const ASTSelectQuery *>(child.get())
|| typeid_cast<const ASTTableExpression *>(child.get()))
continue; continue;
normalizeTreeImpl(child, finished_asts, current_asts, current_alias); normalizeTreeImpl(child, finished_asts, current_asts, current_alias);
@ -779,7 +781,7 @@ void ExpressionAnalyzer::executeScalarSubqueries()
for (auto & child : ast->children) for (auto & child : ast->children)
{ {
/// Не опускаемся в FROM, JOIN, UNION. /// Не опускаемся в FROM, JOIN, UNION.
if (!typeid_cast<const ASTTablesInSelectQuery *>(child.get()) if (!typeid_cast<const ASTTableExpression *>(child.get())
&& child.get() != select_query->next_union_all.get()) && child.get() != select_query->next_union_all.get())
{ {
executeScalarSubqueriesImpl(child); executeScalarSubqueriesImpl(child);
@ -886,9 +888,7 @@ void ExpressionAnalyzer::executeScalarSubqueriesImpl(ASTPtr & ast)
{ {
/** Don't descend into subqueries in FROM section. /** Don't descend into subqueries in FROM section.
*/ */
ASTTablesInSelectQuery * tables = typeid_cast<ASTTablesInSelectQuery *>(ast.get()); if (!typeid_cast<ASTTableExpression *>(ast.get()))
if (!tables)
{ {
/** Don't descend into subqueries in arguments of IN operator. /** Don't descend into subqueries in arguments of IN operator.
* But if an argument is not subquery, than deeper may be scalar subqueries and we need to descend in them. * But if an argument is not subquery, than deeper may be scalar subqueries and we need to descend in them.

View File

@ -936,16 +936,16 @@ SELECT round(2.718281828459045, 18), ceil(2.718281828459045, 18), floor(2.718281
SELECT round(2.718281828459045, 19), ceil(2.718281828459045, 19), floor(2.718281828459045, 19); SELECT round(2.718281828459045, 19), ceil(2.718281828459045, 19), floor(2.718281828459045, 19);
SELECT round(2.718281828459045, 20), ceil(2.718281828459045, 20), floor(2.718281828459045, 20); SELECT round(2.718281828459045, 20), ceil(2.718281828459045, 20), floor(2.718281828459045, 20);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(1) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(1) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(2) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(2) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(3) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(3) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(4) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(4) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(5) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(5) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(6) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(6) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(7) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(7) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(8) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(8) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(9) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(9) AS x);
SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y ARRAY JOIN range(10) AS x); SELECT round(y,3) FROM (SELECT 2.718281828459045 + 1/(1+x*x) AS y FROM system.one ARRAY JOIN range(10) AS x);
/* Negative zeroes. */ /* Negative zeroes. */