Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
d2605d0e
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
d2605d0e
编写于
2月 22, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
connect from client to mgmt
上级
a241006d
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
123 addition
and
389 deletion
+123
-389
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+3
-5
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+2
-9
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+0
-1
src/client/src/tscProfile.c
src/client/src/tscProfile.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+109
-358
src/client/src/tscSql.c
src/client/src/tscSql.c
+8
-14
src/client/src/tscSub.c
src/client/src/tscSub.c
+0
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
d2605d0e
...
...
@@ -324,14 +324,12 @@ typedef struct _sql_obj {
short
vnode
;
int64_t
stime
;
uint32_t
queryId
;
void
*
thandle
;
SRpcIpSet
*
ipSet
;
void
*
pStream
;
void
*
pSubscription
;
char
*
sqlstr
;
char
retry
;
char
maxRetry
;
uint8_t
index
;
SRpcIpSet
*
ipList
;
char
freed
:
4
;
char
listed
:
4
;
tsem_t
rspSem
;
...
...
@@ -379,8 +377,8 @@ int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion);
void
tscInitMsgs
();
extern
int
(
*
tscBuildMsg
[
TSDB_SQL_MAX
])(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
);
void
*
tscProcessMsgFromServer
(
char
*
msg
,
void
*
ahandle
,
void
*
thandl
e
);
int
tscProcessSql
(
SSqlObj
*
pSql
);
void
tscProcessMsgFromServer
(
char
type
,
void
*
pCont
,
int
contLen
,
void
*
ahandle
,
int32_t
cod
e
);
int
tscProcessSql
(
SSqlObj
*
pSql
);
void
tscAsyncInsertMultiVnodesProxy
(
void
*
param
,
TAOS_RES
*
tres
,
int
numOfRows
);
...
...
src/client/src/tscAsync.c
浏览文件 @
d2605d0e
...
...
@@ -318,13 +318,6 @@ void tscProcessAsyncRes(SSchedMsg *pMsg) {
int
cmd
=
pCmd
->
command
;
int
code
=
pRes
->
code
?
-
pRes
->
code
:
pRes
->
numOfRows
;
if
((
tscKeepConn
[
cmd
]
==
0
||
(
code
!=
TSDB_CODE_SUCCESS
&&
code
!=
TSDB_CODE_ACTION_IN_PROGRESS
))
&&
pSql
->
pStream
==
NULL
)
{
if
(
pSql
->
thandle
)
taosAddConnIntoCache
(
tscConnCache
,
pSql
->
thandle
,
pSql
->
ip
,
pSql
->
vnode
,
pTscObj
->
user
);
pSql
->
thandle
=
NULL
;
}
// in case of async insert, restore the user specified callback function
bool
shouldFree
=
tscShouldFreeAsyncSqlObj
(
pSql
);
...
...
@@ -454,8 +447,8 @@ void tscMeterMetaCallBack(void *param, TAOS_RES *res, int code) {
tscTrace
(
"%p failed to renew meterMeta"
,
pSql
);
tsem_post
(
&
pSql
->
rspSem
);
}
else
{
tscTrace
(
"%p renew meterMeta successfully, command:%d, code:%d,
thandle:%p,
retry:%d"
,
pSql
,
pSql
->
cmd
.
command
,
pSql
->
res
.
code
,
pSql
->
thandle
,
pSql
->
retry
);
tscTrace
(
"%p renew meterMeta successfully, command:%d, code:%d, retry:%d"
,
pSql
,
pSql
->
cmd
.
command
,
pSql
->
res
.
code
,
pSql
->
retry
);
SMeterMetaInfo
*
pMeterMetaInfo
=
tscGetMeterMetaInfo
(
&
pSql
->
cmd
,
0
,
0
);
assert
(
pMeterMetaInfo
->
pMeterMeta
==
NULL
);
...
...
src/client/src/tscPrepare.c
浏览文件 @
d2605d0e
...
...
@@ -451,7 +451,6 @@ static int insertStmtExecute(STscStmt* stmt) {
pRes
->
numOfTotalInCurrentClause
=
0
;
pRes
->
qhandle
=
0
;
pSql
->
thandle
=
NULL
;
tscDoQuery
(
pSql
);
...
...
src/client/src/tscProfile.c
浏览文件 @
d2605d0e
...
...
@@ -145,7 +145,7 @@ void tscKillQuery(STscObj *pObj, uint32_t killId) {
if
(
pSql
==
NULL
)
return
;
tscTrace
(
"%p query is killed, queryId:%d
thandle:%p"
,
pSql
,
killId
,
pSql
->
thandle
);
tscTrace
(
"%p query is killed, queryId:%d
"
,
pSql
,
killId
);
taos_stop_query
(
pSql
);
}
...
...
src/client/src/tscServer.c
浏览文件 @
d2605d0e
此差异已折叠。
点击以展开。
src/client/src/tscSql.c
浏览文件 @
d2605d0e
...
...
@@ -64,14 +64,18 @@ TAOS *taos_connect_imp(const char *ip, const char *user, const char *pass, const
}
if
(
ip
&&
ip
[
0
])
{
tscMgmtIpList
.
numOfIps
=
3
;
tscMgmtIpList
.
numOfIps
=
2
;
tscMgmtIpList
.
index
=
0
;
tscMgmtIpList
.
ip
[
0
]
=
inet_addr
(
ip
);
tscMgmtIpList
.
ip
[
1
]
=
inet_addr
(
tsMasterIp
);
tscMgmtIpList
.
ip
[
2
]
=
inet_addr
(
tsSecondIp
);
tscMgmtIpList
.
index
=
0
;
tscMgmtIpList
.
port
=
tsMgmtShellPort
;
if
(
tsSecondIp
[
0
])
{
tscMgmtIpList
.
numOfIps
=
3
;
tscMgmtIpList
.
ip
[
2
]
=
inet_addr
(
tsSecondIp
);
}
}
tscMgmtIpList
.
port
=
port
?
port
:
tsMgmtShellPort
;
pObj
=
(
STscObj
*
)
malloc
(
sizeof
(
STscObj
));
if
(
NULL
==
pObj
)
{
globalCode
=
TSDB_CODE_CLI_OUT_OF_MEMORY
;
...
...
@@ -208,7 +212,6 @@ int taos_query_imp(STscObj *pObj, SSqlObj *pSql) {
* to free connection, which may cause segment fault, when the parse phrase is not even successfully executed.
*/
pRes
->
qhandle
=
0
;
pSql
->
thandle
=
NULL
;
if
(
pRes
->
code
==
TSDB_CODE_SUCCESS
)
{
tscDoQuery
(
pSql
);
...
...
@@ -713,7 +716,6 @@ void taos_free_result_imp(TAOS_RES* res, int keepCmd) {
/* Query rsp is not received from vnode, so the qhandle is NULL */
tscTrace
(
"%p qhandle is null, abort free, fp:%p"
,
pSql
,
pSql
->
fp
);
if
(
pSql
->
fp
!=
NULL
)
{
pSql
->
thandle
=
NULL
;
tscFreeSqlObj
(
pSql
);
tscTrace
(
"%p Async SqlObj is freed by app"
,
pSql
);
}
else
if
(
keepCmd
)
{
...
...
@@ -774,7 +776,6 @@ void taos_free_result_imp(TAOS_RES* res, int keepCmd) {
*
* Then this object will be reused and no free operation is required.
*/
pSql
->
thandle
=
NULL
;
if
(
keepCmd
)
{
tscFreeSqlResult
(
pSql
);
tscTrace
(
"%p sql result is freed by app while sql command is kept"
,
pSql
);
...
...
@@ -785,7 +786,6 @@ void taos_free_result_imp(TAOS_RES* res, int keepCmd) {
}
}
else
{
// if no free resource msg is sent to vnode, we free this object immediately.
pSql
->
thandle
=
NULL
;
if
(
pSql
->
fp
)
{
assert
(
pRes
->
numOfRows
==
0
||
(
pCmd
->
command
>
TSDB_SQL_LOCAL
));
...
...
@@ -899,11 +899,6 @@ void taos_stop_query(TAOS_RES *res) {
return
;
}
if
(
pSql
->
thandle
==
NULL
)
{
tscTrace
(
"%p no connection, abort cancel"
,
res
);
return
;
}
//taosStopRpcConn(pSql->thandle);
tscTrace
(
"%p query is cancelled"
,
res
);
}
...
...
@@ -1147,7 +1142,6 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
* to free connection, which may cause segment fault, when the parse phrase is not even successfully executed.
*/
pRes
->
qhandle
=
0
;
pSql
->
thandle
=
NULL
;
free
(
str
);
if
(
pRes
->
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/client/src/tscSub.c
浏览文件 @
d2605d0e
...
...
@@ -382,7 +382,6 @@ TAOS_RES *taos_consume(TAOS_SUB *tsub) {
pRes
->
numOfRows
=
1
;
pRes
->
numOfTotal
=
0
;
pRes
->
qhandle
=
0
;
pSql
->
thandle
=
NULL
;
pSql
->
cmd
.
command
=
TSDB_SQL_SELECT
;
pQueryInfo
->
type
=
type
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录