diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index a45db94b492079b184fa5947c427df63300162b5..14f0fa07caab1daac854cc9372fedc88e161ee12 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -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) { - 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); if (pObj != NULL) { @@ -191,7 +191,7 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha 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 int code = taosCheckVersion(version, taos_get_server_info(pObj), 3); diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index d713a9ee5fa9cd9b223ae9e787c033352083730e..07926306db9c3fff2851ec453108429a83eaea41 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -69,6 +69,8 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pDnodeConn) { if (*pDnodeConn == NULL) { tscError("failed to init connection to TDengine"); return -1; + } else { + tscTrace("dnodeConn:%p is created, user:%s", *pDnodeConn, user); } } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index ccb363d9e823f0d119e84e5791092e8e276c6c7d..dd3cb76cbf40876718786dae14dbb5a7b263d8c7 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -766,7 +766,7 @@ void tscCloseTscObj(STscObj* pObj) { rpcClose(pObj->pDnodeConn); } - tscTrace("%p DB connection is closed", pObj); + tscTrace("%p DB connection is closed, dnodeConn:%p", pObj, pObj->pDnodeConn); tfree(pObj); } diff --git a/src/dnode/src/dnodePeer.c b/src/dnode/src/dnodePeer.c index b1e5d9fd38d3a2f6d0ab2f369c57e5218d0d36c4..ea21ed02061ce5aaf52222914b465d7d338229e0 100644 --- a/src/dnode/src/dnodePeer.c +++ b/src/dnode/src/dnodePeer.c @@ -61,7 +61,7 @@ int32_t dnodeInitServer() { rpcInit.cfp = dnodeProcessReqMsgFromDnode; rpcInit.sessions = 100; rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 2000; + rpcInit.idleTime = tsShellActivityTimer * 1000; tsDnodeServerRpc = rpcOpen(&rpcInit); if (tsDnodeServerRpc == NULL) { @@ -122,7 +122,7 @@ int32_t dnodeInitClient() { rpcInit.ufp = dnodeUpdateIpSet; rpcInit.sessions = 100; rpcInit.connType = TAOS_CONN_CLIENT; - rpcInit.idleTime = tsShellActivityTimer * 2000; + rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.user = "t"; rpcInit.ckey = "key"; rpcInit.secret = "secret"; diff --git a/src/dnode/src/dnodeShell.c b/src/dnode/src/dnodeShell.c index cf6b5e38abda31202ad73d3f635b743d3ba33eec..28679262faa7d38eebf8c49317b5df272ae2625e 100644 --- a/src/dnode/src/dnodeShell.c +++ b/src/dnode/src/dnodeShell.c @@ -86,7 +86,7 @@ int32_t dnodeInitShell() { rpcInit.cfp = dnodeProcessMsgFromShell; rpcInit.sessions = TSDB_SESSIONS_PER_DNODE; rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 1500; + rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.afp = dnodeRetrieveUserAuthInfo; tsDnodeShellRpc = rpcOpen(&rpcInit); diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 685b0f2b8644c500035db28b4b69547994be066d..f5244545fc9f36bd70f971e21720590d6440d0d6 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -793,7 +793,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) { pConn->chandle = pRecv->chandle; pConn->peerIp = pRecv->ip; - if (pConn->peerPort == 0) pConn->peerPort = pRecv->port; + pConn->peerPort = pRecv->port; if (pHead->port) pConn->peerPort = htons(pHead->port); terrno = rpcCheckAuthentication(pConn, (char *)pHead, pRecv->msgLen); diff --git a/tests/script/general/user/pass_alter.sim b/tests/script/general/user/pass_alter.sim index 034e704a8780e37bab3b29f3b313e2b19db5e8d2..857d658db1ee7f1b91220106983ebb95c9b687d6 100644 --- a/tests/script/general/user/pass_alter.sim +++ b/tests/script/general/user/pass_alter.sim @@ -19,28 +19,47 @@ endi print ============= step2 sql close +sleep 2500 +print user read login sql connect read -sleep 2000 sql alter user read pass 'taosdata' sql alter user write pass 'taosdata1' -x step2 return -1 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 sql close +sleep 2500 +print user write login 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 read pass 'taosdata' -x step3 return -1 step3: +sql show users +if $rows != 5 then + return -1 +endi + print ============= step4 sql close +sleep 2500 +print root write login sql connect -sleep 2000 sql create user oroot pass 'taosdata' + sql show users if $rows != 6 then return -1