Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
720aea62
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看板
未验证
提交
720aea62
编写于
5月 08, 2021
作者:
sangshuduo
提交者:
GitHub
5月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4083]<fix>: taosdemo query times need be more than 0. (#6038)
Co-authored-by:
N
Shuduo Sang
<
sdsang@taosdata.com
>
上级
e3696554
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
22 deletion
+23
-22
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+23
-22
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
720aea62
...
@@ -771,48 +771,49 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
...
@@ -771,48 +771,49 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
}
arguments
->
sqlFile
=
argv
[
++
i
];
arguments
->
sqlFile
=
argv
[
++
i
];
}
else
if
(
strcmp
(
argv
[
i
],
"-q"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-q"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-q need a number following!
\n
Query mode -- 0: SYNC, 1: ASYNC. Default is SYNC.
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-q need a number following!
\n
Query mode -- 0: SYNC, 1: ASYNC. Default is SYNC.
\n
"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
arguments
->
query_mode
=
atoi
(
argv
[
++
i
]);
arguments
->
query_mode
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-T"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-T"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-T need a number following!
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-T need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
arguments
->
num_of_threads
=
atoi
(
argv
[
++
i
]);
arguments
->
num_of_threads
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-i"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-i need a number following!
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-i need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
arguments
->
insert_interval
=
atoi
(
argv
[
++
i
]);
arguments
->
insert_interval
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-qt"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-qt"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
||
(
!
isStringNumber
(
argv
[
i
+
1
]))
||
(
atoi
(
argv
[
i
+
1
])
<=
0
))
{
printHelp
();
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-qt need a number following!
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-qt need a
valid (>0)
number following!
\n
"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
arguments
->
query_times
=
atoi
(
argv
[
++
i
]);
arguments
->
query_times
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-B"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-B"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-B need a number following!
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-B need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
arguments
->
interlace_rows
=
atoi
(
argv
[
++
i
]);
arguments
->
interlace_rows
=
atoi
(
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-r"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-r"
)
==
0
)
{
if
((
argc
==
i
+
1
)
||
if
((
argc
==
i
+
1
)
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
||
(
!
isStringNumber
(
argv
[
i
+
1
])))
{
printHelp
();
printHelp
();
errorPrint
(
"%s"
,
"
\n\t
-r need a number following!
\n
"
);
errorPrint
(
"%s"
,
"
\n\t
-r need a number following!
\n
"
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -4040,9 +4041,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
...
@@ -4040,9 +4041,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
gQueryTimes
=
cJSON_GetObjectItem
(
root
,
"query_times"
);
cJSON
*
gQueryTimes
=
cJSON_GetObjectItem
(
root
,
"query_times"
);
if
(
gQueryTimes
&&
gQueryTimes
->
type
==
cJSON_Number
)
{
if
(
gQueryTimes
&&
gQueryTimes
->
type
==
cJSON_Number
)
{
if
(
gQueryTimes
->
valueint
<
0
)
{
if
(
gQueryTimes
->
valueint
<
=
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
input mistake
\n
"
,
errorPrint
(
"%s() LN%d, failed to read json, query_times
: %"
PRId64
", need be a valid (>0) number
\n
"
,
__func__
,
__LINE__
);
__func__
,
__LINE__
,
gQueryTimes
->
valueint
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
g_args
.
query_times
=
gQueryTimes
->
valueint
;
g_args
.
query_times
=
gQueryTimes
->
valueint
;
...
@@ -4091,9 +4092,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
...
@@ -4091,9 +4092,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
specifiedQueryTimes
=
cJSON_GetObjectItem
(
specifiedQuery
,
cJSON
*
specifiedQueryTimes
=
cJSON_GetObjectItem
(
specifiedQuery
,
"query_times"
);
"query_times"
);
if
(
specifiedQueryTimes
&&
specifiedQueryTimes
->
type
==
cJSON_Number
)
{
if
(
specifiedQueryTimes
&&
specifiedQueryTimes
->
type
==
cJSON_Number
)
{
if
(
specifiedQueryTimes
->
valueint
<
0
)
{
if
(
specifiedQueryTimes
->
valueint
<
=
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
input mistake
\n
"
,
errorPrint
(
"%s() LN%d, failed to read json, query_times
: %"
PRId64
", need be a valid (>0) number
\n
"
,
__func__
,
__LINE__
);
__func__
,
__LINE__
,
specifiedQueryTimes
->
valueint
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
...
@@ -4235,9 +4236,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
...
@@ -4235,9 +4236,9 @@ static bool getMetaFromQueryJsonFile(cJSON* root) {
cJSON
*
superQueryTimes
=
cJSON_GetObjectItem
(
superQuery
,
"query_times"
);
cJSON
*
superQueryTimes
=
cJSON_GetObjectItem
(
superQuery
,
"query_times"
);
if
(
superQueryTimes
&&
superQueryTimes
->
type
==
cJSON_Number
)
{
if
(
superQueryTimes
&&
superQueryTimes
->
type
==
cJSON_Number
)
{
if
(
superQueryTimes
->
valueint
<
0
)
{
if
(
superQueryTimes
->
valueint
<
=
0
)
{
errorPrint
(
"%s() LN%d, failed to read json, query_times
input mistake
\n
"
,
errorPrint
(
"%s() LN%d, failed to read json, query_times
: %"
PRId64
", need be a valid (>0) number
\n
"
,
__func__
,
__LINE__
);
__func__
,
__LINE__
,
superQueryTimes
->
valueint
);
goto
PARSE_OVER
;
goto
PARSE_OVER
;
}
}
g_queryInfo
.
superQueryInfo
.
queryTimes
=
superQueryTimes
->
valueint
;
g_queryInfo
.
superQueryInfo
.
queryTimes
=
superQueryTimes
->
valueint
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录