diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 7a44870938f943e1aec667f4ecf0890fd394ff43..dbbb6be128274fbd882617de7832bef7cea7cffa 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -419,7 +419,6 @@ char *tscGetErrorMsgPayload(SSqlCmd *pCmd); int32_t tscInvalidSQLErrMsg(char *msg, const char *additionalInfo, const char *sql); int32_t tscToSQLCmd(SSqlObj *pSql, struct SSqlInfo *pInfo); -//void tscGetResultColumnChr(SSqlRes *pRes, SFieldInfo* pFieldInfo, int32_t column); static FORCE_INLINE void tscGetResultColumnChr(SSqlRes* pRes, SFieldInfo* pFieldInfo, int32_t columnIndex) { SFieldSupInfo* pInfo = (SFieldSupInfo*) TARRAY_GET_ELEM(pFieldInfo->pSupportInfo, columnIndex); diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 15e02799aabd8dea2cd7d7aa3c4342fb38b96080..c396c8131052c9741cfb2ac15ad986580571ac9a 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1054,6 +1054,10 @@ void tscSetupOutputColumnIndex(SSqlObj* pSql) { } } } + + // restore the offset value for super table query in case of final result. + tscRestoreSQLFuncForSTableQuery(pQueryInfo); + tscFieldInfoUpdateOffset(pQueryInfo); } void tscJoinQueryCallback(void* param, TAOS_RES* tres, int code) { @@ -2046,9 +2050,7 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) { } while (1) { - if (pRes->row < pRes->numOfRows) { - assert(0); - } + assert (pRes->row >= pRes->numOfRows); doBuildResFromSubqueries(pSql); sem_post(&pSql->rspSem);