Merge pull request #12536 from taosdata/feature/3.0_liaohj
fix(query): return error code when connecting to database failed.
This commit is contained in:
commit
3ebebcb841
|
@ -518,8 +518,9 @@ STscObj* taosConnectImpl(const char* user, const char* auth, const char* db, __t
|
|||
if (pRequest->code != TSDB_CODE_SUCCESS) {
|
||||
const char* errorMsg =
|
||||
(pRequest->code == TSDB_CODE_RPC_FQDN_ERROR) ? taos_errstr(pRequest) : tstrerror(pRequest->code);
|
||||
printf("failed to connect to server, reason: %s\n\n", errorMsg);
|
||||
fprintf(stderr,"failed to connect to server, reason: %s\n\n", errorMsg);
|
||||
|
||||
terrno = pRequest->code;
|
||||
destroyRequest(pRequest);
|
||||
taos_close(pTscObj);
|
||||
pTscObj = NULL;
|
||||
|
|
|
@ -2034,11 +2034,9 @@ static void doMergeTwoLevelData(STsdbReadHandle* pTsdbReadHandle, STableCheckInf
|
|||
lastKeyAppend = key;
|
||||
|
||||
if (rv1 != TD_ROW_SVER(row1)) {
|
||||
// pSchema1 = tsdbGetTableSchemaByVersion(pTable, memRowVersion(row1));
|
||||
rv1 = TD_ROW_SVER(row1);
|
||||
}
|
||||
if (row2 && rv2 != TD_ROW_SVER(row2)) {
|
||||
// pSchema2 = tsdbGetTableSchemaByVersion(pTable, memRowVersion(row2));
|
||||
rv2 = TD_ROW_SVER(row2);
|
||||
}
|
||||
|
||||
|
|
|
@ -812,13 +812,11 @@ int32_t qwHandlePrePhaseEvents(QW_FPARAMS_DEF, int8_t phase, SQWPhaseInput *inpu
|
|||
}
|
||||
|
||||
if (ctx->rspCode) {
|
||||
QW_TASK_ELOG("task already failed at phase %s, error:%x - %s", qwPhaseStr(phase), ctx->rspCode,
|
||||
tstrerror(ctx->rspCode));
|
||||
QW_TASK_ELOG("task already failed at phase %s, code:%s", qwPhaseStr(phase), tstrerror(ctx->rspCode));
|
||||
QW_ERR_JRET(ctx->rspCode);
|
||||
}
|
||||
|
||||
_return:
|
||||
|
||||
if (ctx) {
|
||||
QW_UPDATE_RSP_CODE(ctx, code);
|
||||
|
||||
|
@ -836,7 +834,11 @@ _return:
|
|||
QW_TASK_DLOG("cancel rsp send, handle:%p, code:%x - %s", cancelConnection->handle, code, tstrerror(code));
|
||||
}
|
||||
|
||||
QW_TASK_DLOG("end to handle event at phase %s, code:%x - %s", qwPhaseStr(phase), code, tstrerror(code));
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
QW_TASK_ELOG("end to handle event at phase %s, code:%s", qwPhaseStr(phase), tstrerror(code));
|
||||
} else {
|
||||
QW_TASK_DLOG("end to handle event at phase %s, code:%s", qwPhaseStr(phase), tstrerror(code));
|
||||
}
|
||||
|
||||
QW_RET(code);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue