Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
709b59a3
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
709b59a3
编写于
5月 19, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix assert crash in tsort.c
上级
42c65898
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
7 deletion
+8
-7
include/common/tdatablock.h
include/common/tdatablock.h
+1
-1
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+3
-4
source/libs/executor/src/groupoperator.c
source/libs/executor/src/groupoperator.c
+2
-1
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+2
-1
未找到文件。
include/common/tdatablock.h
浏览文件 @
709b59a3
...
...
@@ -215,7 +215,7 @@ void colInfoDataCleanup(SColumnInfoData* pColumn, uint32_t numOfRows);
void
blockDataCleanup
(
SSDataBlock
*
pDataBlock
);
void
blockDataEmpty
(
SSDataBlock
*
pDataBlock
);
size_t
blockDataGetCapacityInRow
(
const
SSDataBlock
*
pBlock
,
size_t
pageSize
);
size_t
blockDataGetCapacityInRow
(
const
SSDataBlock
*
pBlock
,
size_t
pageSize
,
int32_t
extraSize
);
int32_t
blockDataTrimFirstRows
(
SSDataBlock
*
pBlock
,
size_t
n
);
int32_t
blockDataKeepFirstNRows
(
SSDataBlock
*
pBlock
,
size_t
n
);
...
...
source/common/src/tdatablock.c
浏览文件 @
709b59a3
...
...
@@ -445,12 +445,11 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
size_t
headerSize
=
sizeof
(
int32_t
);
size_t
colHeaderSize
=
sizeof
(
int32_t
)
*
numOfCols
;
size_t
payloadSize
=
pageSize
-
(
headerSize
+
colHeaderSize
);
// TODO speedup by checking if the whole page can fit in firstly.
if
(
!
hasVarCol
)
{
size_t
rowSize
=
blockDataGetRowSize
(
pBlock
);
int32_t
capacity
=
payloadSize
/
(
rowSize
+
numOfCols
*
bitmapChar
/
8
.
0
);
int32_t
capacity
=
blockDataGetCapacityInRow
(
pBlock
,
pageSize
,
headerSize
+
colHeaderSize
);
if
(
capacity
<=
0
)
{
return
TSDB_CODE_FAILED
;
}
...
...
@@ -1532,10 +1531,10 @@ SColumnInfoData* bdGetColumnInfoData(const SSDataBlock* pBlock, int32_t index) {
return
taosArrayGet
(
pBlock
->
pDataBlock
,
index
);
}
size_t
blockDataGetCapacityInRow
(
const
SSDataBlock
*
pBlock
,
size_t
pageSize
)
{
size_t
blockDataGetCapacityInRow
(
const
SSDataBlock
*
pBlock
,
size_t
pageSize
,
int32_t
extraSize
)
{
size_t
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
int32_t
payloadSize
=
pageSize
-
blockDataGetSerialMetaSize
(
numOfCols
)
;
int32_t
payloadSize
=
pageSize
-
extraSize
;
int32_t
rowSize
=
pBlock
->
info
.
rowSize
;
int32_t
nRows
=
payloadSize
/
rowSize
;
ASSERT
(
nRows
>=
1
);
...
...
source/libs/executor/src/groupoperator.c
浏览文件 @
709b59a3
...
...
@@ -885,7 +885,8 @@ SOperatorInfo* createPartitionOperatorInfo(SOperatorInfo* downstream, SPartition
goto
_error
;
}
pInfo
->
rowCapacity
=
blockDataGetCapacityInRow
(
pInfo
->
binfo
.
pRes
,
getBufPageSize
(
pInfo
->
pBuf
));
pInfo
->
rowCapacity
=
blockDataGetCapacityInRow
(
pInfo
->
binfo
.
pRes
,
getBufPageSize
(
pInfo
->
pBuf
),
blockDataGetSerialMetaSize
(
taosArrayGetSize
(
pInfo
->
binfo
.
pRes
->
pDataBlock
)));
pInfo
->
columnOffset
=
setupColumnOffset
(
pInfo
->
binfo
.
pRes
,
pInfo
->
rowCapacity
);
code
=
initGroupOptrInfo
(
&
pInfo
->
pGroupColVals
,
&
pInfo
->
groupKeyLen
,
&
pInfo
->
keyBuf
,
pInfo
->
pGroupCols
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
source/libs/executor/src/tsort.c
浏览文件 @
709b59a3
...
...
@@ -533,7 +533,8 @@ static int32_t doInternalMergeSort(SSortHandle* pHandle) {
pHandle
->
numOfPages
);
}
int32_t
numOfRows
=
blockDataGetCapacityInRow
(
pHandle
->
pDataBlock
,
pHandle
->
pageSize
);
int32_t
numOfRows
=
blockDataGetCapacityInRow
(
pHandle
->
pDataBlock
,
pHandle
->
pageSize
,
blockDataGetSerialMetaSize
(
taosArrayGetSize
(
pHandle
->
pDataBlock
->
pDataBlock
)));
blockDataEnsureCapacity
(
pHandle
->
pDataBlock
,
numOfRows
);
// the initial pass + sortPass + final mergePass
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录