diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index d5eaa65761a128b05bdaf076ad726e13a54cc661..59c0da340b1f241c2a8240714e4d5de8ac249437 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -696,7 +696,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); }