Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d12532b4
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d12532b4
编写于
5月 06, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnodew
上级
84e89395
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
130 addition
and
4 deletion
+130
-4
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
+1
-0
source/dnode/qnode/src/qnode.c
source/dnode/qnode/src/qnode.c
+2
-0
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+127
-4
未找到文件。
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
浏览文件 @
d12532b4
...
...
@@ -101,6 +101,7 @@ void qmInitMsgHandle(SMgmtWrapper *pWrapper) {
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_CONTINUE
,
qmProcessQueryMsg
,
QNODE_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH
,
qmProcessFetchMsg
,
QNODE_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH_RSP
,
qmProcessFetchMsg
,
QNODE_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_HEARTBEAT
,
qmProcessFetchMsg
,
QNODE_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_RES_READY
,
qmProcessFetchMsg
,
QNODE_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_TASKS_STATUS
,
qmProcessFetchMsg
,
QNODE_HANDLE
);
...
...
source/dnode/qnode/src/qnode.c
浏览文件 @
d12532b4
...
...
@@ -84,6 +84,8 @@ int32_t qndProcessFetchMsg(SQnode *pQnode, SRpcMsg *pMsg) {
// return vnodeGetTableMeta(pQnode, pMsg);
case
TDMT_VND_CONSUME
:
// return tqProcessConsumeReq(pQnode->pTq, pMsg);
case
TDMT_VND_QUERY_HEARTBEAT
:
return
qWorkerProcessHbMsg
(
pQnode
,
pQnode
->
pQuery
,
pMsg
);
default:
qError
(
"unknown msg type:%d in fetch queue"
,
pMsg
->
msgType
);
return
TSDB_CODE_VND_APP_ERROR
;
...
...
tests/script/api/batchprepare.c
浏览文件 @
d12532b4
...
...
@@ -398,7 +398,7 @@ void bpAppendOperatorParam(BindData *data, int32_t *len, int32_t dataType, int32
}
}
void
generateQuerySQL
(
BindData
*
data
,
int32_t
tblIdx
)
{
void
generateQuery
Cond
SQL
(
BindData
*
data
,
int32_t
tblIdx
)
{
int32_t
len
=
sprintf
(
data
->
sql
,
"select * from %s%d where "
,
bpTbPrefix
,
tblIdx
);
if
(
!
gCurCase
->
fullCol
)
{
for
(
int
c
=
0
;
c
<
gCurCase
->
bindColNum
;
++
c
)
{
...
...
@@ -462,6 +462,72 @@ void generateQuerySQL(BindData *data, int32_t tblIdx) {
}
}
void
generateQueryMiscSQL
(
BindData
*
data
,
int32_t
tblIdx
)
{
int32_t
len
=
sprintf
(
data
->
sql
,
"select * from %s%d where "
,
bpTbPrefix
,
tblIdx
);
if
(
!
gCurCase
->
fullCol
)
{
for
(
int
c
=
0
;
c
<
gCurCase
->
bindColNum
;
++
c
)
{
if
(
c
)
{
len
+=
sprintf
(
data
->
sql
+
len
,
" and "
);
}
switch
(
data
->
pBind
[
c
].
buffer_type
)
{
case
TSDB_DATA_TYPE_BOOL
:
len
+=
sprintf
(
data
->
sql
+
len
,
"booldata"
);
break
;
case
TSDB_DATA_TYPE_TINYINT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"tinydata"
);
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"smalldata"
);
break
;
case
TSDB_DATA_TYPE_INT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"intdata"
);
break
;
case
TSDB_DATA_TYPE_BIGINT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"bigdata"
);
break
;
case
TSDB_DATA_TYPE_FLOAT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"floatdata"
);
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
len
+=
sprintf
(
data
->
sql
+
len
,
"doubledata"
);
break
;
case
TSDB_DATA_TYPE_VARCHAR
:
len
+=
sprintf
(
data
->
sql
+
len
,
"binarydata"
);
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
len
+=
sprintf
(
data
->
sql
+
len
,
"ts"
);
break
;
case
TSDB_DATA_TYPE_NCHAR
:
len
+=
sprintf
(
data
->
sql
+
len
,
"nchardata"
);
break
;
case
TSDB_DATA_TYPE_UTINYINT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"utinydata"
);
break
;
case
TSDB_DATA_TYPE_USMALLINT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"usmalldata"
);
break
;
case
TSDB_DATA_TYPE_UINT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"uintdata"
);
break
;
case
TSDB_DATA_TYPE_UBIGINT
:
len
+=
sprintf
(
data
->
sql
+
len
,
"ubigdata"
);
break
;
default:
printf
(
"!!!invalid col type:%d"
,
data
->
pBind
[
c
].
buffer_type
);
exit
(
1
);
}
bpAppendOperatorParam
(
data
,
&
len
,
data
->
pBind
[
c
].
buffer_type
,
c
);
}
}
if
(
gCaseCtrl
.
printStmtSql
)
{
printf
(
"
\t
STMT SQL: %s
\n
"
,
data
->
sql
);
}
}
void
generateErrorSQL
(
BindData
*
data
,
int32_t
tblIdx
)
{
int32_t
len
=
0
;
data
->
sql
=
taosMemoryCalloc
(
1
,
1024
);
...
...
@@ -677,7 +743,7 @@ int32_t prepareInsertData(BindData *data) {
return
0
;
}
int32_t
prepareQueryData
(
BindData
*
data
,
int32_t
tblIdx
)
{
int32_t
prepareQuery
Cond
Data
(
BindData
*
data
,
int32_t
tblIdx
)
{
static
int64_t
tsData
=
1591060628000
;
uint64_t
bindNum
=
gCurCase
->
rowNum
/
gCurCase
->
bindRowNum
;
...
...
@@ -735,6 +801,63 @@ int32_t prepareQueryData(BindData *data, int32_t tblIdx) {
}
int32_t
prepareQueryMiscData
(
BindData
*
data
,
int32_t
tblIdx
)
{
static
int64_t
tsData
=
1591060628000
;
uint64_t
bindNum
=
gCurCase
->
rowNum
/
gCurCase
->
bindRowNum
;
data
->
colNum
=
0
;
data
->
colTypes
=
taosMemoryCalloc
(
30
,
sizeof
(
int32_t
));
data
->
sql
=
taosMemoryCalloc
(
1
,
1024
);
data
->
pBind
=
taosMemoryCalloc
(
bindNum
*
gCurCase
->
bindColNum
,
sizeof
(
TAOS_MULTI_BIND
));
data
->
tsData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
int64_t
));
data
->
boolData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
bool
));
data
->
tinyData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
int8_t
));
data
->
utinyData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
uint8_t
));
data
->
smallData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
int16_t
));
data
->
usmallData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
uint16_t
));
data
->
intData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
int32_t
));
data
->
uintData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
uint32_t
));
data
->
bigData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
int64_t
));
data
->
ubigData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
uint64_t
));
data
->
floatData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
float
));
data
->
doubleData
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
double
));
data
->
binaryData
=
taosMemoryMalloc
(
bindNum
*
gVarCharSize
);
data
->
binaryLen
=
taosMemoryMalloc
(
bindNum
*
sizeof
(
int32_t
));
if
(
gCurCase
->
bindNullNum
)
{
data
->
isNull
=
taosMemoryCalloc
(
bindNum
,
sizeof
(
char
));
}
for
(
int32_t
i
=
0
;
i
<
bindNum
;
++
i
)
{
data
->
tsData
[
i
]
=
tsData
+
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
;
data
->
boolData
[
i
]
=
(
bool
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
tinyData
[
i
]
=
(
int8_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
utinyData
[
i
]
=
(
uint8_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
smallData
[
i
]
=
(
int16_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
usmallData
[
i
]
=
(
uint16_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
intData
[
i
]
=
(
int32_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
uintData
[
i
]
=
(
uint32_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
bigData
[
i
]
=
(
int64_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
ubigData
[
i
]
=
(
uint64_t
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
floatData
[
i
]
=
(
float
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
data
->
doubleData
[
i
]
=
(
double
)(
tblIdx
*
gCurCase
->
rowNum
+
rand
()
%
gCurCase
->
rowNum
);
memset
(
data
->
binaryData
+
gVarCharSize
*
i
,
'a'
+
i
%
26
,
gVarCharLen
);
if
(
gCurCase
->
bindNullNum
)
{
data
->
isNull
[
i
]
=
i
%
2
;
}
data
->
binaryLen
[
i
]
=
gVarCharLen
;
}
for
(
int
b
=
0
;
b
<
bindNum
;
b
++
)
{
for
(
int
c
=
0
;
c
<
gCurCase
->
bindColNum
;
++
c
)
{
prepareColData
(
data
,
b
*
gCurCase
->
bindColNum
+
c
,
b
*
gCurCase
->
bindRowNum
,
c
);
}
}
generateQueryMiscSQL
(
data
,
tblIdx
);
return
0
;
}
void
destroyData
(
BindData
*
data
)
{
...
...
@@ -1385,7 +1508,7 @@ int querySUBTTest1(TAOS_STMT *stmt, TAOS *taos) {
for
(
int32_t
t
=
0
;
t
<
gCurCase
->
tblNum
;
++
t
)
{
memset
(
&
data
,
0
,
sizeof
(
data
));
prepareQueryData
(
&
data
,
t
);
prepareQuery
Cond
Data
(
&
data
,
t
);
int
code
=
taos_stmt_prepare
(
stmt
,
data
.
sql
,
0
);
if
(
code
!=
0
){
...
...
@@ -1431,7 +1554,7 @@ int querySUBTTest2(TAOS_STMT *stmt, TAOS *taos) {
for
(
int32_t
t
=
0
;
t
<
gCurCase
->
tblNum
;
++
t
)
{
memset
(
&
data
,
0
,
sizeof
(
data
));
prepareQueryData
(
&
data
,
t
);
prepareQuery
Misc
Data
(
&
data
,
t
);
int
code
=
taos_stmt_prepare
(
stmt
,
data
.
sql
,
0
);
if
(
code
!=
0
){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录