diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 3264290f7e71a9efcc4c848a46a60c92fbbe18d7..ae5a322b0567d25151776c2a24ccd57baebabf64 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -679,7 +679,11 @@ char *taos_errstr(TAOS_RES *tres) { } if (hasAdditionalErrorInfo(pSql->res.code, &pSql->cmd) || pSql->res.code == TSDB_CODE_RPC_FQDN_ERROR) { - return pSql->cmd.payload; + if (pSql->cmd.payload[0] != '\0') { + return pSql->cmd.payload; + } + + return (char*)tstrerror(pSql->res.code); } else { return (char*)tstrerror(pSql->res.code); }