Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a80529e8
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
Star
22018
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看板
未验证
提交
a80529e8
编写于
6月 11, 2022
作者:
H
Haojun Liao
提交者:
GitHub
6月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13688 from taosdata/feature/3_liaohj
fix(query): fix invalid write.
上级
f2a2e14d
94c8ca1e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
29 deletion
+15
-29
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+5
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+10
-28
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
a80529e8
...
...
@@ -294,7 +294,7 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, uint32_t numOfRow1, in
int32_t
colDataAssign
(
SColumnInfoData
*
pColumnInfoData
,
const
SColumnInfoData
*
pSource
,
int32_t
numOfRows
)
{
ASSERT
(
pColumnInfoData
!=
NULL
&&
pSource
!=
NULL
&&
pColumnInfoData
->
info
.
type
==
pSource
->
info
.
type
);
if
(
numOfRows
=
=
0
)
{
if
(
numOfRows
<
=
0
)
{
return
numOfRows
;
}
...
...
@@ -322,6 +322,7 @@ int32_t colDataAssign(SColumnInfoData* pColumnInfoData, const SColumnInfoData* p
pColumnInfoData
->
varmeta
.
length
=
pSource
->
varmeta
.
length
;
}
else
{
char
*
tmp
=
taosMemoryRealloc
(
pColumnInfoData
->
nullbitmap
,
BitmapLen
(
numOfRows
));
printf
(
"----------------%d
\n
"
,
BitmapLen
(
numOfRows
));
if
(
tmp
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
...
...
@@ -1239,6 +1240,9 @@ SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData) {
return
NULL
;
}
if
(
pSrc
->
pData
==
NULL
)
{
continue
;
}
colDataAssign
(
pDst
,
pSrc
,
pDataBlock
->
info
.
rows
);
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
a80529e8
...
...
@@ -1819,7 +1819,7 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO
}
}
static
void
extractQualifiedTupleByFilterResult
(
SSDataBlock
*
pBlock
,
const
int8_t
*
rowRes
,
bool
keep
,
bool
needFree
);
static
void
extractQualifiedTupleByFilterResult
(
SSDataBlock
*
pBlock
,
const
int8_t
*
rowRes
,
bool
keep
);
void
doFilter
(
const
SNode
*
pFilterNode
,
SSDataBlock
*
pBlock
,
bool
needFree
)
{
if
(
pFilterNode
==
NULL
)
{
...
...
@@ -1840,30 +1840,29 @@ void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock, bool needFree) {
bool
keep
=
filterExecute
(
filter
,
pBlock
,
&
rowRes
,
NULL
,
param1
.
numOfCols
);
filterFreeInfo
(
filter
);
extractQualifiedTupleByFilterResult
(
pBlock
,
rowRes
,
keep
,
needFree
);
extractQualifiedTupleByFilterResult
(
pBlock
,
rowRes
,
keep
);
blockDataUpdateTsWindow
(
pBlock
,
0
);
}
void
extractQualifiedTupleByFilterResult
(
SSDataBlock
*
pBlock
,
const
int8_t
*
rowRes
,
bool
keep
,
bool
needFree
)
{
void
extractQualifiedTupleByFilterResult
(
SSDataBlock
*
pBlock
,
const
int8_t
*
rowRes
,
bool
keep
)
{
if
(
keep
)
{
return
;
}
if
(
rowRes
!=
NULL
)
{
SSDataBlock
*
px
=
createOneDataBlock
(
pBlock
,
false
);
blockDataEnsureCapacity
(
px
,
pBlock
->
info
.
rows
);
SSDataBlock
*
px
=
createOneDataBlock
(
pBlock
,
true
);
int32_t
totalRows
=
pBlock
->
info
.
rows
;
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
numOfCols
;
++
i
)
{
SColumnInfoData
*
pDst
=
taosArrayGet
(
px
->
pDataBlock
,
i
);
SColumnInfoData
*
pSrc
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
SColumnInfoData
*
pSrc
=
taosArrayGet
(
px
->
pDataBlock
,
i
);
SColumnInfoData
*
pDst
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
// it is a reserved column for scalar function, and no data in this column yet.
if
(
p
Src
->
pData
==
NULL
)
{
if
(
p
Dst
->
pData
==
NULL
)
{
continue
;
}
colInfoDataCleanup
(
pDst
,
pBlock
->
info
.
rows
);
int32_t
numOfRows
=
0
;
for
(
int32_t
j
=
0
;
j
<
totalRows
;
++
j
)
{
if
(
rowRes
[
j
]
==
0
)
{
...
...
@@ -1883,20 +1882,8 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowR
}
else
{
ASSERT
(
pBlock
->
info
.
rows
==
numOfRows
);
}
SColumnInfoData
tmp
=
*
pSrc
;
*
pSrc
=
*
pDst
;
*
pDst
=
tmp
;
if
(
!
needFree
)
{
if
(
IS_VAR_DATA_TYPE
(
pDst
->
info
.
type
))
{
// this elements do not need free
pDst
->
varmeta
.
offset
=
NULL
;
}
else
{
pDst
->
nullbitmap
=
NULL
;
}
pDst
->
pData
=
NULL
;
}
}
blockDataDestroy
(
px
);
// fix memory leak
}
else
{
// do nothing
...
...
@@ -2137,11 +2124,6 @@ static int32_t compressQueryColData(SColumnInfoData* pColRes, int32_t numOfRows,
}
int32_t
doFillTimeIntervalGapsInResults
(
struct
SFillInfo
*
pFillInfo
,
SSDataBlock
*
pBlock
,
int32_t
capacity
)
{
// for(int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
// SColumnInfoData* pColInfoData = taosArrayGet(pOutput->pDataBlock, i);
// p[i] = pColInfoData->pData + (pColInfoData->info.bytes * pOutput->info.rows);
// }
int32_t
numOfRows
=
(
int32_t
)
taosFillResultDataBlock
(
pFillInfo
,
pBlock
,
capacity
-
pBlock
->
info
.
rows
);
pBlock
->
info
.
rows
+=
numOfRows
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录