Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
872fec65
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看板
提交
872fec65
编写于
3月 20, 2021
作者:
W
wu champion
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/TD-1380
上级
d2aa6fe5
30b26112
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
15 deletion
+25
-15
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+25
-15
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
872fec65
...
...
@@ -2633,10 +2633,10 @@ static void createChildTables() {
if
((
strncasecmp
(
g_args
.
datatype
[
j
],
"BINARY"
,
strlen
(
"BINARY"
))
==
0
)
||
(
strncasecmp
(
g_args
.
datatype
[
j
],
"NCHAR"
,
strlen
(
"NCHAR"
))
==
0
))
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
-
len
,
", COL%d %s(60)"
,
j
,
g_args
.
datatype
[
j
]);
}
else
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
-
len
,
", COL%d %s"
,
j
,
g_args
.
datatype
[
j
]);
}
len
=
strlen
(
tblColsBuf
);
...
...
@@ -4319,7 +4319,8 @@ static int generateDataTail(char *tableName, int32_t tableSeq,
return
k
;
}
static
int
generateSQLHead
(
char
*
tableName
,
int32_t
tableSeq
,
threadInfo
*
pThreadInfo
,
SSuperTable
*
superTblInfo
,
char
*
buffer
)
static
int
generateSQLHead
(
char
*
tableName
,
int32_t
tableSeq
,
threadInfo
*
pThreadInfo
,
SSuperTable
*
superTblInfo
,
char
*
buffer
)
{
int
len
;
if
(
superTblInfo
)
{
...
...
@@ -4440,7 +4441,6 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
int64_t
insertRows
=
(
superTblInfo
)
?
superTblInfo
->
insertRows
:
g_args
.
num_of_DPT
;
int
insert_interval
=
superTblInfo
?
superTblInfo
->
insertInterval
:
g_args
.
insert_interval
;
int
timeStempStep
=
superTblInfo
?
superTblInfo
->
timeStampStep
:
DEFAULT_TIMESTAMP_STEP
;
uint64_t
st
=
0
;
uint64_t
et
=
0xffffffff
;
...
...
@@ -4475,6 +4475,7 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
int
generatedRecPerTbl
=
0
;
bool
flagSleep
=
true
;
int
sleepTimeTotal
=
0
;
int
timeShift
=
0
;
while
(
pThreadInfo
->
totalInsertRows
<
pThreadInfo
->
ntables
*
insertRows
)
{
if
((
flagSleep
)
&&
(
insert_interval
))
{
st
=
taosGetTimestampUs
();
...
...
@@ -4512,7 +4513,7 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
generateDataTail
(
tableName
,
tableSeq
,
pThreadInfo
,
superTblInfo
,
batchPerTbl
,
pstr
,
insertRows
,
0
,
startTime
+
sleepTimeTotal
+
0
*
timeStempStep
,
startTime
+
timeShift
+
sleepTimeTotal
,
&
(
pThreadInfo
->
samplePos
),
&
dataLen
);
pstr
+=
dataLen
;
recOfBatch
+=
batchPerTbl
;
...
...
@@ -4521,6 +4522,7 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
pThreadInfo
->
threadID
,
__func__
,
__LINE__
,
batchPerTbl
,
recOfBatch
);
timeShift
++
;
tableSeq
++
;
if
(
insertMode
==
INTERLACE_INSERT_MODE
)
{
if
(
tableSeq
==
pThreadInfo
->
start_table_from
+
pThreadInfo
->
ntables
)
{
...
...
@@ -5486,7 +5488,11 @@ static int queryTestProcess() {
char
sqlStr
[
MAX_TB_NAME_SIZE
*
2
];
sprintf
(
sqlStr
,
"use %s"
,
g_queryInfo
.
dbName
);
verbosePrint
(
"%s() %d sqlStr: %s
\n
"
,
__func__
,
__LINE__
,
sqlStr
);
(
void
)
queryDbExec
(
t_info
->
taos
,
sqlStr
,
NO_INSERT_TYPE
);
if
(
0
!=
queryDbExec
(
t_info
->
taos
,
sqlStr
,
NO_INSERT_TYPE
))
{
errorPrint
(
"use database %s failed!
\n\n
"
,
g_queryInfo
.
dbName
);
return
-
1
;
}
}
else
{
t_info
->
taos
=
NULL
;
}
...
...
@@ -5756,22 +5762,27 @@ static int subscribeTestProcess() {
pthread_t
*
pids
=
NULL
;
threadInfo
*
infos
=
NULL
;
//==== create sub threads for query from super table
if
(
g_queryInfo
.
superQueryInfo
.
sqlCount
>
0
&&
g_queryInfo
.
superQueryInfo
.
concurrent
>
0
)
{
pids
=
malloc
(
g_queryInfo
.
superQueryInfo
.
concurrent
*
sizeof
(
pthread_t
));
infos
=
malloc
(
g_queryInfo
.
superQueryInfo
.
concurrent
*
sizeof
(
threadInfo
));
if
((
NULL
==
pids
)
||
(
NULL
==
infos
))
{
if
((
g_queryInfo
.
superQueryInfo
.
sqlCount
<=
0
)
||
(
g_queryInfo
.
superQueryInfo
.
concurrent
<=
0
))
{
errorPrint
(
"%s() LN%d, query sqlCount %d or concurrent %d is not correct.
\n
"
,
__func__
,
__LINE__
,
g_queryInfo
.
superQueryInfo
.
sqlCount
,
g_queryInfo
.
superQueryInfo
.
concurrent
);
exit
(
-
1
);
}
pids
=
malloc
(
g_queryInfo
.
superQueryInfo
.
concurrent
*
sizeof
(
pthread_t
));
infos
=
malloc
(
g_queryInfo
.
superQueryInfo
.
concurrent
*
sizeof
(
threadInfo
));
if
((
NULL
==
pids
)
||
(
NULL
==
infos
))
{
printf
(
"malloc failed for create threads
\n
"
);
taos_close
(
taos
);
exit
(
-
1
);
}
}
for
(
int
i
=
0
;
i
<
g_queryInfo
.
superQueryInfo
.
concurrent
;
i
++
)
{
for
(
int
i
=
0
;
i
<
g_queryInfo
.
superQueryInfo
.
concurrent
;
i
++
)
{
threadInfo
*
t_info
=
infos
+
i
;
t_info
->
threadID
=
i
;
t_info
->
taos
=
taos
;
pthread_create
(
pids
+
i
,
NULL
,
superSubscribeProcess
,
t_info
);
}
}
//==== create sub threads for query from sub table
...
...
@@ -6031,7 +6042,6 @@ static void querySqlFile(TAOS* taos, char* sqlFile)
memcpy
(
cmd
+
cmd_len
,
line
,
read_len
);
verbosePrint
(
"%s() LN%d cmd: %s
\n
"
,
__func__
,
__LINE__
,
cmd
);
queryDbExec
(
taos
,
cmd
,
NO_INSERT_TYPE
);
if
(
0
!=
queryDbExec
(
taos
,
cmd
,
NO_INSERT_TYPE
))
{
printf
(
"queryDbExec %s failed!
\n
"
,
cmd
);
tmfree
(
cmd
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录