Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
冷面1992
TDengine
提交
7bcca63e
TDengine
项目概览
冷面1992
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7bcca63e
编写于
3月 08, 2021
作者:
S
Shuduo Sang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-3197] <fix>: fix taosdump and taosdemo coverity scan issue.
上级
bfc1b0df
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
15 deletion
+22
-15
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+20
-15
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+2
-0
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
7bcca63e
...
...
@@ -56,6 +56,7 @@
#include "cJSON.h"
#include "taos.h"
#include "taoserror.h"
#include "tutil.h"
#define REQ_EXTRA_BUF_LEN 1024
...
...
@@ -838,7 +839,8 @@ static void getResult(TAOS_RES *res, char* resultFileName) {
char
*
databuf
=
(
char
*
)
calloc
(
1
,
100
*
1024
*
1024
);
if
(
databuf
==
NULL
)
{
fprintf
(
stderr
,
"failed to malloc, warning: save result to file slowly!
\n
"
);
fclose
(
fp
);
if
(
fp
)
fclose
(
fp
);
return
;
}
...
...
@@ -1669,6 +1671,7 @@ int postProceSql(char* host, uint16_t port, char* sqlstr)
ERROR_EXIT
(
"ERROR storing complete response from socket"
);
}
response_buf
[
RESP_BUF_LEN
-
1
]
=
'\0'
;
printf
(
"Response:
\n
%s
\n
"
,
response_buf
);
free
(
request_buf
);
...
...
@@ -2290,6 +2293,8 @@ int startMultiThreadCreateChildTable(
g_Dbs
.
port
);
if
(
t_info
->
taos
==
NULL
)
{
fprintf
(
stderr
,
"Failed to connect to TDengine, reason:%s
\n
"
,
taos_errstr
(
NULL
));
free
(
pids
);
free
(
infos
);
return
-
1
;
}
t_info
->
start_table_id
=
last
;
...
...
@@ -2342,8 +2347,8 @@ static void createChildTables() {
}
else
{
// normal table
len
=
snprintf
(
tblColsBuf
,
MAX_SQL_SIZE
,
"(TS TIMESTAMP"
);
for
(
int
i
=
0
;
i
<
MAX_COLUMN_COUNT
;
i
++
)
{
if
(
g_args
.
datatype
[
i
])
{
int
i
=
0
;
while
(
g_args
.
datatype
[
i
])
{
if
((
strncasecmp
(
g_args
.
datatype
[
i
],
"BINARY"
,
strlen
(
"BINARY"
))
==
0
)
||
(
strncasecmp
(
g_args
.
datatype
[
i
],
"NCHAR"
,
strlen
(
"NCHAR"
))
==
0
))
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s(60)"
,
i
,
g_args
.
datatype
[
i
]);
...
...
@@ -2351,15 +2356,13 @@ static void createChildTables() {
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
", COL%d %s"
,
i
,
g_args
.
datatype
[
i
]);
}
len
=
strlen
(
tblColsBuf
);
}
else
{
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
,
")"
);
break
;
}
}
len
=
snprintf
(
tblColsBuf
+
len
,
MAX_SQL_SIZE
-
len
,
")"
);
debugPrint
(
"DEBUG - %s() LN%d: %s
\n
"
,
__func__
,
__LINE__
,
tblColsBuf
);
startMultiThreadCreateChildTable
(
startMultiThreadCreateChildTable
(
tblColsBuf
,
g_Dbs
.
threadCountByCreateTbl
,
g_args
.
num_of_DPT
,
...
...
@@ -4073,11 +4076,10 @@ static void* syncWrite(void *sarg) {
int
len_of_binary
=
g_args
.
len_of_binary
;
int
ncols_per_record
=
1
;
// count first col ts
for
(
int
i
=
0
;
i
<
MAX_COLUMN_COUNT
;
i
++
)
{
if
(
NULL
==
g_args
.
datatype
[
i
])
break
;
else
ncols_per_record
++
;
int
i
=
0
;
while
(
g_args
.
datatype
[
i
])
{
i
++
;
ncols_per_record
++
;
}
srand
((
uint32_t
)
time
(
NULL
));
...
...
@@ -4558,11 +4560,14 @@ void startMultiThreadInsertData(int threads, char* db_name, char* precision,
if
(
0
==
strncasecmp
(
superTblInfo
->
startTimestamp
,
"now"
,
3
))
{
start_time
=
taosGetTimestamp
(
timePrec
);
}
else
{
taosParseTime
(
if
(
TSDB_CODE_SUCCESS
!=
taosParseTime
(
superTblInfo
->
startTimestamp
,
&
start_time
,
strlen
(
superTblInfo
->
startTimestamp
),
timePrec
,
0
);
timePrec
,
0
))
{
printf
(
"ERROR to parse time!
\n
"
);
exit
(
-
1
);
}
}
}
else
{
start_time
=
1500000000000
;
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
7bcca63e
...
...
@@ -769,6 +769,7 @@ int32_t taosSaveTableOfMetricToTempFile(TAOS *taosCon, char* metric, struct argu
}
sprintf
(
tmpBuf
,
".select-tbname.tmp"
);
(
void
)
remove
(
tmpBuf
);
free
(
tblBuf
);
close
(
fd
);
return
-
1
;
}
...
...
@@ -1523,6 +1524,7 @@ int taosDumpDb(SDbInfo *dbInfo, struct arguments *arguments, FILE *fp, TAOS *tao
}
sprintf
(
tmpBuf
,
".show-tables.tmp"
);
(
void
)
remove
(
tmpBuf
);
free
(
tblBuf
);
close
(
fd
);
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录