Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
9dbde396
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看板
提交
9dbde396
编写于
3月 08, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into hotfix/sangshuduo/TD-3147-insert-rate-more-than-1s
上级
a273c635
59239c6d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
12 deletion
+14
-12
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+14
-12
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
9dbde396
...
@@ -998,7 +998,7 @@ static int printfInsertMeta() {
...
@@ -998,7 +998,7 @@ static int printfInsertMeta() {
printf
(
"database count:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
dbCount
);
printf
(
"database count:
\033
[33m%d
\033
[0m
\n
"
,
g_Dbs
.
dbCount
);
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
printf
(
"database[
\033
[33m%d
\033
[0m]:
\n
"
,
i
);
printf
(
"database[
\033
[33m%d
\033
[0m]:
\n
"
,
i
);
printf
(
" database
name:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
printf
(
" database
[%d] name:
\033
[33m%s
\033
[0m
\n
"
,
i
,
g_Dbs
.
db
[
i
].
dbName
);
if
(
0
==
g_Dbs
.
db
[
i
].
drop
)
{
if
(
0
==
g_Dbs
.
db
[
i
].
drop
)
{
printf
(
" drop:
\033
[33mno
\033
[0m
\n
"
);
printf
(
" drop:
\033
[33mno
\033
[0m
\n
"
);
}
else
{
}
else
{
...
@@ -1147,7 +1147,7 @@ static void printfInsertMetaToFile(FILE* fp) {
...
@@ -1147,7 +1147,7 @@ static void printfInsertMetaToFile(FILE* fp) {
fprintf
(
fp
,
"database count: %d
\n
"
,
g_Dbs
.
dbCount
);
fprintf
(
fp
,
"database count: %d
\n
"
,
g_Dbs
.
dbCount
);
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
for
(
int
i
=
0
;
i
<
g_Dbs
.
dbCount
;
i
++
)
{
fprintf
(
fp
,
"database[%d]:
\n
"
,
i
);
fprintf
(
fp
,
"database[%d]:
\n
"
,
i
);
fprintf
(
fp
,
" database
name: %s
\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
fprintf
(
fp
,
" database
[%d] name: %s
\n
"
,
i
,
g_Dbs
.
db
[
i
].
dbName
);
if
(
0
==
g_Dbs
.
db
[
i
].
drop
)
{
if
(
0
==
g_Dbs
.
db
[
i
].
drop
)
{
fprintf
(
fp
,
" drop: no
\n
"
);
fprintf
(
fp
,
" drop: no
\n
"
);
}
else
{
}
else
{
...
@@ -2140,7 +2140,7 @@ static int createDatabases() {
...
@@ -2140,7 +2140,7 @@ static int createDatabases() {
}
}
printf
(
"
\n
create database %s success!
\n\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
printf
(
"
\n
create database %s success!
\n\n
"
,
g_Dbs
.
db
[
i
].
dbName
);
debugPrint
(
"DEBUG %s() %d count:%d
\n
"
,
__func__
,
__LINE__
,
g_Dbs
.
db
[
i
].
superTblCount
);
debugPrint
(
"DEBUG %s() %d
supertbl
count:%d
\n
"
,
__func__
,
__LINE__
,
g_Dbs
.
db
[
i
].
superTblCount
);
for
(
int
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
for
(
int
j
=
0
;
j
<
g_Dbs
.
db
[
i
].
superTblCount
;
j
++
)
{
// describe super table, if exists
// describe super table, if exists
sprintf
(
command
,
"describe %s.%s;"
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sTblName
);
sprintf
(
command
,
"describe %s.%s;"
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sTblName
);
...
@@ -2285,6 +2285,7 @@ int startMultiThreadCreateChildTable(
...
@@ -2285,6 +2285,7 @@ int startMultiThreadCreateChildTable(
t_info
->
threadID
=
i
;
t_info
->
threadID
=
i
;
tstrncpy
(
t_info
->
db_name
,
db_name
,
MAX_DB_NAME_SIZE
);
tstrncpy
(
t_info
->
db_name
,
db_name
,
MAX_DB_NAME_SIZE
);
t_info
->
superTblInfo
=
superTblInfo
;
t_info
->
superTblInfo
=
superTblInfo
;
debugPrint
(
"DEBUG %s() %d db_name: %s
\n
"
,
__func__
,
__LINE__
,
db_name
);
t_info
->
taos
=
taos_connect
(
t_info
->
taos
=
taos_connect
(
g_Dbs
.
host
,
g_Dbs
.
host
,
g_Dbs
.
user
,
g_Dbs
.
user
,
...
@@ -2347,25 +2348,26 @@ static void createChildTables() {
...
@@ -2347,25 +2348,26 @@ static void createChildTables() {
}
else
{
}
else
{
// normal table
// normal table
len
=
snprintf
(
tblColsBuf
,
MAX_SQL_SIZE
,
"(TS TIMESTAMP"
);
len
=
snprintf
(
tblColsBuf
,
MAX_SQL_SIZE
,
"(TS TIMESTAMP"
);
int
i
=
0
;
int
j
=
0
;
while
(
g_args
.
datatype
[
i
])
{
while
(
g_args
.
datatype
[
j
])
{
if
((
strncasecmp
(
g_args
.
datatype
[
i
],
"BINARY"
,
strlen
(
"BINARY"
))
==
0
)
if
((
strncasecmp
(
g_args
.
datatype
[
j
],
"BINARY"
,
strlen
(
"BINARY"
))
==
0
)
||
(
strncasecmp
(
g_args
.
datatype
[
i
],
"NCHAR"
,
strlen
(
"NCHAR"
))
==
0
))
{
||
(
strncasecmp
(
g_args
.
datatype
[
j
],
"NCHAR"
,
strlen
(
"NCHAR"
))
==
0
))
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s(60)"
,
i
,
g_args
.
datatype
[
i
]);
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s(60)"
,
j
,
g_args
.
datatype
[
j
]);
}
else
{
}
else
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s"
,
i
,
g_args
.
datatype
[
i
]);
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s"
,
j
,
g_args
.
datatype
[
j
]);
}
}
len
=
strlen
(
tblColsBuf
);
len
=
strlen
(
tblColsBuf
);
j
++
;
}
}
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
-
len
,
")"
);
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
-
len
,
")"
);
debugPrint
(
"DEBUG - %s() LN%d: %s
\n
"
,
__func__
,
__LINE__
,
debugPrint
(
"DEBUG - %s() LN%d:
dbName: %s num of tb: %d schema:
%s
\n
"
,
__func__
,
__LINE__
,
tblColsBuf
);
g_Dbs
.
db
[
i
].
dbName
,
g_args
.
num_of_tables
,
tblColsBuf
);
startMultiThreadCreateChildTable
(
startMultiThreadCreateChildTable
(
tblColsBuf
,
tblColsBuf
,
g_Dbs
.
threadCountByCreateTbl
,
g_Dbs
.
threadCountByCreateTbl
,
g_args
.
num_of_
DPT
,
g_args
.
num_of_
tables
,
g_Dbs
.
db
[
i
].
dbName
,
g_Dbs
.
db
[
i
].
dbName
,
NULL
);
NULL
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录