diff --git a/src/client/src/tscSQLParserImpl.c b/src/client/src/tscSQLParserImpl.c index 9aa19429566c756dd94b9fa7314b191d341c6147..17e1c6f45790acc36c35111aec75e00be227044f 100644 --- a/src/client/src/tscSQLParserImpl.c +++ b/src/client/src/tscSQLParserImpl.c @@ -828,9 +828,6 @@ void setCreateAcctSQL(SSqlInfo *pInfo, int32_t type, SSQLToken *pName, SSQLToken if (pPwd != NULL) { pInfo->pDCLInfo->user.passwd = *pPwd; -// pInfo->pDCLInfo->user.hasPasswd = true; - } else { -// pInfo->pDCLInfo->user.hasPasswd = false; } } @@ -860,14 +857,12 @@ void setAlterUserSQL(SSqlInfo *pInfo, int16_t type, SSQLToken *pName, SSQLToken* if (pPwd != NULL) { pUser->passwd = *pPwd; -// pUser->hasPasswd = true; } else { pUser->passwd.type = TSDB_DATA_TYPE_NULL; } if (pPrivilege != NULL) { pUser->privilege = *pPrivilege; -// pUser->hasPrivilege = true; } else { pUser->privilege.type = TSDB_DATA_TYPE_NULL; } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 492cc5cda2b77fa00ce7b2c4e4df6c122404ce6d..677f728472382fe35990a4aea2c8f6e2eb4a8505 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1999,7 +1999,7 @@ int32_t tscBuildAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) { } int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) { - SAlterUserMsg *pAlterMsg; + SCreateUserMsg *pAlterMsg; char * pMsg, *pStart; SSqlCmd *pCmd = &pSql->cmd; @@ -2009,16 +2009,18 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SUserInfo *pUser = &pInfo->pDCLInfo->user; strncpy(pAlterMsg->user, pUser->user.z, pUser->user.n); + pAlterMsg->flag = pUser->type; if (pUser->type == TSDB_ALTER_USER_PRIVILEGES) { pAlterMsg->privilege = (char)pCmd->count; } else if (pUser->type == TSDB_ALTER_USER_PASSWD) { strncpy(pAlterMsg->pass, pUser->passwd.z, pUser->passwd.n); + } else { // create user password info + strncpy(pAlterMsg->pass, pUser->passwd.z, pUser->passwd.n); } - pMsg += sizeof(SAlterUserMsg); - + pMsg += sizeof(SCreateUserMsg); pCmd->payloadLen = pMsg - pStart; if (pUser->type == TSDB_ALTER_USER_PASSWD || pUser->type == TSDB_ALTER_USER_PRIVILEGES) {