Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
0bfc1f61
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看板
未验证
提交
0bfc1f61
编写于
6月 09, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2208 from taosdata/patch/string-length
Patch/string length
上级
c97720bb
fbf249f2
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
31 addition
and
27 deletion
+31
-27
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+7
-7
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-2
src/cq/src/cqMain.c
src/cq/src/cqMain.c
+4
-4
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-1
src/inc/tcq.h
src/inc/tcq.h
+1
-1
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+1
-1
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+4
-0
src/mnode/inc/mnodeDef.h
src/mnode/inc/mnodeDef.h
+2
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+2
-2
src/os/linux/src/linuxSysPara.c
src/os/linux/src/linuxSysPara.c
+1
-1
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+2
-2
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+1
-1
tests/tsim/src/simMain.c
tests/tsim/src/simMain.c
+1
-1
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
0bfc1f61
...
...
@@ -5420,7 +5420,7 @@ int32_t doLocalQueryProcess(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
tDataTypeDesc
[
TSDB_DATA_TYPE_INT
].
nSize
,
tDataTypeDesc
[
TSDB_DATA_TYPE_INT
].
nSize
,
false
);
const
char
*
name
=
(
pExprList
->
a
[
0
].
aliasName
!=
NULL
)
?
pExprList
->
a
[
0
].
aliasName
:
functionsInfo
[
index
].
name
;
strncpy
(
pExpr1
->
aliasName
,
name
,
tListLen
(
pExpr1
->
aliasName
));
t
strncpy
(
pExpr1
->
aliasName
,
name
,
tListLen
(
pExpr1
->
aliasName
));
return
TSDB_CODE_SUCCESS
;
}
...
...
src/client/src/tscServer.c
浏览文件 @
0bfc1f61
...
...
@@ -1018,7 +1018,7 @@ int32_t tscBuildDropDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SCMDropDnodeMsg
*
pDrop
=
(
SCMDropDnodeMsg
*
)
pCmd
->
payload
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
strcpy
(
pDrop
->
ep
,
pTableMetaInfo
->
name
);
tstrncpy
(
pDrop
->
ep
,
pTableMetaInfo
->
name
,
sizeof
(
pDrop
->
ep
)
);
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_DROP_DNODE
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1036,7 +1036,7 @@ int32_t tscBuildDropUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SCMDropUserMsg
*
pDropMsg
=
(
SCMDropUserMsg
*
)
pCmd
->
payload
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
strcpy
(
pDropMsg
->
user
,
pTableMetaInfo
->
name
);
tstrncpy
(
pDropMsg
->
user
,
pTableMetaInfo
->
name
,
sizeof
(
pDropMsg
->
user
)
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1091,9 +1091,9 @@ int32_t tscBuildShowMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
size_t
nameLen
=
strlen
(
pTableMetaInfo
->
name
);
if
(
nameLen
>
0
)
{
strcpy
(
pShowMsg
->
db
,
pTableMetaInfo
->
name
);
// prefix is set here
tstrncpy
(
pShowMsg
->
db
,
pTableMetaInfo
->
name
,
sizeof
(
pShowMsg
->
db
)
);
// prefix is set here
}
else
{
strcpy
(
pShowMsg
->
db
,
pObj
->
db
);
tstrncpy
(
pShowMsg
->
db
,
pObj
->
db
,
sizeof
(
pShowMsg
->
db
)
);
}
SShowInfo
*
pShowInfo
=
&
pInfo
->
pDCLInfo
->
showOpt
;
...
...
@@ -1300,7 +1300,7 @@ int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SCMAlterDbMsg
*
pAlterDbMsg
=
(
SCMAlterDbMsg
*
)
pCmd
->
payload
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
strcpy
(
pAlterDbMsg
->
db
,
pTableMetaInfo
->
name
);
tstrncpy
(
pAlterDbMsg
->
db
,
pTableMetaInfo
->
name
,
sizeof
(
pAlterDbMsg
->
db
)
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -2150,7 +2150,7 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
SSqlRes
*
pRes
=
&
pSql
->
res
;
SCMConnectRsp
*
pConnect
=
(
SCMConnectRsp
*
)
pRes
->
pRsp
;
strcpy
(
pObj
->
acctId
,
pConnect
->
acctId
);
// copy acctId from response
tstrncpy
(
pObj
->
acctId
,
pConnect
->
acctId
,
sizeof
(
pObj
->
acctId
)
);
// copy acctId from response
int32_t
len
=
sprintf
(
temp
,
"%s%s%s"
,
pObj
->
acctId
,
TS_PATH_DELIMITER
,
pObj
->
db
);
assert
(
len
<=
sizeof
(
pObj
->
db
));
...
...
@@ -2172,7 +2172,7 @@ int tscProcessUseDbRsp(SSqlObj *pSql) {
STscObj
*
pObj
=
pSql
->
pTscObj
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
&
pSql
->
cmd
,
0
,
0
);
strcpy
(
pObj
->
db
,
pTableMetaInfo
->
name
);
tstrncpy
(
pObj
->
db
,
pTableMetaInfo
->
name
,
sizeof
(
pObj
->
db
)
);
return
0
;
}
...
...
src/client/src/tscUtil.c
浏览文件 @
0bfc1f61
...
...
@@ -593,7 +593,7 @@ int32_t tscCreateDataBlock(size_t initialSize, int32_t rowSize, int32_t startOff
dataBuf
->
size
=
startOffset
;
dataBuf
->
tsSource
=
-
1
;
strncpy
(
dataBuf
->
tableId
,
name
,
TSDB_TABLE_ID_LEN
);
tstrncpy
(
dataBuf
->
tableId
,
name
,
sizeof
(
dataBuf
->
tableId
)
);
/*
* The table meta may be released since the table meta cache are completed clean by other thread
...
...
@@ -1666,7 +1666,7 @@ STableMetaInfo* tscAddTableMetaInfo(SQueryInfo* pQueryInfo, const char* name, ST
assert
(
pTableMetaInfo
!=
NULL
);
if
(
name
!=
NULL
)
{
strncpy
(
pTableMetaInfo
->
name
,
name
,
TSDB_TABLE_ID_LEN
);
tstrncpy
(
pTableMetaInfo
->
name
,
name
,
sizeof
(
pTableMetaInfo
->
name
)
);
}
pTableMetaInfo
->
pTableMeta
=
pTableMeta
;
...
...
src/cq/src/cqMain.c
浏览文件 @
0bfc1f61
...
...
@@ -73,8 +73,8 @@ void *cqOpen(void *ahandle, const SCqCfg *pCfg) {
return
NULL
;
}
strcpy
(
pContext
->
user
,
pCfg
->
user
);
strcpy
(
pContext
->
pass
,
pCfg
->
pass
);
tstrncpy
(
pContext
->
user
,
pCfg
->
user
,
sizeof
(
pContext
->
user
)
);
tstrncpy
(
pContext
->
pass
,
pCfg
->
pass
,
sizeof
(
pContext
->
pass
)
);
const
char
*
db
=
pCfg
->
db
;
for
(
const
char
*
p
=
db
;
*
p
!=
0
;
p
++
)
{
if
(
*
p
==
'.'
)
{
...
...
@@ -82,7 +82,7 @@ void *cqOpen(void *ahandle, const SCqCfg *pCfg) {
break
;
}
}
strcpy
(
pContext
->
db
,
db
);
tstrncpy
(
pContext
->
db
,
db
,
sizeof
(
pContext
->
db
)
);
pContext
->
vgId
=
pCfg
->
vgId
;
pContext
->
cqWrite
=
pCfg
->
cqWrite
;
pContext
->
ahandle
=
ahandle
;
...
...
@@ -215,7 +215,7 @@ void cqDrop(void *handle) {
cTrace
(
"vgId:%d, id:%d CQ:%s is dropped"
,
pContext
->
vgId
,
pObj
->
tid
,
pObj
->
sqlStr
);
free
(
pObj
);
pthread_mutex_lock
(
&
pContext
->
mutex
);
pthread_mutex_
un
lock
(
&
pContext
->
mutex
);
}
static
void
cqCreateStream
(
SCqContext
*
pContext
,
SCqObj
*
pObj
)
{
...
...
src/inc/taosmsg.h
浏览文件 @
0bfc1f61
...
...
@@ -296,7 +296,7 @@ typedef struct {
}
SCMConnectMsg
;
typedef
struct
{
char
acctId
[
TSDB_ACCT_LEN
+
1
];
char
acctId
[
TSDB_ACCT_LEN
];
char
serverVersion
[
TSDB_VERSION_LEN
];
int8_t
writeAuth
;
int8_t
superAuth
;
...
...
src/inc/tcq.h
浏览文件 @
0bfc1f61
...
...
@@ -27,7 +27,7 @@ typedef struct {
int
vgId
;
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_PASSWORD_LEN
];
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
FCqWrite
cqWrite
;
}
SCqCfg
;
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
0bfc1f61
...
...
@@ -756,7 +756,7 @@ void *readMetric(void *sarg) {
for
(
int
j
=
0
;
j
<
n
;
j
++
)
{
char
condition
[
BUFFER_SIZE
-
30
]
=
"
\0
"
;
char
tempS
[
BUFFER_SIZE
]
=
"
\0
"
;
char
tempS
[
64
]
=
"
\0
"
;
int
m
=
10
<
num_of_tables
?
10
:
num_of_tables
;
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
0bfc1f61
...
...
@@ -643,6 +643,8 @@ int taosDumpDb(SDbInfo *dbInfo, SDumpArguments *arguments, FILE *fp) {
lseek
(
fd
,
0
,
SEEK_SET
);
while
(
read
(
fd
,
&
tableRecord
,
sizeof
(
STableRecord
))
>
0
)
{
tableRecord
.
name
[
sizeof
(
tableRecord
.
name
)
-
1
]
=
0
;
tableRecord
.
metric
[
sizeof
(
tableRecord
.
metric
)
-
1
]
=
0
;
taosDumpTable
(
tableRecord
.
name
,
tableRecord
.
metric
,
arguments
,
fp
);
}
...
...
@@ -902,6 +904,8 @@ int32_t taosDumpMetric(char *metric, SDumpArguments *arguments, FILE *fp) {
lseek
(
fd
,
0
,
SEEK_SET
);
while
(
read
(
fd
,
&
tableRecord
,
sizeof
(
STableRecord
))
>
0
)
{
tableRecord
.
name
[
sizeof
(
tableRecord
.
name
)
-
1
]
=
0
;
tableRecord
.
metric
[
sizeof
(
tableRecord
.
metric
)
-
1
]
=
0
;
taosDumpTable
(
tableRecord
.
name
,
tableRecord
.
metric
,
arguments
,
fp
);
}
...
...
src/mnode/inc/mnodeDef.h
浏览文件 @
0bfc1f61
...
...
@@ -32,8 +32,8 @@ struct SMnodeObj;
typedef
struct
SDnodeObj
{
int32_t
dnodeId
;
uint16_t
dnodePort
;
char
dnodeFqdn
[
TSDB_FQDN_LEN
+
1
];
char
dnodeEp
[
TSDB_EP_LEN
+
1
];
char
dnodeFqdn
[
TSDB_FQDN_LEN
];
char
dnodeEp
[
TSDB_EP_LEN
];
int64_t
createdTime
;
uint32_t
lastAccess
;
int32_t
openVnodes
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
0bfc1f61
...
...
@@ -1769,8 +1769,8 @@ static int32_t mnodeAutoCreateChildTable(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_OUT_OF_MEMORY
;
}
strncpy
(
pCreateMsg
->
tableId
,
pInfo
->
tableId
,
tListLen
(
pInfo
->
tableId
));
strcpy
(
pCreateMsg
->
db
,
pMsg
->
pDb
->
name
);
tstrncpy
(
pCreateMsg
->
tableId
,
pInfo
->
tableId
,
sizeof
(
pInfo
->
tableId
));
tstrncpy
(
pCreateMsg
->
db
,
pMsg
->
pDb
->
name
,
sizeof
(
pCreateMsg
->
db
)
);
pCreateMsg
->
igExists
=
1
;
pCreateMsg
->
getMeta
=
1
;
pCreateMsg
->
contLen
=
htonl
(
contLen
);
...
...
src/os/linux/src/linuxSysPara.c
浏览文件 @
0bfc1f61
...
...
@@ -160,7 +160,7 @@ static void taosGetSystemTimezone() {
/* load time zone string from /etc/timezone */
FILE
*
f
=
fopen
(
"/etc/timezone"
,
"r"
);
char
buf
[
6
4
]
=
{
0
};
char
buf
[
6
5
]
=
{
0
};
if
(
f
!=
NULL
)
{
fread
(
buf
,
64
,
1
,
f
);
fclose
(
f
);
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
0bfc1f61
...
...
@@ -88,8 +88,8 @@ bool httpParseTaosdAuthToken(HttpContext *pContext, char *token, int len) {
free
(
base64
);
return
false
;
}
else
{
strncpy
(
pContext
->
user
,
descrypt
,
TSDB_USER_LEN
);
strncpy
(
pContext
->
pass
,
descrypt
+
TSDB_USER_LEN
,
TSDB_PASSWORD_LEN
);
tstrncpy
(
pContext
->
user
,
descrypt
,
sizeof
(
pContext
->
user
)
);
t
strncpy
(
pContext
->
pass
,
descrypt
+
TSDB_USER_LEN
,
TSDB_PASSWORD_LEN
);
httpTrace
(
"context:%p, fd:%d, ip:%s, taosd token:%s parsed success, user:%s"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
token
,
pContext
->
user
);
...
...
src/plugins/monitor/src/monitorMain.c
浏览文件 @
0bfc1f61
...
...
@@ -156,7 +156,7 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) {
", io_read float, io_write float"
", req_http int, req_select int, req_insert int"
") tags (dnodeid int, fqdn binary(%d))"
,
tsMonitorDbName
,
TSDB_FQDN_LEN
+
1
);
tsMonitorDbName
,
TSDB_FQDN_LEN
);
}
else
if
(
cmd
==
MONITOR_CMD_CREATE_TB_DN
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.dn%d using %s.dn tags(%d, '%s')"
,
tsMonitorDbName
,
dnodeGetDnodeId
(),
tsMonitorDbName
,
dnodeGetDnodeId
(),
tsLocalEp
);
...
...
src/query/src/qExecutor.c
浏览文件 @
0bfc1f61
...
...
@@ -5242,7 +5242,7 @@ static int32_t createFilterInfo(void *pQInfo, SQuery *pQuery) {
if
(
pQuery
->
colList
[
i
].
numOfFilters
>
0
)
{
SSingleColumnFilterInfo
*
pFilterInfo
=
&
pQuery
->
pFilterInfo
[
j
];
memcpy
(
&
pFilterInfo
->
info
,
&
pQuery
->
colList
[
i
],
sizeof
(
SColumnInfo
Data
));
memcpy
(
&
pFilterInfo
->
info
,
&
pQuery
->
colList
[
i
],
sizeof
(
SColumnInfo
));
pFilterInfo
->
info
=
pQuery
->
colList
[
i
];
pFilterInfo
->
numOfFilters
=
pQuery
->
colList
[
i
].
numOfFilters
;
...
...
tests/tsim/src/simMain.c
浏览文件 @
0bfc1f61
...
...
@@ -29,7 +29,7 @@ int main(int argc, char *argv[]) {
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
&&
i
<
argc
-
1
)
{
strncpy
(
configDir
,
argv
[
++
i
],
MAX_FILE_NAME_LEN
);
t
strncpy
(
configDir
,
argv
[
++
i
],
MAX_FILE_NAME_LEN
);
}
else
if
(
strcmp
(
argv
[
i
],
"-f"
)
==
0
&&
i
<
argc
-
1
)
{
strcpy
(
scriptFile
,
argv
[
++
i
]);
}
else
if
(
strcmp
(
argv
[
i
],
"-a"
)
==
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录