Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
31202e83
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
31202e83
编写于
11月 22, 2022
作者:
D
dapan1121
提交者:
GitHub
11月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18334 from taosdata/fix/TD-20440
fix: crash caused by stream fill
上级
ef4846a6
2020ea0a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
33 deletion
+34
-33
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+1
-0
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+17
-0
source/libs/executor/inc/tfill.h
source/libs/executor/inc/tfill.h
+0
-16
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+2
-0
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+14
-17
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
31202e83
...
...
@@ -1962,6 +1962,7 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
memset
(
pBuf
,
0
,
sizeof
(
pBuf
));
char
*
pData
=
colDataGetVarData
(
pColInfoData
,
j
);
int32_t
dataSize
=
TMIN
(
sizeof
(
pBuf
),
varDataLen
(
pData
));
dataSize
=
TMIN
(
dataSize
,
50
);
memcpy
(
pBuf
,
varDataVal
(
pData
),
dataSize
);
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15s |"
,
pBuf
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
31202e83
...
...
@@ -754,6 +754,23 @@ typedef struct SStreamPartitionOperatorInfo {
SSDataBlock
*
pDelRes
;
}
SStreamPartitionOperatorInfo
;
typedef
struct
SStreamFillSupporter
{
int32_t
type
;
// fill type
SInterval
interval
;
SResultRowData
prev
;
SResultRowData
cur
;
SResultRowData
next
;
SResultRowData
nextNext
;
SFillColInfo
*
pAllColInfo
;
// fill exprs and not fill exprs
SExprSupp
notFillExprSup
;
int32_t
numOfAllCols
;
// number of all exprs, including the tags columns
int32_t
numOfFillCols
;
int32_t
numOfNotFillCols
;
int32_t
rowSize
;
SSHashObj
*
pResMap
;
bool
hasDelete
;
}
SStreamFillSupporter
;
typedef
struct
SStreamFillOperatorInfo
{
SStreamFillSupporter
*
pFillSup
;
SSDataBlock
*
pRes
;
...
...
source/libs/executor/inc/tfill.h
浏览文件 @
31202e83
...
...
@@ -111,22 +111,6 @@ typedef struct SStreamFillInfo {
int32_t
delIndex
;
}
SStreamFillInfo
;
typedef
struct
SStreamFillSupporter
{
int32_t
type
;
// fill type
SInterval
interval
;
SResultRowData
prev
;
SResultRowData
cur
;
SResultRowData
next
;
SResultRowData
nextNext
;
SFillColInfo
*
pAllColInfo
;
// fill exprs and not fill exprs
int32_t
numOfAllCols
;
// number of all exprs, including the tags columns
int32_t
numOfFillCols
;
int32_t
numOfNotFillCols
;
int32_t
rowSize
;
SSHashObj
*
pResMap
;
bool
hasDelete
;
}
SStreamFillSupporter
;
int64_t
getNumOfResultsAfterFillGap
(
SFillInfo
*
pFillInfo
,
int64_t
ekey
,
int32_t
maxNumOfRows
);
void
taosFillSetStartInfo
(
struct
SFillInfo
*
pFillInfo
,
int32_t
numOfRows
,
TSKEY
endKey
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
31202e83
...
...
@@ -2056,6 +2056,8 @@ void destroyExprInfo(SExprInfo* pExpr, int32_t numOfExprs) {
for
(
int32_t
j
=
0
;
j
<
pExprInfo
->
base
.
numOfParams
;
++
j
)
{
if
(
pExprInfo
->
base
.
pParam
[
j
].
type
==
FUNC_PARAM_TYPE_COLUMN
)
{
taosMemoryFreeClear
(
pExprInfo
->
base
.
pParam
[
j
].
pCol
);
}
else
if
(
pExprInfo
->
base
.
pParam
[
j
].
type
==
FUNC_PARAM_TYPE_VALUE
)
{
taosVariantDestroy
(
&
pExprInfo
->
base
.
pParam
[
j
].
param
);
}
}
...
...
source/libs/executor/src/tfill.c
浏览文件 @
31202e83
...
...
@@ -709,6 +709,7 @@ void* destroyStreamFillSupporter(SStreamFillSupporter* pFillSup) {
pFillSup
->
pResMap
=
NULL
;
releaseOutputBuf
(
NULL
,
NULL
,
(
SResultRow
*
)
pFillSup
->
cur
.
pRowVal
);
pFillSup
->
cur
.
pRowVal
=
NULL
;
cleanupExprSupp
(
&
pFillSup
->
notFillExprSup
);
taosMemoryFree
(
pFillSup
);
return
NULL
;
...
...
@@ -1417,25 +1418,13 @@ static void doApplyStreamScalarCalculation(SOperatorInfo* pOperator, SSDataBlock
blockDataEnsureCapacity
(
pDstBlock
,
pSrcBlock
->
info
.
rows
);
setInputDataBlock
(
pSup
,
pSrcBlock
,
TSDB_ORDER_ASC
,
MAIN_SCAN
,
false
);
projectApplyFunctions
(
pSup
->
pExprInfo
,
pDstBlock
,
pSrcBlock
,
pSup
->
pCtx
,
pSup
->
numOfExprs
,
NULL
);
pDstBlock
->
info
.
groupId
=
pSrcBlock
->
info
.
groupId
;
SColumnInfoData
*
pDst
=
taosArrayGet
(
pDstBlock
->
pDataBlock
,
pInfo
->
primaryTsCol
);
SColumnInfoData
*
pSrc
=
taosArrayGet
(
pSrcBlock
->
pDataBlock
,
pInfo
->
primarySrcSlotId
);
colDataAssign
(
pDst
,
pSrc
,
pDstBlock
->
info
.
rows
,
&
pDstBlock
->
info
);
int32_t
numOfNotFill
=
pInfo
->
pFillSup
->
numOfAllCols
-
pInfo
->
pFillSup
->
numOfFillCols
;
for
(
int32_t
i
=
0
;
i
<
numOfNotFill
;
++
i
)
{
SFillColInfo
*
pCol
=
&
pInfo
->
pFillSup
->
pAllColInfo
[
i
+
pInfo
->
pFillSup
->
numOfFillCols
];
ASSERT
(
pCol
->
notFillCol
);
SExprInfo
*
pExpr
=
pCol
->
pExpr
;
int32_t
srcSlotId
=
pExpr
->
base
.
pParam
[
0
].
pCol
->
slotId
;
int32_t
dstSlotId
=
pExpr
->
base
.
resSchema
.
slotId
;
pDstBlock
->
info
.
rows
=
0
;
pSup
=
&
pInfo
->
pFillSup
->
notFillExprSup
;
setInputDataBlock
(
pSup
,
pSrcBlock
,
TSDB_ORDER_ASC
,
MAIN_SCAN
,
false
);
projectApplyFunctions
(
pSup
->
pExprInfo
,
pDstBlock
,
pSrcBlock
,
pSup
->
pCtx
,
pSup
->
numOfExprs
,
NULL
);
pDstBlock
->
info
.
groupId
=
pSrcBlock
->
info
.
groupId
;
SColumnInfoData
*
pDst1
=
taosArrayGet
(
pDstBlock
->
pDataBlock
,
dstSlotId
);
SColumnInfoData
*
pSrc1
=
taosArrayGet
(
pSrcBlock
->
pDataBlock
,
srcSlotId
);
colDataAssign
(
pDst1
,
pSrc1
,
pDstBlock
->
info
.
rows
,
&
pDstBlock
->
info
);
}
blockDataUpdateTsWindow
(
pDstBlock
,
pInfo
->
primaryTsCol
);
}
...
...
@@ -1577,6 +1566,14 @@ static SStreamFillSupporter* initStreamFillSup(SStreamFillPhysiNode* pPhyFillNod
destroyStreamFillSupporter
(
pFillSup
);
return
NULL
;
}
SExprInfo
*
noFillExpr
=
createExprInfo
(
pPhyFillNode
->
pNotFillExprs
,
NULL
,
&
numOfNotFillCols
);
code
=
initExprSupp
(
&
pFillSup
->
notFillExprSup
,
noFillExpr
,
numOfNotFillCols
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
destroyStreamFillSupporter
(
pFillSup
);
return
NULL
;
}
_hash_fn_t
hashFn
=
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
);
pFillSup
->
pResMap
=
tSimpleHashInit
(
16
,
hashFn
);
pFillSup
->
hasDelete
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录