Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
eb1ae65e
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eb1ae65e
编写于
11月 14, 2016
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed error with analyzing double-distributed subqueries [#METR-23472].
上级
52390b01
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
21 deletion
+21
-21
dbms/include/DB/Interpreters/InJoinSubqueriesPreprocessor.h
dbms/include/DB/Interpreters/InJoinSubqueriesPreprocessor.h
+21
-20
dbms/src/Interpreters/tests/in_join_subqueries_preprocessor.cpp
...rc/Interpreters/tests/in_join_subqueries_preprocessor.cpp
+0
-1
未找到文件。
dbms/include/DB/Interpreters/InJoinSubqueriesPreprocessor.h
浏览文件 @
eb1ae65e
...
@@ -73,9 +73,9 @@ bool isQueryFromTable(const ASTSelectQuery & query)
...
@@ -73,9 +73,9 @@ bool isQueryFromTable(const ASTSelectQuery & query)
if
(
query_table
)
if
(
query_table
)
{
{
if
(
typeid_cast
<
const
ASTSelectQuery
*>
(
query_table
.
get
())
!=
nullptr
)
if
(
typeid_cast
<
const
ASTSelectQuery
*>
(
query_table
.
get
()))
return
false
;
return
false
;
else
if
(
typeid_cast
<
const
ASTFunction
*>
(
query_table
.
get
())
!=
nullptr
)
else
if
(
typeid_cast
<
const
ASTFunction
*>
(
query_table
.
get
()))
return
false
;
return
false
;
else
else
return
true
;
return
true
;
...
@@ -166,11 +166,7 @@ public:
...
@@ -166,11 +166,7 @@ public:
auto
node
=
to_preprocess
.
back
();
auto
node
=
to_preprocess
.
back
();
to_preprocess
.
pop_back
();
to_preprocess
.
pop_back
();
ASTFunction
*
function
;
if
(
ASTFunction
*
function
=
typeid_cast
<
ASTFunction
*>
(
node
))
ASTTableJoin
*
join
;
ASTSelectQuery
*
sub_select_query
;
if
((
function
=
typeid_cast
<
ASTFunction
*>
(
node
))
!=
nullptr
)
{
{
auto
attributes
=
getAttributesFromInSubqueryName
(
function
->
name
);
auto
attributes
=
getAttributesFromInSubqueryName
(
function
->
name
);
if
(
attributes
!=
0
)
if
(
attributes
!=
0
)
...
@@ -180,23 +176,28 @@ public:
...
@@ -180,23 +176,28 @@ public:
node
->
attributes
|=
attributes
;
node
->
attributes
|=
attributes
;
}
}
}
}
else
if
(
(
join
=
typeid_cast
<
ASTTableJoin
*>
(
node
))
!=
nullptr
)
else
if
(
ASTTablesInSelectQueryElement
*
join
=
typeid_cast
<
ASTTablesInSelectQueryElement
*>
(
node
)
)
{
{
/// Найдена секция JOIN.
if
(
join
->
table_join
)
node
->
enclosing_in_or_join
=
node
;
{
node
->
attributes
|=
IAST
::
IsJoin
;
/// Найдена секция JOIN.
if
(
join
->
locality
==
ASTTableJoin
::
Locality
::
Global
)
join
->
enclosing_in_or_join
=
join
->
table_join
.
get
();
node
->
attributes
|=
IAST
::
IsGlobal
;
join
->
table_join
->
attributes
|=
IAST
::
IsJoin
;
if
(
static_cast
<
const
ASTTableJoin
&>
(
*
join
->
table_join
).
locality
==
ASTTableJoin
::
Locality
::
Global
)
join
->
table_join
->
attributes
|=
IAST
::
IsGlobal
;
}
}
}
else
if
((
node
!=
static_cast
<
IAST
*>
(
select_query
))
else
if
(
node
!=
static_cast
<
IAST
*>
(
select_query
))
&&
((
sub_select_query
=
typeid_cast
<
ASTSelectQuery
*>
(
node
))
!=
nullptr
))
{
{
++
node
->
select_query_depth
;
if
(
ASTSelectQuery
*
sub_select_query
=
typeid_cast
<
ASTSelectQuery
*>
(
node
))
if
(
sub_select_query
->
enclosing_in_or_join
!=
nullptr
)
{
{
/// Найден подзапрос внутри секции IN или JOIN.
++
node
->
select_query_depth
;
preprocessSubquery
(
*
sub_select_query
);
if
(
sub_select_query
->
enclosing_in_or_join
)
{
/// Найден подзапрос внутри секции IN или JOIN.
preprocessSubquery
(
*
sub_select_query
);
}
}
}
}
}
...
...
dbms/src/Interpreters/tests/in_join_subqueries_preprocessor.cpp
浏览文件 @
eb1ae65e
...
@@ -1148,7 +1148,6 @@ bool performTests(const TestEntries & entries)
...
@@ -1148,7 +1148,6 @@ bool performTests(const TestEntries & entries)
if
(
res
.
first
)
if
(
res
.
first
)
{
{
++
count
;
++
count
;
std
::
cout
<<
"Test "
<<
i
<<
" passed.
\n
"
;
}
}
else
else
std
::
cout
<<
"Test "
<<
i
<<
" at line "
<<
entry
.
line_num
<<
" failed.
\n
"
std
::
cout
<<
"Test "
<<
i
<<
" at line "
<<
entry
.
line_num
<<
" failed.
\n
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录