diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index dfdf97ea432f276de0f73a102f87bb6fc42e4e3e..f93de18e040521d494cec77fa068974182cee99a 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -447,9 +447,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { assert(pCmd->command != TSDB_SQL_INSERT); - // in case of insert, redo parsing the sql string and build new submit data block for two reasons: - // 1. the table Id(tid & uid) may have been update, the submit block needs to be updated accordingly. - // 2. vnode may need the schema information along with submit block to update its local table schema. if (pCmd->command == TSDB_SQL_SELECT) { tscDebug("%p redo parse sql string and proceed", pSql); pCmd->parseFinished = false; @@ -463,8 +460,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { } tscProcessSql(pSql); - - }else { // in all other cases, simple retry + } else { // in all other cases, simple retry tscProcessSql(pSql); } diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index b9f7e6c315c9958e37d3f25ebf64d76e8049fc88..15bc8abadae570df38469fde313337265259203d 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -2254,6 +2254,9 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows) tscResetSqlCmdObj(&pParentObj->cmd, false); + // in case of insert, redo parsing the sql string and build new submit data block for two reasons: + // 1. the table Id(tid & uid) may have been update, the submit block needs to be updated accordingly. + // 2. vnode may need the schema information along with submit block to update its local table schema. tscDebug("%p re-parse sql to generate submit data, retry:%d", pParentObj, pParentObj->retry++); int32_t code = tsParseSql(pParentObj, true); if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) return; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 42bd91c388b0f9e6b0599f7c03211fdb7d6bfd28..e83cafa0ac526b88546f7a29a144e3cdc86cbe50 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -730,9 +730,9 @@ static int32_t updateResultRowCurrentIndex(SResultRowInfo* pWindowResInfo, TSKEY pWindowResInfo->curIndex = pWindowResInfo->size - 1; } else { pWindowResInfo->curIndex = i; + pWindowResInfo->prevSKey = pWindowResInfo->pResult[pWindowResInfo->curIndex]->win.skey; } - pWindowResInfo->prevSKey = pWindowResInfo->pResult[pWindowResInfo->curIndex]->win.skey; return numOfClosed; }