Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
1602daba
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,发现更多精彩内容 >>
提交
1602daba
编写于
9月 12, 2019
作者:
A
alexey-milovidov
提交者:
Nikita Mikhaylov
9月 12, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #6911 from yandex/fix-insert-select-data-loss
Fix insert select data loss (cherry picked from commit
6fbf9ca7
)
上级
da44d9fd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
3 deletion
+21
-3
dbms/src/DataStreams/copyData.cpp
dbms/src/DataStreams/copyData.cpp
+0
-2
dbms/src/Interpreters/executeQuery.cpp
dbms/src/Interpreters/executeQuery.cpp
+14
-1
dbms/tests/queries/0_stateless/01009_insert_select_data_loss.reference
...eries/0_stateless/01009_insert_select_data_loss.reference
+2
-0
dbms/tests/queries/0_stateless/01009_insert_select_data_loss.sql
...sts/queries/0_stateless/01009_insert_select_data_loss.sql
+5
-0
未找到文件。
dbms/src/DataStreams/copyData.cpp
浏览文件 @
1602daba
...
...
@@ -28,8 +28,6 @@ void copyDataImpl(IBlockInputStream & from, IBlockOutputStream & to, TCancelCall
break
;
to
.
write
(
block
);
if
(
!
block
.
rows
())
to
.
flush
();
progress
(
block
);
}
...
...
dbms/src/Interpreters/executeQuery.cpp
浏览文件 @
1602daba
...
...
@@ -35,6 +35,7 @@
#include <Processors/Transforms/LimitsCheckingTransform.h>
#include <Processors/Transforms/MaterializingTransform.h>
#include <Processors/Formats/IOutputFormat.h>
#include <Parsers/ASTWatchQuery.h>
namespace
ProfileEvents
{
...
...
@@ -631,7 +632,19 @@ void executeQuery(
if
(
set_query_id
)
set_query_id
(
context
.
getClientInfo
().
current_query_id
);
copyData
(
*
streams
.
in
,
*
out
);
if
(
ast
->
as
<
ASTWatchQuery
>
())
{
/// For Watch query, flush data if block is empty (to send data to client).
auto
flush_callback
=
[
&
out
](
const
Block
&
block
)
{
if
(
block
.
rows
()
==
0
)
out
->
flush
();
};
copyData
(
*
streams
.
in
,
*
out
,
[](){
return
false
;
},
std
::
move
(
flush_callback
));
}
else
copyData
(
*
streams
.
in
,
*
out
);
}
if
(
pipeline
.
initialized
())
...
...
dbms/tests/queries/0_stateless/01009_insert_select_data_loss.reference
0 → 100644
浏览文件 @
1602daba
0
10
dbms/tests/queries/0_stateless/01009_insert_select_data_loss.sql
0 → 100644
浏览文件 @
1602daba
drop
table
if
exists
tab
;
create
table
tab
(
x
UInt64
)
engine
=
MergeTree
order
by
tuple
();
insert
into
tab
select
number
as
n
from
numbers
(
20
)
any
inner
join
(
select
number
*
10
as
n
from
numbers
(
2
))
using
(
n
)
settings
any_join_distinct_right_table_keys
=
1
,
max_block_size
=
5
;
select
*
from
tab
order
by
x
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录