From ba96c0816a8448e8b0790f66e07c3679a9f30e1e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 5 Jan 2021 14:41:15 +0800 Subject: [PATCH] [TD-2654]: fix crash caused by cancel cluster query. --- src/client/src/tscSubquery.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 681291d0db..063b6af0e6 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -2094,6 +2094,13 @@ static SSqlObj *tscCreateSTableSubquery(SSqlObj *pSql, SRetrieveSupport *trsuppo } void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) { + // the param may be null, since it may be done by other query threads. and the asyncOnError may enter in this + // function while kill query by a user. + if (param == NULL) { + assert(code != TSDB_CODE_SUCCESS); + return; + } + SRetrieveSupport *trsupport = (SRetrieveSupport *) param; SSqlObj* pParentSql = trsupport->pParentSql; -- GitLab