Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
d9503bfb
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,发现更多精彩内容 >>
提交
d9503bfb
编写于
12月 16, 2014
作者:
A
Alexey Arno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply required fixes [#METR-14099].
上级
497ff4b9
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
774 addition
and
766 deletion
+774
-766
dbms/include/DB/Core/Block.h
dbms/include/DB/Core/Block.h
+0
-3
dbms/include/DB/DataTypes/DataTypeFixedString.h
dbms/include/DB/DataTypes/DataTypeFixedString.h
+0
-2
dbms/include/DB/DataTypes/DataTypeString.h
dbms/include/DB/DataTypes/DataTypeString.h
+0
-2
dbms/include/DB/DataTypes/IDataType.h
dbms/include/DB/DataTypes/IDataType.h
+0
-3
dbms/src/Core/Block.cpp
dbms/src/Core/Block.cpp
+0
-35
dbms/src/Interpreters/InterpreterSelectQuery.cpp
dbms/src/Interpreters/InterpreterSelectQuery.cpp
+762
-715
dbms/src/Parsers/ParserSelectQuery.cpp
dbms/src/Parsers/ParserSelectQuery.cpp
+11
-5
dbms/src/Parsers/formatAST.cpp
dbms/src/Parsers/formatAST.cpp
+1
-1
未找到文件。
dbms/include/DB/Core/Block.h
浏览文件 @
d9503bfb
...
...
@@ -125,9 +125,6 @@ typedef std::list<Block> BlocksList;
/// Сравнить типы столбцов у блоков. Порядок столбцов имеет значение. Имена не имеют значения.
bool
blocksHaveEqualStructure
(
const
Block
&
lhs
,
const
Block
&
rhs
);
/// Проверить, что типы столбцов у блоков совместимые. Порядок имеет значение. Имена не имеют значения.
bool
blocksHaveCompatibleStructure
(
const
Block
&
lhs
,
const
Block
&
rhs
);
}
namespace
std
...
...
dbms/include/DB/DataTypes/DataTypeFixedString.h
浏览文件 @
d9503bfb
...
...
@@ -29,8 +29,6 @@ public:
{
return
"FixedString("
+
toString
(
n
)
+
")"
;
}
bool
behavesAsString
()
const
{
return
true
;
}
DataTypePtr
clone
()
const
{
...
...
dbms/include/DB/DataTypes/DataTypeString.h
浏览文件 @
d9503bfb
...
...
@@ -22,8 +22,6 @@ public:
{
return
"String"
;
}
bool
behavesAsString
()
const
{
return
true
;
}
DataTypePtr
clone
()
const
{
...
...
dbms/include/DB/DataTypes/IDataType.h
浏览文件 @
d9503bfb
...
...
@@ -31,9 +31,6 @@ public:
/// true для чисел, false для даты и даты-с-временем.
virtual
bool
behavesAsNumber
()
const
{
return
false
;
}
/// Является ли тип строковым.
virtual
bool
behavesAsString
()
const
{
return
false
;
}
/// Клонировать
virtual
SharedPtr
<
IDataType
>
clone
()
const
=
0
;
...
...
dbms/src/Core/Block.cpp
浏览文件 @
d9503bfb
...
...
@@ -16,24 +16,6 @@
#include <DB/Parsers/formatAST.h>
namespace
{
bool
typesAreCompatible
(
const
DB
::
IDataType
&
lhs
,
const
DB
::
IDataType
&
rhs
)
{
if
(
lhs
.
behavesAsNumber
()
&&
rhs
.
behavesAsNumber
())
return
true
;
if
(
lhs
.
behavesAsString
()
&&
rhs
.
behavesAsString
())
return
true
;
if
(
lhs
.
getName
()
==
rhs
.
getName
())
return
true
;
return
false
;
}
}
namespace
DB
{
...
...
@@ -389,23 +371,6 @@ bool blocksHaveEqualStructure(const Block & lhs, const Block & rhs)
return
true
;
}
bool
blocksHaveCompatibleStructure
(
const
Block
&
lhs
,
const
Block
&
rhs
)
{
size_t
columns
=
lhs
.
columns
();
if
(
rhs
.
columns
()
!=
columns
)
return
false
;
for
(
size_t
i
=
0
;
i
<
columns
;
++
i
)
{
const
IDataType
&
lhs_type
=
*
lhs
.
getByPosition
(
i
).
type
;
const
IDataType
&
rhs_type
=
*
rhs
.
getByPosition
(
i
).
type
;
if
(
!
typesAreCompatible
(
lhs_type
,
rhs_type
))
return
false
;
}
return
true
;
}
void
Block
::
clear
()
{
...
...
dbms/src/Interpreters/InterpreterSelectQuery.cpp
浏览文件 @
d9503bfb
此差异已折叠。
点击以展开。
dbms/src/Parsers/ParserSelectQuery.cpp
浏览文件 @
d9503bfb
...
...
@@ -38,7 +38,8 @@ bool ParserSelectQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Expected &
ParserString
s_order
(
"ORDER"
,
true
,
true
);
ParserString
s_limit
(
"LIMIT"
,
true
,
true
);
ParserString
s_format
(
"FORMAT"
,
true
,
true
);
ParserString
s_union_all
(
"UNION ALL"
,
true
,
true
);
ParserString
s_union
(
"UNION"
,
true
,
true
);
ParserString
s_all
(
"ALL"
,
true
,
true
);
ParserNotEmptyExpressionList
exp_list
;
ParserExpressionWithOptionalAlias
exp_elem
;
...
...
@@ -291,17 +292,22 @@ bool ParserSelectQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Expected &
}
// UNION ALL select query
if
(
s_union
_all
.
ignore
(
pos
,
end
,
expected
))
if
(
s_union
.
ignore
(
pos
,
end
,
expected
))
{
ws
.
ignore
(
pos
,
end
);
ParserSelectQuery
select_p
;
if
(
!
select_p
.
parse
(
pos
,
end
,
select_query
->
next_union_all
,
expected
))
if
(
s_all
.
ignore
(
pos
,
end
,
expected
))
{
ParserSelectQuery
select_p
;
if
(
!
select_p
.
parse
(
pos
,
end
,
select_query
->
next_union_all
,
expected
))
return
false
;
}
else
return
false
;
ws
.
ignore
(
pos
,
end
);
}
select_query
->
children
.
push_back
(
select_query
->
select_expression_list
);
if
(
select_query
->
database
)
select_query
->
children
.
push_back
(
select_query
->
database
);
...
...
dbms/src/Parsers/formatAST.cpp
浏览文件 @
d9503bfb
...
...
@@ -239,7 +239,7 @@ 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
.
isNull
()
)
if
(
ast
.
next_union_all
)
{
s
<<
(
hilite
?
hilite_keyword
:
""
)
<<
nl_or_ws
<<
indent_str
<<
"UNION ALL "
<<
nl_or_ws
<<
(
hilite
?
hilite_none
:
""
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录