fix bug in pass_alter.sim, add log, revise shellActiveTimer
This commit is contained in:
parent
dba2b23ce3
commit
c43695e344
|
@ -172,7 +172,7 @@ static void syncConnCallback(void *param, TAOS_RES *tres, int code) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) {
|
TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) {
|
||||||
tscTrace("try to create a connection to %s", ip);
|
tscTrace("try to create a connection to %s:%u, user:%s db:%s", ip, port, user, db);
|
||||||
|
|
||||||
STscObj *pObj = taosConnectImpl(ip, user, pass, db, port, NULL, NULL, NULL);
|
STscObj *pObj = taosConnectImpl(ip, user, pass, db, port, NULL, NULL, NULL);
|
||||||
if (pObj != NULL) {
|
if (pObj != NULL) {
|
||||||
|
@ -191,7 +191,7 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
tscTrace("%p DB connection is opening", pObj);
|
tscTrace("%p DB connection is opening, dnodeConn:%p", pObj, pObj->pDnodeConn);
|
||||||
|
|
||||||
// version compare only requires the first 3 segments of the version string
|
// version compare only requires the first 3 segments of the version string
|
||||||
int code = taosCheckVersion(version, taos_get_server_info(pObj), 3);
|
int code = taosCheckVersion(version, taos_get_server_info(pObj), 3);
|
||||||
|
|
|
@ -69,6 +69,8 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pDnodeConn) {
|
||||||
if (*pDnodeConn == NULL) {
|
if (*pDnodeConn == NULL) {
|
||||||
tscError("failed to init connection to TDengine");
|
tscError("failed to init connection to TDengine");
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
tscTrace("dnodeConn:%p is created, user:%s", *pDnodeConn, user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -766,7 +766,7 @@ void tscCloseTscObj(STscObj* pObj) {
|
||||||
rpcClose(pObj->pDnodeConn);
|
rpcClose(pObj->pDnodeConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
tscTrace("%p DB connection is closed", pObj);
|
tscTrace("%p DB connection is closed, dnodeConn:%p", pObj, pObj->pDnodeConn);
|
||||||
tfree(pObj);
|
tfree(pObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ int32_t dnodeInitServer() {
|
||||||
rpcInit.cfp = dnodeProcessReqMsgFromDnode;
|
rpcInit.cfp = dnodeProcessReqMsgFromDnode;
|
||||||
rpcInit.sessions = 100;
|
rpcInit.sessions = 100;
|
||||||
rpcInit.connType = TAOS_CONN_SERVER;
|
rpcInit.connType = TAOS_CONN_SERVER;
|
||||||
rpcInit.idleTime = tsShellActivityTimer * 2000;
|
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||||
|
|
||||||
tsDnodeServerRpc = rpcOpen(&rpcInit);
|
tsDnodeServerRpc = rpcOpen(&rpcInit);
|
||||||
if (tsDnodeServerRpc == NULL) {
|
if (tsDnodeServerRpc == NULL) {
|
||||||
|
@ -122,7 +122,7 @@ int32_t dnodeInitClient() {
|
||||||
rpcInit.ufp = dnodeUpdateIpSet;
|
rpcInit.ufp = dnodeUpdateIpSet;
|
||||||
rpcInit.sessions = 100;
|
rpcInit.sessions = 100;
|
||||||
rpcInit.connType = TAOS_CONN_CLIENT;
|
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||||
rpcInit.idleTime = tsShellActivityTimer * 2000;
|
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||||
rpcInit.user = "t";
|
rpcInit.user = "t";
|
||||||
rpcInit.ckey = "key";
|
rpcInit.ckey = "key";
|
||||||
rpcInit.secret = "secret";
|
rpcInit.secret = "secret";
|
||||||
|
|
|
@ -86,7 +86,7 @@ int32_t dnodeInitShell() {
|
||||||
rpcInit.cfp = dnodeProcessMsgFromShell;
|
rpcInit.cfp = dnodeProcessMsgFromShell;
|
||||||
rpcInit.sessions = TSDB_SESSIONS_PER_DNODE;
|
rpcInit.sessions = TSDB_SESSIONS_PER_DNODE;
|
||||||
rpcInit.connType = TAOS_CONN_SERVER;
|
rpcInit.connType = TAOS_CONN_SERVER;
|
||||||
rpcInit.idleTime = tsShellActivityTimer * 1500;
|
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||||
rpcInit.afp = dnodeRetrieveUserAuthInfo;
|
rpcInit.afp = dnodeRetrieveUserAuthInfo;
|
||||||
|
|
||||||
tsDnodeShellRpc = rpcOpen(&rpcInit);
|
tsDnodeShellRpc = rpcOpen(&rpcInit);
|
||||||
|
|
|
@ -793,7 +793,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) {
|
||||||
|
|
||||||
pConn->chandle = pRecv->chandle;
|
pConn->chandle = pRecv->chandle;
|
||||||
pConn->peerIp = pRecv->ip;
|
pConn->peerIp = pRecv->ip;
|
||||||
if (pConn->peerPort == 0) pConn->peerPort = pRecv->port;
|
pConn->peerPort = pRecv->port;
|
||||||
if (pHead->port) pConn->peerPort = htons(pHead->port);
|
if (pHead->port) pConn->peerPort = htons(pHead->port);
|
||||||
|
|
||||||
terrno = rpcCheckAuthentication(pConn, (char *)pHead, pRecv->msgLen);
|
terrno = rpcCheckAuthentication(pConn, (char *)pHead, pRecv->msgLen);
|
||||||
|
|
|
@ -19,28 +19,47 @@ endi
|
||||||
|
|
||||||
print ============= step2
|
print ============= step2
|
||||||
sql close
|
sql close
|
||||||
|
sleep 2500
|
||||||
|
print user read login
|
||||||
sql connect read
|
sql connect read
|
||||||
sleep 2000
|
|
||||||
sql alter user read pass 'taosdata'
|
sql alter user read pass 'taosdata'
|
||||||
sql alter user write pass 'taosdata1' -x step2
|
sql alter user write pass 'taosdata1' -x step2
|
||||||
return -1
|
return -1
|
||||||
step2:
|
step2:
|
||||||
|
|
||||||
|
sql_error create user read pass 'taosdata1'
|
||||||
|
sql_error create user write pass 'taosdata1'
|
||||||
|
|
||||||
|
sql show users
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
print ============= step3
|
print ============= step3
|
||||||
sql close
|
sql close
|
||||||
|
sleep 2500
|
||||||
|
print user write login
|
||||||
sql connect write
|
sql connect write
|
||||||
sleep 2000
|
|
||||||
|
sql_error create user read pass 'taosdata1'
|
||||||
|
sql_error create user write pass 'taosdata1'
|
||||||
sql alter user write pass 'taosdata'
|
sql alter user write pass 'taosdata'
|
||||||
sql alter user read pass 'taosdata' -x step3
|
sql alter user read pass 'taosdata' -x step3
|
||||||
return -1
|
return -1
|
||||||
step3:
|
step3:
|
||||||
|
|
||||||
|
sql show users
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
print ============= step4
|
print ============= step4
|
||||||
sql close
|
sql close
|
||||||
|
sleep 2500
|
||||||
|
print root write login
|
||||||
sql connect
|
sql connect
|
||||||
sleep 2000
|
|
||||||
sql create user oroot pass 'taosdata'
|
sql create user oroot pass 'taosdata'
|
||||||
|
|
||||||
sql show users
|
sql show users
|
||||||
if $rows != 6 then
|
if $rows != 6 then
|
||||||
return -1
|
return -1
|
||||||
|
|
Loading…
Reference in New Issue