Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ff645300
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff645300
编写于
12月 16, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change some error number
上级
22ed98dd
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
56 addition
and
70 deletion
+56
-70
include/util/taoserror.h
include/util/taoserror.h
+22
-38
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+25
-18
source/util/src/terror.c
source/util/src/terror.c
+9
-14
未找到文件。
include/util/taoserror.h
浏览文件 @
ff645300
...
...
@@ -206,44 +206,28 @@ int32_t* taosGetErrno();
#define TSDB_CODE_MND_VGROUP_ALREADY_IN_DNODE TAOS_DEF_ERROR_CODE(0, 0x0392)
// mnode-stable
#define TSDB_CODE_MND_STB_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_IGEXIST TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COLS_NUM TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_TAGS_NUM TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_TYPE TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_ID TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_BYTES TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_STB_INVALID_COL_NAME TAOS_DEF_ERROR_CODE(0, 0x0360)
#define TSDB_CODE_MND_INVALID_TABLE_ID TAOS_DEF_ERROR_CODE(0, 0x0361) //"Table name too long")
#define TSDB_CODE_MND_INVALID_TABLE_NAME TAOS_DEF_ERROR_CODE(0, 0x0362) //"Table does not exist")
#define TSDB_CODE_MND_INVALID_TABLE_TYPE TAOS_DEF_ERROR_CODE(0, 0x0363) //"Invalid table type in tsdb")
#define TSDB_CODE_MND_TOO_MANY_TAGS TAOS_DEF_ERROR_CODE(0, 0x0364) //"Too many tags")
#define TSDB_CODE_MND_TOO_MANY_COLUMNS TAOS_DEF_ERROR_CODE(0, 0x0365) //"Too many columns")
#define TSDB_CODE_MND_TOO_MANY_TIMESERIES TAOS_DEF_ERROR_CODE(0, 0x0366) //"Too many time series")
#define TSDB_CODE_MND_NOT_SUPER_TABLE TAOS_DEF_ERROR_CODE(0, 0x0367) //"Not super table") // operation only available for super table
#define TSDB_CODE_MND_COL_NAME_TOO_LONG TAOS_DEF_ERROR_CODE(0, 0x0368) //"Tag name too long")
#define TSDB_CODE_MND_TAG_ALREAY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0369) //"Tag already exists")
#define TSDB_CODE_MND_TAG_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x036A) //"Tag does not exist")
#define TSDB_CODE_MND_FIELD_ALREAY_EXIST TAOS_DEF_ERROR_CODE(0, 0x036B) //"Field already exists")
#define TSDB_CODE_MND_FIELD_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x036C) //"Field does not exist")
#define TSDB_CODE_MND_INVALID_STABLE_NAME TAOS_DEF_ERROR_CODE(0, 0x036D) //"Super table does not exist")
#define TSDB_CODE_MND_INVALID_CREATE_TABLE_MSG TAOS_DEF_ERROR_CODE(0, 0x036E) //"Invalid create table message")
#define TSDB_CODE_MND_EXCEED_MAX_ROW_BYTES TAOS_DEF_ERROR_CODE(0, 0x036F) //"Exceed max row bytes")
#define TSDB_CODE_MND_FUNC_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0370)
#define TSDB_CODE_MND_FUNC_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0371)
#define TSDB_CODE_MND_INVALID_FUNC TAOS_DEF_ERROR_CODE(0, 0x0372)
#define TSDB_CODE_MND_INVALID_FUNC_NAME TAOS_DEF_ERROR_CODE(0, 0x0373)
#define TSDB_CODE_MND_INVALID_FUNC_COMMENT TAOS_DEF_ERROR_CODE(0, 0x0374)
#define TSDB_CODE_MND_INVALID_FUNC_CODE TAOS_DEF_ERROR_CODE(0, 0x0375)
#define TSDB_CODE_MND_INVALID_FUNC_BUFSIZE TAOS_DEF_ERROR_CODE(0, 0x0376)
#define TSDB_CODE_MND_INVALID_TAG_LENGTH TAOS_DEF_ERROR_CODE(0, 0x0376) //"invalid tag length")
#define TSDB_CODE_MND_INVALID_COLUMN_LENGTH TAOS_DEF_ERROR_CODE(0, 0x0377) //"invalid column length")
#define TSDB_CODE_MND_STB_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A0)
#define TSDB_CODE_MND_STB_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A1)
#define TSDB_CODE_MND_TOO_MANY_STBS TAOS_DEF_ERROR_CODE(0, 0x03A2)
#define TSDB_CODE_MND_INVALID_STB TAOS_DEF_ERROR_CODE(0, 0x03A3)
#define TSDB_CODE_MND_INVALID_STB_OPTION TAOS_DEF_ERROR_CODE(0, 0x03A4)
#define TSDB_CODE_MND_STB_OPTION_UNCHNAGED TAOS_DEF_ERROR_CODE(0, 0x03A5)
#define TSDB_CODE_MND_TOO_MANY_TAGS TAOS_DEF_ERROR_CODE(0, 0x03A6)
#define TSDB_CODE_MND_TAG_ALREAY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A7)
#define TSDB_CODE_MND_TAG_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03A8)
#define TSDB_CODE_MND_TOO_MANY_COLUMNS TAOS_DEF_ERROR_CODE(0, 0x03A9)
#define TSDB_CODE_MND_COLUMN_ALREAY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03AA)
#define TSDB_CODE_MND_COLUMN_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03AB)
#define TSDB_CODE_MND_EXCEED_MAX_ROW_BYTES TAOS_DEF_ERROR_CODE(0, 0x03AC)
// mnode-func
#define TSDB_CODE_MND_FUNC_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x03C0)
#define TSDB_CODE_MND_FUNC_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x03C1)
#define TSDB_CODE_MND_INVALID_FUNC TAOS_DEF_ERROR_CODE(0, 0x03C2)
#define TSDB_CODE_MND_INVALID_FUNC_NAME TAOS_DEF_ERROR_CODE(0, 0x03C3)
#define TSDB_CODE_MND_INVALID_FUNC_COMMENT TAOS_DEF_ERROR_CODE(0, 0x03C4)
#define TSDB_CODE_MND_INVALID_FUNC_CODE TAOS_DEF_ERROR_CODE(0, 0x03C5)
#define TSDB_CODE_MND_INVALID_FUNC_BUFSIZE TAOS_DEF_ERROR_CODE(0, 0x03C6)
// dnode
#define TSDB_CODE_DND_ACTION_IN_PROGRESS TAOS_DEF_ERROR_CODE(0, 0x0400)
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
ff645300
...
...
@@ -157,11 +157,17 @@ static int32_t mndStbActionUpdate(SSdb *pSdb, SStbObj *pOldStb, SStbObj *pNewStb
atomic_exchange_32
(
&
pOldStb
->
version
,
pNewStb
->
version
);
taosWLockLatch
(
&
pOldStb
->
lock
);
pOldStb
->
numOfColumns
=
pNewStb
->
numOfColumns
;
pOldStb
->
numOfTags
=
pNewStb
->
numOfTags
;
int32_t
totalCols
=
pNewStb
->
numOfTags
+
pNewStb
->
numOfColumns
;
int32_t
totalSize
=
totalCols
*
sizeof
(
SSchema
);
if
(
pOldStb
->
numOfTags
+
pOldStb
->
numOfColumns
<
totalCols
)
{
pOldStb
->
pSchema
=
malloc
(
totalSize
);
void
*
pSchema
=
malloc
(
totalSize
);
if
(
pSchema
!=
NULL
)
{
free
(
pOldStb
->
pSchema
);
pOldStb
->
pSchema
=
pSchema
;
}
}
memcpy
(
pOldStb
->
pSchema
,
pNewStb
->
pSchema
,
totalSize
);
...
...
@@ -200,37 +206,37 @@ static int32_t mndCheckStbMsg(SCreateStbMsg *pCreate) {
}
if
(
pCreate
->
igExists
<
0
||
pCreate
->
igExists
>
1
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_IGEXIST
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pCreate
->
numOfColumns
<
TSDB_MIN_COLUMNS
||
pCreate
->
numOfColumns
>
TSDB_MAX_COLUMNS
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COLS_NUM
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pCreate
->
numOfTags
<=
0
||
pCreate
->
numOfTags
>
TSDB_MAX_TAGS
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_TAGS_NUM
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
int32_t
maxColId
=
(
TSDB_MAX_COLUMNS
+
TSDB_MAX_TAGS
);
for
(
int32_t
i
=
0
;
i
<
totalCols
;
++
i
)
{
SSchema
*
pSchema
=
&
pCreate
->
pSchema
[
i
];
if
(
pSchema
->
type
<
=
0
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_TYPE
;
if
(
pSchema
->
type
<
0
)
{
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
colId
<
0
||
pSchema
->
colId
>=
maxColId
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_ID
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
bytes
<=
0
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_BYTES
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
name
[
0
]
==
0
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_NAME
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
}
...
...
@@ -245,6 +251,7 @@ static int32_t mndCreateStb(SMnode *pMnode, SMnodeMsg *pMsg, SCreateStbMsg *pCre
stbObj
.
createdTime
=
taosGetTimestampMs
();
stbObj
.
updateTime
=
stbObj
.
createdTime
;
stbObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
stbObj
.
dbUid
=
pDb
->
uid
;
stbObj
.
version
=
1
;
stbObj
.
numOfColumns
=
pCreate
->
numOfColumns
;
stbObj
.
numOfTags
=
pCreate
->
numOfTags
;
...
...
@@ -350,19 +357,19 @@ static int32_t mndCheckAlterStbMsg(SAlterStbMsg *pAlter) {
pSchema
->
bytes
=
htonl
(
pSchema
->
bytes
);
if
(
pSchema
->
type
<=
0
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_TYPE
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
colId
<
0
||
pSchema
->
colId
>=
(
TSDB_MAX_COLUMNS
+
TSDB_MAX_TAGS
))
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_ID
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
bytes
<=
0
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_BYTES
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
if
(
pSchema
->
name
[
0
]
==
0
)
{
terrno
=
TSDB_CODE_MND_
STB_INVALID_COL_NAME
;
terrno
=
TSDB_CODE_MND_
INVALID_STB_OPTION
;
return
-
1
;
}
...
...
@@ -495,7 +502,7 @@ static int32_t mndProcessStbMetaMsg(SMnodeMsg *pMsg) {
SStbObj
*
pStb
=
mndAcquireStb
(
pMnode
,
pInfo
->
name
);
if
(
pStb
==
NULL
)
{
mndReleaseDb
(
pMnode
,
pDb
);
terrno
=
TSDB_CODE_MND_INVALID_
TABLE_NAME
;
terrno
=
TSDB_CODE_MND_INVALID_
STB
;
mError
(
"stb:%s, failed to get meta since %s"
,
pInfo
->
name
,
terrstr
());
return
-
1
;
}
...
...
@@ -583,14 +590,14 @@ static int32_t mndGetStbMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *pM
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_
SMALL
INT
;
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
[
cols
].
name
,
"columns"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_
SMALL
INT
;
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
[
cols
].
name
,
"tags"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
source/util/src/terror.c
浏览文件 @
ff645300
...
...
@@ -217,22 +217,20 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_VGROUP_NOT_EXIST, "VGroup does not exist
// mnode-stable
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_STB_ALREADY_EXIST
,
"Stable already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_ID
,
"Table name too long"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_NAME
,
"Table does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_TYPE
,
"Invalid table type in tsdb"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_STB_NOT_EXIST
,
"Stable not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_STBS
,
"Too many stables"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_STB
,
"Invalid stable name"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_STB_OPTION
,
"Invalid stable options"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_STB_OPTION_UNCHNAGED
,
"Stable options not changed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TAGS
,
"Too many tags"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_COLUMNS
,
"Too many columns"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TIMESERIES
,
"Too many time series"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_SUPER_TABLE
,
"Not super table"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_COL_NAME_TOO_LONG
,
"Tag name too long"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_ALREAY_EXIST
,
"Tag already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_NOT_EXIST
,
"Tag does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FIELD_ALREAY_EXIST
,
"Field already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FIELD_NOT_EXIST
,
"Field does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_STABLE_NAME
,
"Super table does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_CREATE_TABLE_MSG
,
"Invalid create table message"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_COLUMNS
,
"Too many columns"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_COLUMN_ALREAY_EXIST
,
"Column already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_COLUMN_NOT_EXIST
,
"Column does not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_EXCEED_MAX_ROW_BYTES
,
"Exceed max row bytes"
)
// mnode-func
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FUNC_ALREADY_EXIST
,
"Func already exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FUNC_NOT_EXIST
,
"Func not exists"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_FUNC
,
"Invalid func"
)
...
...
@@ -241,9 +239,6 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_FUNC_COMMENT, "Invalid func comment"
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_FUNC_CODE
,
"Invalid func code"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_FUNC_BUFSIZE
,
"Invalid func bufSize"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TAG_LENGTH
,
"invalid tag length"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_COLUMN_LENGTH
,
"invalid column length"
)
// dnode
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_ACTION_IN_PROGRESS
,
"Action in progress"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_DND_EXITING
,
"Dnode is exiting"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录