diff --git a/src/client/src/tscLocal.c b/src/client/src/tscLocal.c index 79fa1e28ccb4bdea9f82171e25579f7581fd60b2..5ffdcd216780368e54903d413aa8c530b49136da 100644 --- a/src/client/src/tscLocal.c +++ b/src/client/src/tscLocal.c @@ -384,13 +384,10 @@ int tscProcessLocalCmd(SSqlObj *pSql) { // keep the code in local variable in order to avoid invalid read in case of async query int32_t code = pSql->res.code; - - if (pSql->fp != NULL) { // callback function - if (code == 0) { - (*pSql->fp)(pSql->param, pSql, 0); - } else { - tscQueueAsyncRes(pSql); - } + if (code == TSDB_CODE_SUCCESS) { + (*pSql->fp)(pSql->param, pSql, 0); + } else { + tscQueueAsyncRes(pSql); } return code;