minor changes
This commit is contained in:
parent
ed68f95c11
commit
9673e0edf2
|
@ -389,17 +389,20 @@ typedef struct {
|
|||
int32_t maxDbs;
|
||||
int32_t maxTimeSeries;
|
||||
int32_t maxStreams;
|
||||
int64_t maxStorage; // In unit of GB
|
||||
int32_t accessState; // Configured only by command
|
||||
int64_t maxStorage; // In unit of GB
|
||||
int32_t reserve[8];
|
||||
} SCreateAcctMsg, SAlterAcctMsg;
|
||||
|
||||
typedef struct {
|
||||
char user[TSDB_USER_LEN];
|
||||
char user[TSDB_USER_LEN];
|
||||
int32_t reserve[8];
|
||||
} SDropUserMsg, SDropAcctMsg;
|
||||
|
||||
typedef struct {
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_PASSWORD_LEN];
|
||||
char user[TSDB_USER_LEN];
|
||||
char pass[TSDB_PASSWORD_LEN];
|
||||
int32_t reserve[8];
|
||||
} SCreateUserMsg, SAlterUserMsg;
|
||||
|
||||
typedef struct {
|
||||
|
@ -876,16 +879,19 @@ typedef struct SShowRsp {
|
|||
} SShowRsp;
|
||||
|
||||
typedef struct {
|
||||
char ep[TSDB_EP_LEN]; // end point, hostname:port
|
||||
char ep[TSDB_EP_LEN]; // end point, hostname:port
|
||||
int32_t reserve[8];
|
||||
} SCreateDnodeMsg;
|
||||
|
||||
typedef struct {
|
||||
int32_t dnodeId;
|
||||
int32_t reserve[8];
|
||||
} SDropDnodeMsg;
|
||||
|
||||
typedef struct {
|
||||
int32_t dnodeId;
|
||||
char config[TSDB_DNODE_CONFIG_LEN];
|
||||
int32_t reserve[8];
|
||||
} SCfgDnodeMsg;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -45,7 +45,6 @@ extern int32_t mDebugFlag;
|
|||
typedef struct SClusterObj SClusterObj;
|
||||
typedef struct SMnodeObj SMnodeObj;
|
||||
typedef struct SAcctObj SAcctObj;
|
||||
typedef struct SDbObj SDbObj;
|
||||
typedef struct SVgObj SVgObj;
|
||||
typedef struct SFuncObj SFuncObj;
|
||||
typedef struct SOperObj SOperObj;
|
||||
|
@ -209,7 +208,7 @@ typedef struct {
|
|||
int8_t cacheLastRow;
|
||||
} SDbCfg;
|
||||
|
||||
typedef struct SDbObj {
|
||||
typedef struct {
|
||||
char name[TSDB_FULL_DB_NAME_LEN];
|
||||
char acct[TSDB_USER_LEN];
|
||||
int64_t createdTime;
|
||||
|
|
|
@ -300,7 +300,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SMnodeMsg *pMsg, SCreateDbMsg *pCreat
|
|||
tstrncpy(dbObj.acct, acct, TSDB_USER_LEN);
|
||||
dbObj.createdTime = taosGetTimestampMs();
|
||||
dbObj.updateTime = dbObj.createdTime;
|
||||
dbObj.uid = 1234;
|
||||
dbObj.uid = mndGenerateUid(dbObj.name, TSDB_FULL_DB_NAME_LEN);
|
||||
dbObj.cfg = (SDbCfg){.cacheBlockSize = pCreate->cacheBlockSize,
|
||||
.totalBlocks = pCreate->totalBlocks,
|
||||
.daysPerFile = pCreate->daysPerFile,
|
||||
|
|
|
@ -175,6 +175,7 @@ static int32_t mndDnodeActionDelete(SSdb *pSdb, SDnodeObj *pDnode) {
|
|||
|
||||
static int32_t mndDnodeActionUpdate(SSdb *pSdb, SDnodeObj *pOldDnode, SDnodeObj *pNewDnode) {
|
||||
mTrace("dnode:%d, perform update action", pOldDnode->id);
|
||||
pOldDnode->updateTime = pNewDnode->updateTime;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,12 +169,8 @@ static int32_t mndUserActionDelete(SSdb *pSdb, SUserObj *pUser) {
|
|||
|
||||
static int32_t mndUserActionUpdate(SSdb *pSdb, SUserObj *pOldUser, SUserObj *pNewUser) {
|
||||
mTrace("user:%s, perform update action", pOldUser->user);
|
||||
memcpy(pOldUser->user, pNewUser->user, TSDB_USER_LEN);
|
||||
memcpy(pOldUser->pass, pNewUser->pass, TSDB_PASSWORD_LEN);
|
||||
memcpy(pOldUser->acct, pNewUser->acct, TSDB_USER_LEN);
|
||||
pOldUser->createdTime = pNewUser->createdTime;
|
||||
pOldUser->updateTime = pNewUser->updateTime;
|
||||
pOldUser->superUser = pNewUser->superUser;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -328,6 +324,7 @@ static int32_t mndProcessAlterUserMsg(SMnodeMsg *pMsg) {
|
|||
memcpy(&newUser, pUser, sizeof(SUserObj));
|
||||
memset(pUser->pass, 0, sizeof(pUser->pass));
|
||||
taosEncryptPass((uint8_t *)pAlter->pass, strlen(pAlter->pass), pUser->pass);
|
||||
newUser.updateTime = taosGetTimestampMs();
|
||||
|
||||
int32_t code = mndUpdateUser(pMnode, pUser, &newUser, pMsg);
|
||||
sdbRelease(pMnode->pSdb, pOperUser);
|
||||
|
|
Loading…
Reference in New Issue