Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4acff5ce
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看板
未验证
提交
4acff5ce
编写于
3月 31, 2021
作者:
H
huili
提交者:
GitHub
3月 31, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5627 from taosdata/hotfix/test
[TD-3604]<fix>subscribe hanlder overwrite
上级
4db5681f
9353aed0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
13 deletion
+9
-13
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+9
-13
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
4acff5ce
...
...
@@ -5868,6 +5868,7 @@ static TAOS_SUB* subscribeImpl(TAOS *taos, char *sql, char* topic, char* resultF
static
void
*
subSubscribeProcess
(
void
*
sarg
)
{
threadInfo
*
winfo
=
(
threadInfo
*
)
sarg
;
char
subSqlstr
[
1024
];
TAOS_SUB
*
tsub
[
MAX_QUERY_SQL_COUNT
]
=
{
0
};
if
(
winfo
->
taos
==
NULL
)
{
TAOS
*
taos
=
NULL
;
...
...
@@ -5913,9 +5914,8 @@ static void *subSubscribeProcess(void *sarg) {
sprintf
(
tmpFile
,
"%s-%d"
,
g_queryInfo
.
superQueryInfo
.
result
[
i
],
winfo
->
threadID
);
}
g_queryInfo
.
superQueryInfo
.
tsub
[
i
]
=
subscribeImpl
(
winfo
->
taos
,
subSqlstr
,
topic
,
tmpFile
);
if
(
NULL
==
g_queryInfo
.
superQueryInfo
.
tsub
[
i
])
{
tsub
[
i
]
=
subscribeImpl
(
winfo
->
taos
,
subSqlstr
,
topic
,
tmpFile
);
if
(
NULL
==
tsub
[
i
])
{
taos_close
(
winfo
->
taos
);
return
NULL
;
}
...
...
@@ -5932,7 +5932,7 @@ static void *subSubscribeProcess(void *sarg) {
continue
;
}
res
=
taos_consume
(
g_queryInfo
.
superQueryInfo
.
tsub
[
i
]);
res
=
taos_consume
(
tsub
[
i
]);
if
(
res
)
{
char
tmpFile
[
MAX_FILE_NAME_LEN
*
2
]
=
{
0
};
if
(
g_queryInfo
.
superQueryInfo
.
result
[
i
][
0
]
!=
0
)
{
...
...
@@ -5947,8 +5947,7 @@ static void *subSubscribeProcess(void *sarg) {
taos_free_result
(
res
);
for
(
int
i
=
0
;
i
<
g_queryInfo
.
superQueryInfo
.
sqlCount
;
i
++
)
{
taos_unsubscribe
(
g_queryInfo
.
superQueryInfo
.
tsub
[
i
],
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
);
taos_unsubscribe
(
tsub
[
i
],
g_queryInfo
.
superQueryInfo
.
subscribeKeepProgress
);
}
taos_close
(
winfo
->
taos
);
...
...
@@ -5957,6 +5956,7 @@ static void *subSubscribeProcess(void *sarg) {
static
void
*
superSubscribeProcess
(
void
*
sarg
)
{
threadInfo
*
winfo
=
(
threadInfo
*
)
sarg
;
TAOS_SUB
*
tsub
[
MAX_QUERY_SQL_COUNT
]
=
{
0
};
if
(
winfo
->
taos
==
NULL
)
{
TAOS
*
taos
=
NULL
;
...
...
@@ -5999,10 +5999,7 @@ static void *superSubscribeProcess(void *sarg) {
sprintf
(
tmpFile
,
"%s-%d"
,
g_queryInfo
.
specifiedQueryInfo
.
result
[
i
],
winfo
->
threadID
);
}
g_queryInfo
.
specifiedQueryInfo
.
tsub
[
i
]
=
subscribeImpl
(
winfo
->
taos
,
g_queryInfo
.
specifiedQueryInfo
.
sql
[
i
],
topic
,
tmpFile
);
tsub
[
i
]
=
subscribeImpl
(
winfo
->
taos
,
g_queryInfo
.
specifiedQueryInfo
.
sql
[
i
],
topic
,
tmpFile
);
if
(
NULL
==
g_queryInfo
.
specifiedQueryInfo
.
tsub
[
i
])
{
taos_close
(
winfo
->
taos
);
return
NULL
;
...
...
@@ -6020,7 +6017,7 @@ static void *superSubscribeProcess(void *sarg) {
continue
;
}
res
=
taos_consume
(
g_queryInfo
.
specifiedQueryInfo
.
tsub
[
i
]);
res
=
taos_consume
(
tsub
[
i
]);
if
(
res
)
{
char
tmpFile
[
MAX_FILE_NAME_LEN
*
2
]
=
{
0
};
if
(
g_queryInfo
.
specifiedQueryInfo
.
result
[
i
][
0
]
!=
0
)
{
...
...
@@ -6034,8 +6031,7 @@ static void *superSubscribeProcess(void *sarg) {
taos_free_result
(
res
);
for
(
int
i
=
0
;
i
<
g_queryInfo
.
specifiedQueryInfo
.
sqlCount
;
i
++
)
{
taos_unsubscribe
(
g_queryInfo
.
specifiedQueryInfo
.
tsub
[
i
],
g_queryInfo
.
specifiedQueryInfo
.
subscribeKeepProgress
);
taos_unsubscribe
(
tsub
[
i
],
g_queryInfo
.
specifiedQueryInfo
.
subscribeKeepProgress
);
}
taos_close
(
winfo
->
taos
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录