Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
190fd88a
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,发现更多精彩内容 >>
未验证
提交
190fd88a
编写于
10月 12, 2020
作者:
N
Nikolai Kochetov
提交者:
GitHub
10月 12, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15785 from amosbird/e1
Code refactor.
上级
9b42bfdc
8e0862a0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
23 deletion
+12
-23
src/Interpreters/InterpreterKillQueryQuery.cpp
src/Interpreters/InterpreterKillQueryQuery.cpp
+1
-2
src/Interpreters/executeQuery.cpp
src/Interpreters/executeQuery.cpp
+2
-4
src/Server/PostgreSQLHandler.cpp
src/Server/PostgreSQLHandler.cpp
+1
-4
src/Server/TCPHandler.cpp
src/Server/TCPHandler.cpp
+8
-13
未找到文件。
src/Interpreters/InterpreterKillQueryQuery.cpp
浏览文件 @
190fd88a
...
...
@@ -300,8 +300,7 @@ Block InterpreterKillQueryQuery::getSelectResult(const String & columns, const S
if
(
where_expression
)
select_query
+=
" WHERE "
+
queryToString
(
where_expression
);
BlockIO
block_io
=
executeQuery
(
select_query
,
context
.
getGlobalContext
(),
true
);
auto
stream
=
block_io
.
getInputStream
();
auto
stream
=
executeQuery
(
select_query
,
context
.
getGlobalContext
(),
true
).
getInputStream
();
Block
res
=
stream
->
read
();
if
(
res
&&
stream
->
read
())
...
...
src/Interpreters/executeQuery.cpp
浏览文件 @
190fd88a
...
...
@@ -804,8 +804,7 @@ void executeQuery(
InputStreamFromASTInsertQuery
in
(
ast
,
&
istr
,
streams
.
out
->
getHeader
(),
context
,
nullptr
);
copyData
(
in
,
*
streams
.
out
);
}
if
(
streams
.
in
)
else
if
(
streams
.
in
)
{
/// FIXME: try to prettify this cast using `as<>()`
const
auto
*
ast_query_with_output
=
dynamic_cast
<
const
ASTQueryWithOutput
*>
(
ast
.
get
());
...
...
@@ -847,8 +846,7 @@ void executeQuery(
copyData
(
*
streams
.
in
,
*
out
,
[](){
return
false
;
},
[
&
out
](
const
Block
&
)
{
out
->
flush
();
});
}
if
(
pipeline
.
initialized
())
else
if
(
pipeline
.
initialized
())
{
const
ASTQueryWithOutput
*
ast_query_with_output
=
dynamic_cast
<
const
ASTQueryWithOutput
*>
(
ast
.
get
());
...
...
src/Server/PostgreSQLHandler.cpp
浏览文件 @
190fd88a
...
...
@@ -218,10 +218,7 @@ void PostgreSQLHandler::cancelRequest()
String
query
=
Poco
::
format
(
"KILL QUERY WHERE query_id = 'postgres:%d:%d'"
,
msg
->
process_id
,
msg
->
secret_key
);
ReadBufferFromString
replacement
(
query
);
executeQuery
(
replacement
,
*
out
,
true
,
connection_context
,
[](
const
String
&
,
const
String
&
,
const
String
&
,
const
String
&
)
{}
);
executeQuery
(
replacement
,
*
out
,
true
,
connection_context
,
{});
}
inline
std
::
unique_ptr
<
PostgreSQLProtocol
::
Messaging
::
StartupMessage
>
PostgreSQLHandler
::
receiveStartupMessage
(
int
payload_size
)
...
...
src/Server/TCPHandler.cpp
浏览文件 @
190fd88a
...
...
@@ -253,27 +253,27 @@ void TCPHandler::runImpl()
/// Processing Query
state
.
io
=
executeQuery
(
state
.
query
,
*
query_context
,
false
,
state
.
stage
,
may_have_embedded_data
);
if
(
state
.
io
.
out
)
state
.
need_receive_data_for_insert
=
true
;
after_check_cancelled
.
restart
();
after_send_progress
.
restart
();
/// Does the request require receive data from client?
if
(
state
.
need_receive_data_for_insert
)
if
(
state
.
io
.
out
)
{
state
.
need_receive_data_for_insert
=
true
;
processInsertQuery
(
connection_settings
);
else
if
(
state
.
need_receive_data_for_input
)
}
else
if
(
state
.
need_receive_data_for_input
)
// It implies pipeline execution
{
/// It is special case for input(), all works for reading data from client will be done in callbacks.
auto
executor
=
state
.
io
.
pipeline
.
execute
();
executor
->
execute
(
state
.
io
.
pipeline
.
getNumThreads
());
state
.
io
.
onFinish
();
}
else
if
(
state
.
io
.
pipeline
.
initialized
())
processOrdinaryQueryWithProcessors
();
else
else
if
(
state
.
io
.
in
)
processOrdinaryQuery
();
state
.
io
.
onFinish
();
/// Do it before sending end of stream, to have a chance to show log message in client.
query_scope
->
logPeakMemoryUsage
();
...
...
@@ -509,7 +509,6 @@ void TCPHandler::processInsertQuery(const Settings & connection_settings)
readData
(
connection_settings
);
state
.
io
.
out
->
writeSuffix
();
state
.
io
.
onFinish
();
}
...
...
@@ -571,8 +570,6 @@ void TCPHandler::processOrdinaryQuery()
sendData
({});
}
state
.
io
.
onFinish
();
sendProgress
();
}
...
...
@@ -638,8 +635,6 @@ void TCPHandler::processOrdinaryQueryWithProcessors()
sendData
({});
}
state
.
io
.
onFinish
();
sendProgress
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录