diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index ed92d97e9b7c77e7f063933e74156d445e6082bf..9e6bd2ca1438b9d56e0ed03f893b5ff8fbe9eab8 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6615,21 +6615,19 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { } SKVRowBuilder kvRowBuilder = {0}; if (pTagsSchema->type == TSDB_DATA_TYPE_JSON) { - - if (tdInitKVRowBuilder(&kvRowBuilder) < 0) { - return TSDB_CODE_TSC_OUT_OF_MEMORY; - } if (pItem->pVar.nType != TSDB_DATA_TYPE_BINARY) { tscError("json type error, should be string"); - tdDestroyKVRowBuilder(&kvRowBuilder); return invalidOperationMsg(pMsg, msg25); } if (pItem->pVar.nType > TSDB_MAX_JSON_TAGS_LEN / TSDB_NCHAR_SIZE) { tscError("json tag too long"); - tdDestroyKVRowBuilder(&kvRowBuilder); return invalidOperationMsg(pMsg, msg14); } + if (tdInitKVRowBuilder(&kvRowBuilder) < 0) { + return TSDB_CODE_TSC_OUT_OF_MEMORY; + } + int8_t tagVal = TSDB_DATA_JSON_PLACEHOLDER; tdAddColToKVRow(&kvRowBuilder, pTagsSchema->colId, pTagsSchema->type, &tagVal, false); diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index d265a8d36e188866485d77f00d7707a6c666f605..48e03ad1e32dbfdcc6cf101186251a275ae11485 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -1549,8 +1549,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul } ekey = reviseWindowEkey(pQueryAttr, &nextWin); - forwardStep = - getNumOfRowsInTimeWindow(pRuntimeEnv, &pSDataBlock->info, tsCols, startPos, ekey, binarySearchForKey, true); + forwardStep = getNumOfRowsInTimeWindow(pRuntimeEnv, &pSDataBlock->info, tsCols, startPos, ekey, binarySearchForKey, true); // window start(end) key interpolation doWindowBorderInterpolation(pOperatorInfo, pSDataBlock, pInfo->pCtx, pResult, &nextWin, startPos, forwardStep);