diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index a3e1e624c196815b508c5bce4a9a9ae6985b01eb..773924c1105f6fd70b9c86bb03e35f5b29aa9eaf 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -20,14 +20,6 @@ extern "C" { #endif -#include -#include -#include -#include -#include -#include -#include - #include "os.h" #include "taos.h" #include "taosmsg.h" diff --git a/src/client/src/tscJoinProcess.c b/src/client/src/tscJoinProcess.c index 1f26e2a0e53b5f0c337ec1febcbdd19f5a8bdf50..bd9a782d8cd052f53b57b85a75ceb3bcf3bf44b8 100644 --- a/src/client/src/tscJoinProcess.c +++ b/src/client/src/tscJoinProcess.c @@ -396,7 +396,10 @@ static void joinRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) { SSqlObj* pParentSql = pSupporter->pObj; SSqlObj* pSql = (SSqlObj*)tres; - SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); + SSqlCmd* pCmd = &pSql->cmd; + SSqlRes* pRes = &pSql->res; + + SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); if ((pQueryInfo->type & TSDB_QUERY_TYPE_JOIN_SEC_STAGE) == 0) { if (pSupporter->pState->code != TSDB_CODE_SUCCESS) { @@ -443,7 +446,11 @@ static void joinRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) { assert(pQueryInfo->numOfTables == 1); // for projection query, need to try next vnode - if ((++pMeterMetaInfo->vnodeIndex) < pMeterMetaInfo->pMetricMeta->numOfVnodes) { + int32_t totalVnode = pMeterMetaInfo->pMetricMeta->numOfVnodes; + if ((++pMeterMetaInfo->vnodeIndex) < totalVnode) { + tscTrace("%p current vnode:%d exhausted, try next:%d. total vnode:%d. current numOfRes:%d", pSql, + pMeterMetaInfo->vnodeIndex - 1, pMeterMetaInfo->vnodeIndex, totalVnode, pRes->numOfTotal); + pSql->cmd.command = TSDB_SQL_SELECT; pSql->fp = tscJoinQueryCallback; tscProcessSql(pSql); diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 2175d017ad9f419a1c0b5002d6f57cdd6f62904e..2cfe0f949fed63ffaa3f5cf2aba5754d5bdbcef1 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -450,7 +450,7 @@ static bool tscHashRemainDataInSubqueryResultSet(SSqlObj *pSql) { SQueryInfo * pQueryInfo1 = tscGetQueryInfoDetail(pCmd1, pCmd1->clauseIndex); SMeterMetaInfo *pMetaInfo = tscGetMeterMetaInfoFromQueryInfo(pQueryInfo1, 0); - assert(pQueryInfo->numOfTables == 1); + assert(pQueryInfo1->numOfTables == 1); /* * if the global limitation is not reached, and current result has not exhausted, or next more vnodes are @@ -675,8 +675,6 @@ TAOS_ROW taos_fetch_row_impl(TAOS_RES *res) { TAOS_ROW taos_fetch_row(TAOS_RES *res) { SSqlObj *pSql = (SSqlObj *)res; -// SSqlCmd *pCmd = &pSql->cmd; -// SSqlRes *pRes = &pSql->res; if (pSql == NULL || pSql->signature != pSql) { globalCode = TSDB_CODE_DISCONNECTED;