From 3932d0accd0e7504b0f48a9decdbd9427b6c10e1 Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Thu, 27 Feb 2020 10:42:17 +0800 Subject: [PATCH] fix bugs founded in regression test(cancel super table query may cause client crash). --- src/client/src/tscServer.c | 4 +--- src/system/detail/src/vnodeQueryImpl.c | 17 ++++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 9599d280ea..de03375246 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1324,8 +1324,6 @@ void tscKillMetricQuery(SSqlObj *pSql) { taosStopRpcConn(pSql->pSubs[i]->thandle); } - pSql->numOfSubs = 0; - /* * 1. if the subqueries are not launched or partially launched, we need to waiting the launched * query return to successfully free allocated resources. @@ -1571,7 +1569,7 @@ static char *doSerializeTableInfo(SSqlObj *pSql, int32_t numOfMeters, int32_t vn SMeterMeta * pMeterMeta = pMeterMetaInfo->pMeterMeta; SMetricMeta *pMetricMeta = pMeterMetaInfo->pMetricMeta; - tscTrace("%p vid:%d, query on %d meters", pSql, htons(vnodeId), numOfMeters); + tscTrace("%p vid:%d, query on %d meters", pSql, vnodeId, numOfMeters); if (UTIL_METER_IS_NOMRAL_METER(pMeterMetaInfo)) { #ifdef _DEBUG_VIEW tscTrace("%p sid:%d, uid:%" PRIu64, pSql, pMeterMetaInfo->pMeterMeta->sid, pMeterMetaInfo->pMeterMeta->uid); diff --git a/src/system/detail/src/vnodeQueryImpl.c b/src/system/detail/src/vnodeQueryImpl.c index d3fd143121..09c3e14dfb 100644 --- a/src/system/detail/src/vnodeQueryImpl.c +++ b/src/system/detail/src/vnodeQueryImpl.c @@ -2891,7 +2891,6 @@ static int64_t getOldestKey(int32_t numOfFiles, int64_t fileId, SVnodeCfg *pCfg) } bool isQueryKilled(SQuery *pQuery) { - return false; SQInfo *pQInfo = (SQInfo *)GET_QINFO_ADDR(pQuery); /* @@ -5878,13 +5877,13 @@ void disableFunctForTableSuppleScan(SQueryRuntimeEnv *pRuntimeEnv, int32_t order // group by normal columns and interval query on normal table for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) { - pRuntimeEnv->pCtx[i].order = (pRuntimeEnv->pCtx[i].order) ^ 1; + pRuntimeEnv->pCtx[i].order = (pRuntimeEnv->pCtx[i].order) ^ 1u; } SWindowResInfo *pWindowResInfo = &pRuntimeEnv->windowResInfo; doDisableFunctsForSupplementaryScan(pQuery, pWindowResInfo, order); - pQuery->order.order = pQuery->order.order ^ 1; + pQuery->order.order = pQuery->order.order ^ 1u; } void disableFunctForSuppleScan(STableQuerySupportObj *pSupporter, int32_t order) { @@ -5900,24 +5899,24 @@ void disableFunctForSuppleScan(STableQuerySupportObj *pSupporter, int32_t order) } } else { for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) { - pRuntimeEnv->pCtx[i].order = (pRuntimeEnv->pCtx[i].order) ^ 1; + pRuntimeEnv->pCtx[i].order = (pRuntimeEnv->pCtx[i].order) ^ 1u; } SWindowResInfo *pWindowResInfo = &pRuntimeEnv->windowResInfo; doDisableFunctsForSupplementaryScan(pQuery, pWindowResInfo, order); } - pQuery->order.order = pQuery->order.order ^ 1; + pQuery->order.order = (pQuery->order.order) ^ 1u; } void enableFunctForMasterScan(SQueryRuntimeEnv *pRuntimeEnv, int32_t order) { SQuery *pQuery = pRuntimeEnv->pQuery; for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) { - pRuntimeEnv->pCtx[i].order = (pRuntimeEnv->pCtx[i].order) ^ 1; + pRuntimeEnv->pCtx[i].order = (pRuntimeEnv->pCtx[i].order) ^ 1u; } - pQuery->order.order = (pQuery->order.order ^ 1); + pQuery->order.order = (pQuery->order.order) ^ 1u; } void createQueryResultInfo(SQuery *pQuery, SWindowResult *pResultRow, bool isSTableQuery, SPosInfo *posInfo) { @@ -6045,7 +6044,7 @@ void forwardCtxOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, int64_t output) { * * diff function is handled in multi-output function */ - pRuntimeEnv->pCtx[j].ptsOutputBuf += TSDB_KEYSIZE * output /* * factor*/; + pRuntimeEnv->pCtx[j].ptsOutputBuf += TSDB_KEYSIZE * output; } resetResultInfo(pRuntimeEnv->pCtx[j].resultInfo); @@ -6121,7 +6120,7 @@ static void queryStatusSave(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatus *pStatus pStatus->cur = tsBufGetCursor(pRuntimeEnv->pTSBuf); // save the cursor if (pRuntimeEnv->pTSBuf) { - pRuntimeEnv->pTSBuf->cur.order ^= 1; + pRuntimeEnv->pTSBuf->cur.order ^= 1u; tsBufNextPos(pRuntimeEnv->pTSBuf); } -- GitLab