diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index dfdf97ea43..f93de18e04 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 b9f7e6c315..15bc8abada 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 42bd91c388..e83cafa0ac 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; }