Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
013c3820
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,发现更多精彩内容 >>
未验证
提交
013c3820
编写于
6月 25, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
6月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14251 from taosdata/fix/tsim
feat: privilege for sysinfo user
上级
501bec87
225f2837
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
151 addition
and
70 deletion
+151
-70
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+2
-4
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
+7
-5
source/dnode/mnode/impl/inc/mndPrivilege.h
source/dnode/mnode/impl/inc/mndPrivilege.h
+4
-2
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+17
-10
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+5
-1
source/dnode/mnode/impl/src/mndPrivilege.c
source/dnode/mnode/impl/src/mndPrivilege.c
+31
-10
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+4
-0
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+8
-2
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+28
-32
tests/script/tsim/stream/distributeInterval0.sim
tests/script/tsim/stream/distributeInterval0.sim
+24
-0
tests/script/tsim/user/privilege_sysinfo.sim
tests/script/tsim/user/privilege_sysinfo.sim
+20
-1
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+1
-3
未找到文件。
include/libs/transport/trpc.h
浏览文件 @
013c3820
...
...
@@ -34,10 +34,8 @@ extern int32_t tsRpcHeadSize;
typedef
struct
{
uint32_t
clientIp
;
uint16_t
clientPort
;
union
{
char
user
[
TSDB_USER_LEN
];
int64_t
applyIndex
;
};
int64_t
applyIndex
;
char
user
[
TSDB_USER_LEN
];
}
SRpcConnInfo
;
typedef
struct
SRpcHandleInfo
{
...
...
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
浏览文件 @
013c3820
...
...
@@ -247,11 +247,9 @@ int32_t dmAppendVariablesToBlock(SSDataBlock* pBlock, int32_t dnodeId) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
dmProcessRetrieve
(
SDnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
int32_t
size
=
0
;
int32_t
rowsRead
=
0
;
int32_t
size
=
0
;
int32_t
rowsRead
=
0
;
SRetrieveTableReq
retrieveReq
=
{
0
};
if
(
tDeserializeSRetrieveTableReq
(
pMsg
->
pCont
,
pMsg
->
contLen
,
&
retrieveReq
)
!=
0
)
{
...
...
@@ -259,6 +257,11 @@ int32_t dmProcessRetrieve(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
-
1
;
}
if
(
strcmp
(
retrieveReq
.
user
,
TSDB_DEFAULT_USER
)
!=
0
)
{
terrno
=
TSDB_CODE_MND_NO_RIGHTS
;
return
-
1
;
}
if
(
strcasecmp
(
retrieveReq
.
tb
,
TSDB_INS_TABLE_DNODE_VARIABLES
))
{
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
...
...
@@ -309,7 +312,6 @@ int32_t dmProcessRetrieve(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
return
TSDB_CODE_SUCCESS
;
}
SArray
*
dmGetMsgHandles
()
{
int32_t
code
=
-
1
;
SArray
*
pArray
=
taosArrayInit
(
16
,
sizeof
(
SMgmtHandle
));
...
...
source/dnode/mnode/impl/inc/mndPrivilege.h
浏览文件 @
013c3820
...
...
@@ -57,6 +57,8 @@ typedef enum {
MND_OPER_USE_DB
,
MND_OPER_WRITE_DB
,
MND_OPER_READ_DB
,
MND_OPER_READ_OR_WRITE_DB
,
MND_OPER_SHOW_VARIBALES
,
}
EOperType
;
int32_t
mndInitPrivilege
(
SMnode
*
pMnode
);
...
...
@@ -64,8 +66,8 @@ void mndCleanupPrivilege(SMnode *pMnode);
int32_t
mndCheckOperPrivilege
(
SMnode
*
pMnode
,
const
char
*
user
,
EOperType
operType
);
int32_t
mndCheckDbPrivilege
(
SMnode
*
pMnode
,
const
char
*
user
,
EOperType
operType
,
SDbObj
*
pDb
);
int32_t
mndCheckDbPrivilegeByName
(
SMnode
*
pMnode
,
const
char
*
user
,
EOperType
operType
,
const
char
*
name
);
int32_t
mndCheckShowPrivilege
(
SMnode
*
pMnode
,
const
char
*
user
,
int32_t
showTyp
e
);
int32_t
mndCheckDbPrivilegeByName
(
SMnode
*
pMnode
,
const
char
*
user
,
EOperType
operType
,
const
char
*
db
name
);
int32_t
mndCheckShowPrivilege
(
SMnode
*
pMnode
,
const
char
*
user
,
EShowType
showType
,
const
char
*
dbnam
e
);
int32_t
mndCheckAlterUserPrivilege
(
SUserObj
*
pOperUser
,
SUserObj
*
pUser
,
SAlterUserReq
*
pAlter
);
#ifdef __cplusplus
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
013c3820
...
...
@@ -15,9 +15,9 @@
#define _DEFAULT_SOURCE
#include "mndDb.h"
#include "mndPrivilege.h"
#include "mndDnode.h"
#include "mndOffset.h"
#include "mndPrivilege.h"
#include "mndShow.h"
#include "mndSma.h"
#include "mndStb.h"
...
...
@@ -1336,7 +1336,7 @@ char *buildRetension(SArray *pRetension) {
}
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
,
bool
sysDb
,
ESdbStatus
objStatus
)
{
bool
sysDb
,
ESdbStatus
objStatus
,
bool
sysinfo
)
{
int32_t
cols
=
0
;
int32_t
bytes
=
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
;
...
...
@@ -1354,7 +1354,7 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
char
statusB
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
statusB
,
status
,
strlen
(
status
));
if
(
sysDb
)
{
if
(
sysDb
||
!
sysinfo
)
{
for
(
int32_t
i
=
0
;
i
<
pShow
->
numOfColumns
;
++
i
)
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
if
(
i
==
0
)
{
...
...
@@ -1528,17 +1528,21 @@ static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
SDbObj
*
pDb
=
NULL
;
ESdbStatus
objStatus
=
0
;
SUserObj
*
pUser
=
mndAcquireUser
(
pMnode
,
pReq
->
info
.
conn
.
user
);
if
(
pUser
==
NULL
)
return
0
;
bool
sysinfo
=
pUser
->
sysInfo
;
// Append the information_schema database into the result.
if
(
!
pShow
->
sysDbRsp
)
{
SDbObj
infoschemaDb
=
{
0
};
setInformationSchemaDbCfg
(
&
infoschemaDb
);
dumpDbInfoData
(
pBlock
,
&
infoschemaDb
,
pShow
,
numOfRows
,
14
,
true
,
0
);
dumpDbInfoData
(
pBlock
,
&
infoschemaDb
,
pShow
,
numOfRows
,
14
,
true
,
0
,
1
);
numOfRows
+=
1
;
SDbObj
perfschemaDb
=
{
0
};
setPerfSchemaDbCfg
(
&
perfschemaDb
);
dumpDbInfoData
(
pBlock
,
&
perfschemaDb
,
pShow
,
numOfRows
,
3
,
true
,
0
);
dumpDbInfoData
(
pBlock
,
&
perfschemaDb
,
pShow
,
numOfRows
,
3
,
true
,
0
,
1
);
numOfRows
+=
1
;
pShow
->
sysDbRsp
=
true
;
...
...
@@ -1550,16 +1554,19 @@ static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
break
;
}
int32_t
numOfTables
=
0
;
sdbTraverse
(
pSdb
,
SDB_VGROUP
,
mndGetTablesOfDbFp
,
&
numOfTables
,
NULL
,
NULL
);
if
(
mndCheckDbPrivilege
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_READ_OR_WRITE_DB
,
pDb
)
==
0
)
{
int32_t
numOfTables
=
0
;
sdbTraverse
(
pSdb
,
SDB_VGROUP
,
mndGetTablesOfDbFp
,
&
numOfTables
,
NULL
,
NULL
);
dumpDbInfoData
(
pBlock
,
pDb
,
pShow
,
numOfRows
,
numOfTables
,
false
,
objStatus
,
sysinfo
);
numOfRows
++
;
}
dumpDbInfoData
(
pBlock
,
pDb
,
pShow
,
numOfRows
,
numOfTables
,
false
,
objStatus
);
numOfRows
++
;
sdbRelease
(
pSdb
,
pDb
);
}
pShow
->
numOfRows
+=
numOfRows
;
mndReleaseUser
(
pMnode
,
pUser
);
return
numOfRows
;
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
013c3820
...
...
@@ -558,7 +558,11 @@ _OVER:
static
int32_t
mndProcessShowVariablesReq
(
SRpcMsg
*
pReq
)
{
SShowVariablesRsp
rsp
=
{
0
};
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
if
(
mndCheckOperPrivilege
(
pReq
->
info
.
node
,
pReq
->
info
.
conn
.
user
,
MND_OPER_SHOW_VARIBALES
)
!=
0
)
{
goto
_OVER
;
}
rsp
.
variables
=
taosArrayInit
(
4
,
sizeof
(
SVariablesInfo
));
if
(
NULL
==
rsp
.
variables
)
{
...
...
source/dnode/mnode/impl/src/mndPrivilege.c
浏览文件 @
013c3820
...
...
@@ -15,8 +15,8 @@
#define _DEFAULT_SOURCE
#include "mndPrivilege.h"
#include "mndUser.h"
#include "mndDb.h"
#include "mndUser.h"
int32_t
mndInitPrivilege
(
SMnode
*
pMnode
)
{
return
0
;
}
...
...
@@ -46,6 +46,7 @@ int32_t mndCheckOperPrivilege(SMnode *pMnode, const char *user, EOperType operTy
case
MND_OPER_CONNECT
:
case
MND_OPER_CREATE_FUNC
:
case
MND_OPER_DROP_FUNC
:
case
MND_OPER_SHOW_VARIBALES
:
break
;
default:
terrno
=
TSDB_CODE_MND_NO_RIGHTS
;
...
...
@@ -80,7 +81,7 @@ int32_t mndCheckAlterUserPrivilege(SUserObj *pOperUser, SUserObj *pUser, SAlterU
return
-
1
;
}
int32_t
mndCheckShowPrivilege
(
SMnode
*
pMnode
,
const
char
*
user
,
int32_t
showTyp
e
)
{
int32_t
mndCheckShowPrivilege
(
SMnode
*
pMnode
,
const
char
*
user
,
EShowType
showType
,
const
char
*
dbnam
e
)
{
int32_t
code
=
0
;
SUserObj
*
pUser
=
mndAcquireUser
(
pMnode
,
user
);
...
...
@@ -99,14 +100,34 @@ int32_t mndCheckShowPrivilege(SMnode *pMnode, const char *user, int32_t showType
goto
_OVER
;
}
if
(
!
pUser
->
sysInfo
)
{
terrno
=
TSDB_CODE_MND_NO_RIGHTS
;
code
=
-
1
;
if
(
pUser
->
sysInfo
)
{
goto
_OVER
;
}
terrno
=
TSDB_CODE_MND_NO_RIGHTS
;
code
=
-
1
;
switch
(
showType
)
{
case
TSDB_MGMT_TABLE_DB
:
case
TSDB_MGMT_TABLE_STB
:
case
TSDB_MGMT_TABLE_INDEX
:
case
TSDB_MGMT_TABLE_STREAMS
:
case
TSDB_MGMT_TABLE_CONSUMERS
:
case
TSDB_MGMT_TABLE_TOPICS
:
case
TSDB_MGMT_TABLE_SUBSCRIPTIONS
:
case
TSDB_MGMT_TABLE_FUNC
:
case
TSDB_MGMT_TABLE_QUERIES
:
case
TSDB_MGMT_TABLE_CONNS
:
case
TSDB_MGMT_TABLE_APPS
:
case
TSDB_MGMT_TABLE_TRANS
:
code
=
0
;
break
;
default:
terrno
=
TSDB_CODE_MND_NO_RIGHTS
;
code
=
-
1
;
goto
_OVER
;
}
if
(
showType
==
TSDB_MGMT_TABLE_STB
||
showType
==
TSDB_MGMT_TABLE_VGROUP
||
showType
==
TSDB_MGMT_TABLE_INDEX
)
{
code
=
mndCheckDbPrivilegeByName
(
pMnode
,
user
,
MND_OPER_READ_OR_WRITE_DB
,
dbname
);
}
_OVER:
mndReleaseUser
(
pMnode
,
pUser
);
...
...
@@ -138,7 +159,7 @@ int32_t mndCheckDbPrivilege(SMnode *pMnode, const char *user, EOperType operType
if
(
strcmp
(
pUser
->
user
,
pDb
->
createUser
)
==
0
&&
pUser
->
sysInfo
)
goto
_OVER
;
}
if
(
operType
==
MND_OPER_USE_DB
)
{
if
(
operType
==
MND_OPER_USE_DB
||
operType
==
MND_OPER_READ_OR_WRITE_DB
)
{
if
(
strcmp
(
pUser
->
user
,
pDb
->
createUser
)
==
0
)
goto
_OVER
;
if
(
taosHashGet
(
pUser
->
readDbs
,
pDb
->
name
,
strlen
(
pDb
->
name
)
+
1
)
!=
NULL
)
goto
_OVER
;
if
(
taosHashGet
(
pUser
->
writeDbs
,
pDb
->
name
,
strlen
(
pDb
->
name
)
+
1
)
!=
NULL
)
goto
_OVER
;
...
...
@@ -162,8 +183,8 @@ _OVER:
return
code
;
}
int32_t
mndCheckDbPrivilegeByName
(
SMnode
*
pMnode
,
const
char
*
user
,
EOperType
operType
,
const
char
*
name
)
{
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
name
);
int32_t
mndCheckDbPrivilegeByName
(
SMnode
*
pMnode
,
const
char
*
user
,
EOperType
operType
,
const
char
*
db
name
)
{
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
db
name
);
if
(
pDb
==
NULL
)
return
-
1
;
int32_t
code
=
mndCheckDbPrivilege
(
pMnode
,
user
,
operType
,
pDb
);
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
013c3820
...
...
@@ -254,6 +254,10 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
terrstr
());
goto
_OVER
;
}
if
(
mndCheckDbPrivilege
(
pMnode
,
pReq
->
info
.
conn
.
user
,
MND_OPER_READ_OR_WRITE_DB
,
pDb
)
!=
0
)
{
goto
_OVER
;
}
}
pConn
=
mndCreateConn
(
pMnode
,
pReq
->
info
.
conn
.
user
,
connReq
.
connType
,
pReq
->
info
.
conn
.
clientIp
,
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
013c3820
...
...
@@ -231,8 +231,14 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) {
}
mDebug
(
"show:0x%"
PRIx64
", start retrieve data, type:%d"
,
pShow
->
id
,
pShow
->
type
);
// if (mndCheckShowPrivilege(pMnode, pReq->info.conn.user, pShow->type) != 0) return -1;
if
(
retrieveReq
.
user
[
0
]
!=
0
)
{
memcpy
(
pReq
->
info
.
conn
.
user
,
retrieveReq
.
user
,
TSDB_USER_LEN
);
}
else
{
memcpy
(
pReq
->
info
.
conn
.
user
,
TSDB_DEFAULT_USER
,
TSDB_USER_LEN
);
}
if
(
mndCheckShowPrivilege
(
pMnode
,
pReq
->
info
.
conn
.
user
,
pShow
->
type
,
retrieveReq
.
db
)
!=
0
)
{
return
-
1
;
}
int32_t
numOfCols
=
pShow
->
pMeta
->
numOfColumns
;
SSDataBlock
*
pBlock
=
taosMemoryCalloc
(
1
,
sizeof
(
SSDataBlock
));
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
013c3820
...
...
@@ -15,12 +15,12 @@
#define _DEFAULT_SOURCE
#include "mndStb.h"
#include "mndPrivilege.h"
#include "mndDb.h"
#include "mndDnode.h"
#include "mndInfoSchema.h"
#include "mndMnode.h"
#include "mndPerfSchema.h"
#include "mndPrivilege.h"
#include "mndScheduler.h"
#include "mndShow.h"
#include "mndSma.h"
...
...
@@ -107,7 +107,7 @@ SSdbRaw *mndStbActionEncode(SStbObj *pStb) {
int32_t
funcNum
=
taosArrayGetSize
(
pStb
->
pFuncs
);
SDB_SET_INT32
(
pRaw
,
dataPos
,
funcNum
,
_OVER
)
for
(
int32_t
i
=
0
;
i
<
funcNum
;
++
i
)
{
char
*
func
=
taosArrayGet
(
pStb
->
pFuncs
,
i
);
char
*
func
=
taosArrayGet
(
pStb
->
pFuncs
,
i
);
SDB_SET_BINARY
(
pRaw
,
dataPos
,
func
,
TSDB_FUNC_NAME_LEN
,
_OVER
)
}
...
...
@@ -708,7 +708,7 @@ int32_t mndBuildStbFromReq(SMnode *pMnode, SStbObj *pDst, SMCreateStbReq *pCreat
pDst
->
commentLen
=
pCreate
->
commentLen
;
pDst
->
pFuncs
=
pCreate
->
pFuncs
;
pCreate
->
pFuncs
=
NULL
;
if
(
pDst
->
commentLen
>
0
)
{
pDst
->
comment
=
taosMemoryCalloc
(
pDst
->
commentLen
+
1
,
1
);
if
(
pDst
->
comment
==
NULL
)
{
...
...
@@ -1391,12 +1391,11 @@ static int32_t mndBuildStbCfgImp(SDbObj *pDb, SStbObj *pStb, const char *tbName,
if
(
pStb
->
pFuncs
)
{
pRsp
->
pFuncs
=
taosArrayDup
(
pStb
->
pFuncs
);
}
taosRUnLockLatch
(
&
pStb
->
lock
);
return
0
;
}
static
int32_t
mndBuildStbSchema
(
SMnode
*
pMnode
,
const
char
*
dbFName
,
const
char
*
tbName
,
STableMetaRsp
*
pRsp
,
int32_t
*
smaVer
)
{
char
tbFName
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
...
...
@@ -1426,30 +1425,28 @@ static int32_t mndBuildStbSchema(SMnode *pMnode, const char *dbFName, const char
}
static
int32_t
mndBuildStbCfg
(
SMnode
*
pMnode
,
const
char
*
dbFName
,
const
char
*
tbName
,
STableCfgRsp
*
pRsp
)
{
char
tbFName
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
snprintf
(
tbFName
,
sizeof
(
tbFName
),
"%s.%s"
,
dbFName
,
tbName
);
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
dbFName
);
if
(
pDb
==
NULL
)
{
terrno
=
TSDB_CODE_MND_DB_NOT_SELECTED
;
return
-
1
;
}
SStbObj
*
pStb
=
mndAcquireStb
(
pMnode
,
tbFName
);
if
(
pStb
==
NULL
)
{
mndReleaseDb
(
pMnode
,
pDb
);
terrno
=
TSDB_CODE_PAR_TABLE_NOT_EXIST
;
return
-
1
;
}
int32_t
code
=
mndBuildStbCfgImp
(
pDb
,
pStb
,
tbName
,
pRsp
);
mndReleaseDb
(
pMnode
,
pDb
);
mndReleaseStb
(
pMnode
,
pStb
);
return
code
;
}
char
tbFName
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
snprintf
(
tbFName
,
sizeof
(
tbFName
),
"%s.%s"
,
dbFName
,
tbName
);
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
dbFName
);
if
(
pDb
==
NULL
)
{
terrno
=
TSDB_CODE_MND_DB_NOT_SELECTED
;
return
-
1
;
}
SStbObj
*
pStb
=
mndAcquireStb
(
pMnode
,
tbFName
);
if
(
pStb
==
NULL
)
{
mndReleaseDb
(
pMnode
,
pDb
);
terrno
=
TSDB_CODE_PAR_TABLE_NOT_EXIST
;
return
-
1
;
}
int32_t
code
=
mndBuildStbCfgImp
(
pDb
,
pStb
,
tbName
,
pRsp
);
mndReleaseDb
(
pMnode
,
pDb
);
mndReleaseStb
(
pMnode
,
pStb
);
return
code
;
}
static
int32_t
mndBuildSMAlterStbRsp
(
SDbObj
*
pDb
,
const
SMAlterStbReq
*
pAlter
,
SStbObj
*
pObj
,
void
**
pCont
,
int32_t
*
pLen
)
{
...
...
@@ -1811,10 +1808,10 @@ _OVER:
}
static
int32_t
mndProcessTableCfgReq
(
SRpcMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
int32_t
code
=
-
1
;
STableCfgReq
cfgReq
=
{
0
};
STableCfgRsp
cfgRsp
=
{
0
};
SMnode
*
pMnode
=
pReq
->
info
.
node
;
int32_t
code
=
-
1
;
STableCfgReq
cfgReq
=
{
0
};
STableCfgRsp
cfgRsp
=
{
0
};
if
(
tDeserializeSTableCfgReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
cfgReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
...
...
@@ -1866,7 +1863,6 @@ _OVER:
return
code
;
}
int32_t
mndValidateStbInfo
(
SMnode
*
pMnode
,
SSTableVersion
*
pStbVersions
,
int32_t
numOfStbs
,
void
**
ppRsp
,
int32_t
*
pRspLen
)
{
SSTbHbRsp
hbRsp
=
{
0
};
...
...
tests/script/tsim/stream/distributeInterval0.sim
浏览文件 @
013c3820
...
...
@@ -10,6 +10,30 @@ sql create dnode $hostname2 port 7200
system sh/exec.sh -n dnode2 -s start
print ===== step1
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
return -1
endi
if $data(1)[4] != ready then
goto step1
endi
if $data(2)[4] != ready then
goto step1
endi
print ===== step2
sql create database test vgroups 4;
sql use test;
sql create stable st(ts timestamp, a int, b int , c int, d double) tags(ta int,tb int,tc int);
...
...
tests/script/tsim/user/privilege_sysinfo.sim
浏览文件 @
013c3820
...
...
@@ -8,6 +8,7 @@ sql create user sysinfo0 pass 'taosdata'
sql create user sysinfo1 pass 'taosdata'
sql alter user sysinfo0 sysinfo 0
sql alter user sysinfo1 sysinfo 1
sql create database db
print user sysinfo0 login
sql close
...
...
@@ -39,6 +40,24 @@ sql_error kill connection 1
sql_error kill query 1
print =============== check db
sql_error create database db
sql_error create database d1
sql_error drop database db
sql_error use db
sql_error alter database db replica 1;
sql_error show db.vgroups
sql_error show db.stables
sql_error show db.tables
print =============== check show
sql_error show users
sql_error show cluster
sql_error show dnodes
sql_error show mnodes
sql_error show snodes
sql_error show qnodes
sql_error show bnodes
sql_error show grants
sql_error show dnode 1 variables;
sql show variables;
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tools/shell/src/shellEngine.c
浏览文件 @
013c3820
...
...
@@ -859,9 +859,7 @@ void shellGetGrantInfo() {
int32_t
code
=
taos_errno
(
tres
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
==
TSDB_CODE_OPS_NOT_SUPPORT
)
{
fprintf
(
stdout
,
"Server is Community Edition, %s
\n\n
"
,
sinfo
);
}
else
{
if
(
code
!=
TSDB_CODE_OPS_NOT_SUPPORT
&&
code
!=
TSDB_CODE_MND_NO_RIGHTS
)
{
fprintf
(
stderr
,
"Failed to check Server Edition, Reason:0x%04x:%s
\n\n
"
,
code
,
taos_errstr
(
tres
));
}
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录