Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f6b525c9
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f6b525c9
编写于
11月 14, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changed sprintf to snprintf to avoid potential buffer overflow
上级
60ac01df
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
38 deletion
+38
-38
src/plugins/monitor/src/monMain.c
src/plugins/monitor/src/monMain.c
+38
-38
未找到文件。
src/plugins/monitor/src/monMain.c
浏览文件 @
f6b525c9
...
@@ -528,7 +528,7 @@ static int32_t monBuildMemorySql(char *sql) {
...
@@ -528,7 +528,7 @@ static int32_t monBuildMemorySql(char *sql) {
monDebug
(
"failed to get proc memory info"
);
monDebug
(
"failed to get proc memory info"
);
}
}
return
s
printf
(
sql
,
", %f, %f, %d"
,
procMemoryUsedMB
,
sysMemoryUsedMB
,
tsTotalMemoryMB
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f, %f, %d"
,
procMemoryUsedMB
,
sysMemoryUsedMB
,
tsTotalMemoryMB
);
}
}
// unit is %
// unit is %
...
@@ -543,12 +543,12 @@ static int32_t monBuildCpuSql(char *sql) {
...
@@ -543,12 +543,12 @@ static int32_t monBuildCpuSql(char *sql) {
sysCpuUsage
=
procCpuUsage
+
0
.
1
f
;
sysCpuUsage
=
procCpuUsage
+
0
.
1
f
;
}
}
return
s
printf
(
sql
,
", %f, %f, %d"
,
procCpuUsage
,
sysCpuUsage
,
tsNumOfCores
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f, %f, %d"
,
procCpuUsage
,
sysCpuUsage
,
tsNumOfCores
);
}
}
// unit is GB
// unit is GB
static
int32_t
monBuildDiskSql
(
char
*
sql
)
{
static
int32_t
monBuildDiskSql
(
char
*
sql
)
{
return
s
printf
(
sql
,
", %f, %d"
,
tsUsedDataDirGB
,
(
int32_t
)
tsTotalDataDirGB
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f, %d"
,
tsUsedDataDirGB
,
(
int32_t
)
tsTotalDataDirGB
);
}
}
// unit is Kb
// unit is Kb
...
@@ -559,12 +559,12 @@ static int32_t monBuildBandSql(char *sql) {
...
@@ -559,12 +559,12 @@ static int32_t monBuildBandSql(char *sql) {
monDebug
(
"failed to get bandwidth speed"
);
monDebug
(
"failed to get bandwidth speed"
);
}
}
return
s
printf
(
sql
,
", %f"
,
bandSpeedKb
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f"
,
bandSpeedKb
);
}
}
static
int32_t
monBuildReqSql
(
char
*
sql
)
{
static
int32_t
monBuildReqSql
(
char
*
sql
)
{
SDnodeStatisInfo
info
=
tsMonStat
.
dInfo
;
SDnodeStatisInfo
info
=
tsMonStat
.
dInfo
;
return
s
printf
(
sql
,
", %d, %d, %d)"
,
info
.
httpReqNum
,
info
.
queryReqNum
,
info
.
submitReqNum
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d, %d, %d)"
,
info
.
httpReqNum
,
info
.
queryReqNum
,
info
.
submitReqNum
);
}
}
static
int32_t
monBuildIoSql
(
char
*
sql
)
{
static
int32_t
monBuildIoSql
(
char
*
sql
)
{
...
@@ -572,7 +572,7 @@ static int32_t monBuildIoSql(char *sql) {
...
@@ -572,7 +572,7 @@ static int32_t monBuildIoSql(char *sql) {
readKB
=
tsMonStat
.
io_read
;
readKB
=
tsMonStat
.
io_read
;
writeKB
=
tsMonStat
.
io_write
;
writeKB
=
tsMonStat
.
io_write
;
return
s
printf
(
sql
,
", %f, %f"
,
readKB
,
writeKB
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f, %f"
,
readKB
,
writeKB
);
}
}
static
void
monSaveSystemInfo
()
{
static
void
monSaveSystemInfo
()
{
...
@@ -611,11 +611,11 @@ static int32_t monGetRowElemCharLen(TAOS_FIELD field, char *rowElem) {
...
@@ -611,11 +611,11 @@ static int32_t monGetRowElemCharLen(TAOS_FIELD field, char *rowElem) {
}
}
static
int32_t
monBuildFirstEpSql
(
char
*
sql
)
{
static
int32_t
monBuildFirstEpSql
(
char
*
sql
)
{
return
s
printf
(
sql
,
",
\"
%s
\"
"
,
tsFirst
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
",
\"
%s
\"
"
,
tsFirst
);
}
}
static
int32_t
monBuildVersionSql
(
char
*
sql
)
{
static
int32_t
monBuildVersionSql
(
char
*
sql
)
{
return
s
printf
(
sql
,
",
\"
%s
\"
"
,
version
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
",
\"
%s
\"
"
,
version
);
}
}
static
int32_t
monBuildMasterUptimeSql
(
char
*
sql
)
{
static
int32_t
monBuildMasterUptimeSql
(
char
*
sql
)
{
...
@@ -640,11 +640,11 @@ static int32_t monBuildMasterUptimeSql(char *sql) {
...
@@ -640,11 +640,11 @@ static int32_t monBuildMasterUptimeSql(char *sql) {
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %"
PRId64
,
masterUptime
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %"
PRId64
,
masterUptime
);
}
}
static
int32_t
monBuildMonIntervalSql
(
char
*
sql
)
{
static
int32_t
monBuildMonIntervalSql
(
char
*
sql
)
{
return
s
printf
(
sql
,
", %d"
,
tsMonitorInterval
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d"
,
tsMonitorInterval
);
}
}
static
int32_t
monBuildDnodesTotalSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodesTotalSql
(
char
*
sql
)
{
...
@@ -673,7 +673,7 @@ static int32_t monBuildDnodesTotalSql(char *sql) {
...
@@ -673,7 +673,7 @@ static int32_t monBuildDnodesTotalSql(char *sql) {
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %d, %d"
,
totalDnodes
,
totalDnodesAlive
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d, %d"
,
totalDnodes
,
totalDnodesAlive
);
}
}
static
int32_t
monBuildMnodesTotalSql
(
char
*
sql
)
{
static
int32_t
monBuildMnodesTotalSql
(
char
*
sql
)
{
...
@@ -703,7 +703,7 @@ static int32_t monBuildMnodesTotalSql(char *sql) {
...
@@ -703,7 +703,7 @@ static int32_t monBuildMnodesTotalSql(char *sql) {
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %d, %d"
,
totalMnodes
,
totalMnodesAlive
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d, %d"
,
totalMnodes
,
totalMnodesAlive
);
}
}
...
@@ -711,7 +711,7 @@ static int32_t monGetVgroupsTotalStats(char *dbName, int32_t *totalVgroups,
...
@@ -711,7 +711,7 @@ static int32_t monGetVgroupsTotalStats(char *dbName, int32_t *totalVgroups,
int32_t
*
totalVgroupsAlive
)
{
int32_t
*
totalVgroupsAlive
)
{
char
subsql
[
TSDB_DB_NAME_LEN
+
14
];
char
subsql
[
TSDB_DB_NAME_LEN
+
14
];
memset
(
subsql
,
0
,
sizeof
(
subsql
));
memset
(
subsql
,
0
,
sizeof
(
subsql
));
s
printf
(
subsql
,
"show %s.vgroups"
,
dbName
);
s
nprintf
(
subsql
,
TSDB_DB_NAME_LEN
+
13
,
"show %s.vgroups"
,
dbName
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
int32_t
code
=
taos_errno
(
result
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
@@ -761,14 +761,14 @@ static int32_t monBuildVgroupsTotalSql(char *sql) {
...
@@ -761,14 +761,14 @@ static int32_t monBuildVgroupsTotalSql(char *sql) {
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %d, %d"
,
totalVgroups
,
totalVgroupsAlive
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d, %d"
,
totalVgroups
,
totalVgroupsAlive
);
}
}
static
int32_t
monGetVnodesTotalStats
(
char
*
ep
,
int32_t
*
totalVnodes
,
static
int32_t
monGetVnodesTotalStats
(
char
*
ep
,
int32_t
*
totalVnodes
,
int32_t
*
totalVnodesAlive
)
{
int32_t
*
totalVnodesAlive
)
{
char
subsql
[
TSDB_EP_LEN
+
15
];
char
subsql
[
TSDB_EP_LEN
+
15
];
memset
(
subsql
,
0
,
sizeof
(
subsql
));
memset
(
subsql
,
0
,
sizeof
(
subsql
));
s
printf
(
subsql
,
"show vnodes
\"
%s
\"
"
,
ep
);
s
nprintf
(
subsql
,
TSDB_EP_LEN
,
"show vnodes
\"
%s
\"
"
,
ep
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
int32_t
code
=
taos_errno
(
result
);
int32_t
code
=
taos_errno
(
result
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
@@ -819,7 +819,7 @@ static int32_t monBuildVnodesTotalSql(char *sql) {
...
@@ -819,7 +819,7 @@ static int32_t monBuildVnodesTotalSql(char *sql) {
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %d, %d"
,
totalVnodes
,
totalVnodesAlive
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d, %d"
,
totalVnodes
,
totalVnodesAlive
);
}
}
static
int32_t
monBuildConnsTotalSql
(
char
*
sql
)
{
static
int32_t
monBuildConnsTotalSql
(
char
*
sql
)
{
...
@@ -837,7 +837,7 @@ static int32_t monBuildConnsTotalSql(char *sql) {
...
@@ -837,7 +837,7 @@ static int32_t monBuildConnsTotalSql(char *sql) {
}
}
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %d)"
,
totalConns
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d)"
,
totalConns
);
}
}
static
int32_t
monBuildDnodeUptimeSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodeUptimeSql
(
char
*
sql
)
{
...
@@ -864,7 +864,7 @@ static int32_t monBuildDnodeUptimeSql(char *sql) {
...
@@ -864,7 +864,7 @@ static int32_t monBuildDnodeUptimeSql(char *sql) {
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %"
PRId64
,
dnodeUptime
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %"
PRId64
,
dnodeUptime
);
}
}
static
int32_t
monBuildDnodeIoSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodeIoSql
(
char
*
sql
)
{
...
@@ -875,8 +875,8 @@ static int32_t monBuildDnodeIoSql(char *sql) {
...
@@ -875,8 +875,8 @@ static int32_t monBuildDnodeIoSql(char *sql) {
rbyteKB
=
tsMonStat
.
io_read_disk
;
rbyteKB
=
tsMonStat
.
io_read_disk
;
wbyteKB
=
tsMonStat
.
io_write_disk
;
wbyteKB
=
tsMonStat
.
io_write_disk
;
return
s
printf
(
sql
,
", %f, %f, %f, %f"
,
rcharKB
/
tsMonitorInterval
,
wcharKB
/
tsMonitorInterval
,
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f, %f, %f, %f"
,
rcharKB
/
tsMonitorInterval
,
wcharKB
/
tsMonitorInterval
,
rbyteKB
/
tsMonitorInterval
,
wbyteKB
/
tsMonitorInterval
);
rbyteKB
/
tsMonitorInterval
,
wbyteKB
/
tsMonitorInterval
);
}
}
static
int32_t
monBuildNetworkIOSql
(
char
*
sql
)
{
static
int32_t
monBuildNetworkIOSql
(
char
*
sql
)
{
...
@@ -886,8 +886,8 @@ static int32_t monBuildNetworkIOSql(char *sql) {
...
@@ -886,8 +886,8 @@ static int32_t monBuildNetworkIOSql(char *sql) {
monDebug
(
"failed to get network I/O info"
);
monDebug
(
"failed to get network I/O info"
);
}
}
return
s
printf
(
sql
,
", %f, %f"
,
netInKb
/
tsMonitorInterval
,
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f, %f"
,
netInKb
/
tsMonitorInterval
,
netOutKb
/
tsMonitorInterval
);
netOutKb
/
tsMonitorInterval
);
}
}
static
int32_t
monBuildDnodeReqSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodeReqSql
(
char
*
sql
)
{
...
@@ -903,22 +903,22 @@ static int32_t monBuildDnodeReqSql(char *sql) {
...
@@ -903,22 +903,22 @@ static int32_t monBuildDnodeReqSql(char *sql) {
float
submitReqRate
=
submitReqNum
/
interval
;
float
submitReqRate
=
submitReqNum
/
interval
;
float
submitRowRate
=
submitRowNum
/
interval
;
float
submitRowRate
=
submitRowNum
/
interval
;
return
s
printf
(
sql
,
", %d, %f, %d, %f, %d, %d, %f, %d, %d, %f"
,
tsMonStat
.
dInfo
.
httpReqNum
,
httpReqRate
,
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d, %f, %d, %f, %d, %d, %f, %d, %d, %f"
,
tsMonStat
.
dInfo
.
httpReqNum
,
httpReqRate
,
queryReqNum
,
queryReqRate
,
queryReqNum
,
queryReqRate
,
submitRowNum
,
submitRowSucNum
,
submitRowRate
,
submitRowNum
,
submitRowSucNum
,
submitRowRate
,
submitReqNum
,
submitReqSucNum
,
submitReqRate
);
submitReqNum
,
submitReqSucNum
,
submitReqRate
);
}
}
static
int32_t
monBuildDnodeErrorsSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodeErrorsSql
(
char
*
sql
)
{
int64_t
dnode_err
=
dnodeGetDnodeError
();
int64_t
dnode_err
=
dnodeGetDnodeError
();
return
s
printf
(
sql
,
", %"
PRId64
,
dnode_err
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %"
PRId64
,
dnode_err
);
}
}
static
int32_t
monBuildDnodeVnodesSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodeVnodesSql
(
char
*
sql
)
{
int32_t
vnodeNum
=
0
,
masterNum
=
0
;
int32_t
vnodeNum
=
0
,
masterNum
=
0
;
char
sqlStr
[
TSDB_EP_LEN
+
15
];
char
sqlStr
[
TSDB_EP_LEN
+
15
];
memset
(
sqlStr
,
0
,
sizeof
(
sqlStr
));
memset
(
sqlStr
,
0
,
sizeof
(
sqlStr
));
s
printf
(
sqlStr
,
"show vnodes
\"
%s
\"
"
,
tsLocalEp
);
s
nprintf
(
sqlStr
,
TSDB_EP_LEN
+
14
,
"show vnodes
\"
%s
\"
"
,
tsLocalEp
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
sqlStr
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
sqlStr
);
TAOS_ROW
row
;
TAOS_ROW
row
;
...
@@ -938,7 +938,7 @@ static int32_t monBuildDnodeVnodesSql(char *sql) {
...
@@ -938,7 +938,7 @@ static int32_t monBuildDnodeVnodesSql(char *sql) {
}
}
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %d, %d"
,
vnodeNum
,
masterNum
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %d, %d"
,
vnodeNum
,
masterNum
);
}
}
static
int32_t
monBuildDnodeMnodeSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodeMnodeSql
(
char
*
sql
)
{
...
@@ -974,12 +974,12 @@ static int32_t monBuildDnodeMnodeSql(char *sql) {
...
@@ -974,12 +974,12 @@ static int32_t monBuildDnodeMnodeSql(char *sql) {
}
}
taos_free_result
(
result
);
taos_free_result
(
result
);
return
s
printf
(
sql
,
", %s)"
,
has_mnode
?
"true"
:
"false"
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %s)"
,
has_mnode
?
"true"
:
"false"
);
}
}
static
int32_t
monBuildDnodeDiskSql
(
char
*
sql
)
{
static
int32_t
monBuildDnodeDiskSql
(
char
*
sql
)
{
float
taosdDataDirGB
=
0
;
float
taosdDataDirGB
=
0
;
return
s
printf
(
sql
,
", %f, %f, %f"
,
taosdDataDirGB
,
tsUsedDataDirGB
,
tsTotalDataDirGB
);
return
s
nprintf
(
sql
,
SQL_LENGTH
,
", %f, %f, %f"
,
taosdDataDirGB
,
tsUsedDataDirGB
,
tsTotalDataDirGB
);
}
}
static
int32_t
monBuildDiskTierSql
(
char
*
sql
)
{
static
int32_t
monBuildDiskTierSql
(
char
*
sql
)
{
...
@@ -991,9 +991,9 @@ static int32_t monBuildDiskTierSql(char *sql) {
...
@@ -991,9 +991,9 @@ static int32_t monBuildDiskTierSql(char *sql) {
int32_t
pos
=
0
;
int32_t
pos
=
0
;
for
(
int
i
=
0
;
i
<
numTiers
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numTiers
;
++
i
)
{
pos
+=
s
printf
(
sql
+
pos
,
", %f, %f"
,
(
float
)(
tierMetas
[
i
].
used
/
unit
),
(
float
)(
tierMetas
[
i
].
size
/
unit
));
pos
+=
s
nprintf
(
sql
+
pos
,
SQL_LENGTH
,
", %f, %f"
,
(
float
)(
tierMetas
[
i
].
used
/
unit
),
(
float
)(
tierMetas
[
i
].
size
/
unit
));
}
}
pos
+=
s
printf
(
sql
+
pos
,
")"
);
pos
+=
s
nprintf
(
sql
+
pos
,
SQL_LENGTH
,
")"
);
free
(
tierMetas
);
free
(
tierMetas
);
...
@@ -1066,7 +1066,7 @@ static int32_t checkCreateVgroupTable(int32_t vgId) {
...
@@ -1066,7 +1066,7 @@ static int32_t checkCreateVgroupTable(int32_t vgId) {
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
memset
(
subsql
,
0
,
sizeof
(
subsql
));
memset
(
subsql
,
0
,
sizeof
(
subsql
));
s
printf
(
subsql
,
"describe %s.vgroup_%d"
,
tsMonitorDbName
,
vgId
);
s
nprintf
(
subsql
,
255
,
"describe %s.vgroup_%d"
,
tsMonitorDbName
,
vgId
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
subsql
);
code
=
taos_errno
(
result
);
code
=
taos_errno
(
result
);
...
@@ -1092,7 +1092,7 @@ static uint32_t monBuildVgroupsInfoSql(char *sql, char *dbName) {
...
@@ -1092,7 +1092,7 @@ static uint32_t monBuildVgroupsInfoSql(char *sql, char *dbName) {
int64_t
ts
=
taosGetTimestampUs
();
int64_t
ts
=
taosGetTimestampUs
();
memset
(
sql
,
0
,
SQL_LENGTH
+
1
);
memset
(
sql
,
0
,
SQL_LENGTH
+
1
);
s
printf
(
sql
,
"show %s.vgroups"
,
dbName
);
s
nprintf
(
sql
,
SQL_LENGTH
,
"show %s.vgroups"
,
dbName
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
sql
);
TAOS_RES
*
result
=
taos_query
(
tsMonitor
.
conn
,
sql
);
TAOS_ROW
row
;
TAOS_ROW
row
;
...
@@ -1341,7 +1341,7 @@ void monSaveAcctLog(SAcctMonitorObj *pMon) {
...
@@ -1341,7 +1341,7 @@ void monSaveAcctLog(SAcctMonitorObj *pMon) {
if
(
tsMonitor
.
state
!=
MON_STATE_INITED
)
return
;
if
(
tsMonitor
.
state
!=
MON_STATE_INITED
)
return
;
char
sql
[
1024
]
=
{
0
};
char
sql
[
1024
]
=
{
0
};
s
printf
(
sql
,
s
nprintf
(
sql
,
1023
,
"insert into %s.acct_%s using %s.acct tags('%s') values(now"
"insert into %s.acct_%s using %s.acct tags('%s') values(now"
", %"
PRId64
", %"
PRId64
", %"
PRId64
", %"
PRId64
", %"
PRId64
", %"
PRId64
", %"
PRId64
", %"
PRId64
...
@@ -1385,7 +1385,7 @@ void monSaveLog(int32_t level, const char *const format, ...) {
...
@@ -1385,7 +1385,7 @@ void monSaveLog(int32_t level, const char *const format, ...) {
va_end
(
argpointer
);
va_end
(
argpointer
);
if
(
len
>
max_length
)
len
=
max_length
;
if
(
len
>
max_length
)
len
=
max_length
;
len
+=
s
printf
(
sql
+
len
,
"', '%s')"
,
tsLocalEp
);
len
+=
s
nprintf
(
sql
+
len
,
SQL_LENGTH
,
"', '%s')"
,
tsLocalEp
);
sql
[
len
++
]
=
0
;
sql
[
len
++
]
=
0
;
monDebug
(
"save log, sql: %s"
,
sql
);
monDebug
(
"save log, sql: %s"
,
sql
);
...
@@ -1406,7 +1406,7 @@ void monSaveDnodeLog(int32_t level, const char *const format, ...) {
...
@@ -1406,7 +1406,7 @@ void monSaveDnodeLog(int32_t level, const char *const format, ...) {
va_end
(
argpointer
);
va_end
(
argpointer
);
if
(
len
>
max_length
)
len
=
max_length
;
if
(
len
>
max_length
)
len
=
max_length
;
len
+=
s
printf
(
sql
+
len
,
"')"
);
len
+=
s
nprintf
(
sql
+
len
,
SQL_LENGTH
,
"')"
);
sql
[
len
++
]
=
0
;
sql
[
len
++
]
=
0
;
monDebug
(
"save dnode log, sql: %s"
,
sql
);
monDebug
(
"save dnode log, sql: %s"
,
sql
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录