Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
TDengine
提交
e6df8151
TDengine
项目概览
lzh_me
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6df8151
编写于
6月 11, 2020
作者:
F
freemine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
un-hard-coded-username/password
上级
068cf108
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
45 addition
and
39 deletion
+45
-39
src/cq/test/cqtest.c
src/cq/test/cqtest.c
+2
-2
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+4
-2
src/mnode/src/mnodeAcct.c
src/mnode/src/mnodeAcct.c
+5
-3
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+6
-6
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+7
-7
src/mnode/src/mnodeMnode.c
src/mnode/src/mnodeMnode.c
+3
-1
src/mnode/src/mnodeProfile.c
src/mnode/src/mnodeProfile.c
+6
-6
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+10
-10
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+2
-2
未找到文件。
src/cq/test/cqtest.c
浏览文件 @
e6df8151
...
...
@@ -48,8 +48,8 @@ int main(int argc, char *argv[]) {
taosInitLog
(
"cq.log"
,
100000
,
10
);
SCqCfg
cqCfg
;
strcpy
(
cqCfg
.
user
,
"root"
);
strcpy
(
cqCfg
.
pass
,
"taosdata"
);
strcpy
(
cqCfg
.
user
,
tsDefaultUser
);
strcpy
(
cqCfg
.
pass
,
tsDefaultPass
);
cqCfg
.
vgId
=
2
;
cqCfg
.
cqWrite
=
writeToQueue
;
...
...
src/kit/taosdump/taosdump.c
浏览文件 @
e6df8151
...
...
@@ -34,6 +34,8 @@
#include "taosdef.h"
#include "tutil.h"
#include "tglobal.h"
#define COMMAND_SIZE 65536
#define DEFAULT_DUMP_FILE "taosdump.sql"
...
...
@@ -324,7 +326,7 @@ void taosFreeDbInfos();
int
main
(
int
argc
,
char
*
argv
[])
{
SDumpArguments
arguments
=
{
// connection option
NULL
,
"root"
,
"taosdata"
,
0
,
NULL
,
tsDefaultUser
,
tsDefaultPass
,
0
,
// output file
DEFAULT_DUMP_FILE
,
DEFAULT_DUMP_FILE
,
NULL
,
// dump unit option
...
...
@@ -502,7 +504,7 @@ int taosDumpOut(SDumpArguments *arguments) {
}
strncpy
(
dbInfos
[
count
]
->
name
,
(
char
*
)
row
[
TSDB_SHOW_DB_NAME_INDEX
],
fields
[
TSDB_SHOW_DB_NAME_INDEX
].
bytes
);
if
(
strcmp
(
arguments
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
arguments
->
user
,
tsDefaultUser
)
==
0
)
{
dbInfos
[
count
]
->
replica
=
(
int
)(
*
((
int16_t
*
)
row
[
TSDB_SHOW_DB_REPLICA_INDEX
]));
dbInfos
[
count
]
->
days
=
(
int
)(
*
((
int16_t
*
)
row
[
TSDB_SHOW_DB_DAYS_INDEX
]));
dbInfos
[
count
]
->
keep
=
*
((
int
*
)
row
[
TSDB_SHOW_DB_KEEP_INDEX
]);
...
...
src/mnode/src/mnodeAcct.c
浏览文件 @
e6df8151
...
...
@@ -25,6 +25,8 @@
#include "mnodeSdb.h"
#include "mnodeUser.h"
#include "tglobal.h"
void
*
tsAcctSdb
=
NULL
;
static
int32_t
tsAcctUpdateSize
;
static
int32_t
mnodeCreateRootAcct
();
...
...
@@ -171,8 +173,8 @@ static int32_t mnodeCreateRootAcct() {
SAcctObj
*
pAcct
=
malloc
(
sizeof
(
SAcctObj
));
memset
(
pAcct
,
0
,
sizeof
(
SAcctObj
));
strcpy
(
pAcct
->
user
,
"root"
);
taosEncryptPass
((
uint8_t
*
)
"taosdata"
,
strlen
(
"taosdata"
),
pAcct
->
pass
);
strcpy
(
pAcct
->
user
,
tsDefaultUser
);
taosEncryptPass
((
uint8_t
*
)
tsDefaultPass
,
strlen
(
tsDefaultPass
),
pAcct
->
pass
);
pAcct
->
cfg
=
(
SAcctCfg
){
.
maxUsers
=
10
,
.
maxDbs
=
64
,
...
...
@@ -204,4 +206,4 @@ int32_t acctInit() { return TSDB_CODE_SUCCESS; }
void
acctCleanUp
()
{}
int32_t
acctCheck
(
void
*
pAcct
,
EAcctGrantType
type
)
{
return
TSDB_CODE_SUCCESS
;
}
#endif
\ No newline at end of file
#endif
src/mnode/src/mnodeDb.c
浏览文件 @
e6df8151
...
...
@@ -472,7 +472,7 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn
cols
++
;
#ifndef __CLOUD_VERSION__
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
#endif
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
...
...
@@ -484,7 +484,7 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn
#endif
#ifndef __CLOUD_VERSION__
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
#endif
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
...
...
@@ -508,7 +508,7 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn
cols
++
;
#ifndef __CLOUD_VERSION__
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
#endif
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
...
...
@@ -622,7 +622,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
cols
++
;
#ifndef __CLOUD_VERSION__
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
#endif
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
*
(
int32_t
*
)
pWrite
=
pDb
->
numOfVgroups
;
...
...
@@ -632,7 +632,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
#endif
#ifndef __CLOUD_VERSION__
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
#endif
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
*
(
int16_t
*
)
pWrite
=
pDb
->
cfg
.
replications
;
...
...
@@ -653,7 +653,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void
cols
++
;
#ifndef __CLOUD_VERSION__
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
#endif
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
*
(
int32_t
*
)
pWrite
=
pDb
->
cfg
.
maxTables
;
// table num can be created should minus 1
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
e6df8151
...
...
@@ -250,7 +250,7 @@ static int32_t mnodeProcessCfgDnodeMsg(SMnodeMsg *pMsg) {
// TODO temporary disabled for compiling: strcpy(pCmCfgDnode->ep, pCmCfgDnode->ep);
}
if
(
strcmp
(
pMsg
->
pUser
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pMsg
->
pUser
->
user
,
tsDefaultUser
)
!=
0
)
{
return
TSDB_CODE_MND_NO_RIGHTS
;
}
...
...
@@ -447,7 +447,7 @@ static int32_t mnodeDropDnodeByEp(char *ep) {
static
int32_t
mnodeProcessCreateDnodeMsg
(
SMnodeMsg
*
pMsg
)
{
SCMCreateDnodeMsg
*
pCreate
=
pMsg
->
rpcMsg
.
pCont
;
if
(
strcmp
(
pMsg
->
pUser
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pMsg
->
pUser
->
user
,
tsDefaultUser
)
!=
0
)
{
return
TSDB_CODE_MND_NO_RIGHTS
;
}
else
{
int32_t
code
=
mnodeCreateDnode
(
pCreate
->
ep
);
...
...
@@ -467,7 +467,7 @@ static int32_t mnodeProcessCreateDnodeMsg(SMnodeMsg *pMsg) {
static
int32_t
mnodeProcessDropDnodeMsg
(
SMnodeMsg
*
pMsg
)
{
SCMDropDnodeMsg
*
pDrop
=
pMsg
->
rpcMsg
.
pCont
;
if
(
strcmp
(
pMsg
->
pUser
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pMsg
->
pUser
->
user
,
tsDefaultUser
)
!=
0
)
{
return
TSDB_CODE_MND_NO_RIGHTS
;
}
else
{
int32_t
code
=
mnodeDropDnodeByEp
(
pDrop
->
ep
);
...
...
@@ -486,7 +486,7 @@ static int32_t mnodeGetDnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pUser
->
pAcct
->
user
,
tsDefaultUser
)
!=
0
)
{
mnodeDecUserRef
(
pUser
);
return
TSDB_CODE_MND_NO_RIGHTS
;
}
...
...
@@ -615,7 +615,7 @@ static int32_t mnodeGetModuleMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
{
mnodeDecUserRef
(
pUser
);
return
TSDB_CODE_MND_NO_RIGHTS
;
}
...
...
@@ -725,7 +725,7 @@ static int32_t mnodeGetConfigMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
{
mnodeDecUserRef
(
pUser
);
return
TSDB_CODE_MND_NO_RIGHTS
;
}
...
...
@@ -812,7 +812,7 @@ static int32_t mnodeGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
{
mnodeDecUserRef
(
pUser
);
return
TSDB_CODE_MND_NO_RIGHTS
;
}
...
...
src/mnode/src/mnodeMnode.c
浏览文件 @
e6df8151
...
...
@@ -31,6 +31,8 @@
#include "mnodeShow.h"
#include "mnodeUser.h"
#include "tglobal.h"
static
void
*
tsMnodeSdb
=
NULL
;
static
int32_t
tsMnodeUpdateSize
=
0
;
static
SRpcIpSet
tsMnodeIpSetForShell
;
...
...
@@ -333,7 +335,7 @@ static int32_t mnodeGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
pAcct
->
user
,
"root"
)
!=
0
)
{
if
(
strcmp
(
pUser
->
pAcct
->
user
,
tsDefaultUser
)
!=
0
)
{
mnodeDecUserRef
(
pUser
);
return
TSDB_CODE_MND_NO_RIGHTS
;
}
...
...
src/mnode/src/mnodeProfile.c
浏览文件 @
e6df8151
...
...
@@ -168,7 +168,7 @@ static void *mnodeGetNextConn(SHashMutableIterator *pIter, SConnObj **pConn) {
static
int32_t
mnodeGetConnsMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
@@ -282,7 +282,7 @@ int32_t mnodeSaveQueryStreamList(SConnObj *pConn, SCMHeartBeatMsg *pHBMsg) {
static
int32_t
mnodeGetQueryMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
@@ -391,7 +391,7 @@ static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, v
static
int32_t
mnodeGetStreamMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
)
{
SUserObj
*
pUser
=
mnodeGetUserFromConn
(
pConn
);
if
(
pUser
==
NULL
)
return
0
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
schema
;
...
...
@@ -519,7 +519,7 @@ static int32_t mnodeRetrieveStreams(SShowObj *pShow, char *data, int32_t rows, v
static
int32_t
mnodeProcessKillQueryMsg
(
SMnodeMsg
*
pMsg
)
{
SUserObj
*
pUser
=
pMsg
->
pUser
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
SCMKillQueryMsg
*
pKill
=
pMsg
->
rpcMsg
.
pCont
;
mPrint
(
"kill query msg is received, queryId:%s"
,
pKill
->
queryId
);
...
...
@@ -549,7 +549,7 @@ static int32_t mnodeProcessKillQueryMsg(SMnodeMsg *pMsg) {
static
int32_t
mnodeProcessKillStreamMsg
(
SMnodeMsg
*
pMsg
)
{
SUserObj
*
pUser
=
pMsg
->
pUser
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
SCMKillQueryMsg
*
pKill
=
pMsg
->
rpcMsg
.
pCont
;
mPrint
(
"kill stream msg is received, streamId:%s"
,
pKill
->
queryId
);
...
...
@@ -579,7 +579,7 @@ static int32_t mnodeProcessKillStreamMsg(SMnodeMsg *pMsg) {
static
int32_t
mnodeProcessKillConnectionMsg
(
SMnodeMsg
*
pMsg
)
{
SUserObj
*
pUser
=
pMsg
->
pUser
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
!=
0
)
return
TSDB_CODE_MND_NO_RIGHTS
;
SCMKillConnMsg
*
pKill
=
pMsg
->
rpcMsg
.
pCont
;
SConnObj
*
pConn
=
taosCacheAcquireByName
(
tsMnodeConnCache
,
pKill
->
queryId
);
...
...
src/mnode/src/mnodeUser.c
浏览文件 @
e6df8151
...
...
@@ -103,8 +103,8 @@ static int32_t mnodeUserActionDecode(SSdbOper *pOper) {
static
int32_t
mnodeUserActionRestored
()
{
if
(
dnodeIsFirstDeploy
())
{
SAcctObj
*
pAcct
=
mnodeGetAcct
(
"root"
);
mnodeCreateUser
(
pAcct
,
"root"
,
"taosdata"
);
SAcctObj
*
pAcct
=
mnodeGetAcct
(
tsDefaultUser
);
mnodeCreateUser
(
pAcct
,
tsDefaultUser
,
tsDefaultPass
);
mnodeCreateUser
(
pAcct
,
"monitor"
,
tsInternalPass
);
mnodeCreateUser
(
pAcct
,
"_root"
,
tsInternalPass
);
mnodeDecAcctRef
(
pAcct
);
...
...
@@ -218,7 +218,7 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass) {
pUser
->
createdTime
=
taosGetTimestampMs
();
pUser
->
superAuth
=
0
;
pUser
->
writeAuth
=
1
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
||
strcmp
(
pUser
->
user
,
pUser
->
acct
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
||
strcmp
(
pUser
->
user
,
pUser
->
acct
)
==
0
)
{
pUser
->
superAuth
=
1
;
}
...
...
@@ -392,12 +392,12 @@ static int32_t mnodeProcessAlterUserMsg(SMnodeMsg *pMsg) {
if
((
pAlter
->
flag
&
TSDB_ALTER_USER_PASSWD
)
!=
0
)
{
bool
hasRight
=
false
;
if
(
strcmp
(
pOperUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pOperUser
->
user
,
tsDefaultUser
)
==
0
)
{
hasRight
=
true
;
}
else
if
(
strcmp
(
pUser
->
user
,
pOperUser
->
user
)
==
0
)
{
hasRight
=
true
;
}
else
if
(
pOperUser
->
superAuth
)
{
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
strcmp
(
pOperUser
->
acct
,
pUser
->
acct
)
!=
0
)
{
hasRight
=
false
;
...
...
@@ -418,16 +418,16 @@ static int32_t mnodeProcessAlterUserMsg(SMnodeMsg *pMsg) {
}
else
if
((
pAlter
->
flag
&
TSDB_ALTER_USER_PRIVILEGES
)
!=
0
)
{
bool
hasRight
=
false
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
strcmp
(
pUser
->
user
,
pUser
->
acct
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
strcmp
(
pOperUser
->
user
,
"root"
)
==
0
)
{
}
else
if
(
strcmp
(
pOperUser
->
user
,
tsDefaultUser
)
==
0
)
{
hasRight
=
true
;
}
else
if
(
strcmp
(
pUser
->
user
,
pOperUser
->
user
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
pOperUser
->
superAuth
)
{
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
strcmp
(
pOperUser
->
acct
,
pUser
->
acct
)
!=
0
)
{
hasRight
=
false
;
...
...
@@ -482,9 +482,9 @@ static int32_t mnodeProcessDropUserMsg(SMnodeMsg *pMsg) {
}
bool
hasRight
=
false
;
if
(
strcmp
(
pUser
->
user
,
"root"
)
==
0
)
{
if
(
strcmp
(
pUser
->
user
,
tsDefaultUser
)
==
0
)
{
hasRight
=
false
;
}
else
if
(
strcmp
(
pOperUser
->
user
,
"root"
)
==
0
)
{
}
else
if
(
strcmp
(
pOperUser
->
user
,
tsDefaultUser
)
==
0
)
{
hasRight
=
true
;
}
else
if
(
strcmp
(
pUser
->
user
,
pOperUser
->
user
)
==
0
)
{
hasRight
=
false
;
...
...
src/plugins/monitor/src/monitorMain.c
浏览文件 @
e6df8151
...
...
@@ -177,8 +177,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) {
") tags (acctId binary(%d))"
,
tsMonitorDbName
,
TSDB_USER_LEN
+
1
);
}
else
if
(
cmd
==
MONITOR_CMD_CREATE_TB_ACCT_ROOT
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.acct_%s using %s.acct tags('%s')"
,
tsMonitorDbName
,
"root"
,
tsMonitorDbName
,
"root"
);
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.acct_%s using %s.acct tags('%s')"
,
tsMonitorDbName
,
tsDefaultUser
,
tsMonitorDbName
,
tsDefaultUser
);
}
else
if
(
cmd
==
MONITOR_CMD_CREATE_TB_SLOWQUERY
)
{
snprintf
(
sql
,
SQL_LENGTH
,
"create table if not exists %s.slowquery(ts timestamp, username "
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录