From df2d6ea1c0b6a9cb557a6e8fdf61a08497fa853e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 10 Oct 2020 13:46:33 +0800 Subject: [PATCH] [td-1637] --- src/client/src/tscSql.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index ac7081ba70..f37a641eba 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -459,6 +459,7 @@ TAOS_ROW taos_fetch_row(TAOS_RES *res) { SSqlRes *pRes = &pSql->res; if (pRes->qhandle == 0 || + pRes->code == TSDB_CODE_TSC_QUERY_CANCELLED || pCmd->command == TSDB_SQL_RETRIEVE_EMPTY_RESULT || pCmd->command == TSDB_SQL_INSERT) { return NULL; @@ -696,9 +697,8 @@ void taos_stop_query(TAOS_RES *res) { if (tscIsTwoStageSTableQuery(pQueryInfo, 0)) { assert(pSql->pRpcCtx == NULL); tscKillSTableQuery(pSql); - } else { - if (pSql->cmd.command < TSDB_SQL_LOCAL) { - assert(pSql->pRpcCtx != NULL); + } else { // TODO multithreads bug + if (pSql->cmd.command < TSDB_SQL_LOCAL && pSql->pRpcCtx != NULL) { rpcCancelRequest(pSql->pRpcCtx); } }