提交 02951f2f 编写于 作者: Y yihaoDeng

[TD-5610]<enhance> Unable to Resolve FQDN

上级 f9139c32
......@@ -501,6 +501,15 @@ static void doProcessMsgFromServer(SSchedMsg* pSchedMsg) {
pRes->code = rpcMsg->code;
}
rpcMsg->code = (pRes->code == TSDB_CODE_SUCCESS) ? (int32_t)pRes->numOfRows : pRes->code;
if (pRes->code == TSDB_CODE_RPC_FQDN_ERROR) {
if (pEpSet) {
char buf[TSDB_FQDN_LEN + 64] = {0};
tscAllocPayload(pCmd, sizeof(buf));
sprintf(tscGetErrorMsgPayload(pCmd), "%s\"%s\"", tstrerror(pRes->code),pEpSet->fqdn[(pEpSet->inUse)%(pEpSet->numOfEps)]);
} else {
sprintf(tscGetErrorMsgPayload(pCmd), "%s", tstrerror(pRes->code));
}
}
(*pSql->fp)(pSql->param, pSql, rpcMsg->code);
}
......
......@@ -196,6 +196,11 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass,
if (pSql->res.code != TSDB_CODE_SUCCESS) {
terrno = pSql->res.code;
if (terrno ==TSDB_CODE_RPC_FQDN_ERROR) {
printf("taos connect failed, reason: %s\n\n", taos_errstr(pSql));
} else {
printf("taos connect failed, reason: %s.\n\n", tstrerror(terrno));
}
taos_free_result(pSql);
taos_close(pObj);
return NULL;
......@@ -643,7 +648,7 @@ char *taos_errstr(TAOS_RES *tres) {
return (char*) tstrerror(terrno);
}
if (hasAdditionalErrorInfo(pSql->res.code, &pSql->cmd)) {
if (hasAdditionalErrorInfo(pSql->res.code, &pSql->cmd) || pSql->res.code == TSDB_CODE_RPC_FQDN_ERROR) {
return pSql->cmd.payload;
} else {
return (char*)tstrerror(pSql->res.code);
......
......@@ -98,7 +98,6 @@ TAOS *shellInit(SShellArguments *_args) {
}
if (con == NULL) {
printf("taos connect failed, reason: %s.\n\n", tstrerror(terrno));
fflush(stdout);
return con;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册