Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
dfdeb7e0
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看板
未验证
提交
dfdeb7e0
编写于
3月 23, 2021
作者:
sangshuduo
提交者:
GitHub
3月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-3431] <fix>: fix taosdemo cmdline incorrect arguments. (#5536)
Co-authored-by:
N
Shuduo Sang
<
sdsang@taosdata.com
>
上级
38a8cb7a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
25 deletion
+24
-25
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+21
-22
tests/pytest/tools/taosdemoTest.py
tests/pytest/tools/taosdemoTest.py
+1
-1
tests/pytest/tools/taosdemoTest2.py
tests/pytest/tools/taosdemoTest2.py
+1
-1
tests/pytest/tools/taosdemoTestWithoutMetric.py
tests/pytest/tools/taosdemoTestWithoutMetric.py
+1
-1
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
dfdeb7e0
...
@@ -523,8 +523,8 @@ SArguments g_args = {
...
@@ -523,8 +523,8 @@ SArguments g_args = {
1
,
// replica
1
,
// replica
"t"
,
// tb_prefix
"t"
,
// tb_prefix
NULL
,
// sqlFile
NULL
,
// sqlFile
false
,
// use_metric
true
,
// use_metric
false
,
// insert_only
true
,
// insert_only
false
,
// debug_print
false
,
// debug_print
false
,
// verbose_print
false
,
// verbose_print
false
,
// performance statistic print
false
,
// performance statistic print
...
@@ -614,7 +614,7 @@ static void printHelp() {
...
@@ -614,7 +614,7 @@ static void printHelp() {
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-m"
,
indent
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-m"
,
indent
,
"Table prefix name. Default is 't'."
);
"Table prefix name. Default is 't'."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-s"
,
indent
,
"The select sql file."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-s"
,
indent
,
"The select sql file."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
M"
,
indent
,
"Use metric
flag."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-
N"
,
indent
,
"Use normal table
flag."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-o"
,
indent
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-o"
,
indent
,
"Direct output to the named file. Default is './output.txt'."
);
"Direct output to the named file. Default is './output.txt'."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-q"
,
indent
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-q"
,
indent
,
...
@@ -742,10 +742,10 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -742,10 +742,10 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments
->
len_of_binary
=
atoi
(
argv
[
++
i
]);
arguments
->
len_of_binary
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-m"
)
==
0
)
{
arguments
->
tb_prefix
=
argv
[
++
i
];
arguments
->
tb_prefix
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-
M
"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-
N
"
)
==
0
)
{
arguments
->
use_metric
=
tru
e
;
arguments
->
use_metric
=
fals
e
;
}
else
if
(
strcmp
(
argv
[
i
],
"-x"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-x"
)
==
0
)
{
arguments
->
insert_only
=
tru
e
;
arguments
->
insert_only
=
fals
e
;
}
else
if
(
strcmp
(
argv
[
i
],
"-y"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-y"
)
==
0
)
{
arguments
->
answer_yes
=
true
;
arguments
->
answer_yes
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-g"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-g"
)
==
0
)
{
...
@@ -2576,12 +2576,12 @@ static int startMultiThreadCreateChildTable(
...
@@ -2576,12 +2576,12 @@ static int startMultiThreadCreateChildTable(
t_info
->
ntables
=
i
<
b
?
a
+
1
:
a
;
t_info
->
ntables
=
i
<
b
?
a
+
1
:
a
;
t_info
->
end_table_to
=
i
<
b
?
startFrom
+
a
:
startFrom
+
a
-
1
;
t_info
->
end_table_to
=
i
<
b
?
startFrom
+
a
:
startFrom
+
a
-
1
;
startFrom
=
t_info
->
end_table_to
+
1
;
startFrom
=
t_info
->
end_table_to
+
1
;
t_info
->
use_metric
=
1
;
t_info
->
use_metric
=
true
;
t_info
->
cols
=
cols
;
t_info
->
cols
=
cols
;
t_info
->
minDelay
=
INT16_MAX
;
t_info
->
minDelay
=
INT16_MAX
;
pthread_create
(
pids
+
i
,
NULL
,
createTable
,
t_info
);
pthread_create
(
pids
+
i
,
NULL
,
createTable
,
t_info
);
}
}
for
(
int
i
=
0
;
i
<
threads
;
i
++
)
{
for
(
int
i
=
0
;
i
<
threads
;
i
++
)
{
pthread_join
(
pids
[
i
],
NULL
);
pthread_join
(
pids
[
i
],
NULL
);
}
}
...
@@ -2592,12 +2592,11 @@ static int startMultiThreadCreateChildTable(
...
@@ -2592,12 +2592,11 @@ static int startMultiThreadCreateChildTable(
}
}
free
(
pids
);
free
(
pids
);
free
(
infos
);
free
(
infos
);
return
0
;
return
0
;
}
}
static
void
createChildTables
()
{
static
void
createChildTables
()
{
char
tblColsBuf
[
MAX_SQL_SIZE
];
char
tblColsBuf
[
MAX_SQL_SIZE
];
int
len
;
int
len
;
...
@@ -6150,13 +6149,13 @@ static void queryResult() {
...
@@ -6150,13 +6149,13 @@ static void queryResult() {
static
void
testCmdLine
()
{
static
void
testCmdLine
()
{
g_args
.
test_mode
=
INSERT_TEST
;
g_args
.
test_mode
=
INSERT_TEST
;
insertTestProcess
();
insertTestProcess
();
if
(
g_Dbs
.
insert_only
)
if
(
g_Dbs
.
insert_only
)
return
;
return
;
else
else
queryResult
();
queryResult
();
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
...
@@ -6166,7 +6165,7 @@ int main(int argc, char *argv[]) {
...
@@ -6166,7 +6165,7 @@ int main(int argc, char *argv[]) {
if
(
g_args
.
metaFile
)
{
if
(
g_args
.
metaFile
)
{
initOfInsertMeta
();
initOfInsertMeta
();
initOfQueryMeta
();
initOfQueryMeta
();
if
(
false
==
getInfoFromJsonFile
(
g_args
.
metaFile
))
{
if
(
false
==
getInfoFromJsonFile
(
g_args
.
metaFile
))
{
printf
(
"Failed to read %s
\n
"
,
g_args
.
metaFile
);
printf
(
"Failed to read %s
\n
"
,
g_args
.
metaFile
);
...
@@ -6180,12 +6179,12 @@ int main(int argc, char *argv[]) {
...
@@ -6180,12 +6179,12 @@ int main(int argc, char *argv[]) {
if
(
NULL
!=
g_args
.
sqlFile
)
{
if
(
NULL
!=
g_args
.
sqlFile
)
{
TAOS
*
qtaos
=
taos_connect
(
TAOS
*
qtaos
=
taos_connect
(
g_Dbs
.
host
,
g_Dbs
.
host
,
g_Dbs
.
user
,
g_Dbs
.
user
,
g_Dbs
.
password
,
g_Dbs
.
password
,
g_Dbs
.
db
[
0
].
dbName
,
g_Dbs
.
db
[
0
].
dbName
,
g_Dbs
.
port
);
g_Dbs
.
port
);
querySqlFile
(
qtaos
,
g_args
.
sqlFile
);
querySqlFile
(
qtaos
,
g_args
.
sqlFile
);
taos_close
(
qtaos
);
taos_close
(
qtaos
);
}
else
{
}
else
{
...
...
tests/pytest/tools/taosdemoTest.py
浏览文件 @
dfdeb7e0
...
@@ -51,7 +51,7 @@ class TDTestCase:
...
@@ -51,7 +51,7 @@ class TDTestCase:
else
:
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/"
binPath
=
buildPath
+
"/build/bin/"
os
.
system
(
"%staosdemo -y -
M -t %d -n %d -x
"
%
os
.
system
(
"%staosdemo -y -
t %d -n %d
"
%
(
binPath
,
self
.
numberOfTables
,
self
.
numberOfRecords
))
(
binPath
,
self
.
numberOfTables
,
self
.
numberOfRecords
))
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"use test"
)
...
...
tests/pytest/tools/taosdemoTest2.py
浏览文件 @
dfdeb7e0
...
@@ -31,7 +31,7 @@ class TDTestCase:
...
@@ -31,7 +31,7 @@ class TDTestCase:
def
insertDataAndAlterTable
(
self
,
threadID
):
def
insertDataAndAlterTable
(
self
,
threadID
):
if
(
threadID
==
0
):
if
(
threadID
==
0
):
os
.
system
(
"taosdemo -
M -y -t %d -n %d -x
"
%
os
.
system
(
"taosdemo -
y -t %d -n %d
"
%
(
self
.
numberOfTables
,
self
.
numberOfRecords
))
(
self
.
numberOfTables
,
self
.
numberOfRecords
))
if
(
threadID
==
1
):
if
(
threadID
==
1
):
time
.
sleep
(
2
)
time
.
sleep
(
2
)
...
...
tests/pytest/tools/taosdemoTestWithoutMetric.py
浏览文件 @
dfdeb7e0
...
@@ -50,7 +50,7 @@ class TDTestCase:
...
@@ -50,7 +50,7 @@ class TDTestCase:
else
:
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/"
binPath
=
buildPath
+
"/build/bin/"
os
.
system
(
"%staosdemo -
y -t %d -n %d -x
"
%
os
.
system
(
"%staosdemo -
N -y -t %d -n %d
"
%
(
binPath
,
self
.
numberOfTables
,
self
.
numberOfRecords
))
(
binPath
,
self
.
numberOfTables
,
self
.
numberOfRecords
))
tdSql
.
query
(
"show databases"
)
tdSql
.
query
(
"show databases"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录