Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d1078b5a
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看板
提交
d1078b5a
编写于
5月 18, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
stmt query
上级
a3b0136e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
51 addition
and
19 deletion
+51
-19
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+9
-5
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+1
-0
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+28
-1
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+1
-0
source/libs/parser/src/parInsertData.c
source/libs/parser/src/parInsertData.c
+2
-2
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+7
-6
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+3
-5
未找到文件。
source/client/src/clientStmt.c
浏览文件 @
d1078b5a
...
@@ -260,8 +260,8 @@ int32_t stmtCleanBindInfo(STscStmt* pStmt) {
...
@@ -260,8 +260,8 @@ int32_t stmtCleanBindInfo(STscStmt* pStmt) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
stmtCleanExecInfo
(
STscStmt
*
pStmt
,
bool
keepTable
,
bool
freeRequest
)
{
int32_t
stmtCleanExecInfo
(
STscStmt
*
pStmt
,
bool
keepTable
,
bool
deepClean
)
{
if
(
STMT_TYPE_QUERY
!=
pStmt
->
sql
.
type
||
freeRequest
)
{
if
(
STMT_TYPE_QUERY
!=
pStmt
->
sql
.
type
||
deepClean
)
{
taos_free_result
(
pStmt
->
exec
.
pRequest
);
taos_free_result
(
pStmt
->
exec
.
pRequest
);
pStmt
->
exec
.
pRequest
=
NULL
;
pStmt
->
exec
.
pRequest
=
NULL
;
}
}
...
@@ -280,7 +280,11 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool freeRequest) {
...
@@ -280,7 +280,11 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool freeRequest) {
continue
;
continue
;
}
}
qFreeStmtDataBlock
(
pBlocks
);
if
(
STMT_TYPE_MULTI_INSERT
==
pStmt
->
sql
.
type
)
{
qFreeStmtDataBlock
(
pBlocks
);
}
else
{
qDestroyStmtDataBlock
(
pBlocks
);
}
taosHashRemove
(
pStmt
->
exec
.
pBlockHash
,
key
,
keyLen
);
taosHashRemove
(
pStmt
->
exec
.
pBlockHash
,
key
,
keyLen
);
pIter
=
taosHashIterate
(
pStmt
->
exec
.
pBlockHash
,
pIter
);
pIter
=
taosHashIterate
(
pStmt
->
exec
.
pBlockHash
,
pIter
);
...
@@ -320,11 +324,11 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
...
@@ -320,11 +324,11 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
taosHashCleanup
(
pStmt
->
sql
.
pTableCache
);
taosHashCleanup
(
pStmt
->
sql
.
pTableCache
);
pStmt
->
sql
.
pTableCache
=
NULL
;
pStmt
->
sql
.
pTableCache
=
NULL
;
memset
(
&
pStmt
->
sql
,
0
,
sizeof
(
pStmt
->
sql
));
STMT_ERR_RET
(
stmtCleanExecInfo
(
pStmt
,
false
,
true
));
STMT_ERR_RET
(
stmtCleanExecInfo
(
pStmt
,
false
,
true
));
STMT_ERR_RET
(
stmtCleanBindInfo
(
pStmt
));
STMT_ERR_RET
(
stmtCleanBindInfo
(
pStmt
));
memset
(
&
pStmt
->
sql
,
0
,
sizeof
(
pStmt
->
sql
));
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
d1078b5a
...
@@ -131,6 +131,7 @@ typedef struct SCtgCacheStat {
...
@@ -131,6 +131,7 @@ typedef struct SCtgCacheStat {
uint64_t
dbNum
;
uint64_t
dbNum
;
uint64_t
tblNum
;
uint64_t
tblNum
;
uint64_t
stblNum
;
uint64_t
stblNum
;
uint64_t
userNum
;
uint64_t
vgHitNum
;
uint64_t
vgHitNum
;
uint64_t
vgMissNum
;
uint64_t
vgMissNum
;
uint64_t
tblHitNum
;
uint64_t
tblHitNum
;
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
d1078b5a
...
@@ -122,6 +122,11 @@ void ctgFreeDbCache(SCtgDBCache *dbCache) {
...
@@ -122,6 +122,11 @@ void ctgFreeDbCache(SCtgDBCache *dbCache) {
ctgFreeTableMetaCache
(
&
dbCache
->
tbCache
);
ctgFreeTableMetaCache
(
&
dbCache
->
tbCache
);
}
}
void
ctgFreeSCtgUserAuth
(
SCtgUserAuth
*
userCache
)
{
taosHashCleanup
(
userCache
->
createdDbs
);
taosHashCleanup
(
userCache
->
readDbs
);
taosHashCleanup
(
userCache
->
writeDbs
);
}
void
ctgFreeHandle
(
SCatalog
*
pCtg
)
{
void
ctgFreeHandle
(
SCatalog
*
pCtg
)
{
ctgFreeMetaRent
(
&
pCtg
->
dbRent
);
ctgFreeMetaRent
(
&
pCtg
->
dbRent
);
...
@@ -145,7 +150,24 @@ void ctgFreeHandle(SCatalog* pCtg) {
...
@@ -145,7 +150,24 @@ void ctgFreeHandle(SCatalog* pCtg) {
CTG_CACHE_STAT_SUB
(
dbNum
,
dbNum
);
CTG_CACHE_STAT_SUB
(
dbNum
,
dbNum
);
}
}
if
(
pCtg
->
userCache
)
{
int32_t
userNum
=
taosHashGetSize
(
pCtg
->
userCache
);
void
*
pIter
=
taosHashIterate
(
pCtg
->
userCache
,
NULL
);
while
(
pIter
)
{
SCtgUserAuth
*
userCache
=
pIter
;
ctgFreeSCtgUserAuth
(
userCache
);
pIter
=
taosHashIterate
(
pCtg
->
userCache
,
pIter
);
}
taosHashCleanup
(
pCtg
->
userCache
);
CTG_CACHE_STAT_SUB
(
userNum
,
userNum
);
}
taosMemoryFree
(
pCtg
);
taosMemoryFree
(
pCtg
);
}
}
...
@@ -2031,10 +2053,13 @@ int32_t ctgGetTableMeta(SCatalog* pCtg, void *pRpc, const SEpSet* pMgmtEps, cons
...
@@ -2031,10 +2053,13 @@ int32_t ctgGetTableMeta(SCatalog* pCtg, void *pRpc, const SEpSet* pMgmtEps, cons
SName
stbName
=
*
pTableName
;
SName
stbName
=
*
pTableName
;
strcpy
(
stbName
.
tname
,
output
->
tbName
);
strcpy
(
stbName
.
tname
,
output
->
tbName
);
taosMemoryFreeClear
(
output
->
tbMeta
);
CTG_ERR_JRET
(
ctgGetTableMetaFromCache
(
pCtg
,
&
stbName
,
pTableMeta
,
&
inCache
,
flag
,
NULL
));
CTG_ERR_JRET
(
ctgGetTableMetaFromCache
(
pCtg
,
&
stbName
,
pTableMeta
,
&
inCache
,
flag
,
NULL
));
if
(
!
inCache
)
{
if
(
!
inCache
)
{
ctgDebug
(
"stb no longer exist, dbFName:%s, tbName:%s"
,
output
->
dbFName
,
pTableName
->
tname
);
ctgDebug
(
"stb no longer exist, dbFName:%s, tbName:%s"
,
output
->
dbFName
,
pTableName
->
tname
);
continue
;
continue
;
}
}
...
@@ -2306,6 +2331,8 @@ int32_t ctgActUpdateUser(SCtgMetaAction *action) {
...
@@ -2306,6 +2331,8 @@ int32_t ctgActUpdateUser(SCtgMetaAction *action) {
CTG_ERR_JRET
(
TSDB_CODE_OUT_OF_MEMORY
);
CTG_ERR_JRET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
}
taosMemoryFreeClear
(
msg
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
d1078b5a
...
@@ -1045,6 +1045,7 @@ static void destroyInsertParseContext(SInsertParseContext* pCxt) {
...
@@ -1045,6 +1045,7 @@ static void destroyInsertParseContext(SInsertParseContext* pCxt) {
destroyInsertParseContextForTable
(
pCxt
);
destroyInsertParseContextForTable
(
pCxt
);
taosHashCleanup
(
pCxt
->
pVgroupsHashObj
);
taosHashCleanup
(
pCxt
->
pVgroupsHashObj
);
taosHashCleanup
(
pCxt
->
pSubTableHashObj
);
taosHashCleanup
(
pCxt
->
pSubTableHashObj
);
taosHashCleanup
(
pCxt
->
pTableNameHashObj
);
destroyBlockHashmap
(
pCxt
->
pTableBlockHashObj
);
destroyBlockHashmap
(
pCxt
->
pTableBlockHashObj
);
destroyBlockArrayList
(
pCxt
->
pVgDataBlocks
);
destroyBlockArrayList
(
pCxt
->
pVgDataBlocks
);
...
...
source/libs/parser/src/parInsertData.c
浏览文件 @
d1078b5a
...
@@ -235,12 +235,12 @@ static void destroyDataBlock(STableDataBlocks* pDataBlock) {
...
@@ -235,12 +235,12 @@ static void destroyDataBlock(STableDataBlocks* pDataBlock) {
}
}
taosMemoryFreeClear
(
pDataBlock
->
pData
);
taosMemoryFreeClear
(
pDataBlock
->
pData
);
if
(
!
pDataBlock
->
cloned
)
{
//
if (!pDataBlock->cloned) {
// free the refcount for metermeta
// free the refcount for metermeta
taosMemoryFreeClear
(
pDataBlock
->
pTableMeta
);
taosMemoryFreeClear
(
pDataBlock
->
pTableMeta
);
destroyBoundColumnInfo
(
&
pDataBlock
->
boundColumnInfo
);
destroyBoundColumnInfo
(
&
pDataBlock
->
boundColumnInfo
);
}
//
}
taosMemoryFreeClear
(
pDataBlock
);
taosMemoryFreeClear
(
pDataBlock
);
}
}
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
d1078b5a
...
@@ -1438,24 +1438,24 @@ int32_t schHandleDropCallback(void *param, const SDataBuf *pMsg, int32_t code) {
...
@@ -1438,24 +1438,24 @@ int32_t schHandleDropCallback(void *param, const SDataBuf *pMsg, int32_t code) {
}
}
int32_t
schHandleHbCallback
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
schHandleHbCallback
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
SSchedulerHbRsp
rsp
=
{
0
};
SSchTaskCallbackParam
*
pParam
=
(
SSchTaskCallbackParam
*
)
param
;
if
(
code
)
{
if
(
code
)
{
qError
(
"hb rsp error:%s"
,
tstrerror
(
code
));
qError
(
"hb rsp error:%s"
,
tstrerror
(
code
));
SCH_ERR_RET
(
code
);
SCH_ERR_
J
RET
(
code
);
}
}
SSchedulerHbRsp
rsp
=
{
0
};
if
(
tDeserializeSSchedulerHbRsp
(
pMsg
->
pData
,
pMsg
->
len
,
&
rsp
))
{
if
(
tDeserializeSSchedulerHbRsp
(
pMsg
->
pData
,
pMsg
->
len
,
&
rsp
))
{
qError
(
"invalid hb rsp msg, size:%d"
,
pMsg
->
len
);
qError
(
"invalid hb rsp msg, size:%d"
,
pMsg
->
len
);
SCH_ERR_RET
(
TSDB_CODE_QRY_INVALID_INPUT
);
SCH_ERR_
J
RET
(
TSDB_CODE_QRY_INVALID_INPUT
);
}
}
SSchTaskCallbackParam
*
pParam
=
(
SSchTaskCallbackParam
*
)
param
;
SSchTrans
trans
=
{
0
};
SSchTrans
trans
=
{
0
};
trans
.
transInst
=
pParam
->
transport
;
trans
.
transInst
=
pParam
->
transport
;
trans
.
transHandle
=
pMsg
->
handle
;
trans
.
transHandle
=
pMsg
->
handle
;
SCH_ERR_RET
(
schUpdateHbConnection
(
&
rsp
.
epId
,
&
trans
));
SCH_ERR_
J
RET
(
schUpdateHbConnection
(
&
rsp
.
epId
,
&
trans
));
int32_t
taskNum
=
(
int32_t
)
taosArrayGetSize
(
rsp
.
taskStatus
);
int32_t
taskNum
=
(
int32_t
)
taosArrayGetSize
(
rsp
.
taskStatus
);
qDebug
(
"%d task status in hb rsp, nodeId:%d, fqdn:%s, port:%d"
,
taskNum
,
rsp
.
epId
.
nodeId
,
rsp
.
epId
.
ep
.
fqdn
,
qDebug
(
"%d task status in hb rsp, nodeId:%d, fqdn:%s, port:%d"
,
taskNum
,
rsp
.
epId
.
nodeId
,
rsp
.
epId
.
ep
.
fqdn
,
...
@@ -1483,6 +1483,7 @@ int32_t schHandleHbCallback(void *param, const SDataBuf *pMsg, int32_t code) {
...
@@ -1483,6 +1483,7 @@ int32_t schHandleHbCallback(void *param, const SDataBuf *pMsg, int32_t code) {
_return:
_return:
tFreeSSchedulerHbRsp
(
&
rsp
);
tFreeSSchedulerHbRsp
(
&
rsp
);
taosMemoryFree
(
param
);
SCH_RET
(
code
);
SCH_RET
(
code
);
}
}
...
...
tests/script/api/batchprepare.c
浏览文件 @
d1078b5a
...
@@ -251,16 +251,12 @@ CaseCtrl gCaseCtrl = {
...
@@ -251,16 +251,12 @@ CaseCtrl gCaseCtrl = {
.bindColNum = 0,
.bindColNum = 0,
.bindTagNum = 0,
.bindTagNum = 0,
.bindRowNum = 0,
.bindRowNum = 0,
.bindColTypeNum = tListLen(bindColTypeList),
.bindColTypeList = bindColTypeList,
.bindTagTypeNum = 0,
.bindTagTypeNum = 0,
.bindTagTypeList = NULL,
.bindTagTypeList = NULL,
.optrIdxListNum = tListLen(optrIdxList),
.optrIdxList = optrIdxList,
.checkParamNum = false,
.checkParamNum = false,
.printRes = false,
.printRes = false,
.runTimes = 0,
.runTimes = 0,
.caseIdx =
23
,
.caseIdx =
1
,
.caseNum = 1,
.caseNum = 1,
.caseRunIdx = -1,
.caseRunIdx = -1,
.caseRunNum = 1,
.caseRunNum = 1,
...
@@ -1101,7 +1097,9 @@ void destroyData(BindData *data) {
...
@@ -1101,7 +1097,9 @@ void destroyData(BindData *data) {
taosMemoryFree
(
data
->
binaryLen
);
taosMemoryFree
(
data
->
binaryLen
);
taosMemoryFree
(
data
->
isNull
);
taosMemoryFree
(
data
->
isNull
);
taosMemoryFree
(
data
->
pBind
);
taosMemoryFree
(
data
->
pBind
);
taosMemoryFree
(
data
->
pTags
);
taosMemoryFree
(
data
->
colTypes
);
taosMemoryFree
(
data
->
colTypes
);
taosMemoryFree
(
data
->
sql
);
}
}
void
bpFetchRows
(
TAOS_RES
*
result
,
bool
printr
,
int32_t
*
rows
)
{
void
bpFetchRows
(
TAOS_RES
*
result
,
bool
printr
,
int32_t
*
rows
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录