Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_50753323
TDengine
提交
daafb42e
T
TDengine
项目概览
qq_50753323
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
daafb42e
编写于
6月 04, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
td-459: TSDB_DB_NAME_LEN
上级
5e8969d6
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
32 addition
and
32 deletion
+32
-32
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+2
-2
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+3
-3
src/client/src/tscSql.c
src/client/src/tscSql.c
+3
-3
src/common/src/tglobal.c
src/common/src/tglobal.c
+2
-2
src/inc/taosdef.h
src/inc/taosdef.h
+2
-2
src/inc/taosmsg.h
src/inc/taosmsg.h
+5
-5
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+1
-1
src/mnode/inc/mnodeDef.h
src/mnode/inc/mnodeDef.h
+3
-3
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+5
-5
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+1
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/vnode/inc/vnodeInt.h
src/vnode/inc/vnodeInt.h
+1
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
daafb42e
...
...
@@ -285,8 +285,8 @@ typedef struct STscObj {
void
*
pTimer
;
char
user
[
TSDB_USER_LEN
];
char
pass
[
TSDB_KEY_LEN
];
char
acctId
[
TSDB_
DB_NAME
_LEN
];
char
db
[
TSDB_
TABLE_ID
_LEN
];
char
acctId
[
TSDB_
ACCT
_LEN
];
char
db
[
TSDB_
DB_NAME
_LEN
];
char
sversion
[
TSDB_VERSION_LEN
];
char
writeAuth
:
1
;
char
superAuth
:
1
;
...
...
src/client/src/tscLocal.c
浏览文件 @
daafb42e
...
...
@@ -286,7 +286,7 @@ static void tscProcessCurrentUser(SSqlObj *pSql) {
}
static
void
tscProcessCurrentDB
(
SSqlObj
*
pSql
)
{
char
db
[
TSDB_DB_NAME_LEN
+
1
]
=
{
0
};
char
db
[
TSDB_DB_NAME_LEN
]
=
{
0
};
extractDBName
(
pSql
->
pTscObj
->
db
,
db
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pSql
->
cmd
,
0
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
daafb42e
...
...
@@ -1041,7 +1041,7 @@ int32_t setObjFullName(char* fullName, const char* account, SSQLToken* pDB, SSQL
/* db name is not specified, the tableName dose not include db name */
if
(
pDB
!=
NULL
)
{
if
(
pDB
->
n
>
TSDB_DB_NAME_LEN
)
{
if
(
pDB
->
n
>
=
TSDB_DB_NAME_LEN
)
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
...
...
@@ -1060,7 +1060,7 @@ int32_t setObjFullName(char* fullName, const char* account, SSQLToken* pDB, SSQL
}
}
else
{
// pDB == NULL, the db prefix name is specified in tableName
/* the length limitation includes tablename + dbname + sep */
if
(
tableName
->
n
>
TSDB_TABLE_NAME_LEN
+
TSDB_DB_NAME_LEN
+
tListLen
(
TS_PATH_DELIMITER
))
{
if
(
tableName
->
n
>
(
TSDB_TABLE_NAME_LEN
-
1
)
+
(
TSDB_DB_NAME_LEN
-
1
)
+
sizeof
(
TS_PATH_DELIMITER
))
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
}
...
...
@@ -2202,7 +2202,7 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if
(
pDbPrefixToken
->
type
!=
0
)
{
assert
(
pDbPrefixToken
->
n
>=
0
);
if
(
pDbPrefixToken
->
n
>
TSDB_DB_NAME_LEN
)
{
// db name is too long
if
(
pDbPrefixToken
->
n
>
=
TSDB_DB_NAME_LEN
)
{
// db name is too long
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
}
...
...
src/client/src/tscSql.c
浏览文件 @
daafb42e
...
...
@@ -92,15 +92,15 @@ SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
if
(
db
)
{
int32_t
len
=
strlen
(
db
);
/* db name is too long */
if
(
len
>
TSDB_DB_NAME_LEN
)
{
if
(
len
>
=
TSDB_DB_NAME_LEN
)
{
terrno
=
TSDB_CODE_TSC_INVALID_DB_LENGTH
;
rpcClose
(
pDnodeConn
);
free
(
pObj
);
return
NULL
;
}
char
tmp
[
TSDB_DB_NAME_LEN
+
1
]
=
{
0
};
strcpy
(
tmp
,
db
);
char
tmp
[
TSDB_DB_NAME_LEN
]
=
{
0
};
tstrncpy
(
tmp
,
db
,
sizeof
(
tmp
)
);
strdequote
(
tmp
);
strtolower
(
pObj
->
db
,
tmp
);
...
...
src/common/src/tglobal.c
浏览文件 @
daafb42e
...
...
@@ -708,7 +708,7 @@ static void doInitGlobalConfig() {
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
0
;
cfg
.
ptrLength
=
TSDB_DB_NAME_LEN
;
cfg
.
ptrLength
=
TSDB_DB_NAME_LEN
-
1
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
...
...
@@ -923,7 +923,7 @@ static void doInitGlobalConfig() {
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
0
;
cfg
.
ptrLength
=
TSDB_DB_NAME_LEN
;
cfg
.
ptrLength
=
TSDB_DB_NAME_LEN
-
1
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
...
...
src/inc/taosdef.h
浏览文件 @
daafb42e
...
...
@@ -189,7 +189,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_USERID_LEN 9
#define TS_PATH_DELIMITER_LEN 1
#define TSDB_METER_ID_LEN_MARGIN
9
#define TSDB_METER_ID_LEN_MARGIN
8
#define TSDB_TABLE_ID_LEN (TSDB_DB_NAME_LEN+TSDB_TABLE_NAME_LEN+2*TS_PATH_DELIMITER_LEN+TSDB_USERID_LEN+TSDB_METER_ID_LEN_MARGIN) //TSDB_DB_NAME_LEN+TSDB_TABLE_NAME_LEN+2*strlen(TS_PATH_DELIMITER)+strlen(USERID)
#define TSDB_UNI_LEN 24
#define TSDB_USER_LEN TSDB_UNI_LEN
...
...
@@ -201,7 +201,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_NODE_NAME_LEN 64
#define TSDB_TABLE_NAME_LEN 193
#define TSDB_DB_NAME_LEN 3
2
#define TSDB_DB_NAME_LEN 3
3
#define TSDB_COL_NAME_LEN 64
#define TSDB_MAX_SAVED_SQL_LEN TSDB_MAX_COLUMNS * 64
#define TSDB_MAX_SQL_LEN TSDB_PAYLOAD_SIZE
...
...
src/inc/taosmsg.h
浏览文件 @
daafb42e
...
...
@@ -250,7 +250,7 @@ typedef struct {
typedef
struct
{
char
tableId
[
TSDB_TABLE_ID_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
int8_t
igExists
;
int8_t
getMeta
;
int16_t
numOfTags
;
...
...
@@ -268,7 +268,7 @@ typedef struct {
typedef
struct
{
char
tableId
[
TSDB_TABLE_ID_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
int16_t
type
;
/* operation type */
int16_t
numOfCols
;
/* number of schema */
int32_t
tagValLen
;
...
...
@@ -502,7 +502,7 @@ typedef struct {
typedef
struct
{
char
acct
[
TSDB_USER_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
int32_t
cacheBlockSize
;
//MB
int32_t
totalBlocks
;
int32_t
maxTables
;
...
...
@@ -606,7 +606,7 @@ typedef struct {
}
SMDVnodeDesc
;
typedef
struct
{
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
SMDVnodeCfg
cfg
;
SMDVnodeDesc
nodes
[
TSDB_MAX_REPLICA
];
}
SMDCreateVnodeMsg
;
...
...
@@ -671,7 +671,7 @@ typedef struct {
*/
typedef
struct
{
int8_t
type
;
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
uint16_t
payloadLen
;
char
payload
[];
}
SCMShowMsg
;
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
daafb42e
...
...
@@ -102,7 +102,7 @@ typedef struct {
extern
char
version
[];
typedef
struct
{
char
name
[
TSDB_DB_NAME_LEN
+
1
];
char
name
[
TSDB_DB_NAME_LEN
];
int32_t
replica
;
int32_t
days
;
int32_t
keep
;
...
...
src/mnode/inc/mnodeDef.h
浏览文件 @
daafb42e
...
...
@@ -115,7 +115,7 @@ typedef struct {
typedef
struct
SVgObj
{
uint32_t
vgId
;
char
dbName
[
TSDB_DB_NAME_LEN
+
1
];
char
dbName
[
TSDB_DB_NAME_LEN
];
int64_t
createdTime
;
SVnodeGid
vnodeGid
[
TSDB_MAX_REPLICA
];
int32_t
numOfVnodes
;
...
...
@@ -154,7 +154,7 @@ typedef struct {
}
SDbCfg
;
typedef
struct
SDbObj
{
char
name
[
TSDB_DB_NAME_LEN
+
1
];
char
name
[
TSDB_DB_NAME_LEN
];
char
acct
[
TSDB_USER_LEN
+
1
];
int64_t
createdTime
;
int32_t
cfgVersion
;
...
...
@@ -219,7 +219,7 @@ typedef struct SAcctObj {
typedef
struct
{
int8_t
type
;
int32_t
index
;
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
void
*
pIter
;
int16_t
numOfColumns
;
int32_t
rowSize
;
...
...
src/mnode/src/mnodeDb.c
浏览文件 @
daafb42e
...
...
@@ -328,8 +328,8 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCMCreateDbMsg *pCreate) {
if
(
code
!=
0
)
return
code
;
pDb
=
calloc
(
1
,
sizeof
(
SDbObj
));
strncpy
(
pDb
->
name
,
pCreate
->
db
,
TSDB_DB_NAME_LEN
);
strncpy
(
pDb
->
acct
,
pAcct
->
user
,
TSDB_USER_LEN
);
tstrncpy
(
pDb
->
name
,
pCreate
->
db
,
sizeof
(
pDb
->
name
)
);
tstrncpy
(
pDb
->
acct
,
pAcct
->
user
,
sizeof
(
pDb
->
acct
)
);
pDb
->
createdTime
=
taosGetTimestampMs
();
pDb
->
cfg
=
(
SDbCfg
)
{
.
cacheBlockSize
=
pCreate
->
cacheBlockSize
,
...
...
@@ -373,7 +373,7 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCMCreateDbMsg *pCreate) {
}
bool
mnodeCheckIsMonitorDB
(
char
*
db
,
char
*
monitordb
)
{
char
dbName
[
TSDB_DB_NAME_LEN
+
1
]
=
{
0
};
char
dbName
[
TSDB_DB_NAME_LEN
]
=
{
0
};
extractDBName
(
db
,
dbName
);
size_t
len
=
strlen
(
dbName
);
...
...
@@ -453,7 +453,7 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
pShow
->
bytes
[
cols
]
=
TSDB_DB_NAME_LEN
+
VARSTR_HEADER_SIZE
;
pShow
->
bytes
[
cols
]
=
(
TSDB_DB_NAME_LEN
-
1
)
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
strcpy
(
pSchema
[
cols
].
name
,
"name"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
...
...
@@ -610,7 +610,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
char
*
name
=
mnodeGetDbStr
(
pDb
->
name
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
name
,
TSDB_DB_NAME_LEN
);
STR_WITH_MAXSIZE_TO_VARSTR
(
pWrite
,
name
,
TSDB_DB_NAME_LEN
-
1
);
cols
++
;
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
daafb42e
...
...
@@ -43,7 +43,7 @@ typedef enum {
}
ESdbStatus
;
typedef
struct
_SSdbTable
{
char
tableName
[
TSDB_DB_NAME_LEN
+
1
];
char
tableName
[
TSDB_DB_NAME_LEN
];
ESdbTable
tableId
;
ESdbKey
keyType
;
int32_t
hashSessions
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
daafb42e
...
...
@@ -1160,7 +1160,7 @@ int32_t mnodeRetrieveShowSuperTables(SShowObj *pShow, char *data, int32_t rows,
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
int16_t
len
=
strnlen
(
stableName
,
TSDB_DB_NAME_LEN
);
int16_t
len
=
strnlen
(
stableName
,
TSDB_DB_NAME_LEN
-
1
);
*
(
int16_t
*
)
pWrite
=
len
;
pWrite
+=
sizeof
(
int16_t
);
// todo refactor
...
...
src/query/src/qExecutor.c
浏览文件 @
daafb42e
...
...
@@ -6037,9 +6037,9 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
for
(
int32_t
j
=
0
;
j
<
pQuery
->
numOfOutput
;
++
j
)
{
if
(
pExprInfo
[
j
].
base
.
colInfo
.
colId
==
TSDB_TBNAME_COLUMN_INDEX
)
{
data
=
tsdbGetTableName
(
pQInfo
->
tsdb
,
&
item
->
id
,
&
bytes
);
char
*
data
=
tsdbGetTableName
(
pQInfo
->
tsdb
,
&
item
->
id
);
char
*
dst
=
pQuery
->
sdata
[
j
]
->
data
+
i
*
((
TSDB_TABLE_NAME_LEN
-
1
)
+
VARSTR_HEADER_SIZE
);
char
*
dst
=
pQuery
->
sdata
[
j
]
->
data
+
count
*
((
TSDB_TABLE_NAME_LEN
-
1
)
+
VARSTR_HEADER_SIZE
);
memcpy
(
dst
,
data
,
varDataTLen
(
data
));
}
else
{
// todo refactor
int16_t
type
=
pExprInfo
[
j
].
type
;
...
...
src/vnode/inc/vnodeInt.h
浏览文件 @
daafb42e
...
...
@@ -51,7 +51,7 @@ typedef struct {
SSyncCfg
syncCfg
;
SWalCfg
walCfg
;
char
*
rootDir
;
char
db
[
TSDB_DB_NAME_LEN
+
1
];
char
db
[
TSDB_DB_NAME_LEN
];
}
SVnodeObj
;
int
vnodeWriteToQueue
(
void
*
param
,
void
*
pHead
,
int
type
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录