Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
40c1d665
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看板
提交
40c1d665
编写于
6月 02, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix some issues
上级
69142ea5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
10 deletion
+24
-10
src/client/src/tscStream.c
src/client/src/tscStream.c
+14
-0
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+0
-1
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+7
-6
src/dnode/inc/dnodeModule.h
src/dnode/inc/dnodeModule.h
+1
-1
src/inc/tcq.h
src/inc/tcq.h
+1
-1
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+1
-1
未找到文件。
src/client/src/tscStream.c
浏览文件 @
40c1d665
...
@@ -477,6 +477,14 @@ static void setErrorInfo(SSqlObj* pSql, int32_t code, char* info) {
...
@@ -477,6 +477,14 @@ static void setErrorInfo(SSqlObj* pSql, int32_t code, char* info) {
}
}
}
}
static
void
asyncCallback
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
)
{
assert
(
param
!=
NULL
);
SSqlObj
*
pSql
=
((
SSqlObj
*
)
param
);
pSql
->
res
.
code
=
code
;
sem_post
(
&
pSql
->
rspSem
);
}
TAOS_STREAM
*
taos_open_stream
(
TAOS
*
taos
,
const
char
*
sqlstr
,
void
(
*
fp
)(
void
*
param
,
TAOS_RES
*
,
TAOS_ROW
row
),
TAOS_STREAM
*
taos_open_stream
(
TAOS
*
taos
,
const
char
*
sqlstr
,
void
(
*
fp
)(
void
*
param
,
TAOS_RES
*
,
TAOS_ROW
row
),
int64_t
stime
,
void
*
param
,
void
(
*
callback
)(
void
*
))
{
int64_t
stime
,
void
*
param
,
void
(
*
callback
)(
void
*
))
{
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
...
@@ -521,7 +529,13 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
...
@@ -521,7 +529,13 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
return
NULL
;
return
NULL
;
}
}
pSql
->
param
=
pSql
;
pSql
->
fp
=
asyncCallback
;
pRes
->
code
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
pRes
->
code
=
tscToSQLCmd
(
pSql
,
&
SQLInfo
);
if
(
pRes
->
code
==
TSDB_CODE_ACTION_IN_PROGRESS
)
{
sem_wait
(
&
pSql
->
rspSem
);
}
SQLInfoDestroy
(
&
SQLInfo
);
SQLInfoDestroy
(
&
SQLInfo
);
if
(
pRes
->
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
pRes
->
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/common/inc/tdataformat.h
浏览文件 @
40c1d665
...
@@ -70,7 +70,6 @@ typedef struct {
...
@@ -70,7 +70,6 @@ typedef struct {
int
numOfCols
;
// Number of columns appended
int
numOfCols
;
// Number of columns appended
int
tlen
;
// maximum length of a SDataRow without the header part
int
tlen
;
// maximum length of a SDataRow without the header part
int
flen
;
// First part length in a SDataRow after the header part
int
flen
;
// First part length in a SDataRow after the header part
int32_t
version
;
STColumn
columns
[];
STColumn
columns
[];
}
STSchema
;
}
STSchema
;
...
...
src/cq/src/cqMain.c
浏览文件 @
40c1d665
...
@@ -239,19 +239,19 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
...
@@ -239,19 +239,19 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
cTrace
(
"vgId:%d, id:%d CQ:%s stream result is ready"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
cTrace
(
"vgId:%d, id:%d CQ:%s stream result is ready"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
int32_t
flen
=
0
;
for
(
int32_t
i
=
0
;
i
<
pSchema
->
numOfCols
;
i
++
)
{
flen
+=
TYPE_BYTES
[
pSchema
->
columns
[
i
].
type
];
}
// construct data
// construct data
int
size
=
sizeof
(
SWalHead
)
+
sizeof
(
SSubmitMsg
)
+
sizeof
(
SSubmitBlk
)
+
pObj
->
rowSize
;
int
size
=
sizeof
(
SWalHead
)
+
sizeof
(
SSubmitMsg
)
+
sizeof
(
SSubmitBlk
)
+
TD_DATA_ROW_HEAD_SIZE
+
flen
;
char
*
buffer
=
calloc
(
size
,
1
);
char
*
buffer
=
calloc
(
size
,
1
);
SWalHead
*
pHead
=
(
SWalHead
*
)
buffer
;
SWalHead
*
pHead
=
(
SWalHead
*
)
buffer
;
SSubmitMsg
*
pMsg
=
(
SSubmitMsg
*
)
(
buffer
+
sizeof
(
SWalHead
));
SSubmitMsg
*
pMsg
=
(
SSubmitMsg
*
)
(
buffer
+
sizeof
(
SWalHead
));
SSubmitBlk
*
pBlk
=
(
SSubmitBlk
*
)
(
buffer
+
sizeof
(
SWalHead
)
+
sizeof
(
SSubmitMsg
));
SSubmitBlk
*
pBlk
=
(
SSubmitBlk
*
)
(
buffer
+
sizeof
(
SWalHead
)
+
sizeof
(
SSubmitMsg
));
int32_t
flen
=
0
;
for
(
int32_t
i
=
0
;
i
<
pSchema
->
numOfCols
;
i
++
)
{
flen
+=
TYPE_BYTES
[
pSchema
->
columns
[
i
].
type
];
}
SDataRow
trow
=
(
SDataRow
)
pBlk
->
data
;
SDataRow
trow
=
(
SDataRow
)
pBlk
->
data
;
dataRowSetLen
(
trow
,
TD_DATA_ROW_HEAD_SIZE
+
flen
);
dataRowSetLen
(
trow
,
TD_DATA_ROW_HEAD_SIZE
+
flen
);
...
@@ -279,5 +279,6 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
...
@@ -279,5 +279,6 @@ static void cqProcessStreamRes(void *param, TAOS_RES *tres, TAOS_ROW row) {
// write into vnode write queue
// write into vnode write queue
pContext
->
cqWrite
(
pContext
->
ahandle
,
pHead
,
TAOS_QTYPE_CQ
);
pContext
->
cqWrite
(
pContext
->
ahandle
,
pHead
,
TAOS_QTYPE_CQ
);
free
(
buffer
);
}
}
src/dnode/inc/dnodeModule.h
浏览文件 @
40c1d665
...
@@ -23,7 +23,7 @@ extern "C" {
...
@@ -23,7 +23,7 @@ extern "C" {
int32_t
dnodeInitModules
();
int32_t
dnodeInitModules
();
void
dnodeStartModules
();
void
dnodeStartModules
();
void
dnodeStartStream
();
void
dnodeStartStream
();
void
dnodeClean
U
pModules
();
void
dnodeClean
u
pModules
();
void
dnodeProcessModuleStatus
(
uint32_t
moduleStatus
);
void
dnodeProcessModuleStatus
(
uint32_t
moduleStatus
);
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/inc/tcq.h
浏览文件 @
40c1d665
...
@@ -27,7 +27,7 @@ typedef struct {
...
@@ -27,7 +27,7 @@ typedef struct {
int
vgId
;
int
vgId
;
char
user
[
TSDB_USER_LEN
];
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
db
[
TSDB_DB_NAME_LEN
];
char
db
[
TSDB_DB_NAME_LEN
+
1
];
FCqWrite
cqWrite
;
FCqWrite
cqWrite
;
}
SCqCfg
;
}
SCqCfg
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
40c1d665
...
@@ -210,7 +210,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
...
@@ -210,7 +210,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
SCqCfg
cqCfg
=
{
0
};
SCqCfg
cqCfg
=
{
0
};
sprintf
(
cqCfg
.
user
,
"_root"
);
sprintf
(
cqCfg
.
user
,
"_root"
);
strcpy
(
cqCfg
.
pass
,
tsInternalPass
);
strcpy
(
cqCfg
.
pass
,
tsInternalPass
);
strcpy
(
cqCfg
.
db
,
"db"
);
// TODO: replace hard coded db name
strcpy
(
cqCfg
.
db
,
pVnode
->
db
);
cqCfg
.
vgId
=
vnode
;
cqCfg
.
vgId
=
vnode
;
cqCfg
.
cqWrite
=
vnodeWriteToQueue
;
cqCfg
.
cqWrite
=
vnodeWriteToQueue
;
pVnode
->
cq
=
cqOpen
(
pVnode
,
&
cqCfg
);
pVnode
->
cq
=
cqOpen
(
pVnode
,
&
cqCfg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录