Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XKZJ_WCL
TDengine
提交
42ddfce0
T
TDengine
项目概览
XKZJ_WCL
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
42ddfce0
编写于
1月 07, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug
上级
09e1aeaa
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
7 deletion
+34
-7
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+34
-7
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
42ddfce0
...
...
@@ -188,8 +188,10 @@ static int64_t doTSBlockIntersect(SSqlObj* pSql, SJoinSupporter* pSupporter1, SJ
tsBufFlush
(
output2
);
tsBufDestroy
(
pSupporter1
->
pTSBuf
);
pSupporter1
->
pTSBuf
=
NULL
;
tsBufDestroy
(
pSupporter2
->
pTSBuf
);
pSupporter2
->
pTSBuf
=
NULL
;
TSKEY
et
=
taosGetTimestampUs
();
tscDebug
(
"%p input1:%"
PRId64
", input2:%"
PRId64
", final:%"
PRId64
" in %d vnodes for secondary query after ts blocks "
"intersecting, skey:%"
PRId64
", ekey:%"
PRId64
", numOfVnode:%d, elapsed time:%"
PRId64
" us"
,
...
...
@@ -219,12 +221,9 @@ SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, int32_t index) {
assert
(
pSupporter
->
uid
!=
0
);
taosGetTmpfilePath
(
"join-"
,
pSupporter
->
path
);
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w"
);
// todo handle error
if
(
pSupporter
->
f
==
NULL
)
{
tscError
(
"%p failed to create tmp file:%s, reason:%s"
,
pSql
,
pSupporter
->
path
,
strerror
(
errno
));
}
// do NOT create file here to reduce crash generated file left issue
pSupporter
->
f
=
NULL
;
return
pSupporter
;
}
...
...
@@ -244,12 +243,19 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
tscFieldInfoClear
(
&
pSupporter
->
fieldsInfo
);
if
(
pSupporter
->
pTSBuf
!=
NULL
)
{
tsBufDestroy
(
pSupporter
->
pTSBuf
);
pSupporter
->
pTSBuf
=
NULL
;
}
unlink
(
pSupporter
->
path
);
if
(
pSupporter
->
f
!=
NULL
)
{
fclose
(
pSupporter
->
f
);
unlink
(
pSupporter
->
path
);
pSupporter
->
f
=
NULL
;
}
if
(
pSupporter
->
pVgroupTables
!=
NULL
)
{
taosArrayDestroy
(
pSupporter
->
pVgroupTables
);
pSupporter
->
pVgroupTables
=
NULL
;
...
...
@@ -526,6 +532,8 @@ static void quitAllSubquery(SSqlObj* pSqlObj, SJoinSupporter* pSupporter) {
tscError
(
"%p all subquery return and query failed, global code:%s"
,
pSqlObj
,
tstrerror
(
pSqlObj
->
res
.
code
));
freeJoinSubqueryObj
(
pSqlObj
);
}
tscDestroyJoinSupporter
(
pSupporter
);
}
// update the query time range according to the join results on timestamp
...
...
@@ -921,6 +929,22 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
}
if
(
numOfRows
>
0
)
{
// write the compressed timestamp to disk file
if
(
pSupporter
->
f
==
NULL
)
{
pSupporter
->
f
=
fopen
(
pSupporter
->
path
,
"w"
);
if
(
pSupporter
->
f
==
NULL
)
{
tscError
(
"%p failed to create tmp file:%s, reason:%s"
,
pSql
,
pSupporter
->
path
,
strerror
(
errno
));
pParentSql
->
res
.
code
=
TAOS_SYSTEM_ERROR
(
errno
);
quitAllSubquery
(
pParentSql
,
pSupporter
);
tscAsyncResultOnError
(
pParentSql
);
return
;
}
}
fwrite
(
pRes
->
data
,
(
size_t
)
pRes
->
numOfRows
,
1
,
pSupporter
->
f
);
fclose
(
pSupporter
->
f
);
pSupporter
->
f
=
NULL
;
...
...
@@ -930,6 +954,9 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
tscError
(
"%p invalid ts comp file from vnode, abort subquery, file size:%d"
,
pSql
,
numOfRows
);
pParentSql
->
res
.
code
=
TAOS_SYSTEM_ERROR
(
errno
);
quitAllSubquery
(
pParentSql
,
pSupporter
);
tscAsyncResultOnError
(
pParentSql
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录