Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
5757003f
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看板
提交
5757003f
编写于
1月 15, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-225]refactor codes.
上级
52648e93
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
223 addition
and
242 deletion
+223
-242
src/client/inc/tschemautil.h
src/client/inc/tschemautil.h
+0
-24
src/client/src/tscSchemaUtil.c
src/client/src/tscSchemaUtil.c
+0
-62
src/client/src/tscServer.c
src/client/src/tscServer.c
+12
-10
src/common/inc/tname.h
src/common/inc/tname.h
+14
-0
src/common/src/tname.c
src/common/src/tname.c
+66
-0
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+1
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+10
-10
src/mnode/src/mnodeCluster.c
src/mnode/src/mnodeCluster.c
+1
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+113
-128
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+1
-1
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+2
-2
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+3
-3
未找到文件。
src/client/inc/tschemautil.h
浏览文件 @
5757003f
...
...
@@ -24,10 +24,6 @@ extern "C" {
#include "tstoken.h"
#include "tsclient.h"
#define VALIDNUMOFCOLS(x) ((x) >= TSDB_MIN_COLUMNS && (x) <= TSDB_MAX_COLUMNS)
#define VALIDNUMOFTAGS(x) ((x) >= 0 && (x) <= TSDB_MAX_TAGS)
/**
* get the number of tags of this table
* @param pTableMeta
...
...
@@ -79,26 +75,6 @@ SSchema *tscGetTableColumnSchema(const STableMeta *pMeta, int32_t colIndex);
*/
SSchema
*
tscGetColumnSchemaById
(
STableMeta
*
pTableMeta
,
int16_t
colId
);
/**
* check if the schema is valid or not, including following aspects:
* 1. number of columns
* 2. column types
* 3. column length
* 4. column names
* 5. total length
*
* @param pSchema
* @param numOfCols
* @return
*/
bool
isValidSchema
(
struct
SSchema
*
pSchema
,
int32_t
numOfCols
,
int32_t
numOfTags
);
/**
* get the schema for the "tbname" column. it is a built column
* @return
*/
SSchema
tscGetTbnameColumnSchema
();
/**
* create the table meta from the msg
* @param pTableMetaMsg
...
...
src/client/src/tscSchemaUtil.c
浏览文件 @
5757003f
...
...
@@ -66,68 +66,6 @@ STableComInfo tscGetTableInfo(const STableMeta* pTableMeta) {
return
pTableMeta
->
tableInfo
;
}
static
bool
doValidateSchema
(
SSchema
*
pSchema
,
int32_t
numOfCols
,
int32_t
maxLen
)
{
int32_t
rowLen
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
// 1. valid types
if
(
!
isValidDataType
(
pSchema
[
i
].
type
))
{
return
false
;
}
// 2. valid length for each type
if
(
pSchema
[
i
].
type
==
TSDB_DATA_TYPE_BINARY
)
{
if
(
pSchema
[
i
].
bytes
>
TSDB_MAX_BINARY_LEN
)
{
return
false
;
}
}
else
if
(
pSchema
[
i
].
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pSchema
[
i
].
bytes
>
TSDB_MAX_NCHAR_LEN
)
{
return
false
;
}
}
else
{
if
(
pSchema
[
i
].
bytes
!=
tDataTypes
[
pSchema
[
i
].
type
].
bytes
)
{
return
false
;
}
}
// 3. valid column names
for
(
int32_t
j
=
i
+
1
;
j
<
numOfCols
;
++
j
)
{
if
(
strncasecmp
(
pSchema
[
i
].
name
,
pSchema
[
j
].
name
,
sizeof
(
pSchema
[
i
].
name
)
-
1
)
==
0
)
{
return
false
;
}
}
rowLen
+=
pSchema
[
i
].
bytes
;
}
return
rowLen
<=
maxLen
;
}
bool
isValidSchema
(
struct
SSchema
*
pSchema
,
int32_t
numOfCols
,
int32_t
numOfTags
)
{
if
(
!
VALIDNUMOFCOLS
(
numOfCols
))
{
return
false
;
}
if
(
!
VALIDNUMOFTAGS
(
numOfTags
))
{
return
false
;
}
/* first column must be the timestamp, which is a primary key */
if
(
pSchema
[
0
].
type
!=
TSDB_DATA_TYPE_TIMESTAMP
)
{
return
false
;
}
if
(
!
doValidateSchema
(
pSchema
,
numOfCols
,
TSDB_MAX_BYTES_PER_ROW
))
{
return
false
;
}
if
(
!
doValidateSchema
(
&
pSchema
[
numOfCols
],
numOfTags
,
TSDB_MAX_TAGS_LEN
))
{
return
false
;
}
return
true
;
}
SSchema
*
tscGetTableColumnSchema
(
const
STableMeta
*
pTableMeta
,
int32_t
colIndex
)
{
assert
(
pTableMeta
!=
NULL
);
...
...
src/client/src/tscServer.c
浏览文件 @
5757003f
...
...
@@ -25,8 +25,6 @@
#include "ttimer.h"
#include "tlockfree.h"
///SRpcCorEpSet tscMgmtEpSet;
int
(
*
tscBuildMsg
[
TSDB_SQL_MAX
])(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
=
{
0
};
int
(
*
tscProcessMsgRsp
[
TSDB_SQL_MAX
])(
SSqlObj
*
pSql
);
...
...
@@ -1157,7 +1155,7 @@ int32_t tscBuildDropTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SCMDropTableMsg
*
pDropTableMsg
=
(
SCMDropTableMsg
*
)
pCmd
->
payload
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
strcpy
(
pDropTableMsg
->
table
Id
,
pTableMetaInfo
->
name
);
strcpy
(
pDropTableMsg
->
table
Fname
,
pTableMetaInfo
->
name
);
pDropTableMsg
->
igNotExists
=
pInfo
->
pDCLInfo
->
existsCheck
?
1
:
0
;
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_DROP_TABLE
;
...
...
@@ -1347,7 +1345,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pMsg
+=
sizeof
(
SCreateTableMsg
);
SCreatedTableInfo
*
p
=
taosArrayGet
(
list
,
i
);
strcpy
(
pCreate
->
table
Id
,
p
->
fullname
);
strcpy
(
pCreate
->
table
Fname
,
p
->
fullname
);
pCreate
->
igExists
=
(
p
->
igExist
)
?
1
:
0
;
// use dbinfo from table id without modifying current db info
...
...
@@ -1360,7 +1358,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
}
else
{
// create (super) table
pCreateTableMsg
->
numOfTables
=
htonl
(
1
);
// only one table will be created
strcpy
(
pCreateMsg
->
table
Id
,
pTableMetaInfo
->
name
);
strcpy
(
pCreateMsg
->
table
Fname
,
pTableMetaInfo
->
name
);
// use dbinfo from table id without modifying current db info
tscGetDBInfoFromTableFullName
(
pTableMetaInfo
->
name
,
pCreateMsg
->
db
);
...
...
@@ -1431,7 +1429,7 @@ int tscBuildAlterTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SAlterTableMsg
*
pAlterTableMsg
=
(
SAlterTableMsg
*
)
pCmd
->
payload
;
tscGetDBInfoFromTableFullName
(
pTableMetaInfo
->
name
,
pAlterTableMsg
->
db
);
strcpy
(
pAlterTableMsg
->
table
Id
,
pTableMetaInfo
->
name
);
strcpy
(
pAlterTableMsg
->
table
Fname
,
pTableMetaInfo
->
name
);
pAlterTableMsg
->
type
=
htons
(
pAlterInfo
->
type
);
pAlterTableMsg
->
numOfCols
=
htons
(
tscNumOfFields
(
pQueryInfo
));
...
...
@@ -1630,7 +1628,7 @@ int tscBuildTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
STableInfoMsg
*
pInfoMsg
=
(
STableInfoMsg
*
)
pCmd
->
payload
;
strcpy
(
pInfoMsg
->
table
Id
,
pTableMetaInfo
->
name
);
strcpy
(
pInfoMsg
->
table
Fname
,
pTableMetaInfo
->
name
);
pInfoMsg
->
createFlag
=
htons
(
pSql
->
cmd
.
autoCreated
?
1
:
0
);
char
*
pMsg
=
(
char
*
)
pInfoMsg
+
sizeof
(
STableInfoMsg
);
...
...
@@ -1799,7 +1797,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
if
((
pMetaMsg
->
tableType
!=
TSDB_SUPER_TABLE
)
&&
(
pMetaMsg
->
tid
<=
0
||
pMetaMsg
->
vgroup
.
vgId
<
2
||
pMetaMsg
->
vgroup
.
numOfEps
<=
0
))
{
tscError
(
"invalid value in table numOfEps:%d, vgId:%d tid:%d, name:%s"
,
pMetaMsg
->
vgroup
.
numOfEps
,
pMetaMsg
->
vgroup
.
vgId
,
pMetaMsg
->
tid
,
pMetaMsg
->
table
Id
);
pMetaMsg
->
tid
,
pMetaMsg
->
table
Fname
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
...
...
@@ -1831,12 +1829,16 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
assert
(
isValidDataType
(
pSchema
->
type
));
pSchema
++
;
}
STableMeta
*
pTableMeta
=
tscCreateTableMetaFromMsg
(
pMetaMsg
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
&
pSql
->
cmd
,
0
,
0
);
assert
(
pTableMetaInfo
->
pTableMeta
==
NULL
);
STableMeta
*
pTableMeta
=
tscCreateTableMetaFromMsg
(
pMetaMsg
);
if
(
!
isValidSchema
(
pTableMeta
->
schema
,
pTableMeta
->
tableInfo
.
numOfColumns
,
pTableMeta
->
tableInfo
.
numOfTags
))
{
tscError
(
"%p invalid table meta from mnode, name:%s"
,
pSql
,
pTableMetaInfo
->
name
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
if
(
pTableMeta
->
tableType
==
TSDB_CHILD_TABLE
)
{
// check if super table hashmap or not
int32_t
len
=
(
int32_t
)
strnlen
(
pTableMeta
->
sTableName
,
TSDB_TABLE_FNAME_LEN
);
...
...
src/common/inc/tname.h
浏览文件 @
5757003f
...
...
@@ -39,4 +39,18 @@ SColumnFilterInfo* tscFilterInfoClone(const SColumnFilterInfo* src, int32_t numO
SSchema
tscGetTbnameColumnSchema
();
/**
* check if the schema is valid or not, including following aspects:
* 1. number of columns
* 2. column types
* 3. column length
* 4. column names
* 5. total length
*
* @param pSchema
* @param numOfCols
* @return
*/
bool
isValidSchema
(
struct
SSchema
*
pSchema
,
int32_t
numOfCols
,
int32_t
numOfTags
);
#endif // TDENGINE_NAME_H
src/common/src/tname.c
浏览文件 @
5757003f
...
...
@@ -6,6 +6,10 @@
#include "ttokendef.h"
#include "tvariant.h"
#define VALIDNUMOFCOLS(x) ((x) >= TSDB_MIN_COLUMNS && (x) <= TSDB_MAX_COLUMNS)
#define VALIDNUMOFTAGS(x) ((x) >= 0 && (x) <= TSDB_MAX_TAGS)
// todo refactor
UNUSED_FUNC
static
FORCE_INLINE
const
char
*
skipSegments
(
const
char
*
input
,
char
delim
,
int32_t
num
)
{
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
...
...
@@ -206,3 +210,65 @@ SSchema tscGetTbnameColumnSchema() {
strcpy
(
s
.
name
,
TSQL_TBNAME_L
);
return
s
;
}
static
bool
doValidateSchema
(
SSchema
*
pSchema
,
int32_t
numOfCols
,
int32_t
maxLen
)
{
int32_t
rowLen
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
// 1. valid types
if
(
!
isValidDataType
(
pSchema
[
i
].
type
))
{
return
false
;
}
// 2. valid length for each type
if
(
pSchema
[
i
].
type
==
TSDB_DATA_TYPE_BINARY
)
{
if
(
pSchema
[
i
].
bytes
>
TSDB_MAX_BINARY_LEN
)
{
return
false
;
}
}
else
if
(
pSchema
[
i
].
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
pSchema
[
i
].
bytes
>
TSDB_MAX_NCHAR_LEN
)
{
return
false
;
}
}
else
{
if
(
pSchema
[
i
].
bytes
!=
tDataTypes
[
pSchema
[
i
].
type
].
bytes
)
{
return
false
;
}
}
// 3. valid column names
for
(
int32_t
j
=
i
+
1
;
j
<
numOfCols
;
++
j
)
{
if
(
strncasecmp
(
pSchema
[
i
].
name
,
pSchema
[
j
].
name
,
sizeof
(
pSchema
[
i
].
name
)
-
1
)
==
0
)
{
return
false
;
}
}
rowLen
+=
pSchema
[
i
].
bytes
;
}
return
rowLen
<=
maxLen
;
}
bool
isValidSchema
(
struct
SSchema
*
pSchema
,
int32_t
numOfCols
,
int32_t
numOfTags
)
{
if
(
!
VALIDNUMOFCOLS
(
numOfCols
))
{
return
false
;
}
if
(
!
VALIDNUMOFTAGS
(
numOfTags
))
{
return
false
;
}
/* first column must be the timestamp, which is a primary key */
if
(
pSchema
[
0
].
type
!=
TSDB_DATA_TYPE_TIMESTAMP
)
{
return
false
;
}
if
(
!
doValidateSchema
(
pSchema
,
numOfCols
,
TSDB_MAX_BYTES_PER_ROW
))
{
return
false
;
}
if
(
!
doValidateSchema
(
&
pSchema
[
numOfCols
],
numOfTags
,
TSDB_MAX_TAGS_LEN
))
{
return
false
;
}
return
true
;
}
src/dnode/src/dnodeShell.c
浏览文件 @
5757003f
...
...
@@ -216,7 +216,7 @@ void *dnodeSendCfgTableToRecv(int32_t vgId, int32_t tid) {
int16_t
numOfTags
=
htons
(
pTable
->
numOfTags
);
int32_t
tableId
=
htonl
(
pTable
->
tid
);
uint64_t
uid
=
htobe64
(
pTable
->
uid
);
dInfo
(
"table:%s, numOfColumns:%d numOfTags:%d tid:%d uid:%"
PRIu64
,
pTable
->
table
Id
,
numOfColumns
,
numOfTags
,
tableId
,
uid
);
dInfo
(
"table:%s, numOfColumns:%d numOfTags:%d tid:%d uid:%"
PRIu64
,
pTable
->
table
Fname
,
numOfColumns
,
numOfTags
,
tableId
,
uid
);
return
rpcRsp
.
pCont
;
}
...
...
src/inc/taosmsg.h
浏览文件 @
5757003f
...
...
@@ -260,14 +260,14 @@ typedef struct {
uint64_t
uid
;
uint64_t
superTableUid
;
uint64_t
createdTime
;
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
s
uperTableId
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
char
s
tableFname
[
TSDB_TABLE_FNAME_LEN
];
char
data
[];
}
SMDCreateTableMsg
;
typedef
struct
{
int32_t
len
;
// one create table message
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_ACCT_ID_LEN
+
TSDB_DB_NAME_LEN
];
int8_t
igExists
;
int8_t
getMeta
;
...
...
@@ -284,12 +284,12 @@ typedef struct {
}
SCMCreateTableMsg
;
typedef
struct
{
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
int8_t
igNotExists
;
}
SCMDropTableMsg
;
typedef
struct
{
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
char
db
[
TSDB_ACCT_ID_LEN
+
TSDB_DB_NAME_LEN
];
int16_t
type
;
/* operation type */
int16_t
numOfCols
;
/* number of schema */
...
...
@@ -369,14 +369,14 @@ typedef struct {
int32_t
vgId
;
int32_t
tid
;
uint64_t
uid
;
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
}
SMDDropTableMsg
;
typedef
struct
{
int32_t
contLen
;
int32_t
vgId
;
uint64_t
uid
;
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
}
SDropSTableMsg
;
typedef
struct
{
...
...
@@ -688,7 +688,7 @@ typedef struct {
}
SCreateVnodeMsg
,
SAlterVnodeMsg
;
typedef
struct
{
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
int16_t
createFlag
;
char
tags
[];
}
STableInfoMsg
;
...
...
@@ -726,7 +726,7 @@ typedef struct {
typedef
struct
STableMetaMsg
{
int32_t
contLen
;
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
// table id
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
// table id
uint8_t
numOfTags
;
uint8_t
precision
;
uint8_t
tableType
;
...
...
@@ -847,7 +847,7 @@ typedef struct {
uint64_t
uid
;
uint64_t
stime
;
// stream starting time
int32_t
status
;
char
table
Id
[
TSDB_TABLE_FNAME_LEN
];
char
table
Fname
[
TSDB_TABLE_FNAME_LEN
];
}
SAlterStreamMsg
;
typedef
struct
{
...
...
src/mnode/src/mnodeCluster.c
浏览文件 @
5757003f
...
...
@@ -195,7 +195,7 @@ static int32_t mnodeGetClusterMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *
cols
++
;
pMeta
->
numOfColumns
=
htons
(
cols
);
strcpy
(
pMeta
->
table
Id
,
"show cluster"
);
strcpy
(
pMeta
->
table
Fname
,
"show cluster"
);
pShow
->
numOfColumns
=
cols
;
pShow
->
offset
[
0
]
=
0
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
5757003f
此差异已折叠。
点击以展开。
src/mnode/src/mnodeUser.c
浏览文件 @
5757003f
...
...
@@ -337,7 +337,7 @@ static int32_t mnodeGetUserMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
cols
++
;
pMeta
->
numOfColumns
=
htons
(
cols
);
strcpy
(
pMeta
->
table
Id
,
"show users"
);
strcpy
(
pMeta
->
table
Fname
,
"show users"
);
pShow
->
numOfColumns
=
cols
;
pShow
->
offset
[
0
]
=
0
;
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
5757003f
...
...
@@ -253,7 +253,7 @@ STableCfg *tsdbCreateTableCfgFromMsg(SMDCreateTableMsg *pMsg) {
}
}
if
(
tsdbTableSetSchema
(
pCfg
,
tdGetSchemaFromBuilder
(
&
schemaBuilder
),
false
)
<
0
)
goto
_err
;
if
(
tsdbTableSetName
(
pCfg
,
pMsg
->
table
Id
,
true
)
<
0
)
goto
_err
;
if
(
tsdbTableSetName
(
pCfg
,
pMsg
->
table
Fname
,
true
)
<
0
)
goto
_err
;
if
(
numOfTags
>
0
)
{
// Decode tag schema
...
...
@@ -265,7 +265,7 @@ STableCfg *tsdbCreateTableCfgFromMsg(SMDCreateTableMsg *pMsg) {
}
}
if
(
tsdbTableSetTagSchema
(
pCfg
,
tdGetSchemaFromBuilder
(
&
schemaBuilder
),
false
)
<
0
)
goto
_err
;
if
(
tsdbTableSetSName
(
pCfg
,
pMsg
->
s
uperTableId
,
true
)
<
0
)
goto
_err
;
if
(
tsdbTableSetSName
(
pCfg
,
pMsg
->
s
tableFname
,
true
)
<
0
)
goto
_err
;
if
(
tsdbTableSetSuperUid
(
pCfg
,
htobe64
(
pMsg
->
superTableUid
))
<
0
)
goto
_err
;
int32_t
tagDataLen
=
htonl
(
pMsg
->
tagDataLen
);
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
5757003f
...
...
@@ -174,7 +174,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SMDDropTableMsg
*
pTable
=
pCont
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
vDebug
(
"vgId:%d, table:%s, start to drop"
,
pVnode
->
vgId
,
pTable
->
table
Id
);
vDebug
(
"vgId:%d, table:%s, start to drop"
,
pVnode
->
vgId
,
pTable
->
table
Fname
);
STableId
tableId
=
{.
uid
=
htobe64
(
pTable
->
uid
),
.
tid
=
htonl
(
pTable
->
tid
)};
if
(
tsdbDropTable
(
pVnode
->
tsdb
,
tableId
)
<
0
)
code
=
terrno
;
...
...
@@ -197,13 +197,13 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
SDropSTableMsg
*
pTable
=
pCont
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
vDebug
(
"vgId:%d, stable:%s, start to drop"
,
pVnode
->
vgId
,
pTable
->
table
Id
);
vDebug
(
"vgId:%d, stable:%s, start to drop"
,
pVnode
->
vgId
,
pTable
->
table
Fname
);
STableId
stableId
=
{.
uid
=
htobe64
(
pTable
->
uid
),
.
tid
=
-
1
};
if
(
tsdbDropTable
(
pVnode
->
tsdb
,
stableId
)
<
0
)
code
=
terrno
;
vDebug
(
"vgId:%d, stable:%s, drop stable result:%s"
,
pVnode
->
vgId
,
pTable
->
table
Id
,
tstrerror
(
code
));
vDebug
(
"vgId:%d, stable:%s, drop stable result:%s"
,
pVnode
->
vgId
,
pTable
->
table
Fname
,
tstrerror
(
code
));
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录