Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aa143bed
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看板
提交
aa143bed
编写于
6月 06, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix invalid free.
上级
475a399c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
37 addition
and
28 deletion
+37
-28
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+2
-1
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+0
-1
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+16
-8
source/client/src/clientMain.c
source/client/src/clientMain.c
+0
-1
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+19
-16
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+0
-1
未找到文件。
source/client/inc/clientInt.h
浏览文件 @
aa143bed
...
...
@@ -266,7 +266,8 @@ extern SAppInfo appInfo;
extern
int32_t
clientReqRefPool
;
extern
int32_t
clientConnRefPool
;
extern
int
(
*
handleRequestRspFp
[
TDMT_MAX
])(
void
*
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
__async_send_cb_fn_t
getMsgRspHandle
(
int32_t
msgType
);
int
genericRspCallback
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
SMsgSendInfo
*
buildMsgInfoImpl
(
SRequestObj
*
pReqObj
);
...
...
source/client/src/clientEnv.c
浏览文件 @
aa143bed
...
...
@@ -278,7 +278,6 @@ void taos_init_imp(void) {
return
;
}
initMsgHandleFp
();
initQueryModuleMsgHandle
();
rpcInit
();
...
...
source/client/src/clientImpl.c
浏览文件 @
aa143bed
...
...
@@ -535,19 +535,20 @@ int32_t handleAlterTbExecRes(void* res, SCatalog* pCatalog) {
return
catalogUpdateTableMeta
(
pCatalog
,
(
STableMetaRsp
*
)
res
);
}
int32_t
handle
ExecRes
(
SRequestObj
*
pRequest
)
{
int32_t
handle
QueryExecRsp
(
SRequestObj
*
pRequest
)
{
if
(
NULL
==
pRequest
->
body
.
resInfo
.
execRes
.
res
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
code
=
0
;
SCatalog
*
pCatalog
=
NULL
;
code
=
catalogGetHandle
(
pRequest
->
pTscObj
->
pAppInfo
->
clusterId
,
&
pCatalog
);
SAppInstInfo
*
pAppInfo
=
getAppInfo
(
pRequest
);
int32_t
code
=
catalogGetHandle
(
pAppInfo
->
clusterId
,
&
pCatalog
);
if
(
code
)
{
return
code
;
}
SEpSet
epset
=
getEpSet_s
(
&
p
Request
->
pTscObj
->
p
AppInfo
->
mgmtEp
);
SEpSet
epset
=
getEpSet_s
(
&
pAppInfo
->
mgmtEp
);
SQueryExecRes
*
pRes
=
&
pRequest
->
body
.
resInfo
.
execRes
;
switch
(
pRes
->
msgType
)
{
...
...
@@ -565,8 +566,9 @@ int32_t handleExecRes(SRequestObj* pRequest) {
break
;
}
default:
tscError
(
"invalid exec result for request type %d"
,
pRequest
->
type
);
return
TSDB_CODE_APP_ERROR
;
tscError
(
"0x%"
PRIx64
", invalid exec result for request type %d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pRequest
->
type
,
pRequest
->
requestId
);
code
=
TSDB_CODE_APP_ERROR
;
}
return
code
;
...
...
@@ -585,6 +587,12 @@ void schedulerExecCb(SQueryResult* pResult, void* param, int32_t code) {
return
;
}
if
(
code
==
TSDB_CODE_SUCCESS
)
{
code
=
handleQueryExecRsp
(
pRequest
);
ASSERT
(
pRequest
->
code
==
TSDB_CODE_SUCCESS
);
pRequest
->
code
=
code
;
}
if
(
NEED_CLIENT_RM_TBLMETA_REQ
(
pRequest
->
type
))
{
removeMeta
(
pTscObj
,
pRequest
->
tableList
);
}
...
...
@@ -623,7 +631,7 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue
qDestroyQuery
(
pQuery
);
}
handle
ExecRes
(
pRequest
);
handle
QueryExecRsp
(
pRequest
);
if
(
NULL
!=
pRequest
&&
TSDB_CODE_SUCCESS
!=
code
)
{
pRequest
->
code
=
terrno
;
...
...
@@ -884,7 +892,7 @@ static SMsgSendInfo* buildConnectMsg(SRequestObj* pRequest) {
pMsgSendInfo
->
requestObjRefId
=
pRequest
->
self
;
pMsgSendInfo
->
requestId
=
pRequest
->
requestId
;
pMsgSendInfo
->
fp
=
handleRequestRspFp
[
TMSG_INDEX
(
pMsgSendInfo
->
msgType
)]
;
pMsgSendInfo
->
fp
=
getMsgRspHandle
(
pMsgSendInfo
->
msgType
)
;
pMsgSendInfo
->
param
=
pRequest
;
SConnectReq
connectReq
=
{
0
};
...
...
source/client/src/clientMain.c
浏览文件 @
aa143bed
...
...
@@ -748,7 +748,6 @@ void doAsyncQuery(SRequestObj* pRequest, bool updateMetaForce) {
pRequest
->
body
.
queryFp
(
pRequest
->
body
.
param
,
pRequest
,
code
);
}
static
void
fetchCallback
(
void
*
pResult
,
void
*
param
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
(
SRequestObj
*
)
param
;
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
aa143bed
...
...
@@ -21,8 +21,6 @@
#include "tdef.h"
#include "tname.h"
int32_t
(
*
handleRequestRspFp
[
TDMT_MAX
])(
void
*
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
static
void
setErrno
(
SRequestObj
*
pRequest
,
int32_t
code
)
{
pRequest
->
code
=
code
;
terrno
=
code
;
...
...
@@ -107,10 +105,7 @@ SMsgSendInfo* buildMsgInfoImpl(SRequestObj* pRequest) {
assert
(
pRequest
!=
NULL
);
pMsgSendInfo
->
msgInfo
=
pRequest
->
body
.
requestMsg
;
pMsgSendInfo
->
fp
=
(
handleRequestRspFp
[
TMSG_INDEX
(
pRequest
->
type
)]
==
NULL
)
?
genericRspCallback
:
handleRequestRspFp
[
TMSG_INDEX
(
pRequest
->
type
)];
pMsgSendInfo
->
fp
=
getMsgRspHandle
(
pRequest
->
type
);
return
pMsgSendInfo
;
}
...
...
@@ -209,7 +204,7 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
return
0
;
}
int32_t
processCreateTableRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
processCreate
S
TableRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
assert
(
pMsg
!=
NULL
&&
param
!=
NULL
);
SRequestObj
*
pRequest
=
param
;
...
...
@@ -285,13 +280,21 @@ int32_t processAlterStbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
return
code
;
}
// todo refactor: this arraylist is too large
void
initMsgHandleFp
()
{
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_CONNECT
)]
=
processConnectRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_CREATE_DB
)]
=
processCreateDbRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_USE_DB
)]
=
processUseDbRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_CREATE_STB
)]
=
processCreateTableRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_DROP_DB
)]
=
processDropDbRsp
;
handleRequestRspFp
[
TMSG_INDEX
(
TDMT_MND_ALTER_STB
)]
=
processAlterStbRsp
;
__async_send_cb_fn_t
getMsgRspHandle
(
int32_t
msgType
)
{
switch
(
msgType
)
{
case
TDMT_MND_CONNECT
:
return
processConnectRsp
;
case
TDMT_MND_CREATE_DB
:
return
processCreateDbRsp
;
case
TDMT_MND_USE_DB
:
return
processUseDbRsp
;
case
TDMT_MND_CREATE_STB
:
return
processCreateSTableRsp
;
case
TDMT_MND_DROP_DB
:
return
processDropDbRsp
;
case
TDMT_MND_ALTER_STB
:
return
processAlterStbRsp
;
default:
return
genericRspCallback
;
}
}
source/libs/parser/src/parTranslater.c
浏览文件 @
aa143bed
...
...
@@ -2903,7 +2903,6 @@ static int32_t buildRollupAst(STranslateContext* pCxt, SCreateTableStmt* pStmt,
}
}
taosArrayDestroy
(
dbCfg
.
pRetensions
);
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录