Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
1f73c106
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看板
提交
1f73c106
编写于
9月 21, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1529: stream async create db connection
and also fix failed test cases related to stream.
上级
f8cbfe74
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
28 addition
and
7 deletion
+28
-7
src/client/src/tscSql.c
src/client/src/tscSql.c
+9
-1
src/client/src/tscStream.c
src/client/src/tscStream.c
+5
-0
src/cq/CMakeLists.txt
src/cq/CMakeLists.txt
+2
-0
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+12
-6
未找到文件。
src/client/src/tscSql.c
浏览文件 @
1f73c106
...
@@ -236,13 +236,21 @@ TAOS *taos_connect_c(const char *ip, uint8_t ipLen, const char *user, uint8_t us
...
@@ -236,13 +236,21 @@ TAOS *taos_connect_c(const char *ip, uint8_t ipLen, const char *user, uint8_t us
return
taos_connect
(
ipBuf
,
userBuf
,
passBuf
,
dbBuf
,
port
);
return
taos_connect
(
ipBuf
,
userBuf
,
passBuf
,
dbBuf
,
port
);
}
}
static
void
asyncConnCallback
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
)
{
SSqlObj
*
pSql
=
(
SSqlObj
*
)
tres
;
assert
(
pSql
!=
NULL
);
pSql
->
fetchFp
(
pSql
->
param
,
tres
,
code
);
}
TAOS
*
taos_connect_a
(
char
*
ip
,
char
*
user
,
char
*
pass
,
char
*
db
,
uint16_t
port
,
void
(
*
fp
)(
void
*
,
TAOS_RES
*
,
int
),
TAOS
*
taos_connect_a
(
char
*
ip
,
char
*
user
,
char
*
pass
,
char
*
db
,
uint16_t
port
,
void
(
*
fp
)(
void
*
,
TAOS_RES
*
,
int
),
void
*
param
,
void
**
taos
)
{
void
*
param
,
void
**
taos
)
{
SSqlObj
*
pSql
=
taosConnectImpl
(
ip
,
user
,
pass
,
NULL
,
db
,
port
,
fp
,
param
,
taos
);
SSqlObj
*
pSql
=
taosConnectImpl
(
ip
,
user
,
pass
,
NULL
,
db
,
port
,
asyncConnCallback
,
param
,
taos
);
if
(
pSql
==
NULL
)
{
if
(
pSql
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
pSql
->
fetchFp
=
fp
;
pSql
->
res
.
code
=
tscProcessSql
(
pSql
);
pSql
->
res
.
code
=
tscProcessSql
(
pSql
);
tscDebug
(
"%p DB async connection is opening"
,
taos
);
tscDebug
(
"%p DB async connection is opening"
,
taos
);
return
taos
;
return
taos
;
...
...
src/client/src/tscStream.c
浏览文件 @
1f73c106
...
@@ -515,6 +515,10 @@ static void tscCreateStream(void *param, TAOS_RES *res, int code) {
...
@@ -515,6 +515,10 @@ static void tscCreateStream(void *param, TAOS_RES *res, int code) {
return
;
return
;
}
}
uint64_t
handle
=
(
uint64_t
)
pSql
;
pSql
->
self
=
taosCachePut
(
tscObjCache
,
&
handle
,
sizeof
(
uint64_t
),
&
pSql
,
sizeof
(
uint64_t
),
2
*
3600
*
1000
);
T_REF_INC
(
pSql
->
pTscObj
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableComInfo
tinfo
=
tscGetTableInfo
(
pTableMetaInfo
->
pTableMeta
);
STableComInfo
tinfo
=
tscGetTableInfo
(
pTableMetaInfo
->
pTableMeta
);
...
@@ -608,6 +612,7 @@ void taos_close_stream(TAOS_STREAM *handle) {
...
@@ -608,6 +612,7 @@ void taos_close_stream(TAOS_STREAM *handle) {
* Here, we need a check before release memory
* Here, we need a check before release memory
*/
*/
if
(
pSql
->
signature
==
pSql
)
{
if
(
pSql
->
signature
==
pSql
)
{
T_REF_DEC
(
pSql
->
pTscObj
);
tscRemoveFromStreamList
(
pStream
,
pSql
);
tscRemoveFromStreamList
(
pStream
,
pSql
);
taosTmrStopA
(
&
(
pStream
->
pTimer
));
taosTmrStopA
(
&
(
pStream
->
pTimer
));
...
...
src/cq/CMakeLists.txt
浏览文件 @
1f73c106
...
@@ -2,6 +2,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
...
@@ -2,6 +2,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT
(
TDengine
)
PROJECT
(
TDengine
)
INCLUDE_DIRECTORIES
(
inc
)
INCLUDE_DIRECTORIES
(
inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/client/inc
)
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/query/inc
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SRC
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SRC
)
IF
(
TD_LINUX
)
IF
(
TD_LINUX
)
...
...
src/cq/src/cqMain.c
浏览文件 @
1f73c106
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <string.h>
#include <string.h>
#include "taos.h"
#include "taos.h"
#include "tsclient.h"
#include "taosdef.h"
#include "taosdef.h"
#include "taosmsg.h"
#include "taosmsg.h"
#include "ttimer.h"
#include "ttimer.h"
...
@@ -238,18 +239,23 @@ void cqDrop(void *handle) {
...
@@ -238,18 +239,23 @@ void cqDrop(void *handle) {
pthread_mutex_unlock
(
&
pContext
->
mutex
);
pthread_mutex_unlock
(
&
pContext
->
mutex
);
}
}
static
void
doCreateStream
(
void
*
param
,
TAOS_RES
*
result
,
int
code
)
{
SCqObj
*
pObj
=
(
SCqObj
*
)
param
;
SCqContext
*
pContext
=
pObj
->
pContext
;
SSqlObj
*
pSql
=
(
SSqlObj
*
)
result
;
pContext
->
dbConn
=
pSql
->
pTscObj
;
cqCreateStream
(
pContext
,
pObj
);
}
static
void
cqProcessCreateTimer
(
void
*
param
,
void
*
tmrId
)
{
static
void
cqProcessCreateTimer
(
void
*
param
,
void
*
tmrId
)
{
SCqObj
*
pObj
=
(
SCqObj
*
)
param
;
SCqObj
*
pObj
=
(
SCqObj
*
)
param
;
SCqContext
*
pContext
=
pObj
->
pContext
;
SCqContext
*
pContext
=
pObj
->
pContext
;
if
(
pContext
->
dbConn
==
NULL
)
{
if
(
pContext
->
dbConn
==
NULL
)
{
pContext
->
dbConn
=
taos_connect
(
"localhost"
,
pContext
->
user
,
pContext
->
pass
,
pContext
->
db
,
0
);
taos_connect_a
(
NULL
,
pContext
->
user
,
pContext
->
pass
,
pContext
->
db
,
0
,
doCreateStream
,
param
,
NULL
);
if
(
pContext
->
dbConn
==
NULL
)
{
}
else
{
cError
(
"vgId:%d, failed to connect to TDengine(%s)"
,
pContext
->
vgId
,
tstrerror
(
terrno
));
}
}
cqCreateStream
(
pContext
,
pObj
);
cqCreateStream
(
pContext
,
pObj
);
}
}
}
static
void
cqCreateStream
(
SCqContext
*
pContext
,
SCqObj
*
pObj
)
{
static
void
cqCreateStream
(
SCqContext
*
pContext
,
SCqObj
*
pObj
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录