Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
49f492e9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
49f492e9
编写于
9月 28, 2021
作者:
sangshuduo
提交者:
GitHub
9月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10480]<fix>: taosdemo check -P argument. (#8092)
上级
5b24dfa1
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
37 addition
and
14 deletion
+37
-14
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+37
-14
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
49f492e9
...
...
@@ -986,36 +986,55 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments
->
performance_print
=
true
;
}
else
if
((
0
==
strncmp
(
argv
[
i
],
"-P"
,
strlen
(
"-P"
)))
||
(
0
==
strncmp
(
argv
[
i
],
"--port"
,
strlen
(
"--port"
))))
{
uint64_t
port
;
char
strPort
[
BIGINT_BUFF_LEN
];
if
(
2
==
strlen
(
argv
[
i
]))
{
if
(
argc
==
i
+
1
)
{
errorPrintReqArg
(
argv
[
0
],
"P"
);
exit
(
EXIT_FAILURE
);
}
else
if
(
!
isStringNumber
(
argv
[
i
+
1
]))
{
}
else
if
(
isStringNumber
(
argv
[
i
+
1
]))
{
tstrncpy
(
strPort
,
argv
[
++
i
],
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"P"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
port
=
atoi
(
argv
[
++
i
]);
}
else
if
(
0
==
strncmp
(
argv
[
i
],
"--port="
,
strlen
(
"--port="
)))
{
if
(
isStringNumber
((
char
*
)(
argv
[
i
]
+
strlen
(
"--port="
))))
{
arguments
->
port
=
atoi
((
char
*
)(
argv
[
i
]
+
strlen
(
"--port="
)));
tstrncpy
(
strPort
,
(
char
*
)(
argv
[
i
]
+
strlen
(
"--port="
)),
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
}
else
if
(
0
==
strncmp
(
argv
[
i
],
"-P"
,
strlen
(
"-P"
)))
{
if
(
isStringNumber
((
char
*
)(
argv
[
i
]
+
strlen
(
"-P"
))))
{
arguments
->
port
=
atoi
((
char
*
)(
argv
[
i
]
+
strlen
(
"-P"
)));
tstrncpy
(
strPort
,
(
char
*
)(
argv
[
i
]
+
strlen
(
"-P"
)),
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
}
else
if
(
strlen
(
"--port"
)
==
strlen
(
argv
[
i
]))
{
if
(
argc
==
i
+
1
)
{
errorPrintReqArg3
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
else
if
(
!
isStringNumber
(
argv
[
i
+
1
]))
{
}
else
if
(
isStringNumber
(
argv
[
i
+
1
]))
{
tstrncpy
(
strPort
,
argv
[
++
i
],
BIGINT_BUFF_LEN
);
}
else
{
errorPrintReqArg2
(
argv
[
0
],
"--port"
);
exit
(
EXIT_FAILURE
);
}
arguments
->
port
=
atoi
(
argv
[
++
i
]);
}
else
{
errorUnrecognized
(
argv
[
0
],
argv
[
i
]);
exit
(
EXIT_FAILURE
);
}
port
=
atoi
(
strPort
);
if
(
port
>
65535
)
{
errorWrongValue
(
"taosdump"
,
"-P or --port"
,
strPort
);
exit
(
EXIT_FAILURE
);
}
arguments
->
port
=
(
uint16_t
)
port
;
}
else
if
((
0
==
strncmp
(
argv
[
i
],
"-I"
,
strlen
(
"-I"
)))
||
(
0
==
strncmp
(
argv
[
i
],
"--interface"
,
strlen
(
"--interface"
))))
{
if
(
2
==
strlen
(
argv
[
i
]))
{
...
...
@@ -1581,7 +1600,9 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
&&
strcasecmp
(
dataType
,
"BIGINT"
)
&&
strcasecmp
(
dataType
,
"DOUBLE"
)
&&
strcasecmp
(
dataType
,
"TIMESTAMP"
)
&&
!
regexMatch
(
dataType
,
"^(NCHAR|BINARY)(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
)
&&
!
regexMatch
(
dataType
,
"^(NCHAR|BINARY)(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
)
&&
strcasecmp
(
dataType
,
"UTINYINT"
)
&&
strcasecmp
(
dataType
,
"USMALLINT"
)
&&
strcasecmp
(
dataType
,
"UINT"
)
...
...
@@ -1603,11 +1624,13 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_FLOAT
;
}
else
if
(
0
==
strcasecmp
(
dataType
,
"DOUBLE"
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_DOUBLE
;
}
else
if
(
1
==
regexMatch
(
dataType
,
"^BINARY(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
}
else
if
(
1
==
regexMatch
(
dataType
,
"^BINARY(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_BINARY
;
}
else
if
(
1
==
regexMatch
(
dataType
,
"^NCHAR(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
}
else
if
(
1
==
regexMatch
(
dataType
,
"^NCHAR(
\\
([1-9][0-9]*
\\
))?$"
,
REG_ICASE
|
REG_EXTENDED
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_NCHAR
;
}
else
if
(
0
==
strcasecmp
(
dataType
,
"BOOL"
))
{
arguments
->
data_type
[
0
]
=
TSDB_DATA_TYPE_BOOL
;
...
...
@@ -10280,7 +10303,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
&
stbInfo
->
childTblName
,
&
childTblCount
,
limit
,
offset
);
ntables
=
childTblCount
;
// CBD
ntables
=
childTblCount
;
}
else
{
ntables
=
g_args
.
ntables
;
tableFrom
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录