Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
97da3405
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
97da3405
编写于
4月 18, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix invalid free.
上级
7d3e5aa3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
7 deletion
+24
-7
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+17
-0
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+4
-4
source/libs/executor/src/dataDeleter.c
source/libs/executor/src/dataDeleter.c
+1
-0
source/libs/executor/src/dataInserter.c
source/libs/executor/src/dataInserter.c
+1
-0
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-3
未找到文件。
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
97da3405
...
@@ -150,6 +150,21 @@ static int32_t tqInitTaosxRsp(STaosxRsp* pRsp, const SMqPollReq* pReq) {
...
@@ -150,6 +150,21 @@ static int32_t tqInitTaosxRsp(STaosxRsp* pRsp, const SMqPollReq* pReq) {
pRsp
->
blockSchema
=
taosArrayInit
(
0
,
sizeof
(
void
*
));
pRsp
->
blockSchema
=
taosArrayInit
(
0
,
sizeof
(
void
*
));
if
(
pRsp
->
blockData
==
NULL
||
pRsp
->
blockDataLen
==
NULL
||
pRsp
->
blockTbName
==
NULL
||
pRsp
->
blockSchema
==
NULL
)
{
if
(
pRsp
->
blockData
==
NULL
||
pRsp
->
blockDataLen
==
NULL
||
pRsp
->
blockTbName
==
NULL
||
pRsp
->
blockSchema
==
NULL
)
{
if
(
pRsp
->
blockData
!=
NULL
)
{
pRsp
->
blockData
=
taosArrayDestroy
(
pRsp
->
blockData
);
}
if
(
pRsp
->
blockDataLen
!=
NULL
)
{
pRsp
->
blockDataLen
=
taosArrayDestroy
(
pRsp
->
blockDataLen
);
}
if
(
pRsp
->
blockTbName
!=
NULL
)
{
pRsp
->
blockTbName
=
taosArrayDestroy
(
pRsp
->
blockTbName
);
}
if
(
pRsp
->
blockSchema
!=
NULL
)
{
pRsp
->
blockSchema
=
taosArrayDestroy
(
pRsp
->
blockSchema
);
}
return
-
1
;
return
-
1
;
}
}
...
@@ -283,6 +298,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
...
@@ -283,6 +298,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
if
(
offset
->
type
!=
TMQ_OFFSET__LOG
)
{
if
(
offset
->
type
!=
TMQ_OFFSET__LOG
)
{
if
(
tqScanTaosx
(
pTq
,
pHandle
,
&
taosxRsp
,
&
metaRsp
,
offset
)
<
0
)
{
if
(
tqScanTaosx
(
pTq
,
pHandle
,
&
taosxRsp
,
&
metaRsp
,
offset
)
<
0
)
{
tDeleteSTaosxRsp
(
&
taosxRsp
);
return
-
1
;
return
-
1
;
}
}
...
@@ -358,6 +374,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
...
@@ -358,6 +374,7 @@ static int32_t extractDataAndRspForDbStbSubscribe(STQ* pTq, STqHandle* pHandle,
tDeleteSTaosxRsp
(
&
taosxRsp
);
tDeleteSTaosxRsp
(
&
taosxRsp
);
return
code
;
return
code
;
}
}
code
=
0
;
code
=
0
;
taosMemoryFreeClear
(
pCkHead
);
taosMemoryFreeClear
(
pCkHead
);
tDeleteSTaosxRsp
(
&
taosxRsp
);
tDeleteSTaosxRsp
(
&
taosxRsp
);
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
97da3405
...
@@ -1881,7 +1881,7 @@ static FORCE_INLINE STSchema* getLatestTableSchema(STsdbReader* pReader, uint64_
...
@@ -1881,7 +1881,7 @@ static FORCE_INLINE STSchema* getLatestTableSchema(STsdbReader* pReader, uint64_
return
pReader
->
pSchema
;
return
pReader
->
pSchema
;
}
}
int32_t
code
=
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
uid
,
-
1
,
1
,
&
pReader
->
pSchema
);
int32_t
code
=
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pReader
->
suid
,
uid
,
-
1
,
&
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
||
pReader
->
pSchema
==
NULL
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
||
pReader
->
pSchema
==
NULL
)
{
tsdbError
(
"failed to get table schema, uid:%"
PRIu64
", it may have been dropped, ver:-1, %s"
,
uid
,
pReader
->
idStr
);
tsdbError
(
"failed to get table schema, uid:%"
PRIu64
", it may have been dropped, ver:-1, %s"
,
uid
,
pReader
->
idStr
);
}
}
...
@@ -1894,7 +1894,7 @@ static FORCE_INLINE STSchema* doGetSchemaForTSRow(int32_t sversion, STsdbReader*
...
@@ -1894,7 +1894,7 @@ static FORCE_INLINE STSchema* doGetSchemaForTSRow(int32_t sversion, STsdbReader*
// always set the newest schema version in pReader->pSchema
// always set the newest schema version in pReader->pSchema
if
(
pReader
->
pSchema
==
NULL
)
{
if
(
pReader
->
pSchema
==
NULL
)
{
code
=
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
uid
,
-
1
,
1
,
&
pReader
->
pSchema
);
code
=
metaGetTbTSchemaEx
(
pReader
->
pTsdb
->
pVnode
->
pMeta
,
pReader
->
suid
,
uid
,
-
1
,
&
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
terrno
=
code
;
return
NULL
;
return
NULL
;
...
@@ -1975,7 +1975,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
...
@@ -1975,7 +1975,7 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
// DESC: mem -----> imem -----> last block -----> file block
// DESC: mem -----> imem -----> last block -----> file block
if
(
pReader
->
order
==
TSDB_ORDER_ASC
)
{
if
(
pReader
->
order
==
TSDB_ORDER_ASC
)
{
if
(
minKey
==
key
)
{
if
(
minKey
==
key
)
{
init
=
true
;
init
=
true
;
// todo check if pReader->pSchema is null or not
int32_t
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
int32_t
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
return
code
;
...
@@ -5234,7 +5234,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
...
@@ -5234,7 +5234,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
metaReaderClear
(
&
mr
);
metaReaderClear
(
&
mr
);
// get the newest table schema version
// get the newest table schema version
code
=
metaGetTbTSchemaEx
(
pVnode
->
pMeta
,
uid
,
-
1
,
1
,
pSchema
);
code
=
metaGetTbTSchemaEx
(
pVnode
->
pMeta
,
*
suid
,
uid
,
-
1
,
pSchema
);
return
code
;
return
code
;
}
}
...
...
source/libs/executor/src/dataDeleter.c
浏览文件 @
97da3405
...
@@ -240,6 +240,7 @@ int32_t createDataDeleter(SDataSinkManager* pManager, const SDataSinkNode* pData
...
@@ -240,6 +240,7 @@ int32_t createDataDeleter(SDataSinkManager* pManager, const SDataSinkNode* pData
SDataDeleterHandle
*
deleter
=
taosMemoryCalloc
(
1
,
sizeof
(
SDataDeleterHandle
));
SDataDeleterHandle
*
deleter
=
taosMemoryCalloc
(
1
,
sizeof
(
SDataDeleterHandle
));
if
(
NULL
==
deleter
)
{
if
(
NULL
==
deleter
)
{
taosMemoryFree
(
pParam
);
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_end
;
goto
_end
;
}
}
...
...
source/libs/executor/src/dataInserter.c
浏览文件 @
97da3405
...
@@ -408,6 +408,7 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
...
@@ -408,6 +408,7 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
void
*
pParam
)
{
void
*
pParam
)
{
SDataInserterHandle
*
inserter
=
taosMemoryCalloc
(
1
,
sizeof
(
SDataInserterHandle
));
SDataInserterHandle
*
inserter
=
taosMemoryCalloc
(
1
,
sizeof
(
SDataInserterHandle
));
if
(
NULL
==
inserter
)
{
if
(
NULL
==
inserter
)
{
taosMemoryFree
(
pParam
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_OUT_OF_MEMORY
;
}
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
97da3405
...
@@ -517,10 +517,8 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
...
@@ -517,10 +517,8 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
goto
_error
;
goto
_error
;
}
}
// pSinkParam has been freed during create sinker.
code
=
dsCreateDataSinker
(
pSubplan
->
pDataSink
,
handle
,
pSinkParam
,
(
*
pTask
)
->
id
.
str
);
code
=
dsCreateDataSinker
(
pSubplan
->
pDataSink
,
handle
,
pSinkParam
,
(
*
pTask
)
->
id
.
str
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
taosMemoryFreeClear
(
pSinkParam
);
}
}
}
qDebug
(
"subplan task create completed, TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
taskId
,
pSubplan
->
id
.
queryId
);
qDebug
(
"subplan task create completed, TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
taskId
,
pSubplan
->
id
.
queryId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录