Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
246ea1df
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
246ea1df
编写于
7月 18, 2020
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify from ip to ep
上级
599df650
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
53 addition
and
64 deletion
+53
-64
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+2
-2
src/client/src/tscSchemaUtil.c
src/client/src/tscSchemaUtil.c
+4
-4
src/client/src/tscServer.c
src/client/src/tscServer.c
+42
-53
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-1
src/inc/trpc.h
src/inc/trpc.h
+3
-3
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
246ea1df
...
@@ -55,8 +55,8 @@ typedef struct STableComInfo {
...
@@ -55,8 +55,8 @@ typedef struct STableComInfo {
typedef
struct
SCMCorVgroupInfo
{
typedef
struct
SCMCorVgroupInfo
{
int32_t
version
;
int32_t
version
;
int8_t
inUse
;
int8_t
inUse
;
int8_t
numOf
I
ps
;
int8_t
numOf
E
ps
;
S
IpAddr
i
pAddr
[
TSDB_MAX_REPLICA
];
S
EpAddr
e
pAddr
[
TSDB_MAX_REPLICA
];
}
SCMCorVgroupInfo
;
}
SCMCorVgroupInfo
;
typedef
struct
STableMeta
{
typedef
struct
STableMeta
{
...
...
src/client/src/tscSchemaUtil.c
浏览文件 @
246ea1df
...
@@ -143,10 +143,10 @@ struct SSchema tscGetTbnameColumnSchema() {
...
@@ -143,10 +143,10 @@ struct SSchema tscGetTbnameColumnSchema() {
static
void
tscInitCorVgroupInfo
(
SCMCorVgroupInfo
*
corVgroupInfo
,
SCMVgroupInfo
*
vgroupInfo
)
{
static
void
tscInitCorVgroupInfo
(
SCMCorVgroupInfo
*
corVgroupInfo
,
SCMVgroupInfo
*
vgroupInfo
)
{
corVgroupInfo
->
version
=
0
;
corVgroupInfo
->
version
=
0
;
corVgroupInfo
->
inUse
=
0
;
corVgroupInfo
->
inUse
=
0
;
corVgroupInfo
->
numOf
Ips
=
vgroupInfo
->
numOfI
ps
;
corVgroupInfo
->
numOf
Eps
=
vgroupInfo
->
numOfE
ps
;
for
(
int32_t
i
=
0
;
i
<
corVgroupInfo
->
numOf
I
ps
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
corVgroupInfo
->
numOf
E
ps
;
i
++
)
{
strncpy
(
corVgroupInfo
->
ipAddr
[
i
].
fqdn
,
vgroupInfo
->
i
pAddr
[
i
].
fqdn
,
TSDB_FQDN_LEN
);
strncpy
(
corVgroupInfo
->
epAddr
[
i
].
fqdn
,
vgroupInfo
->
e
pAddr
[
i
].
fqdn
,
TSDB_FQDN_LEN
);
corVgroupInfo
->
ipAddr
[
i
].
port
=
vgroupInfo
->
i
pAddr
[
i
].
port
;
corVgroupInfo
->
epAddr
[
i
].
port
=
vgroupInfo
->
e
pAddr
[
i
].
port
;
}
}
}
}
STableMeta
*
tscCreateTableMetaFromMsg
(
STableMetaMsg
*
pTableMetaMsg
,
size_t
*
size
)
{
STableMeta
*
tscCreateTableMetaFromMsg
(
STableMetaMsg
*
pTableMetaMsg
,
size_t
*
size
)
{
...
...
src/client/src/tscServer.c
浏览文件 @
246ea1df
...
@@ -53,64 +53,53 @@ static void tscSetDnodeEpSet(SSqlObj* pSql, SCMVgroupInfo* pVgroupInfo) {
...
@@ -53,64 +53,53 @@ static void tscSetDnodeEpSet(SSqlObj* pSql, SCMVgroupInfo* pVgroupInfo) {
return
;
return
;
}
}
pEp
Lis
t
->
numOfEps
=
pVgroupInfo
->
numOfEps
;
pEp
Se
t
->
numOfEps
=
pVgroupInfo
->
numOfEps
;
for
(
int32_t
i
=
0
;
i
<
pVgroupInfo
->
numOfEps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroupInfo
->
numOfEps
;
++
i
)
{
strcpy
(
pEp
Lis
t
->
fqdn
[
i
],
pVgroupInfo
->
epAddr
[
i
].
fqdn
);
strcpy
(
pEp
Se
t
->
fqdn
[
i
],
pVgroupInfo
->
epAddr
[
i
].
fqdn
);
pEp
Lis
t
->
port
[
i
]
=
pVgroupInfo
->
epAddr
[
i
].
port
;
pEp
Se
t
->
port
[
i
]
=
pVgroupInfo
->
epAddr
[
i
].
port
;
}
}
}
}
void
tscIpSetCopy
(
SRpcIpSet
*
dst
,
SRpcIpSet
*
src
)
{
static
void
tscDumpMgmtEpSet
(
SRpcEpSet
*
epSet
)
{
dst
->
numOfIps
=
src
->
numOfIps
;
taosCorBeginRead
(
&
tscMgmtEpSet
.
version
);
dst
->
inUse
=
src
->
inUse
;
*
epSet
=
tscMgmtEpSet
.
epSet
;
for
(
int32_t
i
=
0
;
i
<
src
->
numOfIps
;
++
i
)
{
taosCorEndRead
(
&
tscMgmtEpSet
.
version
);
dst
->
port
[
i
]
=
src
->
port
[
i
];
strncpy
(
dst
->
fqdn
[
i
],
src
->
fqdn
[
i
],
TSDB_FQDN_LEN
);
}
}
static
void
tscDumpMgmtIpSet
(
SRpcIpSet
*
ipSet
)
{
taosCorBeginRead
(
&
tscMgmtIpSet
.
version
);
SRpcIpSet
*
src
=
&
tscMgmtIpSet
.
ipSet
;
tscIpSetCopy
(
ipSet
,
src
);
taosCorEndRead
(
&
tscMgmtIpSet
.
version
);
}
}
static
void
tsc
IpSetHtons
(
SRpcI
pSet
*
s
)
{
static
void
tsc
EpSetHtons
(
SRpcE
pSet
*
s
)
{
for
(
int32_t
i
=
0
;
i
<
s
->
numOf
I
ps
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
s
->
numOf
E
ps
;
i
++
)
{
s
->
port
[
i
]
=
htons
(
s
->
port
[
i
]);
s
->
port
[
i
]
=
htons
(
s
->
port
[
i
]);
}
}
}
}
bool
tsc
IpSetIsEqual
(
SRpcIpSet
*
s1
,
SRpcI
pSet
*
s2
)
{
bool
tsc
EpSetIsEqual
(
SRpcEpSet
*
s1
,
SRpcE
pSet
*
s2
)
{
if
(
s1
->
numOf
Ips
!=
s2
->
numOfI
ps
||
s1
->
inUse
!=
s2
->
inUse
)
{
if
(
s1
->
numOf
Eps
!=
s2
->
numOfE
ps
||
s1
->
inUse
!=
s2
->
inUse
)
{
return
false
;
return
false
;
}
}
for
(
int32_t
i
=
0
;
i
<
s1
->
numOf
I
ps
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
s1
->
numOf
E
ps
;
i
++
)
{
if
(
s1
->
port
[
i
]
!=
s2
->
port
[
i
]
if
(
s1
->
port
[
i
]
!=
s2
->
port
[
i
]
||
strncmp
(
s1
->
fqdn
[
i
],
s2
->
fqdn
[
i
],
TSDB_FQDN_LEN
)
!=
0
)
||
strncmp
(
s1
->
fqdn
[
i
],
s2
->
fqdn
[
i
],
TSDB_FQDN_LEN
)
!=
0
)
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
void
tscUpdateMgmt
IpList
(
SRpcIpSet
*
pI
pSet
)
{
void
tscUpdateMgmt
EpSet
(
SRpcEpSet
*
pE
pSet
)
{
// no need to update if equal
// no need to update if equal
taosCorBeginWrite
(
&
tscMgmtIpSet
.
version
);
taosCorBeginWrite
(
&
tscMgmtEpSet
.
version
);
// or copy directly, tscMgmtIpSet.ipSet = *pIpSet
tscMgmtEpSet
.
epSet
=
*
pEpSet
;
SRpcIpSet
*
mgmtIpSet
=
&
tscMgmtIpSet
.
ipSet
;
taosCorEndWrite
(
&
tscMgmtEpSet
.
version
);
tscIpSetCopy
(
mgmtIpSet
,
pIpSet
);
taosCorEndWrite
(
&
tscMgmtIpSet
.
version
);
}
}
static
void
tscDump
IpSetFromVgroupInfo
(
SCMCorVgroupInfo
*
pVgroupInfo
,
SRpcIpSet
*
pI
pSet
)
{
static
void
tscDump
EpSetFromVgroupInfo
(
SCMCorVgroupInfo
*
pVgroupInfo
,
SRpcEpSet
*
pE
pSet
)
{
if
(
pVgroupInfo
==
NULL
)
{
return
;}
if
(
pVgroupInfo
==
NULL
)
{
return
;}
taosCorBeginRead
(
&
pVgroupInfo
->
version
);
taosCorBeginRead
(
&
pVgroupInfo
->
version
);
int8_t
inUse
=
pVgroupInfo
->
inUse
;
int8_t
inUse
=
pVgroupInfo
->
inUse
;
p
I
pSet
->
inUse
=
(
inUse
>=
0
&&
inUse
<
TSDB_MAX_REPLICA
)
?
inUse
:
0
;
p
E
pSet
->
inUse
=
(
inUse
>=
0
&&
inUse
<
TSDB_MAX_REPLICA
)
?
inUse
:
0
;
p
IpSet
->
numOfIps
=
pVgroupInfo
->
numOfI
ps
;
p
EpSet
->
numOfEps
=
pVgroupInfo
->
numOfE
ps
;
for
(
int32_t
i
=
0
;
i
<
pVgroupInfo
->
numOf
I
ps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroupInfo
->
numOf
E
ps
;
++
i
)
{
strncpy
(
p
IpSet
->
fqdn
[
i
],
pVgroupInfo
->
i
pAddr
[
i
].
fqdn
,
TSDB_FQDN_LEN
);
strncpy
(
p
EpSet
->
fqdn
[
i
],
pVgroupInfo
->
e
pAddr
[
i
].
fqdn
,
TSDB_FQDN_LEN
);
p
IpSet
->
port
[
i
]
=
pVgroupInfo
->
i
pAddr
[
i
].
port
;
p
EpSet
->
port
[
i
]
=
pVgroupInfo
->
e
pAddr
[
i
].
port
;
}
}
taosCorEndRead
(
&
pVgroupInfo
->
version
);
taosCorEndRead
(
&
pVgroupInfo
->
version
);
}
}
static
void
tscUpdateVgroupInfo
(
SSqlObj
*
pObj
,
SRpc
IpSet
*
pI
pSet
)
{
static
void
tscUpdateVgroupInfo
(
SSqlObj
*
pObj
,
SRpc
EpSet
*
pE
pSet
)
{
SSqlCmd
*
pCmd
=
&
pObj
->
cmd
;
SSqlCmd
*
pCmd
=
&
pObj
->
cmd
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
if
(
pTableMetaInfo
==
NULL
||
pTableMetaInfo
->
pTableMeta
==
NULL
)
{
return
;}
if
(
pTableMetaInfo
==
NULL
||
pTableMetaInfo
->
pTableMeta
==
NULL
)
{
return
;}
...
@@ -130,7 +119,7 @@ void tscPrintMgmtEp() {
...
@@ -130,7 +119,7 @@ void tscPrintMgmtEp() {
SRpcEpSet
dump
;
SRpcEpSet
dump
;
tscDumpMgmtEpSet
(
&
dump
);
tscDumpMgmtEpSet
(
&
dump
);
if
(
dump
.
numOfEps
<=
0
)
{
if
(
dump
.
numOfEps
<=
0
)
{
tscError
(
"invalid mnode EP list:%d"
,
dump
.
numOfE
P
s
);
tscError
(
"invalid mnode EP list:%d"
,
dump
.
numOfE
p
s
);
}
else
{
}
else
{
for
(
int
i
=
0
;
i
<
dump
.
numOfEps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
dump
.
numOfEps
;
++
i
)
{
tscDebug
(
"mnode index:%d %s:%d"
,
i
,
dump
.
fqdn
[
i
],
dump
.
port
[
i
]);
tscDebug
(
"mnode index:%d %s:%d"
,
i
,
dump
.
fqdn
[
i
],
dump
.
port
[
i
]);
...
@@ -166,10 +155,10 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
...
@@ -166,10 +155,10 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
if
(
code
==
0
)
{
if
(
code
==
0
)
{
SCMHeartBeatRsp
*
pRsp
=
(
SCMHeartBeatRsp
*
)
pRes
->
pRsp
;
SCMHeartBeatRsp
*
pRsp
=
(
SCMHeartBeatRsp
*
)
pRes
->
pRsp
;
SRpcEpSet
*
pEpList
=
&
pRsp
->
epLis
t
;
SRpcEpSet
*
epSet
=
&
pRsp
->
epSe
t
;
if
(
pEpLis
t
->
numOfEps
>
0
)
{
if
(
epSe
t
->
numOfEps
>
0
)
{
tscEpSetHtons
(
pEpLis
t
);
tscEpSetHtons
(
epSe
t
);
tscUpdateMgmtEp
List
(
pEpLis
t
);
tscUpdateMgmtEp
Set
(
epSe
t
);
}
}
pSql
->
pTscObj
->
connId
=
htonl
(
pRsp
->
connId
);
pSql
->
pTscObj
->
connId
=
htonl
(
pRsp
->
connId
);
...
@@ -242,7 +231,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
...
@@ -242,7 +231,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
// set the mgmt ip list
// set the mgmt ip list
if
(
pSql
->
cmd
.
command
>=
TSDB_SQL_MGMT
)
{
if
(
pSql
->
cmd
.
command
>=
TSDB_SQL_MGMT
)
{
tscDumpMgmtEpSet
(
&
pSql
->
ep
Lis
t
);
tscDumpMgmtEpSet
(
&
pSql
->
ep
Se
t
);
}
}
memcpy
(
pMsg
,
pSql
->
cmd
.
payload
,
pSql
->
cmd
.
payloadLen
);
memcpy
(
pMsg
,
pSql
->
cmd
.
payload
,
pSql
->
cmd
.
payloadLen
);
...
@@ -296,11 +285,11 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
...
@@ -296,11 +285,11 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
if
(
pEpSet
)
{
if
(
pEpSet
)
{
//SRpcEpSet dump;
//SRpcEpSet dump;
tscEpSetHtons
(
pEpSet
);
tscEpSetHtons
(
pEpSet
);
if
(
tscEpSetIsEqual
(
&
pSql
->
ep
Lis
t
,
pEpSet
))
{
if
(
tscEpSetIsEqual
(
&
pSql
->
ep
Se
t
,
pEpSet
))
{
if
(
pCmd
->
command
<
TSDB_SQL_MGMT
)
{
if
(
pCmd
->
command
<
TSDB_SQL_MGMT
)
{
tscUpdateVgroupInfo
(
pSql
,
pEpSet
);
tscUpdateVgroupInfo
(
pSql
,
pEpSet
);
}
else
{
}
else
{
tscUpdateMgmtEp
Lis
t
(
pEpSet
);
tscUpdateMgmtEp
Se
t
(
pEpSet
);
}
}
}
}
}
}
...
@@ -589,7 +578,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -589,7 +578,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
// pSql->cmd.payloadLen is set during copying data into payload
// pSql->cmd.payloadLen is set during copying data into payload
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_SUBMIT
;
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_SUBMIT
;
tscDumpEpSetFromVgroupInfo
(
&
pTableMeta
->
corVgroupInfo
,
&
pSql
->
ep
Lis
t
);
tscDumpEpSetFromVgroupInfo
(
&
pTableMeta
->
corVgroupInfo
,
&
pSql
->
ep
Se
t
);
tscDebug
(
"%p build submit msg, vgId:%d numOfTables:%d numberOfEP:%d"
,
pSql
,
vgId
,
pSql
->
cmd
.
numOfTablesInSubmit
,
tscDebug
(
"%p build submit msg, vgId:%d numOfTables:%d numberOfEP:%d"
,
pSql
,
vgId
,
pSql
->
cmd
.
numOfTablesInSubmit
,
pSql
->
epSet
.
numOfEps
);
pSql
->
epSet
.
numOfEps
);
...
@@ -631,7 +620,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -631,7 +620,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
}
else
{
}
else
{
pVgroupInfo
=
&
pTableMeta
->
vgroupInfo
;
pVgroupInfo
=
&
pTableMeta
->
vgroupInfo
;
}
}
tscSetDnodeEp
Lis
t
(
pSql
,
pVgroupInfo
);
tscSetDnodeEp
Se
t
(
pSql
,
pVgroupInfo
);
if
(
pVgroupInfo
!=
NULL
)
{
if
(
pVgroupInfo
!=
NULL
)
{
pQueryMsg
->
head
.
vgId
=
htonl
(
pVgroupInfo
->
vgId
);
pQueryMsg
->
head
.
vgId
=
htonl
(
pVgroupInfo
->
vgId
);
...
@@ -654,7 +643,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -654,7 +643,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
SVgroupTableInfo
*
pTableIdList
=
taosArrayGet
(
pTableMetaInfo
->
pVgroupTables
,
index
);
SVgroupTableInfo
*
pTableIdList
=
taosArrayGet
(
pTableMetaInfo
->
pVgroupTables
,
index
);
// set the vgroup info
// set the vgroup info
tscSetDnodeEp
Lis
t
(
pSql
,
&
pTableIdList
->
vgInfo
);
tscSetDnodeEp
Se
t
(
pSql
,
&
pTableIdList
->
vgInfo
);
pQueryMsg
->
head
.
vgId
=
htonl
(
pTableIdList
->
vgInfo
.
vgId
);
pQueryMsg
->
head
.
vgId
=
htonl
(
pTableIdList
->
vgInfo
.
vgId
);
int32_t
numOfTables
=
taosArrayGetSize
(
pTableIdList
->
itemList
);
int32_t
numOfTables
=
taosArrayGetSize
(
pTableIdList
->
itemList
);
...
@@ -1200,11 +1189,11 @@ int32_t tscBuildShowMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -1200,11 +1189,11 @@ int32_t tscBuildShowMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pShowMsg
->
payloadLen
=
htons
(
pPattern
->
n
);
pShowMsg
->
payloadLen
=
htons
(
pPattern
->
n
);
}
}
}
else
{
}
else
{
SSQLToken
*
p
I
pAddr
=
&
pShowInfo
->
prefix
;
SSQLToken
*
p
E
pAddr
=
&
pShowInfo
->
prefix
;
assert
(
p
IpAddr
->
n
>
0
&&
pI
pAddr
->
type
>
0
);
assert
(
p
EpAddr
->
n
>
0
&&
pE
pAddr
->
type
>
0
);
strncpy
(
pShowMsg
->
payload
,
p
IpAddr
->
z
,
pI
pAddr
->
n
);
strncpy
(
pShowMsg
->
payload
,
p
EpAddr
->
z
,
pE
pAddr
->
n
);
pShowMsg
->
payloadLen
=
htons
(
p
I
pAddr
->
n
);
pShowMsg
->
payloadLen
=
htons
(
p
E
pAddr
->
n
);
}
}
pCmd
->
payloadLen
=
sizeof
(
SCMShowMsg
)
+
pShowMsg
->
payloadLen
;
pCmd
->
payloadLen
=
sizeof
(
SCMShowMsg
)
+
pShowMsg
->
payloadLen
;
...
@@ -1387,7 +1376,7 @@ int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
...
@@ -1387,7 +1376,7 @@ int tscBuildUpdateTagMsg(SSqlObj* pSql, SSqlInfo *pInfo) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
tscDumpEpSetFromVgroupInfo
(
&
pTableMetaInfo
->
pTableMeta
->
corVgroupInfo
,
&
pSql
->
ep
Lis
t
);
tscDumpEpSetFromVgroupInfo
(
&
pTableMetaInfo
->
pTableMeta
->
corVgroupInfo
,
&
pSql
->
ep
Se
t
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -2011,9 +2000,9 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
...
@@ -2011,9 +2000,9 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
assert
(
len
<=
sizeof
(
pObj
->
db
));
assert
(
len
<=
sizeof
(
pObj
->
db
));
tstrncpy
(
pObj
->
db
,
temp
,
sizeof
(
pObj
->
db
));
tstrncpy
(
pObj
->
db
,
temp
,
sizeof
(
pObj
->
db
));
if
(
pConnect
->
ep
Lis
t
.
numOfEps
>
0
)
{
if
(
pConnect
->
ep
Se
t
.
numOfEps
>
0
)
{
tscEpSetHtons
(
&
pConnect
->
ep
Lis
t
);
tscEpSetHtons
(
&
pConnect
->
ep
Se
t
);
tscUpdateMgmtEp
List
(
&
pConnect
->
epLis
t
);
tscUpdateMgmtEp
Set
(
&
pConnect
->
epSe
t
);
}
}
strcpy
(
pObj
->
sversion
,
pConnect
->
serverVersion
);
strcpy
(
pObj
->
sversion
,
pConnect
->
serverVersion
);
...
...
src/client/src/tscSql.c
浏览文件 @
246ea1df
...
@@ -62,7 +62,7 @@ SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
...
@@ -62,7 +62,7 @@ SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
}
}
if
(
ip
)
{
if
(
ip
)
{
if
(
tscSetMgmtEp
Lis
tFromCfg
(
ip
,
NULL
)
<
0
)
return
NULL
;
if
(
tscSetMgmtEp
Se
tFromCfg
(
ip
,
NULL
)
<
0
)
return
NULL
;
if
(
port
)
tscMgmtEpSet
.
epSet
.
port
[
0
]
=
port
;
if
(
port
)
tscMgmtEpSet
.
epSet
.
port
[
0
]
=
port
;
}
}
...
...
src/client/src/tscUtil.c
浏览文件 @
246ea1df
...
@@ -2145,7 +2145,7 @@ char* strdup_throw(const char* str) {
...
@@ -2145,7 +2145,7 @@ char* strdup_throw(const char* str) {
return
p
;
return
p
;
}
}
int
tscSetMgmtEp
Lis
tFromCfg
(
const
char
*
first
,
const
char
*
second
)
{
int
tscSetMgmtEp
Se
tFromCfg
(
const
char
*
first
,
const
char
*
second
)
{
// init mgmt ip set
// init mgmt ip set
tscMgmtEpSet
.
version
=
0
;
tscMgmtEpSet
.
version
=
0
;
SRpcEpSet
*
mgmtEpSet
=
&
(
tscMgmtEpSet
.
epSet
);
SRpcEpSet
*
mgmtEpSet
=
&
(
tscMgmtEpSet
.
epSet
);
...
...
src/inc/trpc.h
浏览文件 @
246ea1df
...
@@ -35,10 +35,10 @@ typedef struct SRpcEpSet {
...
@@ -35,10 +35,10 @@ typedef struct SRpcEpSet {
char
fqdn
[
TSDB_MAX_REPLICA
][
TSDB_FQDN_LEN
];
char
fqdn
[
TSDB_MAX_REPLICA
][
TSDB_FQDN_LEN
];
}
SRpcEpSet
;
}
SRpcEpSet
;
typedef
struct
SRpcCor
I
pSet
{
typedef
struct
SRpcCor
E
pSet
{
int32_t
version
;
int32_t
version
;
SRpc
IpSet
i
pSet
;
SRpc
EpSet
e
pSet
;
}
SRpcCor
I
pSet
;
}
SRpcCor
E
pSet
;
typedef
struct
SRpcConnInfo
{
typedef
struct
SRpcConnInfo
{
uint32_t
clientIp
;
uint32_t
clientIp
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录