Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c79eda9f
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看板
提交
c79eda9f
编写于
6月 22, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): prepare the buffer before serialize the retrieved data.
上级
aa4d8635
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
61 deletion
+16
-61
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+11
-54
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+4
-5
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-2
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
c79eda9f
...
...
@@ -302,50 +302,20 @@ int32_t colDataAssign(SColumnInfoData* pColumnInfoData, const SColumnInfoData* p
ASSERT
(
pBlockInfo
->
capacity
>=
numOfRows
);
if
(
IS_VAR_DATA_TYPE
(
pColumnInfoData
->
info
.
type
))
{
// if (pColumnInfoData->capacity < numOfRows) {
// char* p = taosMemoryRealloc(pColumnInfoData->varmeta.offset, sizeof(int32_t) * numOfRows);
// if (p == NULL) {
// return TSDB_CODE_OUT_OF_MEMORY;
// }
//
// memset(p, 0, sizeof(int32_t));
// pColumnInfoData->capacity = numOfRows;
// pColumnInfoData->varmeta.offset = (int32_t*)p;
// }
memcpy
(
pColumnInfoData
->
varmeta
.
offset
,
pSource
->
varmeta
.
offset
,
sizeof
(
int32_t
)
*
numOfRows
);
//
if (pColumnInfoData->varmeta.allocLen < pSource->varmeta.length) {
//
char* tmp = taosMemoryRealloc(pColumnInfoData->pData, pSource->varmeta.length);
//
if (tmp == NULL) {
//
return TSDB_CODE_OUT_OF_MEMORY;
//
}
//
//
pColumnInfoData->pData = tmp;
//
pColumnInfoData->varmeta.allocLen = pSource->varmeta.length;
//
}
if
(
pColumnInfoData
->
varmeta
.
allocLen
<
pSource
->
varmeta
.
length
)
{
char
*
tmp
=
taosMemoryRealloc
(
pColumnInfoData
->
pData
,
pSource
->
varmeta
.
length
);
if
(
tmp
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pColumnInfoData
->
pData
=
tmp
;
pColumnInfoData
->
varmeta
.
allocLen
=
pSource
->
varmeta
.
length
;
}
memcpy
(
pColumnInfoData
->
pData
,
pSource
->
pData
,
pSource
->
varmeta
.
length
);
pColumnInfoData
->
varmeta
.
length
=
pSource
->
varmeta
.
length
;
memcpy
(
pColumnInfoData
->
pData
,
pSource
->
pData
,
pSource
->
varmeta
.
length
);
}
else
{
// if (pColumnInfoData->capacity < numOfRows) {
// char* tmp = taosMemoryRealloc(pColumnInfoData->nullbitmap, BitmapLen(numOfRows));
// if (tmp == NULL) {
// return TSDB_CODE_OUT_OF_MEMORY;
// }
//
// memset(tmp, 0, BitmapLen(numOfRows));
// pColumnInfoData->nullbitmap = tmp;
//
// int32_t newSize = numOfRows * pColumnInfoData->info.bytes;
// tmp = taosMemoryRealloc(pColumnInfoData->pData, newSize);
// if (tmp == NULL) {
// return TSDB_CODE_OUT_OF_MEMORY;
// }
//
// pColumnInfoData->pData = tmp;
// pColumnInfoData->capacity = numOfRows;
// }
memcpy
(
pColumnInfoData
->
nullbitmap
,
pSource
->
nullbitmap
,
BitmapLen
(
numOfRows
));
memcpy
(
pColumnInfoData
->
pData
,
pSource
->
pData
,
pSource
->
info
.
bytes
*
numOfRows
);
}
...
...
@@ -1874,8 +1844,6 @@ void blockCompressEncode(const SSDataBlock* pBlock, char* data, int32_t* dataLen
}
const
char
*
blockCompressDecode
(
SSDataBlock
*
pBlock
,
int32_t
numOfCols
,
int32_t
numOfRows
,
const
char
*
pData
)
{
blockDataEnsureCapacity
(
pBlock
,
numOfRows
);
const
char
*
pStart
=
pData
;
int32_t
dataLen
=
*
(
int32_t
*
)
pStart
;
...
...
@@ -1884,11 +1852,6 @@ const char* blockCompressDecode(SSDataBlock* pBlock, int32_t numOfCols, int32_t
pBlock
->
info
.
groupId
=
*
(
uint64_t
*
)
pStart
;
pStart
+=
sizeof
(
uint64_t
);
if
(
pBlock
->
pDataBlock
==
NULL
)
{
pBlock
->
pDataBlock
=
taosArrayInit
(
numOfCols
,
sizeof
(
SColumnInfoData
));
taosArraySetSize
(
pBlock
->
pDataBlock
,
numOfCols
);
}
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
pColInfoData
->
info
.
type
=
*
(
int16_t
*
)
pStart
;
...
...
@@ -1919,22 +1882,16 @@ const char* blockCompressDecode(SSDataBlock* pBlock, int32_t numOfCols, int32_t
memcpy
(
pColInfoData
->
varmeta
.
offset
,
pStart
,
sizeof
(
int32_t
)
*
numOfRows
);
pStart
+=
sizeof
(
int32_t
)
*
numOfRows
;
if
(
colLen
[
i
]
>
0
)
{
if
(
colLen
[
i
]
>
0
&&
pColInfoData
->
pData
==
NULL
)
{
taosMemoryFreeClear
(
pColInfoData
->
pData
);
pColInfoData
->
pData
=
taosMemoryMalloc
(
colLen
[
i
]);
}
}
else
{
if
(
pColInfoData
->
nullbitmap
==
NULL
)
{
pColInfoData
->
nullbitmap
=
taosMemoryCalloc
(
1
,
BitmapLen
(
numOfRows
));
}
memcpy
(
pColInfoData
->
nullbitmap
,
pStart
,
BitmapLen
(
numOfRows
));
pStart
+=
BitmapLen
(
numOfRows
);
}
if
(
colLen
[
i
]
>
0
)
{
if
(
pColInfoData
->
pData
==
NULL
)
{
pColInfoData
->
pData
=
taosMemoryCalloc
(
1
,
colLen
[
i
]);
}
memcpy
(
pColInfoData
->
pData
,
pStart
,
colLen
[
i
]);
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
c79eda9f
...
...
@@ -2075,14 +2075,13 @@ int32_t extractDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLo
blockCompressDecode
(
pBlock
,
numOfCols
,
numOfRows
,
pStart
);
blockDataEnsureCapacity
(
pRes
,
numOfRows
);
relocateColumnData
(
pRes
,
pColList
,
pBlock
->
pDataBlock
,
false
);
// data from mnode
pRes
->
info
.
rows
=
numOfRows
;
relocateColumnData
(
pRes
,
pColList
,
pBlock
->
pDataBlock
,
false
);
taosArrayDestroy
(
pBlock
->
pDataBlock
);
taosMemoryFree
(
pBlock
);
//
blockDataDestroy(pBlock);
//
taosArrayDestroy(pBlock->pDataBlock);
//
taosMemoryFree(pBlock);
blockDataDestroy
(
pBlock
);
}
// todo move this to time window aggregator, since the primary timestamp may not be known by exchange operator.
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
c79eda9f
...
...
@@ -1366,7 +1366,6 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) {
}
blockDataCleanup
(
pInfo
->
pRes
);
int32_t
numOfRows
=
0
;
const
char
*
db
=
NULL
;
...
...
@@ -1558,7 +1557,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) {
if
(
pRsp
->
numOfRows
==
0
||
pRsp
->
completed
)
{
pOperator
->
status
=
OP_EXEC_DONE
;
qDebug
(
"%s load meta data from mnode completed, rowsOfSource:%d, totalRows:%"
PRIu64
" "
,
GET_TASKID
(
pTaskInfo
),
qDebug
(
"%s load meta data from mnode completed, rowsOfSource:%d, totalRows:%"
PRIu64
,
GET_TASKID
(
pTaskInfo
),
pRsp
->
numOfRows
,
pInfo
->
loadInfo
.
totalRows
);
if
(
pRsp
->
numOfRows
==
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录