Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
95eb0c9f
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看板
提交
95eb0c9f
编写于
5月 11, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(query): do some internal refactor.
上级
e6730411
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
33 addition
and
7 deletion
+33
-7
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+18
-0
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+3
-1
source/client/src/clientMain.c
source/client/src/clientMain.c
+3
-1
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+4
-4
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+5
-1
未找到文件。
include/libs/catalog/catalog.h
浏览文件 @
95eb0c9f
...
...
@@ -122,6 +122,24 @@ int32_t catalogGetDBVgVersion(SCatalog* pCtg, const char* dbFName, int32_t* vers
*/
int32_t
catalogGetDBVgInfo
(
SCatalog
*
pCatalog
,
void
*
pTransporter
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
SArray
**
pVgroupList
);
typedef
void
*
__async_cb_fn_t
(
void
*
pResult
,
void
*
param
,
int32_t
code
);
typedef
struct
{
SCatalog
*
pCatalog
;
void
*
pTransporter
;
SEpSet
*
pMgmtEps
;
char
*
pDbname
;
}
CatalogParamWrapper
;
/**
*
* @param pCatalogWrapper
* @param fp
* @param param
* @return
*/
int32_t
catalogGetDBVgInfo_a
(
CatalogParamWrapper
*
pCatalogWrapper
,
__async_cb_fn_t
fp
,
void
*
param
);
int32_t
catalogUpdateDBVgInfo
(
SCatalog
*
pCatalog
,
const
char
*
dbName
,
uint64_t
dbId
,
SDBVgInfo
*
dbInfo
);
int32_t
catalogRemoveDB
(
SCatalog
*
pCatalog
,
const
char
*
dbName
,
uint64_t
dbId
);
...
...
source/client/inc/clientInt.h
浏览文件 @
95eb0c9f
...
...
@@ -121,7 +121,7 @@ struct SAppInstInfo {
SCorEpSet
mgmtEp
;
SInstanceSummary
summary
;
SList
*
pConnList
;
// STscObj linked list
int64_t
clusterId
;
uint64_t
clusterId
;
void
*
pTransporter
;
SAppHbMgr
*
pAppHbMgr
;
};
...
...
@@ -282,6 +282,8 @@ void initMsgHandleFp();
TAOS
*
taos_connect_internal
(
const
char
*
ip
,
const
char
*
user
,
const
char
*
pass
,
const
char
*
auth
,
const
char
*
db
,
uint16_t
port
,
int
connType
);
SRequestObj
*
launchQuery
(
STscObj
*
pTscObj
,
const
char
*
sql
,
int
sqlLen
);
int32_t
parseSql
(
SRequestObj
*
pRequest
,
bool
topicQuery
,
SQuery
**
pQuery
,
SStmtCallback
*
pStmtCb
);
int32_t
getPlan
(
SRequestObj
*
pRequest
,
SQuery
*
pQuery
,
SQueryPlan
**
pPlan
,
SArray
*
pNodeList
);
...
...
source/client/src/clientMain.c
浏览文件 @
95eb0c9f
...
...
@@ -572,8 +572,10 @@ void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param
int32_t
retryNum
=
0
;
int32_t
code
=
0
;
size_t
sqlLen
=
strlen
(
sql
);
while
(
retryNum
++
<
REQUEST_MAX_TRY_TIMES
)
{
// pRequest = launchQuery(pTscObj
, sql, sqlLen);
pRequest
=
launchQuery
(
taos
,
sql
,
sqlLen
);
if
(
pRequest
==
NULL
||
TSDB_CODE_SUCCESS
==
pRequest
->
code
||
!
NEED_CLIENT_HANDLE_ERROR
(
pRequest
->
code
))
{
break
;
}
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
95eb0c9f
...
...
@@ -125,10 +125,10 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
struct
SCatalog
*
pCatalog
=
NULL
;
if
(
usedbRsp
.
vgVersion
>=
0
)
{
int32_t
code1
=
catalogGetHandle
(
pRequest
->
pTscObj
->
pAppInfo
->
clusterId
,
&
pCatalog
);
uint64_t
clusterId
=
pRequest
->
pTscObj
->
pAppInfo
->
clusterId
;
int32_t
code1
=
catalogGetHandle
(
clusterId
,
&
pCatalog
);
if
(
code1
!=
TSDB_CODE_SUCCESS
)
{
tscWarn
(
"catalogGetHandle failed, clusterId:%"
PRIx64
", error:%s"
,
pRequest
->
pTscObj
->
pAppInfo
->
clusterId
,
tstrerror
(
code1
));
tscWarn
(
"0x%"
PRIx64
"catalogGetHandle failed, clusterId:%"
PRIx64
", error:%s"
,
pRequest
->
requestId
,
clusterId
,
tstrerror
(
code1
));
}
else
{
catalogRemoveDB
(
pCatalog
,
usedbRsp
.
db
,
usedbRsp
.
uid
);
}
...
...
@@ -158,7 +158,7 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
if
(
output
.
dbVgroup
)
taosHashCleanup
(
output
.
dbVgroup
->
vgHash
);
taosMemoryFreeClear
(
output
.
dbVgroup
);
tscError
(
"
failed to build use db output since %s"
,
terrstr
());
tscError
(
"
0x%"
PRIx64
" failed to build use db output since %s"
,
pRequest
->
requestId
,
terrstr
());
}
else
if
(
output
.
dbVgroup
)
{
struct
SCatalog
*
pCatalog
=
NULL
;
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
95eb0c9f
...
...
@@ -563,6 +563,10 @@ int32_t ctgGetQnodeListFromMnode(SCatalog* pCtg, void *pRpc, const SEpSet* pMgmt
return
TSDB_CODE_SUCCESS
;
}
//typedef void __taos_async_internal_fn_t(void* param, )
void
ctgGetDBVgInfoFromMnode_a
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
SBuildUseDBInput
*
input
,
__taos_async_fn_t
fp
)
{
}
int32_t
ctgGetDBVgInfoFromMnode
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
SBuildUseDBInput
*
input
,
SUseDbOutput
*
out
)
{
char
*
msg
=
NULL
;
...
...
@@ -1768,7 +1772,7 @@ int32_t ctgCloneVgInfo(SDBVgInfo *src, SDBVgInfo **dst) {
return
TSDB_CODE_SUCCESS
;
}
void
ctgGetDBVgInfo_a
();
int32_t
ctgGetDBVgInfo
(
SCatalog
*
pCtg
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
dbFName
,
SCtgDBCache
**
dbCache
,
SDBVgInfo
**
pInfo
)
{
bool
inCache
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录