Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
e136b417
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,发现更多精彩内容 >>
提交
e136b417
编写于
12月 17, 2014
作者:
A
Alexey Arno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add style cleanup and small functional test change. [#METR-14099]
上级
cba51f74
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
12 deletion
+12
-12
dbms/src/Interpreters/InterpreterSelectQuery.cpp
dbms/src/Interpreters/InterpreterSelectQuery.cpp
+2
-2
dbms/src/Parsers/formatAST.cpp
dbms/src/Parsers/formatAST.cpp
+8
-8
dbms/tests/queries/0_stateless/00098_1_union_all.sql
dbms/tests/queries/0_stateless/00098_1_union_all.sql
+2
-2
未找到文件。
dbms/src/Interpreters/InterpreterSelectQuery.cpp
浏览文件 @
e136b417
...
...
@@ -88,14 +88,14 @@ void InterpreterSelectQuery::init(BlockInputStreamPtr input_, const NamesAndType
if
(
isFirstSelectInsideUnionAll
())
{
// Создаем цепочку запросов SELECT и проверяем, что результаты всех запросов SELECT cовместимые.
// Создаем цепочку запросов SELECT и проверяем, что результаты всех запросов SELECT cовместимые.
// NOTE Мы можем безопасно применить static_cast вместо typeid_cast,
// потому что знаем, что в цепочке UNION ALL имеются только деревья типа SELECT.
InterpreterSelectQuery
*
interpreter
=
this
;
Block
first
=
interpreter
->
getSampleBlock
();
for
(
ASTPtr
tree
=
query
.
next_union_all
;
!
tree
.
isNull
();
tree
=
(
static_cast
<
ASTSelectQuery
&>
(
*
tree
)).
next_union_all
)
{
interpreter
->
next_select_in_union_all
.
reset
(
new
InterpreterSelectQueryWithContext
(
tree
,
context
,
to_stage
,
subquery_depth
,
nullptr
,
false
));
interpreter
->
next_select_in_union_all
.
reset
(
new
InterpreterSelectQueryWithContext
(
tree
,
context
,
to_stage
,
subquery_depth
,
nullptr
,
false
));
interpreter
=
&
(
interpreter
->
next_select_in_union_all
->
query
);
Block
current
=
interpreter
->
getSampleBlock
();
if
(
!
blocksHaveEqualStructure
(
first
,
current
))
...
...
dbms/src/Parsers/formatAST.cpp
浏览文件 @
e136b417
...
...
@@ -239,16 +239,16 @@ void formatAST(const ASTSelectQuery & ast, std::ostream & s, size_t indent, bo
formatAST
(
*
ast
.
format
,
s
,
indent
,
hilite
,
one_line
);
}
if
(
ast
.
next_union_all
)
{
s
<<
(
hilite
?
hilite_keyword
:
""
)
<<
nl_or_ws
<<
indent_str
<<
"UNION ALL "
<<
nl_or_ws
<<
(
hilite
?
hilite_none
:
""
);
if
(
ast
.
next_union_all
)
{
s
<<
(
hilite
?
hilite_keyword
:
""
)
<<
nl_or_ws
<<
indent_str
<<
"UNION ALL "
<<
nl_or_ws
<<
(
hilite
?
hilite_none
:
""
);
// NOTE Мы можем безопасно применить static_cast вместо typeid_cast, потому что знаем, что в цепочке UNION ALL
// имеются только деревья типа SELECT.
const
ASTSelectQuery
&
next_ast
=
static_cast
<
const
ASTSelectQuery
&>
(
*
ast
.
next_union_all
);
// NOTE Мы можем безопасно применить static_cast вместо typeid_cast, потому что знаем, что в цепочке UNION ALL
// имеются только деревья типа SELECT.
const
ASTSelectQuery
&
next_ast
=
static_cast
<
const
ASTSelectQuery
&>
(
*
ast
.
next_union_all
);
formatAST
(
next_ast
,
s
,
indent
,
hilite
,
one_line
,
need_parens
);
}
formatAST
(
next_ast
,
s
,
indent
,
hilite
,
one_line
,
need_parens
);
}
}
void
formatAST
(
const
ASTSubquery
&
ast
,
std
::
ostream
&
s
,
size_t
indent
,
bool
hilite
,
bool
one_line
,
bool
need_parens
)
...
...
dbms/tests/queries/0_stateless/00098_1_union_all.sql
浏览文件 @
e136b417
DROP
TABLE
IF
EXISTS
data2013
;
DROP
TABLE
IF
EXISTS
data2014
;
CREATE
TABLE
data2013
(
name
String
,
value
UInt32
)
ENGINE
=
TinyLog
;
CREATE
TABLE
data2014
(
name
String
,
value
UInt32
)
ENGINE
=
TinyLog
;
CREATE
TABLE
data2013
(
name
String
,
value
UInt32
)
ENGINE
=
Memory
;
CREATE
TABLE
data2014
(
name
String
,
value
UInt32
)
ENGINE
=
Memory
;
INSERT
INTO
data2013
(
name
,
value
)
VALUES
(
'Alice'
,
1000
);
INSERT
INTO
data2013
(
name
,
value
)
VALUES
(
'Bob'
,
2000
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录