Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2db42f58
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2db42f58
编写于
6月 08, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 08, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2191 from taosdata/coverity_scan
Coverity scan
上级
ae88f4af
03ee481d
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
22 addition
and
21 deletion
+22
-21
src/inc/taoserror.h
src/inc/taoserror.h
+11
-10
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+6
-6
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+2
-2
src/plugins/http/src/httpJson.c
src/plugins/http/src/httpJson.c
+1
-1
src/plugins/http/src/tgJson.c
src/plugins/http/src/tgJson.c
+1
-1
tests/script/general/http/restful_full.sim
tests/script/general/http/restful_full.sim
+1
-1
未找到文件。
src/inc/taoserror.h
浏览文件 @
2db42f58
...
...
@@ -136,16 +136,17 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_USERS, 0, 0x0355, "mnode too
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TABLE_ALREADY_EXIST
,
0
,
0x0360
,
"mnode table already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_ID
,
0
,
0x0361
,
"mnode invalid table id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_TYPE
,
0
,
0x0362
,
"mnode invalid table type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TAGS
,
0
,
0x0363
,
"mnode too many tags"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TABLES
,
0
,
0x0364
,
"mnode too many tables"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TIMESERIES
,
0
,
0x0365
,
"mnode not enough time series"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_SUPER_TABLE
,
0
,
0x0366
,
"mnode no super table"
)
// operation only available for super table
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_COL_NAME_TOO_LONG
,
0
,
0x0367
,
"mnode column name too long"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_ALREAY_EXIST
,
0
,
0x0368
,
"mnode tag already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_NOT_EXIST
,
0
,
0x0369
,
"mnode tag not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FIELD_ALREAY_EXIST
,
0
,
0x036A
,
"mnode field already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FIELD_NOT_EXIST
,
0
,
0x036B
,
"mnode field not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_NAME
,
0
,
0x0362
,
"mnode invalid table name"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_INVALID_TABLE_TYPE
,
0
,
0x0363
,
"mnode invalid table type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TAGS
,
0
,
0x0364
,
"mnode too many tags"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TABLES
,
0
,
0x0365
,
"mnode too many tables"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TOO_MANY_TIMESERIES
,
0
,
0x0366
,
"mnode not enough time series"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_NOT_SUPER_TABLE
,
0
,
0x0367
,
"mnode no super table"
)
// operation only available for super table
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_COL_NAME_TOO_LONG
,
0
,
0x0368
,
"mnode column name too long"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_ALREAY_EXIST
,
0
,
0x0369
,
"mnode tag already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_TAG_NOT_EXIST
,
0
,
0x036A
,
"mnode tag not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FIELD_ALREAY_EXIST
,
0
,
0x036B
,
"mnode field already exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_FIELD_NOT_EXIST
,
0
,
0x036C
,
"mnode field not exist"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_DB_NOT_SELECTED
,
0
,
0x0380
,
"mnode db not selected"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MND_DB_ALREADY_EXIST
,
0
,
0x0381
,
"mnode database aleady exist"
)
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
2db42f58
...
...
@@ -714,7 +714,7 @@ static int32_t mnodeProcessDropTableMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_SUCCESS
;
}
else
{
mError
(
"table:%s, failed to drop table, table not exist"
,
pDrop
->
tableId
);
return
TSDB_CODE_MND_INVALID_TABLE_
ID
;
return
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
}
}
...
...
@@ -742,7 +742,7 @@ static int32_t mnodeProcessTableMetaMsg(SMnodeMsg *pMsg) {
if
(
pMsg
->
pTable
==
NULL
)
{
if
(
!
pInfo
->
createFlag
)
{
mError
(
"table:%s, failed to get table meta, table not exist"
,
pInfo
->
tableId
);
return
TSDB_CODE_MND_INVALID_TABLE_
ID
;
return
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
}
else
{
mTrace
(
"table:%s, failed to get table meta, start auto create table "
,
pInfo
->
tableId
);
return
mnodeAutoCreateChildTable
(
pMsg
);
...
...
@@ -779,7 +779,7 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
if
(
pStable
->
schema
==
NULL
)
{
free
(
pStable
);
mError
(
"table:%s, failed to create, no schema input"
,
pCreate
->
tableId
);
return
TSDB_CODE_MND_INVALID_TABLE_
ID
;
return
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
}
memcpy
(
pStable
->
schema
,
pCreate
->
schema
,
numOfCols
*
sizeof
(
SSchema
));
...
...
@@ -1340,7 +1340,7 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
if
(
pRsp
->
numOfTables
!=
numOfTable
)
{
rpcFreeCont
(
pRsp
);
return
TSDB_CODE_MND_INVALID_TABLE_
ID
;
return
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
}
else
{
pRsp
->
numOfTables
=
htonl
(
pRsp
->
numOfTables
);
pMsg
->
rpcRsp
.
rsp
=
pRsp
;
...
...
@@ -1452,7 +1452,7 @@ static SChildTableObj* mnodeDoCreateChildTable(SCMCreateTableMsg *pCreate, SVgOb
if
(
pSuperTable
==
NULL
)
{
mError
(
"table:%s, corresponding super table:%s does not exist"
,
pCreate
->
tableId
,
pTagData
->
name
);
mnodeDestroyChildTable
(
pTable
);
terrno
=
TSDB_CODE_MND_INVALID_TABLE_
ID
;
terrno
=
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
return
NULL
;
}
mnodeDecTableRef
(
pSuperTable
);
...
...
@@ -2212,7 +2212,7 @@ static int32_t mnodeProcessAlterTableMsg(SMnodeMsg *pMsg) {
if
(
pMsg
->
pTable
==
NULL
)
pMsg
->
pTable
=
mnodeGetTable
(
pAlter
->
tableId
);
if
(
pMsg
->
pTable
==
NULL
)
{
mError
(
"table:%s, failed to alter table, table not exist"
,
pMsg
->
pTable
->
tableId
);
return
TSDB_CODE_MND_INVALID_TABLE_
ID
;
return
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
}
pAlter
->
type
=
htons
(
pAlter
->
type
);
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
2db42f58
...
...
@@ -383,11 +383,11 @@ int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
pTable
=
mnodeGetTable
(
pShow
->
payload
);
if
(
NULL
==
pTable
||
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
mnodeDecTableRef
(
pTable
);
return
TSDB_CODE_MND_INVALID_TABLE_
ID
;
return
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
}
mnodeDecTableRef
(
pTable
);
pVgroup
=
mnodeGetVgroup
(((
SChildTableObj
*
)
pTable
)
->
vgId
);
if
(
NULL
==
pVgroup
)
return
TSDB_CODE_MND_INVALID_TABLE_
ID
;
if
(
NULL
==
pVgroup
)
return
TSDB_CODE_MND_INVALID_TABLE_
NAME
;
mnodeDecVgroupRef
(
pVgroup
);
maxReplica
=
pVgroup
->
numOfVnodes
>
maxReplica
?
pVgroup
->
numOfVnodes
:
maxReplica
;
}
else
{
...
...
src/plugins/http/src/httpJson.c
浏览文件 @
2db42f58
...
...
@@ -445,7 +445,7 @@ void httpJsonPairStatus(JsonBuf* buf, int code) {
httpJsonItemToken
(
buf
);
if
(
code
==
TSDB_CODE_MND_DB_NOT_SELECTED
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create database"
,
23
);
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_
ID
)
{
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_
NAME
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create table"
,
22
);
}
else
httpJsonPair
(
buf
,
"desc"
,
4
,
(
char
*
)
tstrerror
(
code
),
(
int
)
strlen
(
tstrerror
(
code
)));
...
...
src/plugins/http/src/tgJson.c
浏览文件 @
2db42f58
...
...
@@ -111,7 +111,7 @@ bool tgCheckFinished(struct HttpContext *pContext, HttpSqlCmd *cmd, int code) {
pContext
->
ipstr
);
return
false
;
}
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_
ID
)
{
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_
NAME
)
{
cmd
->
cmdState
=
HTTP_CMD_STATE_RUN_FINISHED
;
if
(
multiCmds
->
cmds
[
multiCmds
->
pos
-
1
].
cmdState
==
HTTP_CMD_STATE_NOT_RUN_YET
)
{
multiCmds
->
pos
=
(
int16_t
)(
multiCmds
->
pos
-
2
);
...
...
tests/script/general/http/restful_full.sim
浏览文件 @
2db42f58
...
...
@@ -147,7 +147,7 @@ print =============== step3 - db
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d ' select * from d1.t1;' 127.0.0.1:6020/rest/sql
print 21-> $system_content
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid table
id
"}@ then
if $system_content != @{"status":"error","code":1000,"desc":"mnode invalid table
name
"}@ then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录