From 5dd9322cbf476499b8c6a230ae864c09af6611cd Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 28 Dec 2022 09:16:10 +0800 Subject: [PATCH 001/139] enh(query): add event window. --- .../libs/executor/src/eventwindowoperator.c | 295 ++++++++++++++++++ source/libs/executor/src/timewindowoperator.c | 1 + 2 files changed, 296 insertions(+) create mode 100644 source/libs/executor/src/eventwindowoperator.c diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c new file mode 100644 index 0000000000..e38070953a --- /dev/null +++ b/source/libs/executor/src/eventwindowoperator.c @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include "executorimpl.h" +#include "filter.h" +#include "function.h" +#include "functionMgt.h" +#include "tcommon.h" +#include "tcompare.h" +#include "tdatablock.h" +#include "tfill.h" +#include "ttime.h" + +typedef struct SEventWindowOperatorInfo { + SOptrBasicInfo binfo; + SAggSupporter aggSup; + SExprSupp scalarSup; + SGroupResInfo groupResInfo; + SWindowRowsSup winSup; + SColumn stateCol; // start row index + bool hasKey; + SStateKeys stateKey; + int32_t tsSlotId; // primary timestamp column slot id + STimeWindowAggSupp twAggSup; +} SEventWindowOperatorInfo; + +static int32_t openEventWindowAggOptr(SOperatorInfo* pOperator); +static void destroyEWindowOperatorInfo(void* param); +static void doEventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock); +static SSDataBlock* doEventWindowAgg(SOperatorInfo* pOperator); + +SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SEventWinodwPhysiNode* pStateNode, + SExecTaskInfo* pTaskInfo) { + SEventWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SEventWindowOperatorInfo)); + SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); + if (pInfo == NULL || pOperator == NULL) { + goto _error; + } + + int32_t tsSlotId = ((SColumnNode*)pStateNode->window.pTspk)->slotId; + SColumnNode* pColNode = (SColumnNode*)((STargetNode*)pStateNode->pStartCond)->pExpr; + + if (pStateNode->window.pExprs != NULL) { + int32_t numOfScalarExpr = 0; + SExprInfo* pScalarExprInfo = createExprInfo(pStateNode->window.pExprs, NULL, &numOfScalarExpr); + int32_t code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, numOfScalarExpr); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + } + + pInfo->stateCol = extractColumnFromColumnNode(pColNode); + pInfo->stateKey.type = pInfo->stateCol.type; + pInfo->stateKey.bytes = pInfo->stateCol.bytes; + pInfo->stateKey.pData = taosMemoryCalloc(1, pInfo->stateCol.bytes); + if (pInfo->stateKey.pData == NULL) { + goto _error; + } + + int32_t code = filterInitFromNode((SNode*)pStateNode->window.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; + + int32_t num = 0; + SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &num); + initResultSizeInfo(&pOperator->resultInfo, 4096); + + code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + SSDataBlock* pResBlock = createDataBlockFromDescNode(pStateNode->window.node.pOutputDataBlockDesc); + initBasicInfo(&pInfo->binfo, pResBlock); + initResultRowInfo(&pInfo->binfo.resultRowInfo); + + pInfo->twAggSup = + (STimeWindowAggSupp){.waterMark = pStateNode->window.watermark, .calTrigger = pStateNode->window.triggerType}; + + initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); + + pInfo->tsSlotId = tsSlotId; + + setOperatorInfo(pOperator, "StateWindowOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE, true, OP_NOT_OPENED, pInfo, + pTaskInfo); + pOperator->fpSet = createOperatorFpSet(openEventWindowAggOptr, doEventWindowAgg, NULL, destroyEWindowOperatorInfo, + optrDefaultBufFn, NULL); + + code = appendDownstream(pOperator, &downstream, 1); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + return pOperator; + +_error: + if (pInfo != NULL) { + destroyEWindowOperatorInfo(pInfo); + } + + taosMemoryFreeClear(pOperator); + pTaskInfo->code = code; + return NULL; +} + +void destroyEWindowOperatorInfo(void* param) { + SEventWindowOperatorInfo* pInfo = (SEventWindowOperatorInfo*)param; + if (pInfo == NULL) { + return; + } + + cleanupBasicInfo(&pInfo->binfo); + colDataDestroy(&pInfo->twAggSup.timeWindowData); + + cleanupAggSup(&pInfo->aggSup); + cleanupGroupResInfo(&pInfo->groupResInfo); + taosMemoryFreeClear(param); +} + +static int32_t openEventWindowAggOptr(SOperatorInfo* pOperator) { + if (OPTR_IS_OPENED(pOperator)) { + return TSDB_CODE_SUCCESS; + } + + SEventWindowOperatorInfo* pInfo = pOperator->info; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + + SExprSupp* pSup = &pOperator->exprSupp; + int32_t order = TSDB_ORDER_ASC; + int64_t st = taosGetTimestampUs(); + + SOperatorInfo* downstream = pOperator->pDownstream[0]; + while (1) { + SSDataBlock* pBlock = downstream->fpSet.getNextFn(downstream); + if (pBlock == NULL) { + break; + } + + setInputDataBlock(pSup, pBlock, order, MAIN_SCAN, true); + blockDataUpdateTsWindow(pBlock, pInfo->tsSlotId); + + // there is an scalar expression that needs to be calculated right before apply the group aggregation. + if (pInfo->scalarSup.pExprInfo != NULL) { + pTaskInfo->code = projectApplyFunctions(pInfo->scalarSup.pExprInfo, pBlock, pBlock, pInfo->scalarSup.pCtx, + pInfo->scalarSup.numOfExprs, NULL); + if (pTaskInfo->code != TSDB_CODE_SUCCESS) { + T_LONG_JMP(pTaskInfo->env, pTaskInfo->code); + } + } + + doEventWindowAggImpl(pOperator, pInfo, pBlock); + } + + pOperator->cost.openCost = (taosGetTimestampUs() - st) / 1000.0; + initGroupedResultInfo(&pInfo->groupResInfo, pInfo->aggSup.pResultRowHashTable, TSDB_ORDER_ASC); + pOperator->status = OP_RES_TO_RETURN; + + return TSDB_CODE_SUCCESS; +} + +void doEventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SExprSupp* pSup = &pOperator->exprSupp; + + SColumnInfoData* pStateColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->stateCol.slotId); + int64_t gid = pBlock->info.id.groupId; + + bool masterScan = true; + int32_t numOfOutput = pOperator->exprSupp.numOfExprs; + int16_t bytes = pStateColInfoData->info.bytes; + + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); + TSKEY* tsList = (TSKEY*)pColInfoData->pData; + + SWindowRowsSup* pRowSup = &pInfo->winSup; + pRowSup->numOfRows = 0; + + struct SColumnDataAgg* pAgg = NULL; + for (int32_t j = 0; j < pBlock->info.rows; ++j) { + pAgg = (pBlock->pBlockAgg != NULL) ? pBlock->pBlockAgg[pInfo->stateCol.slotId] : NULL; + if (colDataIsNull(pStateColInfoData, pBlock->info.rows, j, pAgg)) { + continue; + } + + char* val = colDataGetData(pStateColInfoData, j); + + if (gid != pRowSup->groupId || !pInfo->hasKey) { + // todo extract method + if (IS_VAR_DATA_TYPE(pInfo->stateKey.type)) { + varDataCopy(pInfo->stateKey.pData, val); + } else { + memcpy(pInfo->stateKey.pData, val, bytes); + } + + pInfo->hasKey = true; + + doKeepNewWindowStartInfo(pRowSup, tsList, j, gid); + doKeepTuple(pRowSup, tsList[j], gid); + } else if (compareVal(val, &pInfo->stateKey)) { + doKeepTuple(pRowSup, tsList[j], gid); + if (j == 0 && pRowSup->startRowIndex != 0) { + pRowSup->startRowIndex = 0; + } + } else { // a new state window started + SResultRow* pResult = NULL; + + // keep the time window for the closed time window. + STimeWindow window = pRowSup->win; + + pRowSup->win.ekey = pRowSup->win.skey; + int32_t ret = setTimeWindowOutputBuf(&pInfo->binfo.resultRowInfo, &window, masterScan, &pResult, gid, pSup->pCtx, + numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo); + if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code + T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR); + } + + updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &window, false); + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, + pRowSup->numOfRows, pBlock->info.rows, numOfOutput); + + // here we start a new session window + doKeepNewWindowStartInfo(pRowSup, tsList, j, gid); + doKeepTuple(pRowSup, tsList[j], gid); + + // todo extract method + if (IS_VAR_DATA_TYPE(pInfo->stateKey.type)) { + varDataCopy(pInfo->stateKey.pData, val); + } else { + memcpy(pInfo->stateKey.pData, val, bytes); + } + } + } + + SResultRow* pResult = NULL; + pRowSup->win.ekey = tsList[pBlock->info.rows - 1]; + int32_t ret = setTimeWindowOutputBuf(&pInfo->binfo.resultRowInfo, &pRowSup->win, masterScan, &pResult, gid, + pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo); + if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code + T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR); + } + + updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pRowSup->win, false); + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, + pBlock->info.rows, numOfOutput); +} + +SSDataBlock* doEventWindowAgg(SOperatorInfo* pOperator) { + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } + + SStateWindowOperatorInfo* pInfo = pOperator->info; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SOptrBasicInfo* pBInfo = &pInfo->binfo; + + pTaskInfo->code = pOperator->fpSet._openFn(pOperator); + if (pTaskInfo->code != TSDB_CODE_SUCCESS) { + setOperatorCompleted(pOperator); + return NULL; + } + + blockDataEnsureCapacity(pBInfo->pRes, pOperator->resultInfo.capacity); + while (1) { + doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); + doFilter(pBInfo->pRes, pOperator->exprSupp.pFilterInfo, NULL); + + bool hasRemain = hasRemainResults(&pInfo->groupResInfo); + if (!hasRemain) { + setOperatorCompleted(pOperator); + break; + } + + if (pBInfo->pRes->info.rows > 0) { + break; + } + } + + pOperator->resultInfo.totalRows += pBInfo->pRes->info.rows; + return (pBInfo->pRes->info.rows == 0) ? NULL : pBInfo->pRes; +} diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 8107cea4a0..6c17df9fb1 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1964,6 +1964,7 @@ static SSDataBlock* doSessionWindowAgg(SOperatorInfo* pOperator) { return (pBInfo->pRes->info.rows == 0) ? NULL : pBInfo->pRes; } +// todo make this as an non-blocking operator SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWinodwPhysiNode* pStateNode, SExecTaskInfo* pTaskInfo) { SStateWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SStateWindowOperatorInfo)); From e7b1a7dc783b15ea4e6a8cbb8c141f9baf159e15 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 3 Jan 2023 13:15:09 +0800 Subject: [PATCH 002/139] enh(query): support event window. --- .../libs/executor/src/eventwindowoperator.c | 28 ++++++++++++++++++- source/libs/executor/src/timewindowoperator.c | 4 +-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c index e38070953a..408d75998d 100644 --- a/source/libs/executor/src/eventwindowoperator.c +++ b/source/libs/executor/src/eventwindowoperator.c @@ -41,6 +41,32 @@ static void destroyEWindowOperatorInfo(void* param); static void doEventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock); static SSDataBlock* doEventWindowAgg(SOperatorInfo* pOperator); +// todo : move to util +static void doKeepNewWindowStartInfo(SWindowRowsSup* pRowSup, const int64_t* tsList, int32_t rowIndex, + uint64_t groupId) { + pRowSup->startRowIndex = rowIndex; + pRowSup->numOfRows = 0; + pRowSup->win.skey = tsList[rowIndex]; + pRowSup->groupId = groupId; +} + +static void doKeepTuple(SWindowRowsSup* pRowSup, int64_t ts, uint64_t groupId) { + pRowSup->win.ekey = ts; + pRowSup->prevTs = ts; + pRowSup->numOfRows += 1; + pRowSup->groupId = groupId; +} + +static void updateTimeWindowInfo(SColumnInfoData* pColData, STimeWindow* pWin, bool includeEndpoint) { + int64_t* ts = (int64_t*)pColData->pData; + int32_t delta = includeEndpoint ? 1 : 0; + + int64_t duration = pWin->ekey - pWin->skey + delta; + ts[2] = duration; // set the duration + ts[3] = pWin->skey; // window start key + ts[4] = pWin->ekey + delta; // window end key +} + SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SEventWinodwPhysiNode* pStateNode, SExecTaskInfo* pTaskInfo) { SEventWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SEventWindowOperatorInfo)); @@ -264,7 +290,7 @@ SSDataBlock* doEventWindowAgg(SOperatorInfo* pOperator) { return NULL; } - SStateWindowOperatorInfo* pInfo = pOperator->info; + SEventWindowOperatorInfo* pInfo = pOperator->info; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SOptrBasicInfo* pBInfo = &pInfo->binfo; diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 6c17df9fb1..32e0c517b4 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -4174,8 +4174,8 @@ static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultR } updateTimeWindowInfo(&iaInfo->twAggSup.timeWindowData, &currWin, true); - applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, currPos - startPos, - pBlock->info.rows, pSup->numOfExprs); + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &iaInfo->twAggSup.timeWindowData, startPos, + currPos - startPos, pBlock->info.rows, pSup->numOfExprs); finalizeResultRows(iaInfo->aggSup.pResultBuf, &pResultRowInfo->cur, pSup, pResultBlock, pTaskInfo); resetResultRow(miaInfo->pResultRow, iaInfo->aggSup.resultRowSize - sizeof(SResultRow)); From 53c3cbd661428bd3bceaaf1c10e6b41d1b7cf400 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 3 Jan 2023 17:41:10 +0800 Subject: [PATCH 003/139] enh(query): support event window. --- source/libs/executor/inc/executorimpl.h | 6 + .../libs/executor/src/eventwindowoperator.c | 256 ++++++++---------- source/libs/executor/src/executorimpl.c | 17 +- 3 files changed, 133 insertions(+), 146 deletions(-) diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 60efefb1e4..d957dd987b 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -800,6 +800,8 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFillPhysiNode* pPhyFillNode, SExecTaskInfo* pTaskInfo); SOperatorInfo* createGroupSortOperatorInfo(SOperatorInfo* downstream, SGroupSortPhysiNode* pSortPhyNode, SExecTaskInfo* pTaskInfo); + +SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, SExecTaskInfo* pTaskInfo); // clang-format on int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBlock* pSrcBlock, SqlFunctionCtx* pCtx, @@ -853,6 +855,10 @@ int32_t saveOutputBuf(SStreamState* pState, SWinKey* pKey, SResultRow* pResult, void getNextIntervalWindow(SInterval* pInterval, STimeWindow* tw, int32_t order); int32_t qAppendTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo* pInfo); +void copyResultrowToDataBlock(SExprInfo* pExprInfo, int32_t numOfExprs, SResultRow* pRow, SqlFunctionCtx* pCtx, + SSDataBlock* pBlock, const int32_t* rowEntryOffset, SExecTaskInfo* pTaskInfo); +void doUpdateNumOfRows(SqlFunctionCtx* pCtx, SResultRow* pRow, int32_t numOfExprs, const int32_t* rowEntryOffset) ; + #ifdef __cplusplus } #endif diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c index 408d75998d..61c8030bd9 100644 --- a/source/libs/executor/src/eventwindowoperator.c +++ b/source/libs/executor/src/eventwindowoperator.c @@ -20,7 +20,6 @@ #include "tcommon.h" #include "tcompare.h" #include "tdatablock.h" -#include "tfill.h" #include "ttime.h" typedef struct SEventWindowOperatorInfo { @@ -29,16 +28,20 @@ typedef struct SEventWindowOperatorInfo { SExprSupp scalarSup; SGroupResInfo groupResInfo; SWindowRowsSup winSup; - SColumn stateCol; // start row index bool hasKey; SStateKeys stateKey; int32_t tsSlotId; // primary timestamp column slot id STimeWindowAggSupp twAggSup; + + SFilterInfo* pStartCondInfo; + SFilterInfo* pEndCondInfo; + bool inWindow; + SResultRow* pRow; } SEventWindowOperatorInfo; -static int32_t openEventWindowAggOptr(SOperatorInfo* pOperator); -static void destroyEWindowOperatorInfo(void* param); -static void doEventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock); +static SSDataBlock* eventWindowAggregate(SOperatorInfo* pOperator); +static void destroyEWindowOperatorInfo(void* param); +static void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock); static SSDataBlock* doEventWindowAgg(SOperatorInfo* pOperator); // todo : move to util @@ -67,7 +70,7 @@ static void updateTimeWindowInfo(SColumnInfoData* pColData, STimeWindow* pWin, b ts[4] = pWin->ekey + delta; // window end key } -SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SEventWinodwPhysiNode* pStateNode, +SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode, SExecTaskInfo* pTaskInfo) { SEventWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SEventWindowOperatorInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); @@ -75,27 +78,29 @@ SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SEventWi goto _error; } - int32_t tsSlotId = ((SColumnNode*)pStateNode->window.pTspk)->slotId; - SColumnNode* pColNode = (SColumnNode*)((STargetNode*)pStateNode->pStartCond)->pExpr; + SEventWinodwPhysiNode* pEventWindowNode = (SEventWinodwPhysiNode*)physiNode; - if (pStateNode->window.pExprs != NULL) { + int32_t tsSlotId = ((SColumnNode*)pEventWindowNode->window.pTspk)->slotId; + int32_t code = filterInitFromNode((SNode*)pEventWindowNode->pStartCond, &pInfo->pStartCondInfo, 0); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + code = filterInitFromNode((SNode*)pEventWindowNode->pEndCond, &pInfo->pEndCondInfo, 0); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + if (pEventWindowNode->window.pExprs != NULL) { int32_t numOfScalarExpr = 0; - SExprInfo* pScalarExprInfo = createExprInfo(pStateNode->window.pExprs, NULL, &numOfScalarExpr); - int32_t code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, numOfScalarExpr); + SExprInfo* pScalarExprInfo = createExprInfo(pEventWindowNode->window.pExprs, NULL, &numOfScalarExpr); + code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, numOfScalarExpr); if (code != TSDB_CODE_SUCCESS) { goto _error; } } - pInfo->stateCol = extractColumnFromColumnNode(pColNode); - pInfo->stateKey.type = pInfo->stateCol.type; - pInfo->stateKey.bytes = pInfo->stateCol.bytes; - pInfo->stateKey.pData = taosMemoryCalloc(1, pInfo->stateCol.bytes); - if (pInfo->stateKey.pData == NULL) { - goto _error; - } - - int32_t code = filterInitFromNode((SNode*)pStateNode->window.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0); + code = filterInitFromNode((SNode*)pEventWindowNode->window.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -103,7 +108,7 @@ SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SEventWi size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; int32_t num = 0; - SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &num); + SExprInfo* pExprInfo = createExprInfo(pEventWindowNode->window.pFuncs, NULL, &num); initResultSizeInfo(&pOperator->resultInfo, 4096); code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); @@ -111,20 +116,22 @@ SOperatorInfo* createEventwindowOperatorInfo(SOperatorInfo* downstream, SEventWi goto _error; } - SSDataBlock* pResBlock = createDataBlockFromDescNode(pStateNode->window.node.pOutputDataBlockDesc); + SSDataBlock* pResBlock = createDataBlockFromDescNode(pEventWindowNode->window.node.pOutputDataBlockDesc); + blockDataEnsureCapacity(pResBlock, pOperator->resultInfo.capacity); + initBasicInfo(&pInfo->binfo, pResBlock); initResultRowInfo(&pInfo->binfo.resultRowInfo); - pInfo->twAggSup = - (STimeWindowAggSupp){.waterMark = pStateNode->window.watermark, .calTrigger = pStateNode->window.triggerType}; + pInfo->twAggSup = (STimeWindowAggSupp){.waterMark = pEventWindowNode->window.watermark, + .calTrigger = pEventWindowNode->window.triggerType}; initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); pInfo->tsSlotId = tsSlotId; - setOperatorInfo(pOperator, "StateWindowOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE, true, OP_NOT_OPENED, pInfo, + setOperatorInfo(pOperator, "EventWindowOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE, true, OP_NOT_OPENED, pInfo, pTaskInfo); - pOperator->fpSet = createOperatorFpSet(openEventWindowAggOptr, doEventWindowAgg, NULL, destroyEWindowOperatorInfo, + pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, eventWindowAggregate, NULL, destroyEWindowOperatorInfo, optrDefaultBufFn, NULL); code = appendDownstream(pOperator, &downstream, 1); @@ -158,17 +165,14 @@ void destroyEWindowOperatorInfo(void* param) { taosMemoryFreeClear(param); } -static int32_t openEventWindowAggOptr(SOperatorInfo* pOperator) { - if (OPTR_IS_OPENED(pOperator)) { - return TSDB_CODE_SUCCESS; - } - +static SSDataBlock* eventWindowAggregate(SOperatorInfo* pOperator) { SEventWindowOperatorInfo* pInfo = pOperator->info; SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SExprSupp* pSup = &pOperator->exprSupp; int32_t order = TSDB_ORDER_ASC; - int64_t st = taosGetTimestampUs(); + + blockDataCleanup(pInfo->binfo.pRes); SOperatorInfo* downstream = pOperator->pDownstream[0]; while (1) { @@ -189,133 +193,113 @@ static int32_t openEventWindowAggOptr(SOperatorInfo* pOperator) { } } - doEventWindowAggImpl(pOperator, pInfo, pBlock); + eventWindowAggImpl(pOperator, pInfo, pBlock); } - pOperator->cost.openCost = (taosGetTimestampUs() - st) / 1000.0; - initGroupedResultInfo(&pInfo->groupResInfo, pInfo->aggSup.pResultRowHashTable, TSDB_ORDER_ASC); - pOperator->status = OP_RES_TO_RETURN; + return pInfo->binfo.pRes->info.rows == 0 ? NULL : pInfo->binfo.pRes; +} +static int32_t setSingleOutputTupleBufv1(SResultRowInfo* pResultRowInfo, STimeWindow* win, SResultRow** pResult, + SExprSupp* pExprSup, SAggSupporter* pAggSup) { + if (*pResult == NULL) { + SResultRow* p = taosMemoryCalloc(1, pAggSup->resultRowSize); + pResultRowInfo->cur = (SResultRowPosition){.pageId = p->pageId, .offset = p->offset}; + *pResult = p; + } + + (*pResult)->win = *win; + setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); return TSDB_CODE_SUCCESS; } -void doEventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock) { - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SExprSupp* pSup = &pOperator->exprSupp; - - SColumnInfoData* pStateColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->stateCol.slotId); - int64_t gid = pBlock->info.id.groupId; - - bool masterScan = true; - int32_t numOfOutput = pOperator->exprSupp.numOfExprs; - int16_t bytes = pStateColInfoData->info.bytes; - - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); - TSKEY* tsList = (TSKEY*)pColInfoData->pData; - +static void doEventWindowAggImpl(SEventWindowOperatorInfo* pInfo, SExprSupp* pSup, int32_t startIndex, int32_t endIndex, + const SSDataBlock* pBlock, int64_t* tsList, SExecTaskInfo* pTaskInfo) { SWindowRowsSup* pRowSup = &pInfo->winSup; - pRowSup->numOfRows = 0; - struct SColumnDataAgg* pAgg = NULL; - for (int32_t j = 0; j < pBlock->info.rows; ++j) { - pAgg = (pBlock->pBlockAgg != NULL) ? pBlock->pBlockAgg[pInfo->stateCol.slotId] : NULL; - if (colDataIsNull(pStateColInfoData, pBlock->info.rows, j, pAgg)) { - continue; - } + int32_t numOfOutput = pSup->numOfExprs; + int32_t numOfRows = endIndex - startIndex + 1; - char* val = colDataGetData(pStateColInfoData, j); + doKeepTuple(pRowSup, tsList[endIndex], pBlock->info.id.groupId); - if (gid != pRowSup->groupId || !pInfo->hasKey) { - // todo extract method - if (IS_VAR_DATA_TYPE(pInfo->stateKey.type)) { - varDataCopy(pInfo->stateKey.pData, val); - } else { - memcpy(pInfo->stateKey.pData, val, bytes); - } - - pInfo->hasKey = true; - - doKeepNewWindowStartInfo(pRowSup, tsList, j, gid); - doKeepTuple(pRowSup, tsList[j], gid); - } else if (compareVal(val, &pInfo->stateKey)) { - doKeepTuple(pRowSup, tsList[j], gid); - if (j == 0 && pRowSup->startRowIndex != 0) { - pRowSup->startRowIndex = 0; - } - } else { // a new state window started - SResultRow* pResult = NULL; - - // keep the time window for the closed time window. - STimeWindow window = pRowSup->win; - - pRowSup->win.ekey = pRowSup->win.skey; - int32_t ret = setTimeWindowOutputBuf(&pInfo->binfo.resultRowInfo, &window, masterScan, &pResult, gid, pSup->pCtx, - numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo); - if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code - T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR); - } - - updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &window, false); - applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, - pRowSup->numOfRows, pBlock->info.rows, numOfOutput); - - // here we start a new session window - doKeepNewWindowStartInfo(pRowSup, tsList, j, gid); - doKeepTuple(pRowSup, tsList[j], gid); - - // todo extract method - if (IS_VAR_DATA_TYPE(pInfo->stateKey.type)) { - varDataCopy(pInfo->stateKey.pData, val); - } else { - memcpy(pInfo->stateKey.pData, val, bytes); - } - } - } - - SResultRow* pResult = NULL; - pRowSup->win.ekey = tsList[pBlock->info.rows - 1]; - int32_t ret = setTimeWindowOutputBuf(&pInfo->binfo.resultRowInfo, &pRowSup->win, masterScan, &pResult, gid, - pSup->pCtx, numOfOutput, pSup->rowEntryInfoOffset, &pInfo->aggSup, pTaskInfo); + int32_t ret = + setSingleOutputTupleBufv1(&pInfo->binfo.resultRowInfo, &pRowSup->win, &pInfo->pRow, pSup, &pInfo->aggSup); if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code T_LONG_JMP(pTaskInfo->env, TSDB_CODE_APP_ERROR); } updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pRowSup->win, false); - applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, pRowSup->startRowIndex, pRowSup->numOfRows, + applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startIndex, numOfRows, pBlock->info.rows, numOfOutput); } -SSDataBlock* doEventWindowAgg(SOperatorInfo* pOperator) { - if (pOperator->status == OP_EXEC_DONE) { - return NULL; - } +void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SExprSupp* pSup = &pOperator->exprSupp; - SEventWindowOperatorInfo* pInfo = pOperator->info; - SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; - SOptrBasicInfo* pBInfo = &pInfo->binfo; + int64_t gid = pBlock->info.id.groupId; - pTaskInfo->code = pOperator->fpSet._openFn(pOperator); - if (pTaskInfo->code != TSDB_CODE_SUCCESS) { - setOperatorCompleted(pOperator); - return NULL; - } + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); + TSKEY* tsList = (TSKEY*)pColInfoData->pData; - blockDataEnsureCapacity(pBInfo->pRes, pOperator->resultInfo.capacity); - while (1) { - doBuildResultDatablock(pOperator, &pInfo->binfo, &pInfo->groupResInfo, pInfo->aggSup.pResultBuf); - doFilter(pBInfo->pRes, pOperator->exprSupp.pFilterInfo, NULL); + SColumnInfoData *ps = NULL, *pe = NULL; - bool hasRemain = hasRemainResults(&pInfo->groupResInfo); - if (!hasRemain) { - setOperatorCompleted(pOperator); - break; - } + SWindowRowsSup* pRowSup = &pInfo->winSup; + pRowSup->numOfRows = 0; - if (pBInfo->pRes->info.rows > 0) { - break; + SFilterColumnParam param1 = {.numOfCols = taosArrayGetSize(pBlock->pDataBlock), .pDataBlock = pBlock->pDataBlock}; + int32_t code = filterSetDataFromSlotId(pInfo->pStartCondInfo, ¶m1); + + int32_t status1 = 0; + bool keep1 = filterExecute(pInfo->pStartCondInfo, pBlock, &ps, NULL, param1.numOfCols, &status1); + + SFilterColumnParam param2 = {.numOfCols = taosArrayGetSize(pBlock->pDataBlock), .pDataBlock = pBlock->pDataBlock}; + code = filterSetDataFromSlotId(pInfo->pEndCondInfo, ¶m2); + + int32_t status2 = 0; + bool keep2 = filterExecute(pInfo->pEndCondInfo, pBlock, &pe, NULL, param2.numOfCols, &status2); + + int32_t rowIndex = 0; + int32_t startIndex = pInfo->inWindow ? 0 : -1; + + while (rowIndex < pBlock->info.rows) { + if (pInfo->inWindow) { // let's find the first end value + for (rowIndex = startIndex; rowIndex < pBlock->info.rows; ++rowIndex) { + if (((bool*)pe->pData)[rowIndex]) { + break; + } + } + + if (rowIndex < pBlock->info.rows) { + doEventWindowAggImpl(pInfo, pSup, startIndex, rowIndex, pBlock, tsList, pTaskInfo); + + // todo check if pblock buffer is enough + doUpdateNumOfRows(pSup->pCtx, pInfo->pRow, pSup->numOfExprs, pSup->rowEntryInfoOffset); + + copyResultrowToDataBlock(pSup->pExprInfo, pSup->numOfExprs, pInfo->pRow, pSup->pCtx, pInfo->binfo.pRes, + pSup->rowEntryInfoOffset, pTaskInfo); + + pInfo->binfo.pRes->info.rows += pInfo->pRow->numOfRows; + + pInfo->inWindow = false; + rowIndex += 1; + } else { + doEventWindowAggImpl(pInfo, pSup, startIndex, pBlock->info.rows - 1, pBlock, tsList, pTaskInfo); + } + } else { // find the first start value that is fulfill for the start condition + for (; rowIndex < pBlock->info.rows; ++rowIndex) { + if (((bool*)ps->pData)[rowIndex]) { + doKeepNewWindowStartInfo(pRowSup, tsList, rowIndex, gid); + pInfo->inWindow = true; + startIndex = rowIndex; + break; + } + } + + if (pInfo->inWindow) { + continue; + } else { + break; + } } } - - pOperator->resultInfo.totalRows += pBInfo->pRes->info.rows; - return (pBInfo->pRes->info.rows == 0) ? NULL : pBInfo->pRes; } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index fecdcd8fa3..5ee209a07a 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -936,8 +936,7 @@ static void setExecutionContext(SOperatorInfo* pOperator, int32_t numOfOutput, u pAggInfo->groupId = groupId; } -static void doUpdateNumOfRows(SqlFunctionCtx* pCtx, SResultRow* pRow, int32_t numOfExprs, - const int32_t* rowEntryOffset) { +void doUpdateNumOfRows(SqlFunctionCtx* pCtx, SResultRow* pRow, int32_t numOfExprs, const int32_t* rowEntryOffset) { bool returnNotNull = false; for (int32_t j = 0; j < numOfExprs; ++j) { SResultRowEntryInfo* pResInfo = getResultEntryInfo(pRow, j, rowEntryOffset); @@ -960,8 +959,8 @@ static void doUpdateNumOfRows(SqlFunctionCtx* pCtx, SResultRow* pRow, int32_t nu } } -static void doCopyResultToDataBlock(SExprInfo* pExprInfo, int32_t numOfExprs, SResultRow* pRow, SqlFunctionCtx* pCtx, - SSDataBlock* pBlock, const int32_t* rowEntryOffset, SExecTaskInfo* pTaskInfo) { +void copyResultrowToDataBlock(SExprInfo* pExprInfo, int32_t numOfExprs, SResultRow* pRow, SqlFunctionCtx* pCtx, + SSDataBlock* pBlock, const int32_t* rowEntryOffset, SExecTaskInfo* pTaskInfo) { for (int32_t j = 0; j < numOfExprs; ++j) { int32_t slotId = pExprInfo[j].base.resSchema.slotId; @@ -1022,7 +1021,7 @@ int32_t finalizeResultRows(SDiskbasedBuf* pBuf, SResultRowPosition* resultRowPos T_LONG_JMP(pTaskInfo->env, code); } - doCopyResultToDataBlock(pExprInfo, pSup->numOfExprs, pRow, pCtx, pBlock, rowEntryOffset, pTaskInfo); + copyResultrowToDataBlock(pExprInfo, pSup->numOfExprs, pRow, pCtx, pBlock, rowEntryOffset, pTaskInfo); releaseBufPage(pBuf, page); pBlock->info.rows += pRow->numOfRows; @@ -1070,7 +1069,7 @@ int32_t doCopyToSDataBlock(SExecTaskInfo* pTaskInfo, SSDataBlock* pBlock, SExprS } pGroupResInfo->index += 1; - doCopyResultToDataBlock(pExprInfo, numOfExprs, pRow, pCtx, pBlock, rowEntryOffset, pTaskInfo); + copyResultrowToDataBlock(pExprInfo, numOfExprs, pRow, pCtx, pBlock, rowEntryOffset, pTaskInfo); releaseBufPage(pBuf, page); pBlock->info.rows += pRow->numOfRows; @@ -2087,8 +2086,6 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo pOperator = createCacherowsScanOperator(pScanNode, pHandle, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_PROJECT == type) { pOperator = createProjectOperatorInfo(NULL, (SProjectPhysiNode*)pPhyNode, pTaskInfo); - } else { - ASSERT(0); } if (pOperator != NULL) { @@ -2179,8 +2176,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo pOptr = createIndefinitOutputOperatorInfo(ops[0], pPhyNode, pTaskInfo); } else if (QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC == type) { pOptr = createTimeSliceOperatorInfo(ops[0], pPhyNode, pTaskInfo); - } else { - ASSERT(0); + } else if (QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT == type) { + pOptr = createEventwindowOperatorInfo(ops[0], pPhyNode, pTaskInfo); } taosMemoryFree(ops); From 169a6703d171ef6046e34135edeef0d6fce88ddb Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 3 Jan 2023 17:51:50 +0800 Subject: [PATCH 004/139] enh(query): support event window. --- .../libs/executor/src/eventwindowoperator.c | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c index 61c8030bd9..1480ac0451 100644 --- a/source/libs/executor/src/eventwindowoperator.c +++ b/source/libs/executor/src/eventwindowoperator.c @@ -172,7 +172,9 @@ static SSDataBlock* eventWindowAggregate(SOperatorInfo* pOperator) { SExprSupp* pSup = &pOperator->exprSupp; int32_t order = TSDB_ORDER_ASC; - blockDataCleanup(pInfo->binfo.pRes); + SSDataBlock* pRes = pInfo->binfo.pRes; + + blockDataCleanup(pRes); SOperatorInfo* downstream = pOperator->pDownstream[0]; while (1) { @@ -194,9 +196,12 @@ static SSDataBlock* eventWindowAggregate(SOperatorInfo* pOperator) { } eventWindowAggImpl(pOperator, pInfo, pBlock); + if (pRes->info.rows >= pOperator->resultInfo.threshold) { + return pRes; + } } - return pInfo->binfo.pRes->info.rows == 0 ? NULL : pInfo->binfo.pRes; + return pRes->info.rows == 0 ? NULL : pRes; } static int32_t setSingleOutputTupleBufv1(SResultRowInfo* pResultRowInfo, STimeWindow* win, SResultRow** pResult, @@ -236,6 +241,7 @@ void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInf SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SExprSupp* pSup = &pOperator->exprSupp; + SSDataBlock* pRes = pInfo->binfo.pRes; int64_t gid = pBlock->info.id.groupId; SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId); @@ -272,13 +278,18 @@ void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInf if (rowIndex < pBlock->info.rows) { doEventWindowAggImpl(pInfo, pSup, startIndex, rowIndex, pBlock, tsList, pTaskInfo); - // todo check if pblock buffer is enough doUpdateNumOfRows(pSup->pCtx, pInfo->pRow, pSup->numOfExprs, pSup->rowEntryInfoOffset); - copyResultrowToDataBlock(pSup->pExprInfo, pSup->numOfExprs, pInfo->pRow, pSup->pCtx, pInfo->binfo.pRes, + // check buffer size + if (pRes->info.rows + pInfo->pRow->numOfRows >= pRes->info.capacity) { + int32_t newSize = pRes->info.rows + pInfo->pRow->numOfRows; + blockDataEnsureCapacity(pRes, newSize); + } + + copyResultrowToDataBlock(pSup->pExprInfo, pSup->numOfExprs, pInfo->pRow, pSup->pCtx, pRes, pSup->rowEntryInfoOffset, pTaskInfo); - pInfo->binfo.pRes->info.rows += pInfo->pRow->numOfRows; + pRes->info.rows += pInfo->pRow->numOfRows; pInfo->inWindow = false; rowIndex += 1; From 4dce537a8a77fc682df83a0520179a8604d2ef34 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 3 Jan 2023 19:27:16 +0800 Subject: [PATCH 005/139] enh(query): opt filter perf. --- source/libs/executor/src/executorimpl.c | 102 +++++++++++++++++++----- 1 file changed, 84 insertions(+), 18 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 5ee209a07a..41f93a62c5 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -858,32 +858,100 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD } else if (status == FILTER_RESULT_NONE_QUALIFIED) { pBlock->info.rows = 0; } else { - SSDataBlock* px = createOneDataBlock(pBlock, true); + int32_t bmLen = BitmapLen(totalRows); + char* pBitmap = NULL; size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* pSrc = taosArrayGet(px->pDataBlock, i); SColumnInfoData* pDst = taosArrayGet(pBlock->pDataBlock, i); // it is a reserved column for scalar function, and no data in this column yet. - if (pDst->pData == NULL || pSrc->pData == NULL) { + if (pDst->pData == NULL) { continue; } - colInfoDataCleanup(pDst, pBlock->info.rows); - int32_t numOfRows = 0; - for (int32_t j = 0; j < totalRows; ++j) { - if (((int8_t*)p->pData)[j] == 0) { - continue; - } - if (colDataIsNull_s(pSrc, j)) { - colDataAppendNULL(pDst, numOfRows); - } else { - colDataAppend(pDst, numOfRows, colDataGetData(pSrc, j), false); - } - numOfRows += 1; - } + switch (pDst->info.type) { + case TSDB_DATA_TYPE_VARCHAR: + case TSDB_DATA_TYPE_NCHAR: + break; + default: + if (pBitmap == NULL) { + pBitmap = taosMemoryCalloc(1, bmLen); + } + memcpy(pBitmap, pDst->nullbitmap, bmLen); + memset(pDst->nullbitmap, 0, bmLen); + + int32_t j = 0; + + switch (pDst->info.type) { + case TSDB_DATA_TYPE_BIGINT: + case TSDB_DATA_TYPE_UBIGINT: + case TSDB_DATA_TYPE_DOUBLE: + case TSDB_DATA_TYPE_TIMESTAMP: + while (j < totalRows) { + if (((int8_t*)p->pData)[j] == 0) { + j += 1; + continue; + } + + if (colDataIsNull_f(pBitmap, j)) { + colDataAppendNULL(pDst, numOfRows); + } else { + ((int64_t*)pDst->pData)[numOfRows] = ((int64_t*)pDst->pData)[j]; + } + numOfRows += 1; + } + break; + case TSDB_DATA_TYPE_FLOAT: + case TSDB_DATA_TYPE_INT: + case TSDB_DATA_TYPE_UINT: + while (j < totalRows) { + if (((int8_t*)p->pData)[j] == 0) { + j += 1; + continue; + } + if (colDataIsNull_f(pBitmap, j)) { + colDataAppendNULL(pDst, numOfRows); + } else { + ((int32_t*)pDst->pData)[numOfRows++] = ((int32_t*)pDst->pData)[j]; + } + numOfRows += 1; + } + break; + case TSDB_DATA_TYPE_SMALLINT: + case TSDB_DATA_TYPE_USMALLINT: + while (j < totalRows) { + if (((int8_t*)p->pData)[j] == 0) { + j += 1; + continue; + } + if (colDataIsNull_f(pBitmap, j)) { + colDataAppendNULL(pDst, numOfRows); + } else { + ((int16_t*)pDst->pData)[numOfRows++] = ((int16_t*)pDst->pData)[j]; + } + numOfRows += 1; + } + break; + case TSDB_DATA_TYPE_BOOL: + case TSDB_DATA_TYPE_TINYINT: + case TSDB_DATA_TYPE_UTINYINT: + while (j < totalRows) { + if (((int8_t*)p->pData)[j] == 0) { + j += 1; + continue; + } + if (colDataIsNull_f(pBitmap, j)) { + colDataAppendNULL(pDst, numOfRows); + } else { + ((int8_t*)pDst->pData)[numOfRows] = ((int8_t*)pDst->pData)[j]; + } + numOfRows += 1; + } + break; + } + }; // todo this value can be assigned directly if (pBlock->info.rows == totalRows) { @@ -892,8 +960,6 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const SColumnInfoD ASSERT(pBlock->info.rows == numOfRows); } } - - blockDataDestroy(px); // fix memory leak } } From 730fbe42cb659361c07e145e38f98cee77d22f8e Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 5 Jan 2023 14:34:07 +0800 Subject: [PATCH 006/139] fix:add logic for system table ins_columns --- include/client/taos.h | 1 + include/common/systable.h | 1 + include/common/tmsg.h | 1 + source/client/src/clientMain.c | 25 ++++ source/common/src/systable.c | 13 ++ source/dnode/mnode/impl/src/mndShow.c | 2 + source/libs/executor/src/sysscanoperator.c | 140 ++++++++++++++++++++- source/libs/parser/src/parAstParser.c | 28 +++++ source/libs/parser/src/parTranslater.c | 14 ++- source/libs/parser/test/mockCatalog.cpp | 4 + source/libs/planner/src/planPhysiCreater.c | 3 +- 11 files changed, 225 insertions(+), 7 deletions(-) diff --git a/include/client/taos.h b/include/client/taos.h index 838d0e8266..c51aa6f7c4 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -208,6 +208,7 @@ DLL_EXPORT TAOS_ROW *taos_result_block(TAOS_RES *res); DLL_EXPORT const char *taos_get_server_info(TAOS *taos); DLL_EXPORT const char *taos_get_client_info(); +DLL_EXPORT const char *taos_get_current_db(TAOS *taos, size_t *required); DLL_EXPORT const char *taos_errstr(TAOS_RES *res); DLL_EXPORT int taos_errno(TAOS_RES *res); diff --git a/include/common/systable.h b/include/common/systable.h index 6f65c1e8b8..9b5f66f64c 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -36,6 +36,7 @@ extern "C" { #define TSDB_INS_TABLE_STABLES "ins_stables" #define TSDB_INS_TABLE_TABLES "ins_tables" #define TSDB_INS_TABLE_TAGS "ins_tags" +#define TSDB_INS_TABLE_COLS "ins_columns" #define TSDB_INS_TABLE_TABLE_DISTRIBUTED "ins_table_distributed" #define TSDB_INS_TABLE_USERS "ins_users" #define TSDB_INS_TABLE_LICENCES "ins_grants" diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 800f9e2eb7..5c1288e391 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -115,6 +115,7 @@ typedef enum _mgmt_table { TSDB_MGMT_TABLE_STREAMS, TSDB_MGMT_TABLE_TABLE, TSDB_MGMT_TABLE_TAG, + TSDB_MGMT_TABLE_COL, TSDB_MGMT_TABLE_USER, TSDB_MGMT_TABLE_GRANTS, TSDB_MGMT_TABLE_VGROUP, diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index be4012d53a..9c8e3e1465 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -430,6 +430,22 @@ const char *taos_data_type(int type) { return "TSDB_DATA_TYPE_NCHAR"; case TSDB_DATA_TYPE_JSON: return "TSDB_DATA_TYPE_JSON"; + case TSDB_DATA_TYPE_UTINYINT: + return "TSDB_DATA_TYPE_UTINYINT"; + case TSDB_DATA_TYPE_USMALLINT: + return "TSDB_DATA_TYPE_USMALLINT"; + case TSDB_DATA_TYPE_UINT: + return "TSDB_DATA_TYPE_UINT"; + case TSDB_DATA_TYPE_UBIGINT: + return "TSDB_DATA_TYPE_UBIGINT"; + case TSDB_DATA_TYPE_VARBINARY: + return "TSDB_DATA_TYPE_VARBINARY"; + case TSDB_DATA_TYPE_DECIMAL: + return "TSDB_DATA_TYPE_DECIMAL"; + case TSDB_DATA_TYPE_BLOB: + return "TSDB_DATA_TYPE_BLOB"; + case TSDB_DATA_TYPE_MEDIUMBLOB: + return "TSDB_DATA_TYPE_MEDIUMBLOB"; default: return "UNKNOWN"; } @@ -670,6 +686,15 @@ const char *taos_get_server_info(TAOS *taos) { return pTscObj->sDetailVer; } +const char *taos_get_current_db(TAOS *taos, size_t *required) { + STscObj *pTscObj = acquireTscObj(*(int64_t *)taos); + if (pTscObj == NULL) { + terrno = TSDB_CODE_TSC_DISCONNECTED; + return NULL; + } + return pTscObj->db; +} + static void destoryTablesReq(void *p) { STablesReq *pRes = (STablesReq *)p; taosArrayDestroy(pRes->pTables); diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 60a673ef9c..9171ad76db 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -176,6 +176,18 @@ static const SSysDbTableSchema userTagsSchema[] = { {.name = "tag_value", .bytes = TSDB_MAX_TAGS_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, }; +static const SSysDbTableSchema userColsSchema[] = { + {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "stable_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "col_name", .bytes = TSDB_COL_NAME_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "col_type", .bytes = 32 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "col_length", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "col_precision", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "col_scale", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "col_nullable", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, +}; + static const SSysDbTableSchema userTblDistSchema[] = { {.name = "db_name", .bytes = 32 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "table_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, @@ -292,6 +304,7 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_STABLES, userStbsSchema, tListLen(userStbsSchema), false}, {TSDB_INS_TABLE_TABLES, userTblsSchema, tListLen(userTblsSchema), false}, {TSDB_INS_TABLE_TAGS, userTagsSchema, tListLen(userTagsSchema), false}, + {TSDB_INS_TABLE_COLS, userColsSchema, tListLen(userColsSchema), false}, // {TSDB_INS_TABLE_TABLE_DISTRIBUTED, userTblDistSchema, tListLen(userTblDistSchema)}, {TSDB_INS_TABLE_USERS, userUsersSchema, tListLen(userUsersSchema), false}, {TSDB_INS_TABLE_LICENCES, grantsSchema, tListLen(grantsSchema), true}, diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index 7a8de4099f..4f644d4be1 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -76,6 +76,8 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { type = TSDB_MGMT_TABLE_TABLE; } else if (strncasecmp(name, TSDB_INS_TABLE_TAGS, len) == 0) { type = TSDB_MGMT_TABLE_TAG; + } else if (strncasecmp(name, TSDB_INS_TABLE_COLS, len) == 0) { + type = TSDB_MGMT_TABLE_COL; } else if (strncasecmp(name, TSDB_INS_TABLE_TABLE_DISTRIBUTED, len) == 0) { // type = TSDB_MGMT_TABLE_DIST; } else if (strncasecmp(name, TSDB_INS_TABLE_USERS, len) == 0) { diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index ac32b54f56..4441f57c0f 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -413,6 +413,135 @@ static bool sysTableIsCondOnOneTable(SNode* pCond, char* condTable) { return false; } +static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; + SSysTableScanInfo* pInfo = pOperator->info; + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } + + blockDataCleanup(pInfo->pRes); + int32_t numOfRows = 0; + + SSDataBlock* dataBlock = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_COLS); + blockDataEnsureCapacity(dataBlock, pOperator->resultInfo.capacity); + + const char* db = NULL; + int32_t vgId = 0; + vnodeGetInfo(pInfo->readHandle.vnode, &db, &vgId); + + SName sn = {0}; + char dbname[TSDB_DB_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + tNameFromString(&sn, db, T_NAME_ACCT | T_NAME_DB); + + tNameGetDbName(&sn, varDataVal(dbname)); + varDataSetLen(dbname, strlen(varDataVal(dbname))); + + char condTableName[TSDB_TABLE_NAME_LEN] = {0}; + // optimize when sql like where table_name='tablename' and xxx. + if (pInfo->pCondition && sysTableIsCondOnOneTable(pInfo->pCondition, condTableName)) { + char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(tableName, condTableName); + + SMetaReader smrChildTable = {0}; + metaReaderInit(&smrChildTable, pInfo->readHandle.meta, 0); + int32_t code = metaGetTableEntryByName(&smrChildTable, condTableName); + if (code != TSDB_CODE_SUCCESS) { + // terrno has been set by metaGetTableEntryByName, therefore, return directly + metaReaderClear(&smrChildTable); + blockDataDestroy(dataBlock); + pInfo->loadInfo.totalRows = 0; + return NULL; + } + + if (smrChildTable.me.type != TSDB_CHILD_TABLE) { + metaReaderClear(&smrChildTable); + blockDataDestroy(dataBlock); + pInfo->loadInfo.totalRows = 0; + return NULL; + } + + SMetaReader smrSuperTable = {0}; + metaReaderInit(&smrSuperTable, pInfo->readHandle.meta, META_READER_NOLOCK); + code = metaGetTableEntryByUid(&smrSuperTable, smrChildTable.me.ctbEntry.suid); + if (code != TSDB_CODE_SUCCESS) { + // terrno has been set by metaGetTableEntryByUid + metaReaderClear(&smrSuperTable); + metaReaderClear(&smrChildTable); + blockDataDestroy(dataBlock); + return NULL; + } + + sysTableUserTagsFillOneTableTags(pInfo, &smrSuperTable, &smrChildTable, dbname, tableName, &numOfRows, dataBlock); + metaReaderClear(&smrSuperTable); + metaReaderClear(&smrChildTable); + + if (numOfRows > 0) { + relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); + numOfRows = 0; + } + blockDataDestroy(dataBlock); + pInfo->loadInfo.totalRows += pInfo->pRes->info.rows; + setOperatorCompleted(pOperator); + return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes; + } + + int32_t ret = 0; + if (pInfo->pCur == NULL) { + pInfo->pCur = metaOpenTbCursor(pInfo->readHandle.meta); + } + + while ((ret = metaTbCursorNext(pInfo->pCur)) == 0) { + if (pInfo->pCur->mr.me.type != TSDB_CHILD_TABLE) { + continue; + } + + char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); + + SMetaReader smrSuperTable = {0}; + metaReaderInit(&smrSuperTable, pInfo->readHandle.meta, 0); + uint64_t suid = pInfo->pCur->mr.me.ctbEntry.suid; + int32_t code = metaGetTableEntryByUid(&smrSuperTable, suid); + if (code != TSDB_CODE_SUCCESS) { + qError("failed to get super table meta, uid:0x%" PRIx64 ", code:%s, %s", suid, tstrerror(terrno), + GET_TASKID(pTaskInfo)); + metaReaderClear(&smrSuperTable); + metaCloseTbCursor(pInfo->pCur); + pInfo->pCur = NULL; + T_LONG_JMP(pTaskInfo->env, terrno); + } + + sysTableUserTagsFillOneTableTags(pInfo, &smrSuperTable, &pInfo->pCur->mr, dbname, tableName, &numOfRows, dataBlock); + + metaReaderClear(&smrSuperTable); + + if (numOfRows >= pOperator->resultInfo.capacity) { + relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); + numOfRows = 0; + + if (pInfo->pRes->info.rows > 0) { + break; + } + } + } + + if (numOfRows > 0) { + relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); + numOfRows = 0; + } + + blockDataDestroy(dataBlock); + if (ret != 0) { + metaCloseTbCursor(pInfo->pCur); + pInfo->pCur = NULL; + setOperatorCompleted(pOperator); + } + + pInfo->loadInfo.totalRows += pInfo->pRes->info.rows; + return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes; +} + static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SSysTableScanInfo* pInfo = pOperator->info; @@ -1321,6 +1450,8 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { pBlock = sysTableScanUserTables(pOperator); } else if (strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { pBlock = sysTableScanUserTags(pOperator); + } else if (strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0) { + pBlock = sysTableScanUserCols(pOperator); } else if (strncasecmp(name, TSDB_INS_TABLE_STABLES, TSDB_TABLE_FNAME_LEN) == 0 && pInfo->showRewrite && IS_SYS_DBNAME(dbName)) { pBlock = sysTableScanUserSTables(pOperator); @@ -1427,6 +1558,7 @@ static SSDataBlock* sysTableScanFromMNode(SOperatorInfo* pOperator, SSysTableSca SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScanPhysiNode* pScanPhyNode, const char* pUser, SExecTaskInfo* pTaskInfo) { + int32_t code = TDB_CODE_SUCCESS; SSysTableScanInfo* pInfo = taosMemoryCalloc(1, sizeof(SSysTableScanInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); if (pInfo == NULL || pOperator == NULL) { @@ -1437,7 +1569,7 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan SDataBlockDescNode* pDescNode = pScanNode->node.pOutputDataBlockDesc; int32_t num = 0; - int32_t code = extractColMatchInfo(pScanNode->pScanCols, pDescNode, &num, COL_MATCH_FROM_COL_ID, &pInfo->matchInfo); + code = extractColMatchInfo(pScanNode->pScanCols, pDescNode, &num, COL_MATCH_FROM_COL_ID, &pInfo->matchInfo); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -1463,7 +1595,8 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan const char* name = tNameGetTableName(&pInfo->name); if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0 || - strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { + strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0 || + strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0) { pInfo->readHandle = *(SReadHandle*)readHandle; } else { tsem_init(&pInfo->ready, 0, 0); @@ -1513,7 +1646,8 @@ void destroySysScanOperator(void* param) { const char* name = tNameGetTableName(&pInfo->name); if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0 || - strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0 || pInfo->pCur != NULL) { + strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0 || + strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0|| pInfo->pCur != NULL) { metaCloseTbCursor(pInfo->pCur); pInfo->pCur = NULL; } diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index fae62626fa..5019f4c757 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -147,6 +147,16 @@ static int32_t collectMetaKeyFromInsTags(SCollectMetaKeyCxt* pCxt) { return code; } +static int32_t collectMetaKeyFromInsCols(SCollectMetaKeyCxt* pCxt) { + SSelectStmt* pSelect = (SSelectStmt*)pCxt->pStmt; + SName name = {0}; + int32_t code = getVnodeSysTableTargetName(pCxt->pParseCxt->acctId, pSelect->pWhere, &name); + if (TSDB_CODE_SUCCESS == code) { + code = collectMetaKeyFromInsTagsImpl(pCxt, &name); + } + return code; +} + static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const char* pDb, const char* pTable, AUTH_TYPE authType) { int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pDb, pTable, pCxt->pMetaCache); @@ -170,6 +180,11 @@ static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const c QUERY_NODE_SELECT_STMT == nodeType(pCxt->pStmt)) { code = collectMetaKeyFromInsTags(pCxt); } + if (TSDB_CODE_SUCCESS == code && + 0 == strcmp(pTable, TSDB_INS_TABLE_COLS) && + QUERY_NODE_SELECT_STMT == nodeType(pCxt->pStmt)) { + code = collectMetaKeyFromInsCols(pCxt); + } return code; } @@ -475,6 +490,19 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p return code; } +static int32_t collectMetaKeyFromShowCols(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_COLS, + pCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); + } + if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pTbName) { + code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, + ((SValueNode*)pStmt->pTbName)->literal, pCxt->pMetaCache); + } + return code; +} + static int32_t collectMetaKeyFromShowStableTags(SCollectMetaKeyCxt* pCxt, SShowTableTagsStmt* pStmt) { return collectMetaKeyFromRealTableImpl(pCxt, ((SValueNode*)pStmt->pDbName)->literal, ((SValueNode*)pStmt->pTbName)->literal, AUTH_TYPE_READ); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index a9a8e4d4c2..a9d55de77c 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -162,6 +162,13 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, + { + .showType = QUERY_NODE_SHOW_TAGS_STMT, + .pDbName = TSDB_INFORMATION_SCHEMA_DB, + .pTableName = TSDB_INS_TABLE_COLS, + .numOfShowCols = 1, + .pShowCols = {"*"} + }, { .showType = QUERY_NODE_SHOW_USERS_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, @@ -2210,7 +2217,7 @@ static int32_t dnodeToVgroupsInfo(SArray* pDnodes, SVgroupsInfo** pVgsInfo) { } static bool sysTableFromVnode(const char* pTable) { - return ((0 == strcmp(pTable, TSDB_INS_TABLE_TABLES)) || (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS))); + return ((0 == strcmp(pTable, TSDB_INS_TABLE_TABLES)) || (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS)) || (0 == strcmp(pTable, TSDB_INS_TABLE_COLS))); } static bool sysTableFromDnode(const char* pTable) { return 0 == strcmp(pTable, TSDB_INS_TABLE_DNODE_VARIABLES); } @@ -2273,7 +2280,7 @@ static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName, SArray* pVgs = NULL; int32_t code = getVnodeSysTableVgroupList(pCxt, pName, &pVgs, &hasUserDbCond); - if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS) && + if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS) && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS) && isSelectStmt(pCxt->pCurrStmt) && 0 == taosArrayGetSize(pVgs)) { ((SSelectStmt*)pCxt->pCurrStmt)->isEmptyResult = true; } @@ -2376,7 +2383,8 @@ static bool isSingleTable(SRealTableNode* pRealTable) { int8_t tableType = pRealTable->pMeta->tableType; if (TSDB_SYSTEM_TABLE == tableType) { return 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) && - 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS); + 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS) && + 0 != strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS); } return (TSDB_CHILD_TABLE == tableType || TSDB_NORMAL_TABLE == tableType); } diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index ae702ec02f..c3f6c3ac72 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -102,6 +102,10 @@ void generateInformationSchema(MockCatalogService* mcs) { .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) .done(); + mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_COLS, TSDB_SYSTEM_TABLE, 2) + .addColumn("table_name", TSDB_DATA_TYPE_BINARY, TSDB_TABLE_NAME_LEN) + .addColumn("db_name", TSDB_DATA_TYPE_BINARY, TSDB_DB_NAME_LEN) + .done(); mcs->createTableBuilder(TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_USER_PRIVILEGES, TSDB_SYSTEM_TABLE, 2) .addColumn("user_name", TSDB_DATA_TYPE_BINARY, TSDB_USER_LEN) .addColumn("privilege", TSDB_DATA_TYPE_BINARY, 10) diff --git a/source/libs/planner/src/planPhysiCreater.c b/source/libs/planner/src/planPhysiCreater.c index 7d6238193d..f83704be87 100644 --- a/source/libs/planner/src/planPhysiCreater.c +++ b/source/libs/planner/src/planPhysiCreater.c @@ -609,7 +609,8 @@ static int32_t createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pScan->accountId = pCxt->pPlanCxt->acctId; pScan->sysInfo = pCxt->pPlanCxt->sysInfo; if (0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_TABLES) || - 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_TAGS)) { + 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_TAGS) || + 0 == strcmp(pScanLogicNode->tableName.tname, TSDB_INS_TABLE_COLS)) { vgroupInfoToNodeAddr(pScanLogicNode->pVgroupList->vgroups, &pSubplan->execNode); } else { pSubplan->execNode.nodeId = MNODE_HANDLE; From 47ace000903ac18e1c9ef87735a3846b6a9e56b6 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Thu, 5 Jan 2023 15:40:43 +0800 Subject: [PATCH 007/139] enh: refactor some sync func names for pipelining --- source/libs/sync/inc/syncMessage.h | 4 +-- source/libs/sync/inc/syncPipeline.h | 12 ++++---- source/libs/sync/src/syncAppendEntries.c | 4 +-- source/libs/sync/src/syncMessage.c | 4 +-- source/libs/sync/src/syncPipeline.c | 35 +++++++++++------------- 5 files changed, 28 insertions(+), 31 deletions(-) diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index 3bd94dbab5..bd89f6af3a 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -258,8 +258,8 @@ int32_t syncBuildRequestVote(SRpcMsg* pMsg, int32_t vgId); int32_t syncBuildRequestVoteReply(SRpcMsg* pMsg, int32_t vgId); int32_t syncBuildAppendEntries(SRpcMsg* pMsg, int32_t dataLen, int32_t vgId); int32_t syncBuildAppendEntriesReply(SRpcMsg* pMsg, int32_t vgId); -int32_t syncBuildAppendEntriesFromRaftLog(SSyncNode* pNode, SSyncRaftEntry* pEntry, SyncTerm prevLogTerm, - SRpcMsg* pRpcMsg); +int32_t syncBuildAppendEntriesFromRaftEntry(SSyncNode* pNode, SSyncRaftEntry* pEntry, SyncTerm prevLogTerm, + SRpcMsg* pRpcMsg); int32_t syncBuildHeartbeat(SRpcMsg* pMsg, int32_t vgId); int32_t syncBuildHeartbeatReply(SRpcMsg* pMsg, int32_t vgId); int32_t syncBuildPreSnapshot(SRpcMsg* pMsg, int32_t vgId); diff --git a/source/libs/sync/inc/syncPipeline.h b/source/libs/sync/inc/syncPipeline.h index a0a0691694..fb5541f916 100644 --- a/source/libs/sync/inc/syncPipeline.h +++ b/source/libs/sync/inc/syncPipeline.h @@ -78,14 +78,14 @@ static FORCE_INLINE int32_t syncLogGetNextRetryBackoff(SSyncLogReplMgr* pMgr) { SyncTerm syncLogReplMgrGetPrevLogTerm(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index); int32_t syncLogReplMgrReplicateOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode); -int32_t syncLogBufferReplicateOneTo(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index, SyncTerm* pTerm, - SRaftId* pDestId, bool* pBarrier); -int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode); -int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index); +int32_t syncLogReplMgrReplicateOneTo(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index, SyncTerm* pTerm, + SRaftId* pDestId, bool* pBarrier); +int32_t syncLogReplMgrReplicateAttempt(SSyncLogReplMgr* pMgr, SSyncNode* pNode); +int32_t syncLogReplMgrReplicateProbe(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index); int32_t syncLogReplMgrProcessReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg); -int32_t syncLogReplMgrProcessReplyInRecoveryMode(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg); -int32_t syncLogReplMgrProcessReplyInNormalMode(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg); +int32_t syncLogReplMgrProcessReplyAsRecovery(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg); +int32_t syncLogReplMgrProcessReplyAsNormal(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg); int32_t syncLogReplMgrProcessHeartbeatReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncHeartbeatReply* pMsg); int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode); diff --git a/source/libs/sync/src/syncAppendEntries.c b/source/libs/sync/src/syncAppendEntries.c index 1dc6905b88..d9b13610e3 100644 --- a/source/libs/sync/src/syncAppendEntries.c +++ b/source/libs/sync/src/syncAppendEntries.c @@ -127,7 +127,7 @@ int32_t syncNodeFollowerCommit(SSyncNode* ths, SyncIndex newCommitIndex) { return 0; } -SSyncRaftEntry* syncLogAppendEntriesToRaftEntry(const SyncAppendEntries* pMsg) { +SSyncRaftEntry* syncBuildRaftEntryFromAppendEntries(const SyncAppendEntries* pMsg) { SSyncRaftEntry* pEntry = taosMemoryMalloc(pMsg->dataLen); if (pEntry == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -181,7 +181,7 @@ int32_t syncNodeOnAppendEntries(SSyncNode* ths, const SRpcMsg* pRpcMsg) { goto _IGNORE; } - SSyncRaftEntry* pEntry = syncLogAppendEntriesToRaftEntry(pMsg); + SSyncRaftEntry* pEntry = syncBuildRaftEntryFromAppendEntries(pMsg); if (pEntry == NULL) { sError("vgId:%d, failed to get raft entry from append entries since %s", ths->vgId, terrstr()); diff --git a/source/libs/sync/src/syncMessage.c b/source/libs/sync/src/syncMessage.c index 467b4e2219..af2555153b 100644 --- a/source/libs/sync/src/syncMessage.c +++ b/source/libs/sync/src/syncMessage.c @@ -154,8 +154,8 @@ int32_t syncBuildAppendEntriesReply(SRpcMsg* pMsg, int32_t vgId) { return 0; } -int32_t syncBuildAppendEntriesFromRaftLog(SSyncNode* pNode, SSyncRaftEntry* pEntry, SyncTerm prevLogTerm, - SRpcMsg* pRpcMsg) { +int32_t syncBuildAppendEntriesFromRaftEntry(SSyncNode* pNode, SSyncRaftEntry* pEntry, SyncTerm prevLogTerm, + SRpcMsg* pRpcMsg) { uint32_t dataLen = pEntry->bytes; uint32_t bytes = sizeof(SyncAppendEntries) + dataLen; pRpcMsg->contLen = bytes; diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 410986b87a..4a5dc46c76 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -617,7 +617,7 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { } bool barrier = false; - if (syncLogBufferReplicateOneTo(pMgr, pNode, index, &term, pDestId, &barrier) < 0) { + if (syncLogReplMgrReplicateOneTo(pMgr, pNode, index, &term, pDestId, &barrier) < 0) { sError("vgId:%d, failed to replicate sync log entry since %s. index: %" PRId64 ", dest: %" PRIx64 "", pNode->vgId, terrstr(), index, pDestId->addr); goto _out; @@ -647,8 +647,7 @@ _out: return ret; } -int32_t syncLogReplMgrProcessReplyInRecoveryMode(SSyncLogReplMgr* pMgr, SSyncNode* pNode, - SyncAppendEntriesReply* pMsg) { +int32_t syncLogReplMgrProcessReplyAsRecovery(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg) { SSyncLogBuffer* pBuf = pNode->pLogBuf; SRaftId destId = pMsg->srcId; ASSERT(pMgr->restored == false); @@ -723,7 +722,7 @@ int32_t syncLogReplMgrProcessReplyInRecoveryMode(SSyncLogReplMgr* pMgr, SSyncNod // attempt to replicate the raft log at index (void)syncLogReplMgrReset(pMgr); - return syncLogReplMgrReplicateProbeOnce(pMgr, pNode, index); + return syncLogReplMgrReplicateProbe(pMgr, pNode, index); } int32_t syncLogReplMgrProcessHeartbeatReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncHeartbeatReply* pMsg) { @@ -751,9 +750,9 @@ int32_t syncLogReplMgrProcessReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, Sync } if (pMgr->restored) { - (void)syncLogReplMgrProcessReplyInNormalMode(pMgr, pNode, pMsg); + (void)syncLogReplMgrProcessReplyAsNormal(pMgr, pNode, pMsg); } else { - (void)syncLogReplMgrProcessReplyInRecoveryMode(pMgr, pNode, pMsg); + (void)syncLogReplMgrProcessReplyAsRecovery(pMgr, pNode, pMsg); } taosThreadMutexUnlock(&pBuf->mutex); return 0; @@ -761,14 +760,14 @@ int32_t syncLogReplMgrProcessReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, Sync int32_t syncLogReplMgrReplicateOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { if (pMgr->restored) { - (void)syncLogReplMgrReplicateAttemptedOnce(pMgr, pNode); + (void)syncLogReplMgrReplicateAttempt(pMgr, pNode); } else { - (void)syncLogReplMgrReplicateProbeOnce(pMgr, pNode, pNode->pLogBuf->matchIndex); + (void)syncLogReplMgrReplicateProbe(pMgr, pNode, pNode->pLogBuf->matchIndex); } return 0; } -int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index) { +int32_t syncLogReplMgrReplicateProbe(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index) { ASSERT(!pMgr->restored); ASSERT(pMgr->startIndex >= 0); int64_t retryMaxWaitMs = SYNC_LOG_REPL_RETRY_WAIT_MS * (1 << SYNC_MAX_RETRY_BACKOFF); @@ -783,7 +782,7 @@ int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; bool barrier = false; SyncTerm term = -1; - if (syncLogBufferReplicateOneTo(pMgr, pNode, index, &term, pDestId, &barrier) < 0) { + if (syncLogReplMgrReplicateOneTo(pMgr, pNode, index, &term, pDestId, &barrier) < 0) { sError("vgId:%d, failed to replicate log entry since %s. index: %" PRId64 ", dest: 0x%016" PRIx64 "", pNode->vgId, terrstr(), index, pDestId->addr); return -1; @@ -807,7 +806,7 @@ int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode return 0; } -int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { +int32_t syncLogReplMgrReplicateAttempt(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { ASSERT(pMgr->restored); SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; @@ -827,7 +826,7 @@ int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* p SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; bool barrier = false; SyncTerm term = -1; - if (syncLogBufferReplicateOneTo(pMgr, pNode, index, &term, pDestId, &barrier) < 0) { + if (syncLogReplMgrReplicateOneTo(pMgr, pNode, index, &term, pDestId, &barrier) < 0) { sError("vgId:%d, failed to replicate log entry since %s. index: %" PRId64 ", dest: 0x%016" PRIx64 "", pNode->vgId, terrstr(), index, pDestId->addr); return -1; @@ -857,7 +856,7 @@ int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* p return 0; } -int32_t syncLogReplMgrProcessReplyInNormalMode(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg) { +int32_t syncLogReplMgrProcessReplyAsNormal(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg) { ASSERT(pMgr->restored == true); if (pMgr->startIndex <= pMsg->lastSendIndex && pMsg->lastSendIndex < pMgr->endIndex) { if (pMgr->startIndex < pMgr->matchIndex && pMgr->retryBackoff > 0) { @@ -876,7 +875,7 @@ int32_t syncLogReplMgrProcessReplyInNormalMode(SSyncLogReplMgr* pMgr, SSyncNode* pMgr->startIndex = pMgr->matchIndex; } - return syncLogReplMgrReplicateAttemptedOnce(pMgr, pNode); + return syncLogReplMgrReplicateAttempt(pMgr, pNode); } SSyncLogReplMgr* syncLogReplMgrCreate() { @@ -1066,12 +1065,11 @@ SSyncRaftEntry* syncLogBufferGetOneEntry(SSyncLogBuffer* pBuf, SSyncNode* pNode, return pEntry; } -int32_t syncLogBufferReplicateOneTo(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index, SyncTerm* pTerm, - SRaftId* pDestId, bool* pBarrier) { +int32_t syncLogReplMgrReplicateOneTo(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncIndex index, SyncTerm* pTerm, + SRaftId* pDestId, bool* pBarrier) { SSyncRaftEntry* pEntry = NULL; SRpcMsg msgOut = {0}; bool inBuf = false; - int32_t ret = -1; SyncTerm prevLogTerm = -1; SSyncLogBuffer* pBuf = pNode->pLogBuf; @@ -1097,14 +1095,13 @@ int32_t syncLogBufferReplicateOneTo(SSyncLogReplMgr* pMgr, SSyncNode* pNode, Syn } if (pTerm) *pTerm = pEntry->term; - int32_t code = syncBuildAppendEntriesFromRaftLog(pNode, pEntry, prevLogTerm, &msgOut); + int32_t code = syncBuildAppendEntriesFromRaftEntry(pNode, pEntry, prevLogTerm, &msgOut); if (code < 0) { sError("vgId:%d, failed to get append entries for index:%" PRId64 "", pNode->vgId, index); goto _err; } (void)syncNodeSendAppendEntries(pNode, pDestId, &msgOut); - ret = 0; sTrace("vgId:%d, replicate one msg index: %" PRId64 " term: %" PRId64 " prevterm: %" PRId64 " to dest: 0x%016" PRIx64, pNode->vgId, pEntry->index, pEntry->term, prevLogTerm, pDestId->addr); From e66f19ab4647584b59253856ae7722afe86af601 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Thu, 5 Jan 2023 16:59:16 +0800 Subject: [PATCH 008/139] enh: vote for higher lastLogTerm despite commitIndex --- source/libs/sync/src/syncRequestVote.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source/libs/sync/src/syncRequestVote.c b/source/libs/sync/src/syncRequestVote.c index 773befe1e4..bdcc749516 100644 --- a/source/libs/sync/src/syncRequestVote.c +++ b/source/libs/sync/src/syncRequestVote.c @@ -48,15 +48,6 @@ static bool syncNodeOnRequestVoteLogOK(SSyncNode* pSyncNode, SyncRequestVote* pM SyncTerm myLastTerm = syncNodeGetLastTerm(pSyncNode); SyncIndex myLastIndex = syncNodeGetLastIndex(pSyncNode); - if (pMsg->lastLogIndex < pSyncNode->commitIndex) { - sNTrace(pSyncNode, - "logok:0, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 - ", recv-term:%" PRIu64 "}", - myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); - - return false; - } - if (myLastTerm == SYNC_TERM_INVALID) { sNTrace(pSyncNode, "logok:0, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 @@ -70,6 +61,13 @@ static bool syncNodeOnRequestVoteLogOK(SSyncNode* pSyncNode, SyncRequestVote* pM "logok:1, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 ", recv-term:%" PRIu64 "}", myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); + + if (pMsg->lastLogIndex < pSyncNode->commitIndex) { + sNWarn(pSyncNode, + "logok:1, commit rollback required. {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 + ", recv-lindex:%" PRId64 ", recv-term:%" PRIu64 "}", + myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); + } return true; } @@ -137,4 +135,4 @@ int32_t syncNodeOnRequestVote(SSyncNode* ths, const SRpcMsg* pRpcMsg) { syncLogSendRequestVoteReply(ths, pReply, ""); syncNodeSendMsgById(&pReply->destId, ths, &rpcMsg); return 0; -} \ No newline at end of file +} From d1b4dc94d88ea4d18aee113ae47e2538fe234baf Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 5 Jan 2023 19:26:45 +0800 Subject: [PATCH 009/139] fix:table name error in schemaless --- include/common/tname.h | 2 +- source/client/src/clientSml.c | 13 ++++----- source/common/src/tname.c | 1 - utils/test/c/sml_test.c | 54 +++++++++++++++++++++++++++++++++-- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/include/common/tname.h b/include/common/tname.h index 666a25303e..6a89d2a6be 100644 --- a/include/common/tname.h +++ b/include/common/tname.h @@ -78,7 +78,7 @@ typedef struct { // output char* ctbShortName; // must have size of TSDB_TABLE_NAME_LEN; - uint64_t uid; // child table uid, may be useful +// uint64_t uid; // child table uid, may be useful } RandTableName; void buildChildTableName(RandTableName* rName); diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index a4e943da32..c24aa536c2 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -182,6 +182,7 @@ typedef struct { SSmlMsgBuf msgBuf; SHashObj *dumplicateKey; // for dumplicate key SArray *colsContainer; // for cols parse, if dataFormat == false + int32_t uid; // used for automatic create child table cJSON *root; // for parse json } SSmlHandle; @@ -2155,13 +2156,11 @@ static int32_t smlParseInfluxLine(SSmlHandle *info, const char *sql, const int l (*oneTable)->sTableNameLen = elements.measureLen; if (strlen((*oneTable)->childTableName) == 0) { RandTableName rName = {(*oneTable)->tags, (*oneTable)->sTableName, (uint8_t)(*oneTable)->sTableNameLen, - (*oneTable)->childTableName, 0}; + (*oneTable)->childTableName}; buildChildTableName(&rName); - (*oneTable)->uid = rName.uid; - } else { - (*oneTable)->uid = *(uint64_t *)((*oneTable)->childTableName); } + (*oneTable)->uid = info->uid++; } SSmlSTableMeta **tableMeta = (SSmlSTableMeta **)taosHashGet(info->superTables, elements.measure, elements.measureLen); @@ -2226,11 +2225,8 @@ static int32_t smlParseTelnetLine(SSmlHandle *info, void *data, const int len) { taosHashClear(info->dumplicateKey); if (strlen(tinfo->childTableName) == 0) { - RandTableName rName = {tinfo->tags, tinfo->sTableName, (uint8_t)tinfo->sTableNameLen, tinfo->childTableName, 0}; + RandTableName rName = {tinfo->tags, tinfo->sTableName, (uint8_t)tinfo->sTableNameLen, tinfo->childTableName}; buildChildTableName(&rName); - tinfo->uid = rName.uid; - } else { - tinfo->uid = *(uint64_t *)(tinfo->childTableName); // generate uid by name simple } bool hasTable = true; @@ -2239,6 +2235,7 @@ static int32_t smlParseTelnetLine(SSmlHandle *info, void *data, const int len) { if (!oneTable) { taosHashPut(info->childTables, tinfo->childTableName, strlen(tinfo->childTableName), &tinfo, POINTER_BYTES); oneTable = &tinfo; + tinfo->uid = info->uid++; hasTable = false; } else { smlDestroyTableInfo(info, tinfo); diff --git a/source/common/src/tname.c b/source/common/src/tname.c index 5cb3fe4dc0..f21938ed29 100644 --- a/source/common/src/tname.c +++ b/source/common/src/tname.c @@ -330,5 +330,4 @@ void buildChildTableName(RandTableName* rName) { strcat(rName->ctbShortName, temp); } taosStringBuilderDestroy(&sb); - rName->uid = *(uint64_t*)(context.digest); } diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index df416b3822..315aabab3c 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -1131,8 +1131,10 @@ int sml_ttl_Test() { pRes = taos_query(taos, "select `ttl` from information_schema.ins_tables where table_name='t_be97833a0e1f523fcdaeb6291d6fdf27'"); printf("%s result2:%s\n", __FUNCTION__, taos_errstr(pRes)); TAOS_ROW row = taos_fetch_row(pRes); - int32_t ttl = *(int32_t*)row[0]; - ASSERT(ttl == 20); + if(row != NULL && row[0] != NULL){ + int32_t ttl = *(int32_t*)row[0]; + ASSERT(ttl == 20); + } int code = taos_errno(pRes); taos_free_result(pRes); @@ -1141,8 +1143,56 @@ int sml_ttl_Test() { return code; } +int sml_ts2385_Test() { + TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0); + + TAOS_RES *pRes = taos_query(taos, "CREATE DATABASE IF NOT EXISTS ts2385"); + taos_free_result(pRes); + + const char *sql[] ={ + "DataRTU,deviceId=2211230C94K0_1,dataModelName=DataRTU_2211230C94K0_1 s5=false,s18=false,k14=0,k2=0,k8=0,k10=0,s9=false,s19=false,k11=0,k13=0,s22=false,k15=0,m2=37.416671660000006,m8=600,m10=1532,m1=20.25,m13=0,s7=false,k7=0,m16=0,s17=false,k4=0,s11=false,s15=true,m7=600,m12=1490,s1=true,m14=0,s14=false,s16=true,k5=0,hex=\"7b3b00000001030301030200000000323231313233304339344b30002b01012a10028003000000070d05da025802580258025802580258045305fc05f505d200000000000000000afc7d\",k6=0,m3=600,s3=false,s24=false,k3=0,m6=600,m15=0,s12=false,k1=0,k16=0,s10=false,s21=false,k12=0,m5=600,s8=false,m4=600,m9=1107,s2=false,s13=false,s20=false,s23=false,k9=0,m11=1525,s4=false,s6=false 1672818929178749400", + "DataRTU,deviceId=2211230C94K0_1,dataModelName=DataRTU_2211230C94K0_1 k2=0,k11=0,m3=600,m12=1506,s17=false,m5=600,s11=false,s22=false,k6=0,m13=0,s16=true,k5=0,s21=false,m4=600,m7=600,s9=false,s10=false,s18=false,k7=0,m8=600,k1=0,hex=\"7b3a00000001030301030200000000323231313233304339344b30002b01012a10028003000000071105e8025802580258025802580258044905eb05ef05e200000000000000000afc7d\",m11=1519,m16=0,s19=false,s23=false,s24=false,s14=false,s6=false,k10=0,k15=0,k14=0,s2=false,s4=false,s8=false,s13=false,s15=true,s20=false,m2=38.000005040000005,s3=false,s7=false,k3=0,k8=0,k13=0,m6=600,m14=0,m15=0,k4=0,m1=20.450000000000003,m9=1097,s1=true,m10=1515,s5=false,s12=false,k9=0,k12=0,k16=0 1672818919126971000", + "DataRTU,deviceId=2211230C94K0_1,dataModelName=DataRTU_2211230C94K0_1 k7=0,k14=0,m3=600,m7=600,s5=false,k2=0,k3=0,k8=0,s3=false,s20=false,k15=0,m10=1482,s17=false,k1=0,k16=0,m15=0,s12=false,k9=0,m16=0,s11=false,m4=600,s10=false,s15=true,s24=false,m8=600,m13=0,s2=false,s18=false,k12=0,s14=false,s19=false,hex=\"7b3900000001030301030200000000323231313233304339344b30002b01012a10028003000000071505ef025802580258025802580258045005ca05b105d800000000000000000aa47d\",s1=true,s4=false,s7=false,s8=false,s13=false,m6=600,s6=false,s21=false,k11=0,m12=1496,m9=1104,s16=true,k5=0,s9=false,k10=0,k13=0,m2=38.291671730000004,s22=false,m5=600,m11=1457,m14=0,k4=0,m1=20.650000000000006,s23=false,k6=0 1672818909130866800", + "DataRTU,deviceId=2211230C94K0_1,dataModelName=DataRTU_2211230C94K0_1 m7=600,k4=0,k14=0,s22=false,k13=0,s2=false,m11=1510,m14=0,s4=false,s10=false,m1=21,m16=0,m13=0,s9=false,s13=false,s14=false,k10=0,m3=600,m9=1107,s18=false,s19=false,k2=0,hex=\"7b3600000001030301030200000000323231313233304339344b30002b01012a10028003000000071c0619025802580258025802580258045305dc05e6058d00000000000000000ad27d\",m2=40.04167187,m8=600,k7=0,k8=0,m10=1500,s23=false,k5=0,s11=false,s21=false,k9=0,m15=0,m12=1421,s1=true,s5=false,s8=false,m5=600,k16=0,k15=0,m6=600,s3=false,s6=false,s7=false,s15=true,s20=false,s24=false,k11=0,k1=0,k6=0,k12=0,m4=600,s16=true,s17=false,k3=0,s12=false 1672818879189483200", + "DataRTU,deviceId=2106070C11M0_2,dataModelName=DataRTU_2106070C11M0_2 m1=5691,k14=0,m6=0,s14=false,k8=0,s19=false,s20=false,k12=0,s17=false,k3=0,m8=0,s8=false,m7=0,s9=false,s4=false,s11=false,s13=false,s16=false,k5=0,k15=0,k16=0,s10=false,s23=false,s1=false,s2=false,s3=false,s12=false,s24=false,k2=0,k10=0,hex=\"7b1400000001030301030200000000323130363037304331314d30002b01022a080400000000000008af0c000000000000000000000000000000000000000000000000000000000ad47d\",m2=0,s7=false,s18=false,s21=false,m3=0,m5=0,k4=0,k11=0,m4=0,k1=0,k6=0,k13=0,s6=false,s15=false,s5=false,s22=false,k7=0,k9=0 1672818779549848800" + }; + pRes = taos_query(taos, "use ts2385"); + taos_free_result(pRes); + + pRes = taos_schemaless_insert(taos, (char **)sql, sizeof(sql) / sizeof(sql[0]), TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS); + + printf("%s result:%s\n", __FUNCTION__, taos_errstr(pRes)); + int code = taos_errno(pRes); + ASSERT(!code); + taos_free_result(pRes); + + pRes = taos_query(taos, "select distinct tbname from `DataRTU` order by tbname"); + printf("%s result2:%s\n", __FUNCTION__, taos_errstr(pRes)); + int num = 0; + TAOS_ROW row = NULL; + while((row = taos_fetch_row(pRes))){ + if(row[0] != NULL && num == 0){ + ASSERT(strncmp((char *)row[0], "DataRTU_2106070C11M0_2", sizeof("DataRTU_2106070C11M0_2") - 1) == 0); + } + + if(row[0] != NULL && num == 1){ + ASSERT(strncmp((char *)row[0], "DataRTU_2211230C94K0_1", sizeof("DataRTU_2211230C94K0_1") - 1) == 0); + } + num++; + } + ASSERT(num == 2); + + code = taos_errno(pRes); + taos_free_result(pRes); + taos_close(taos); + + return code; +} + int main(int argc, char *argv[]) { int ret = 0; + ret = sml_ts2385_Test(); + ASSERT(!ret); ret = sml_ttl_Test(); ASSERT(!ret); ret = sml_ts2164_Test(); From 66e62bb010281357f6c58dc2431697fd53fa6943 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 6 Jan 2023 19:19:31 +0800 Subject: [PATCH 010/139] fix: tsdb read invalid memory read issue --- source/dnode/vnode/src/tsdb/tsdbUtil.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 55703002b8..f30308845b 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -775,7 +775,16 @@ _exit: return code; } -void tRowMergerClear(SRowMerger *pMerger) { taosArrayDestroy(pMerger->pArray); } +void tRowMergerClear(SRowMerger *pMerger) { + for (int32_t iCol = 1; iCol < pMerger->pTSchema->numOfCols; iCol++) { + SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); + if (IS_VAR_DATA_TYPE(pTColVal->type)) { + tFree(pTColVal->value.pData); + } + } + + taosArrayDestroy(pMerger->pArray); +} int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { int32_t code = 0; @@ -789,7 +798,17 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { if (key.version > pMerger->version) { if (!COL_VAL_IS_NONE(pColVal)) { - taosArraySet(pMerger->pArray, iCol, pColVal); + if (IS_VAR_DATA_TYPE(pColVal->type)) { + SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); + + code = tRealloc(pTColVal->value.pData, pColVal->value.nData); + if (code) goto _exit; + + pTColVal->value.nData = pColVal->value.nData; + memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal.value.nData); + } else { + taosArraySet(pMerger->pArray, iCol, pColVal); + } } } else if (key.version < pMerger->version) { SColVal *tColVal = (SColVal *)taosArrayGet(pMerger->pArray, iCol); From e1020b79677375905e3642cbc3e8bff63373dd89 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 6 Jan 2023 19:20:31 +0800 Subject: [PATCH 011/139] fix:add interface for taos_get_current_db --- include/client/taos.h | 2 +- source/client/src/clientMain.c | 25 ++++- source/common/src/systable.c | 1 - source/libs/executor/src/sysscanoperator.c | 119 ++++++++++++++------- source/libs/parser/src/parAstParser.c | 28 ----- source/libs/parser/src/parTranslater.c | 7 -- 6 files changed, 102 insertions(+), 80 deletions(-) diff --git a/include/client/taos.h b/include/client/taos.h index c51aa6f7c4..cf410a42da 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -208,7 +208,7 @@ DLL_EXPORT TAOS_ROW *taos_result_block(TAOS_RES *res); DLL_EXPORT const char *taos_get_server_info(TAOS *taos); DLL_EXPORT const char *taos_get_client_info(); -DLL_EXPORT const char *taos_get_current_db(TAOS *taos, size_t *required); +DLL_EXPORT int taos_get_current_db(TAOS *taos, char *database, int len, int *required); DLL_EXPORT const char *taos_errstr(TAOS_RES *res); DLL_EXPORT int taos_errno(TAOS_RES *res); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 9c8e3e1465..70b6b22c84 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -686,13 +686,32 @@ const char *taos_get_server_info(TAOS *taos) { return pTscObj->sDetailVer; } -const char *taos_get_current_db(TAOS *taos, size_t *required) { +int taos_get_current_db(TAOS *taos, char *database, int len, int *required) { STscObj *pTscObj = acquireTscObj(*(int64_t *)taos); if (pTscObj == NULL) { terrno = TSDB_CODE_TSC_DISCONNECTED; - return NULL; + return -1; } - return pTscObj->db; + + int code = TSDB_CODE_SUCCESS; + taosThreadMutexLock(&pTscObj->mutex); + if(database == NULL || len <= 0){ + if(required != NULL) *required = strlen(pTscObj->db) + 1; + terrno = TSDB_CODE_INVALID_PARA; + return -1; + } + + if(len < strlen(pTscObj->db) + 1){ + tstrncpy(database, pTscObj->db, len); + if(required) *required = strlen(pTscObj->db) + 1; + terrno = TSDB_CODE_INVALID_PARA; + code = -1; + }else{ + strcpy(database, pTscObj->db); + code = 0; + } + taosThreadMutexUnlock(&pTscObj->mutex); + return code; } static void destoryTablesReq(void *p) { diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 9171ad76db..43abcf1624 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -179,7 +179,6 @@ static const SSysDbTableSchema userTagsSchema[] = { static const SSysDbTableSchema userColsSchema[] = { {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, - {.name = "stable_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_name", .bytes = TSDB_COL_NAME_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_type", .bytes = 32 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_length", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 4441f57c0f..33fa23fc38 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -140,6 +140,9 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, SMetaReader* smrChildTable, const char* dbname, const char* tableName, int32_t* pNumOfRows, const SSDataBlock* dataBlock); +static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo, SMetaReader* smrTable, const char* dbname, + int32_t* pNumOfRows, const SSDataBlock* dataBlock); + static void relocateAndFilterSysTagsScanResult(SSysTableScanInfo* pInfo, int32_t numOfRows, SSDataBlock* dataBlock, SFilterInfo* pFilterInfo); @@ -443,38 +446,26 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; STR_TO_VARSTR(tableName, condTableName); - SMetaReader smrChildTable = {0}; - metaReaderInit(&smrChildTable, pInfo->readHandle.meta, 0); - int32_t code = metaGetTableEntryByName(&smrChildTable, condTableName); + SMetaReader smrTable = {0}; + metaReaderInit(&smrTable, pInfo->readHandle.meta, 0); + int32_t code = metaGetTableEntryByName(&smrTable, condTableName); if (code != TSDB_CODE_SUCCESS) { // terrno has been set by metaGetTableEntryByName, therefore, return directly - metaReaderClear(&smrChildTable); + metaReaderClear(&smrTable); blockDataDestroy(dataBlock); pInfo->loadInfo.totalRows = 0; return NULL; } - if (smrChildTable.me.type != TSDB_CHILD_TABLE) { - metaReaderClear(&smrChildTable); + if (smrTable.me.type == TSDB_CHILD_TABLE) { + metaReaderClear(&smrTable); blockDataDestroy(dataBlock); pInfo->loadInfo.totalRows = 0; return NULL; } - SMetaReader smrSuperTable = {0}; - metaReaderInit(&smrSuperTable, pInfo->readHandle.meta, META_READER_NOLOCK); - code = metaGetTableEntryByUid(&smrSuperTable, smrChildTable.me.ctbEntry.suid); - if (code != TSDB_CODE_SUCCESS) { - // terrno has been set by metaGetTableEntryByUid - metaReaderClear(&smrSuperTable); - metaReaderClear(&smrChildTable); - blockDataDestroy(dataBlock); - return NULL; - } - - sysTableUserTagsFillOneTableTags(pInfo, &smrSuperTable, &smrChildTable, dbname, tableName, &numOfRows, dataBlock); - metaReaderClear(&smrSuperTable); - metaReaderClear(&smrChildTable); + sysTableUserColsFillOneTableCols(pInfo, &smrTable, dbname, &numOfRows, dataBlock); + metaReaderClear(&smrTable); if (numOfRows > 0) { relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); @@ -492,29 +483,11 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { } while ((ret = metaTbCursorNext(pInfo->pCur)) == 0) { - if (pInfo->pCur->mr.me.type != TSDB_CHILD_TABLE) { + if (pInfo->pCur->mr.me.type == TSDB_CHILD_TABLE) { continue; } - char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); - - SMetaReader smrSuperTable = {0}; - metaReaderInit(&smrSuperTable, pInfo->readHandle.meta, 0); - uint64_t suid = pInfo->pCur->mr.me.ctbEntry.suid; - int32_t code = metaGetTableEntryByUid(&smrSuperTable, suid); - if (code != TSDB_CODE_SUCCESS) { - qError("failed to get super table meta, uid:0x%" PRIx64 ", code:%s, %s", suid, tstrerror(terrno), - GET_TASKID(pTaskInfo)); - metaReaderClear(&smrSuperTable); - metaCloseTbCursor(pInfo->pCur); - pInfo->pCur = NULL; - T_LONG_JMP(pTaskInfo->env, terrno); - } - - sysTableUserTagsFillOneTableTags(pInfo, &smrSuperTable, &pInfo->pCur->mr, dbname, tableName, &numOfRows, dataBlock); - - metaReaderClear(&smrSuperTable); + sysTableUserColsFillOneTableCols(pInfo, &pInfo->pCur->mr, dbname, &numOfRows, dataBlock); if (numOfRows >= pOperator->resultInfo.capacity) { relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); @@ -857,6 +830,72 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, return TSDB_CODE_SUCCESS; } +static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo, SMetaReader* smrTable, const char* dbname, + int32_t* pNumOfRows, const SSDataBlock* dataBlock) { + char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(tableName, smrTable->me.name); + + SSchemaWrapper schemaRow = {0}; + if(smrTable->me.type == TSDB_SUPER_TABLE){ + schemaRow = smrTable->me.stbEntry.schemaRow; + }else if(smrTable->me.type == TSDB_NORMAL_TABLE){ + schemaRow = smrTable->me.ntbEntry.schemaRow; + } + int32_t numOfRows = *pNumOfRows; + + int32_t numOfCols = schemaRow.nCols; + for (int32_t i = 0; i < numOfCols; ++i) { + SColumnInfoData* pColInfoData = NULL; + + // table name + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 0); + colDataAppend(pColInfoData, numOfRows, tableName, tableName == NULL ? true : false); + + // database name + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 1); + colDataAppend(pColInfoData, numOfRows, dbname, false); + + // col name + char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(colName, schemaRow.pSchema[i].name); + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 2); + colDataAppend(pColInfoData, numOfRows, colName, false); + + // col type + int8_t colType = schemaRow.pSchema[i].type; + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 3); + char colTypeStr[VARSTR_HEADER_SIZE + 32]; + int colTypeLen = sprintf(varDataVal(colTypeStr), "%s", tDataTypes[colType].name); + if (colType == TSDB_DATA_TYPE_VARCHAR) { + colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)", + (int32_t)(schemaRow.pSchema[i].bytes - VARSTR_HEADER_SIZE)); + } else if (colType == TSDB_DATA_TYPE_NCHAR) { + colTypeLen += sprintf( + varDataVal(colTypeStr) + colTypeLen, "(%d)", + (int32_t)((schemaRow.pSchema[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); + } + varDataSetLen(colTypeStr, colTypeLen); + colDataAppend(pColInfoData, numOfRows, (char*)colTypeStr, false); + + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 4); + colDataAppend(pColInfoData, numOfRows, (const char*)&schemaRow.pSchema[i].bytes, false); + + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 5); + colDataAppend(pColInfoData, numOfRows, NULL, true); + + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 6); + colDataAppend(pColInfoData, numOfRows, NULL, true); + + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 7); + colDataAppend(pColInfoData, numOfRows, NULL, true); + ++numOfRows; + } + + *pNumOfRows = numOfRows; + + return TSDB_CODE_SUCCESS; +} + static SSDataBlock* buildInfoSchemaTableMetaBlock(char* tableName) { size_t size = 0; const SSysTableMeta* pMeta = NULL; diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 5019f4c757..fae62626fa 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -147,16 +147,6 @@ static int32_t collectMetaKeyFromInsTags(SCollectMetaKeyCxt* pCxt) { return code; } -static int32_t collectMetaKeyFromInsCols(SCollectMetaKeyCxt* pCxt) { - SSelectStmt* pSelect = (SSelectStmt*)pCxt->pStmt; - SName name = {0}; - int32_t code = getVnodeSysTableTargetName(pCxt->pParseCxt->acctId, pSelect->pWhere, &name); - if (TSDB_CODE_SUCCESS == code) { - code = collectMetaKeyFromInsTagsImpl(pCxt, &name); - } - return code; -} - static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const char* pDb, const char* pTable, AUTH_TYPE authType) { int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pDb, pTable, pCxt->pMetaCache); @@ -180,11 +170,6 @@ static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const c QUERY_NODE_SELECT_STMT == nodeType(pCxt->pStmt)) { code = collectMetaKeyFromInsTags(pCxt); } - if (TSDB_CODE_SUCCESS == code && - 0 == strcmp(pTable, TSDB_INS_TABLE_COLS) && - QUERY_NODE_SELECT_STMT == nodeType(pCxt->pStmt)) { - code = collectMetaKeyFromInsCols(pCxt); - } return code; } @@ -490,19 +475,6 @@ static int32_t collectMetaKeyFromShowTags(SCollectMetaKeyCxt* pCxt, SShowStmt* p return code; } -static int32_t collectMetaKeyFromShowCols(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_COLS, - pCxt->pMetaCache); - if (TSDB_CODE_SUCCESS == code) { - code = reserveDbVgInfoInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); - } - if (TSDB_CODE_SUCCESS == code && NULL != pStmt->pTbName) { - code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, - ((SValueNode*)pStmt->pTbName)->literal, pCxt->pMetaCache); - } - return code; -} - static int32_t collectMetaKeyFromShowStableTags(SCollectMetaKeyCxt* pCxt, SShowTableTagsStmt* pStmt) { return collectMetaKeyFromRealTableImpl(pCxt, ((SValueNode*)pStmt->pDbName)->literal, ((SValueNode*)pStmt->pTbName)->literal, AUTH_TYPE_READ); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index a9d55de77c..951966d436 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -162,13 +162,6 @@ static const SSysTableShowAdapter sysTableShowAdapter[] = { .numOfShowCols = 1, .pShowCols = {"*"} }, - { - .showType = QUERY_NODE_SHOW_TAGS_STMT, - .pDbName = TSDB_INFORMATION_SCHEMA_DB, - .pTableName = TSDB_INS_TABLE_COLS, - .numOfShowCols = 1, - .pShowCols = {"*"} - }, { .showType = QUERY_NODE_SHOW_USERS_STMT, .pDbName = TSDB_INFORMATION_SCHEMA_DB, From d70e32e7d36b14a5f7497d33ef310a68580bdef9 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Sat, 7 Jan 2023 14:56:43 +0800 Subject: [PATCH 012/139] fix: compile issue --- source/dnode/vnode/src/tsdb/tsdbUtil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index f30308845b..112fbb61c6 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -801,11 +801,11 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { if (IS_VAR_DATA_TYPE(pColVal->type)) { SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); - code = tRealloc(pTColVal->value.pData, pColVal->value.nData); + code = tRealloc(&pTColVal->value.pData, pColVal->value.nData); if (code) goto _exit; pTColVal->value.nData = pColVal->value.nData; - memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal.value.nData); + memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal->value.nData); } else { taosArraySet(pMerger->pArray, iCol, pColVal); } From 90830e54104512882bbf5c9e9c88645e15b00777 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Mon, 9 Jan 2023 09:08:28 +0800 Subject: [PATCH 013/139] fix: use pInfo->info.state.committed instead of the current one for async vnodeCommit --- source/dnode/vnode/src/vnd/vnodeCommit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 6c54c3cb5c..9a69299d9d 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -294,7 +294,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { SVnode *pVnode = pInfo->pVnode; vInfo("vgId:%d, start to commit, commitId:%" PRId64 " version:%" PRId64 " term: %" PRId64, TD_VID(pVnode), - pVnode->state.commitID, pVnode->state.applied, pVnode->state.applyTerm); + pInfo->info.state.commitID, pInfo->info.state.committed, pVnode->state.commitTerm); // persist wal before starting if (walPersist(pVnode->pWal) < 0) { @@ -308,8 +308,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { snprintf(dir, TSDB_FILENAME_LEN, "%s", pVnode->path); } - // walBeginSnapshot(pVnode->pWal, pVnode->state.applied); - syncBeginSnapshot(pVnode->sync, pVnode->state.applied); + syncBeginSnapshot(pVnode->sync, pInfo->info.state.committed); // commit each sub-system code = tsdbCommit(pVnode->pTsdb, pInfo); @@ -351,7 +350,6 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) { return -1; } - // walEndSnapshot(pVnode->pWal); syncEndSnapshot(pVnode->sync); _exit: From d4d329ecce0250a4002b0b8b504eaed5d7219e34 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 10:18:12 +0800 Subject: [PATCH 014/139] fix: rename global variables --- source/dnode/mgmt/node_mgmt/src/dmEnv.c | 6 +++--- source/libs/sync/inc/syncRaftStore.h | 2 -- source/libs/sync/src/syncRaftStore.c | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index 1d0236c0c5..acf96ad397 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -16,9 +16,9 @@ #define _DEFAULT_SOURCE #include "dmMgmt.h" -static SDnode global = {0}; +static SDnode globalDnode = {0}; -SDnode *dmInstance() { return &global; } +SDnode *dmInstance() { return &globalDnode; } static int32_t dmCheckRepeatInit(SDnode *pDnode) { if (atomic_val_compare_exchange_8(&pDnode->once, DND_ENV_INIT, DND_ENV_READY) != DND_ENV_INIT) { @@ -270,6 +270,6 @@ void dmReportStartup(const char *pName, const char *pDesc) { } int64_t dmGetClusterId() { - return global.data.clusterId; + return globalDnode.data.clusterId; } diff --git a/source/libs/sync/inc/syncRaftStore.h b/source/libs/sync/inc/syncRaftStore.h index bb6405f6b2..28faf8ea6d 100644 --- a/source/libs/sync/inc/syncRaftStore.h +++ b/source/libs/sync/inc/syncRaftStore.h @@ -37,8 +37,6 @@ typedef struct SRaftStore { SRaftStore *raftStoreOpen(const char *path); int32_t raftStoreClose(SRaftStore *pRaftStore); int32_t raftStorePersist(SRaftStore *pRaftStore); -int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len); -int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len); bool raftStoreHasVoted(SRaftStore *pRaftStore); void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId); diff --git a/source/libs/sync/src/syncRaftStore.c b/source/libs/sync/src/syncRaftStore.c index b19cda2a44..8ef3ceeae7 100644 --- a/source/libs/sync/src/syncRaftStore.c +++ b/source/libs/sync/src/syncRaftStore.c @@ -20,6 +20,8 @@ // private function static int32_t raftStoreInit(SRaftStore *pRaftStore); static bool raftStoreFileExist(char *path); +static int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len); +static int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len); // public function SRaftStore *raftStoreOpen(const char *path) { From 80586ad997994924f77810c79850d39d14171d41 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 9 Jan 2023 11:33:26 +0800 Subject: [PATCH 015/139] fix: invalid free issue --- source/dnode/vnode/src/inc/tsdb.h | 1 + source/dnode/vnode/src/tsdb/tsdbUtil.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 5a2e462c8c..77a3bb7a2f 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -573,6 +573,7 @@ struct STSDBRowIter { struct SRowMerger { STSchema *pTSchema; int64_t version; + bool merged; SArray *pArray; // SArray }; diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 112fbb61c6..a9c31c19cb 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -776,10 +776,12 @@ _exit: } void tRowMergerClear(SRowMerger *pMerger) { - for (int32_t iCol = 1; iCol < pMerger->pTSchema->numOfCols; iCol++) { - SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); - if (IS_VAR_DATA_TYPE(pTColVal->type)) { - tFree(pTColVal->value.pData); + if (pMerger->merged) { + for (int32_t iCol = 1; iCol < pMerger->pTSchema->numOfCols; iCol++) { + SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); + if (IS_VAR_DATA_TYPE(pTColVal->type)) { + tFree(pTColVal->value.pData); + } } } @@ -801,6 +803,7 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { if (IS_VAR_DATA_TYPE(pColVal->type)) { SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); + pTColVal->value.pData = NULL; code = tRealloc(&pTColVal->value.pData, pColVal->value.nData); if (code) goto _exit; @@ -821,6 +824,7 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { } pMerger->version = key.version; + pMerger->merged = true; _exit: return code; From 902ab5b12f9238ee1ea03d49654b73adc816148a Mon Sep 17 00:00:00 2001 From: Xuefeng Tan <1172915550@qq.com> Date: Mon, 9 Jan 2023 11:36:36 +0800 Subject: [PATCH 016/139] fix: get vgid in batch (#19437) --- cmake/taosadapter_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 3e2e879e38..ab1609f35f 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG a2e9920 + GIT_TAG 69eee2e SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From 060fc941b55a013c9a0de2ff011c5b57c88a006b Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 9 Jan 2023 11:39:14 +0800 Subject: [PATCH 017/139] fix:add config dir for libtaos in sml_test --- tests/system-test/2-query/sml.py | 7 ++++++- utils/test/c/sml_test.c | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/system-test/2-query/sml.py b/tests/system-test/2-query/sml.py index b764edebd7..78b633cf94 100644 --- a/tests/system-test/2-query/sml.py +++ b/tests/system-test/2-query/sml.py @@ -15,6 +15,9 @@ sys.path.append("./7-tmq") from tmqCommon import * class TDTestCase: + updatecfgDict = {'clientCfg': {'smlChildTableName': 'dataModelName', 'fqdn': 'localhost'}, 'fqdn': 'localhost'} + print("===================: ", updatecfgDict) + def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) tdLog.debug(f"start to excute {__file__}") @@ -22,8 +25,10 @@ class TDTestCase: #tdSql.init(conn.cursor(), logSql) # output sql.txt file def checkFileContent(self, dbname="sml_db"): + simClientCfg="%s/taos.cfg"%tdDnodes.getSimCfgPath() buildPath = tdCom.getBuildPath() - cmdStr = '%s/build/bin/sml_test'%(buildPath) + cmdStr = '%s/build/bin/sml_test %s'%(buildPath, simClientCfg) + print("cmdStr:", cmdStr) tdLog.info(cmdStr) ret = os.system(cmdStr) if ret != 0: diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index 315aabab3c..c6073541fd 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -1190,6 +1190,10 @@ int sml_ts2385_Test() { } int main(int argc, char *argv[]) { + if(argc == 2){ + taos_options(TSDB_OPTION_CONFIGDIR, argv[1]); + } + int ret = 0; ret = sml_ts2385_Test(); ASSERT(!ret); From 2aeda3a94171340ab5b8fc3ca0b58e6db59b0813 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 12:01:36 +0800 Subject: [PATCH 018/139] enh: refact raft store file --- source/libs/sync/inc/syncInt.h | 17 +- source/libs/sync/inc/syncRaftStore.h | 27 +- source/libs/sync/src/syncAppendEntries.c | 12 +- source/libs/sync/src/syncAppendEntriesReply.c | 12 +- source/libs/sync/src/syncCommit.c | 4 +- source/libs/sync/src/syncElection.c | 10 +- source/libs/sync/src/syncMain.c | 91 +++---- source/libs/sync/src/syncMessage.c | 2 +- source/libs/sync/src/syncPipeline.c | 46 ++-- source/libs/sync/src/syncRaftStore.c | 253 +++++++++--------- source/libs/sync/src/syncReplication.c | 4 +- source/libs/sync/src/syncRequestVote.c | 34 +-- source/libs/sync/src/syncRequestVoteReply.c | 10 +- source/libs/sync/src/syncRespMgr.c | 2 +- source/libs/sync/src/syncSnapshot.c | 40 +-- source/libs/sync/src/syncUtil.c | 12 +- .../test/sync_test_lib/src/syncMainDebug.c | 4 +- .../sync_test_lib/src/syncSnapshotDebug.c | 2 +- 18 files changed, 283 insertions(+), 299 deletions(-) diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index 6793430923..7e08e195c1 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -32,11 +32,9 @@ typedef struct SyncRequestVoteReply SyncRequestVoteReply; typedef struct SyncAppendEntries SyncAppendEntries; typedef struct SyncAppendEntriesReply SyncAppendEntriesReply; typedef struct SSyncEnv SSyncEnv; -typedef struct SRaftStore SRaftStore; typedef struct SVotesGranted SVotesGranted; typedef struct SVotesRespond SVotesRespond; typedef struct SSyncIndexMgr SSyncIndexMgr; -typedef struct SRaftCfg SRaftCfg; typedef struct SSyncRespMgr SSyncRespMgr; typedef struct SSyncSnapshotSender SSyncSnapshotSender; typedef struct SSyncSnapshotReceiver SSyncSnapshotReceiver; @@ -70,6 +68,11 @@ typedef struct SRaftId { SyncGroupId vgId; } SRaftId; +typedef struct SRaftStore { + SyncTerm currentTerm; + SRaftId voteFor; +} SRaftStore; + typedef struct SSyncHbTimerData { int64_t syncNodeRid; SSyncTimer* pTimer; @@ -112,8 +115,8 @@ typedef struct SSyncNode { // sync io SSyncLogBuffer* pLogBuf; - SWal* pWal; - const SMsgCb* msgcb; + SWal* pWal; + const SMsgCb* msgcb; int32_t (*syncSendMSg)(const SEpSet* pEpSet, SRpcMsg* pMsg); int32_t (*syncEqMsg)(const SMsgCb* msgcb, SRpcMsg* pMsg); int32_t (*syncEqCtrlMsg)(const SMsgCb* msgcb, SRpcMsg* pMsg); @@ -139,8 +142,8 @@ typedef struct SSyncNode { int64_t rid; // tla+ server vars - ESyncState state; - SRaftStore* pRaftStore; + ESyncState state; + SRaftStore raftStore; // tla+ candidate vars SVotesGranted* pVotesGranted; @@ -229,7 +232,7 @@ int32_t syncNodeStartStandBy(SSyncNode* pSyncNode); void syncNodeClose(SSyncNode* pSyncNode); void syncNodePreClose(SSyncNode* pSyncNode); void syncNodePostClose(SSyncNode* pSyncNode); -int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t *seq); +int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_t* seq); int32_t syncNodeRestore(SSyncNode* pSyncNode); void syncHbTimerDataFree(SSyncHbTimerData* pData); diff --git a/source/libs/sync/inc/syncRaftStore.h b/source/libs/sync/inc/syncRaftStore.h index bb6405f6b2..21a8fc64a8 100644 --- a/source/libs/sync/inc/syncRaftStore.h +++ b/source/libs/sync/inc/syncRaftStore.h @@ -24,27 +24,16 @@ extern "C" { #define RAFT_STORE_BLOCK_SIZE 512 #define RAFT_STORE_PATH_LEN (TSDB_FILENAME_LEN * 2) +#define EMPTY_RAFT_ID ((SRaftId){.addr = 0, .vgId = 0}) -#define EMPTY_RAFT_ID ((SRaftId){.addr = 0, .vgId = 0}) +int32_t raftStoreReadFile(SSyncNode *pNode); +int32_t raftStoreWriteFile(SSyncNode *pNode); -typedef struct SRaftStore { - SyncTerm currentTerm; - SRaftId voteFor; - TdFilePtr pFile; - char path[RAFT_STORE_PATH_LEN]; -} SRaftStore; - -SRaftStore *raftStoreOpen(const char *path); -int32_t raftStoreClose(SRaftStore *pRaftStore); -int32_t raftStorePersist(SRaftStore *pRaftStore); -int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len); -int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len); - -bool raftStoreHasVoted(SRaftStore *pRaftStore); -void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId); -void raftStoreClearVote(SRaftStore *pRaftStore); -void raftStoreNextTerm(SRaftStore *pRaftStore); -void raftStoreSetTerm(SRaftStore *pRaftStore, SyncTerm term); +bool raftStoreHasVoted(SSyncNode *pNode); +void raftStoreVote(SSyncNode *pNode, SRaftId *pRaftId); +void raftStoreClearVote(SSyncNode *pNode); +void raftStoreNextTerm(SSyncNode *pNode); +void raftStoreSetTerm(SSyncNode *pNode, SyncTerm term); #ifdef __cplusplus } diff --git a/source/libs/sync/src/syncAppendEntries.c b/source/libs/sync/src/syncAppendEntries.c index 026ebdb37c..83d1777f44 100644 --- a/source/libs/sync/src/syncAppendEntries.c +++ b/source/libs/sync/src/syncAppendEntries.c @@ -159,17 +159,17 @@ int32_t syncNodeOnAppendEntries(SSyncNode* ths, const SRpcMsg* pRpcMsg) { // prepare response msg pReply->srcId = ths->myRaftId; pReply->destId = pMsg->srcId; - pReply->term = ths->pRaftStore->currentTerm; + pReply->term = ths->raftStore.currentTerm; pReply->success = false; pReply->matchIndex = SYNC_INDEX_INVALID; pReply->lastSendIndex = pMsg->prevLogIndex + 1; pReply->startTime = ths->startTime; - if (pMsg->term < ths->pRaftStore->currentTerm) { + if (pMsg->term < ths->raftStore.currentTerm) { goto _SEND_RESPONSE; } - if (pMsg->term > ths->pRaftStore->currentTerm) { + if (pMsg->term > ths->raftStore.currentTerm) { pReply->term = pMsg->term; } @@ -253,19 +253,19 @@ int32_t syncNodeOnAppendEntriesOld(SSyncNode* ths, const SRpcMsg* pRpcMsg) { SyncAppendEntriesReply* pReply = rpcRsp.pCont; pReply->srcId = ths->myRaftId; pReply->destId = pMsg->srcId; - pReply->term = ths->pRaftStore->currentTerm; + pReply->term = ths->raftStore.currentTerm; pReply->success = false; // pReply->matchIndex = ths->pLogStore->syncLogLastIndex(ths->pLogStore); pReply->matchIndex = SYNC_INDEX_INVALID; pReply->lastSendIndex = pMsg->prevLogIndex + 1; pReply->startTime = ths->startTime; - if (pMsg->term < ths->pRaftStore->currentTerm) { + if (pMsg->term < ths->raftStore.currentTerm) { syncLogRecvAppendEntries(ths, pMsg, "reject, small term"); goto _SEND_RESPONSE; } - if (pMsg->term > ths->pRaftStore->currentTerm) { + if (pMsg->term > ths->raftStore.currentTerm) { pReply->term = pMsg->term; } diff --git a/source/libs/sync/src/syncAppendEntriesReply.c b/source/libs/sync/src/syncAppendEntriesReply.c index b83be2bebb..8157a5a14f 100644 --- a/source/libs/sync/src/syncAppendEntriesReply.c +++ b/source/libs/sync/src/syncAppendEntriesReply.c @@ -50,19 +50,19 @@ int32_t syncNodeOnAppendEntriesReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { } // drop stale response - if (pMsg->term < ths->pRaftStore->currentTerm) { + if (pMsg->term < ths->raftStore.currentTerm) { syncLogRecvAppendEntriesReply(ths, pMsg, "drop stale response"); return 0; } if (ths->state == TAOS_SYNC_STATE_LEADER) { - if (pMsg->term > ths->pRaftStore->currentTerm) { + if (pMsg->term > ths->raftStore.currentTerm) { syncLogRecvAppendEntriesReply(ths, pMsg, "error term"); syncNodeStepDown(ths, pMsg->term); return -1; } - ASSERT(pMsg->term == ths->pRaftStore->currentTerm); + ASSERT(pMsg->term == ths->raftStore.currentTerm); sTrace("vgId:%d, received append entries reply. srcId:0x%016" PRIx64 ", term:%" PRId64 ", matchIndex:%" PRId64 "", pMsg->vgId, pMsg->srcId.addr, pMsg->term, pMsg->matchIndex); @@ -100,19 +100,19 @@ int32_t syncNodeOnAppendEntriesReplyOld(SSyncNode* ths, SyncAppendEntriesReply* } // drop stale response - if (pMsg->term < ths->pRaftStore->currentTerm) { + if (pMsg->term < ths->raftStore.currentTerm) { syncLogRecvAppendEntriesReply(ths, pMsg, "drop stale response"); return 0; } if (ths->state == TAOS_SYNC_STATE_LEADER) { - if (pMsg->term > ths->pRaftStore->currentTerm) { + if (pMsg->term > ths->raftStore.currentTerm) { syncLogRecvAppendEntriesReply(ths, pMsg, "error term"); syncNodeStepDown(ths, pMsg->term); return -1; } - ASSERT(pMsg->term == ths->pRaftStore->currentTerm); + ASSERT(pMsg->term == ths->raftStore.currentTerm); if (pMsg->success) { SyncIndex oldMatchIndex = syncIndexMgrGetIndex(ths->pMatchIndex, &(pMsg->srcId)); diff --git a/source/libs/sync/src/syncCommit.c b/source/libs/sync/src/syncCommit.c index 152fddb7e6..286cf4daf5 100644 --- a/source/libs/sync/src/syncCommit.c +++ b/source/libs/sync/src/syncCommit.c @@ -133,7 +133,7 @@ void syncMaybeAdvanceCommitIndex(SSyncNode* pSyncNode) { } } // cannot commit, even if quorum agree. need check term! - if (pEntry->term <= pSyncNode->pRaftStore->currentTerm) { + if (pEntry->term <= pSyncNode->raftStore.currentTerm) { // update commit index newCommitIndex = index; @@ -329,7 +329,7 @@ int64_t syncNodeCheckCommitIndex(SSyncNode* ths, SyncIndex indexLikely) { SyncIndex commitIndex = indexLikely; syncNodeUpdateCommitIndex(ths, commitIndex); sTrace("vgId:%d, agreed upon. role:%d, term:%" PRId64 ", index: %" PRId64 "", ths->vgId, ths->state, - ths->pRaftStore->currentTerm, commitIndex); + ths->raftStore.currentTerm, commitIndex); } return ths->commitIndex; } diff --git a/source/libs/sync/src/syncElection.c b/source/libs/sync/src/syncElection.c index bcc95c5f10..cd3ffc33e3 100644 --- a/source/libs/sync/src/syncElection.c +++ b/source/libs/sync/src/syncElection.c @@ -48,7 +48,7 @@ static int32_t syncNodeRequestVotePeers(SSyncNode* pNode) { SyncRequestVote* pMsg = rpcMsg.pCont; pMsg->srcId = pNode->myRaftId; pMsg->destId = pNode->peersId[i]; - pMsg->term = pNode->pRaftStore->currentTerm; + pMsg->term = pNode->raftStore.currentTerm; ret = syncNodeGetLastIndexTerm(pNode, &pMsg->lastLogIndex, &pMsg->lastLogTerm); ASSERT(ret == 0); @@ -75,10 +75,10 @@ int32_t syncNodeElect(SSyncNode* pSyncNode) { } // start election - raftStoreNextTerm(pSyncNode->pRaftStore); - raftStoreClearVote(pSyncNode->pRaftStore); - voteGrantedReset(pSyncNode->pVotesGranted, pSyncNode->pRaftStore->currentTerm); - votesRespondReset(pSyncNode->pVotesRespond, pSyncNode->pRaftStore->currentTerm); + raftStoreNextTerm(pSyncNode); + raftStoreClearVote(pSyncNode); + voteGrantedReset(pSyncNode->pVotesGranted, pSyncNode->raftStore.currentTerm); + votesRespondReset(pSyncNode->pVotesRespond, pSyncNode->raftStore.currentTerm); syncNodeVoteForSelf(pSyncNode); if (voteGrantedMajority(pSyncNode->pVotesGranted)) { diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index c2bf6dc837..a339cb9857 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -468,7 +468,7 @@ bool syncNodeIsReadyForRead(SSyncNode* pSyncNode) { } if (code == 0 && pEntry != NULL) { - if (pEntry->originalRpcType == TDMT_SYNC_NOOP && pEntry->term == pSyncNode->pRaftStore->currentTerm) { + if (pEntry->originalRpcType == TDMT_SYNC_NOOP && pEntry->term == pSyncNode->raftStore.currentTerm) { ready = true; } @@ -736,7 +736,7 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, SRpcMsg* pMsg, bool isWeak, int64_ int32_t code = syncNodeOnClientRequest(pSyncNode, pMsg, &retIndex); if (code == 0) { pMsg->info.conn.applyIndex = retIndex; - pMsg->info.conn.applyTerm = pSyncNode->pRaftStore->currentTerm; + pMsg->info.conn.applyTerm = pSyncNode->raftStore.currentTerm; sTrace("vgId:%d, propose optimized msg, index:%" PRId64 " type:%s", pSyncNode->vgId, retIndex, TMSG_INFO(pMsg->msgType)); return 1; @@ -983,8 +983,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { // init TLA+ server vars pSyncNode->state = TAOS_SYNC_STATE_FOLLOWER; - pSyncNode->pRaftStore = raftStoreOpen(pSyncNode->raftStorePath); - if (pSyncNode->pRaftStore == NULL) { + if (raftStoreReadFile(pSyncNode) != 0) { sError("vgId:%d, failed to open raft store at path %s", pSyncNode->vgId, pSyncNode->raftStorePath); goto _error; } @@ -1184,7 +1183,7 @@ int32_t syncNodeRestore(SSyncNode* pSyncNode) { int32_t syncNodeStart(SSyncNode* pSyncNode) { // start raft if (pSyncNode->replicaNum == 1) { - raftStoreNextTerm(pSyncNode->pRaftStore); + raftStoreNextTerm(pSyncNode); syncNodeBecomeLeader(pSyncNode, "one replica start"); // Raft 3.6.2 Committing entries from previous terms @@ -1202,7 +1201,7 @@ int32_t syncNodeStart(SSyncNode* pSyncNode) { void syncNodeStartOld(SSyncNode* pSyncNode) { // start raft if (pSyncNode->replicaNum == 1) { - raftStoreNextTerm(pSyncNode->pRaftStore); + raftStoreNextTerm(pSyncNode); syncNodeBecomeLeader(pSyncNode, "one replica start"); // Raft 3.6.2 Committing entries from previous terms @@ -1288,10 +1287,6 @@ void syncNodeClose(SSyncNode* pSyncNode) { if (pSyncNode == NULL) return; sNInfo(pSyncNode, "sync close, node:%p", pSyncNode); - int32_t ret = raftStoreClose(pSyncNode->pRaftStore); - ASSERT(ret == 0); - pSyncNode->pRaftStore = NULL; - syncNodeLogReplMgrDestroy(pSyncNode); syncRespMgrDestroy(pSyncNode->pSyncRespMgr); pSyncNode->pSyncRespMgr = NULL; @@ -1714,39 +1709,39 @@ _END: // raft state change -------------- void syncNodeUpdateTerm(SSyncNode* pSyncNode, SyncTerm term) { - if (term > pSyncNode->pRaftStore->currentTerm) { - raftStoreSetTerm(pSyncNode->pRaftStore, term); + if (term > pSyncNode->raftStore.currentTerm) { + raftStoreSetTerm(pSyncNode, term); char tmpBuf[64]; snprintf(tmpBuf, sizeof(tmpBuf), "update term to %" PRId64, term); syncNodeBecomeFollower(pSyncNode, tmpBuf); - raftStoreClearVote(pSyncNode->pRaftStore); + raftStoreClearVote(pSyncNode); } } void syncNodeUpdateTermWithoutStepDown(SSyncNode* pSyncNode, SyncTerm term) { - if (term > pSyncNode->pRaftStore->currentTerm) { - raftStoreSetTerm(pSyncNode->pRaftStore, term); + if (term > pSyncNode->raftStore.currentTerm) { + raftStoreSetTerm(pSyncNode, term); } } void syncNodeStepDown(SSyncNode* pSyncNode, SyncTerm newTerm) { - if (pSyncNode->pRaftStore->currentTerm > newTerm) { + if (pSyncNode->raftStore.currentTerm > newTerm) { sNTrace(pSyncNode, "step down, ignore, new-term:%" PRId64 ", current-term:%" PRId64, newTerm, - pSyncNode->pRaftStore->currentTerm); + pSyncNode->raftStore.currentTerm); return; } do { sNTrace(pSyncNode, "step down, new-term:%" PRId64 ", current-term:%" PRId64, newTerm, - pSyncNode->pRaftStore->currentTerm); + pSyncNode->raftStore.currentTerm); } while (0); - if (pSyncNode->pRaftStore->currentTerm < newTerm) { - raftStoreSetTerm(pSyncNode->pRaftStore, newTerm); + if (pSyncNode->raftStore.currentTerm < newTerm) { + raftStoreSetTerm(pSyncNode, newTerm); char tmpBuf[64]; snprintf(tmpBuf, sizeof(tmpBuf), "step down, update term to %" PRId64, newTerm); syncNodeBecomeFollower(pSyncNode, tmpBuf); - raftStoreClearVote(pSyncNode->pRaftStore); + raftStoreClearVote(pSyncNode); } else { if (pSyncNode->state != TAOS_SYNC_STATE_FOLLOWER) { @@ -1904,7 +1899,7 @@ void syncNodeCandidate2Leader(SSyncNode* pSyncNode) { SyncIndex lastIndex = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); ASSERT(lastIndex >= 0); sInfo("vgId:%d, become leader. term: %" PRId64 ", commit index: %" PRId64 ", last index: %" PRId64 "", - pSyncNode->vgId, pSyncNode->pRaftStore->currentTerm, pSyncNode->commitIndex, lastIndex); + pSyncNode->vgId, pSyncNode->raftStore.currentTerm, pSyncNode->commitIndex, lastIndex); } void syncNodeCandidate2LeaderOld(SSyncNode* pSyncNode) { @@ -1937,7 +1932,7 @@ void syncNodeFollower2Candidate(SSyncNode* pSyncNode) { pSyncNode->state = TAOS_SYNC_STATE_CANDIDATE; SyncIndex lastIndex = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); sInfo("vgId:%d, become candidate from follower. term: %" PRId64 ", commit index: %" PRId64 ", last index: %" PRId64, - pSyncNode->vgId, pSyncNode->pRaftStore->currentTerm, pSyncNode->commitIndex, lastIndex); + pSyncNode->vgId, pSyncNode->raftStore.currentTerm, pSyncNode->commitIndex, lastIndex); sNTrace(pSyncNode, "follower to candidate"); } @@ -1947,7 +1942,7 @@ void syncNodeLeader2Follower(SSyncNode* pSyncNode) { syncNodeBecomeFollower(pSyncNode, "leader to follower"); SyncIndex lastIndex = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); sInfo("vgId:%d, become follower from leader. term: %" PRId64 ", commit index: %" PRId64 ", last index: %" PRId64, - pSyncNode->vgId, pSyncNode->pRaftStore->currentTerm, pSyncNode->commitIndex, lastIndex); + pSyncNode->vgId, pSyncNode->raftStore.currentTerm, pSyncNode->commitIndex, lastIndex); sNTrace(pSyncNode, "leader to follower"); } @@ -1957,7 +1952,7 @@ void syncNodeCandidate2Follower(SSyncNode* pSyncNode) { syncNodeBecomeFollower(pSyncNode, "candidate to follower"); SyncIndex lastIndex = pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore); sInfo("vgId:%d, become follower from candidate. term: %" PRId64 ", commit index: %" PRId64 ", last index: %" PRId64, - pSyncNode->vgId, pSyncNode->pRaftStore->currentTerm, pSyncNode->commitIndex, lastIndex); + pSyncNode->vgId, pSyncNode->raftStore.currentTerm, pSyncNode->commitIndex, lastIndex); sNTrace(pSyncNode, "candidate to follower"); } @@ -1965,15 +1960,15 @@ void syncNodeCandidate2Follower(SSyncNode* pSyncNode) { // just called by syncNodeVoteForSelf // need assert void syncNodeVoteForTerm(SSyncNode* pSyncNode, SyncTerm term, SRaftId* pRaftId) { - ASSERT(term == pSyncNode->pRaftStore->currentTerm); - ASSERT(!raftStoreHasVoted(pSyncNode->pRaftStore)); + ASSERT(term == pSyncNode->raftStore.currentTerm); + ASSERT(!raftStoreHasVoted(pSyncNode)); - raftStoreVote(pSyncNode->pRaftStore, pRaftId); + raftStoreVote(pSyncNode, pRaftId); } // simulate get vote from outside void syncNodeVoteForSelf(SSyncNode* pSyncNode) { - syncNodeVoteForTerm(pSyncNode, pSyncNode->pRaftStore->currentTerm, &pSyncNode->myRaftId); + syncNodeVoteForTerm(pSyncNode, pSyncNode->raftStore.currentTerm, &pSyncNode->myRaftId); SRpcMsg rpcMsg = {0}; int32_t ret = syncBuildRequestVoteReply(&rpcMsg, pSyncNode->vgId); @@ -1982,7 +1977,7 @@ void syncNodeVoteForSelf(SSyncNode* pSyncNode) { SyncRequestVoteReply* pMsg = rpcMsg.pCont; pMsg->srcId = pSyncNode->myRaftId; pMsg->destId = pSyncNode->myRaftId; - pMsg->term = pSyncNode->pRaftStore->currentTerm; + pMsg->term = pSyncNode->raftStore.currentTerm; pMsg->voteGranted = true; voteGrantedVote(pSyncNode->pVotesGranted, pMsg); @@ -2272,13 +2267,6 @@ static void syncNodeEqPeerHeartbeatTimer(void* param, void* tmrId) { return; } - if (pSyncNode->pRaftStore == NULL) { - syncNodeRelease(pSyncNode); - syncHbTimerDataRelease(pData); - sError("vgId:%d, hb timer raft store already stop", pSyncNode->vgId); - return; - } - // sTrace("vgId:%d, eq peer hb timer", pSyncNode->vgId); if (pSyncNode->replicaNum > 1) { @@ -2302,7 +2290,7 @@ static void syncNodeEqPeerHeartbeatTimer(void* param, void* tmrId) { SyncHeartbeat* pSyncMsg = rpcMsg.pCont; pSyncMsg->srcId = pSyncNode->myRaftId; pSyncMsg->destId = pData->destId; - pSyncMsg->term = pSyncNode->pRaftStore->currentTerm; + pSyncMsg->term = pSyncNode->raftStore.currentTerm; pSyncMsg->commitIndex = pSyncNode->commitIndex; pSyncMsg->minMatchIndex = syncMinMatchIndex(pSyncNode); pSyncMsg->privateTerm = 0; @@ -2348,7 +2336,7 @@ static int32_t syncNodeEqNoop(SSyncNode* pNode) { } SyncIndex index = pNode->pLogStore->syncLogWriteIndex(pNode->pLogStore); - SyncTerm term = pNode->pRaftStore->currentTerm; + SyncTerm term = pNode->raftStore.currentTerm; SSyncRaftEntry* pEntry = syncEntryBuildNoop(term, index, pNode->vgId); if (pEntry == NULL) return -1; @@ -2394,8 +2382,7 @@ int32_t syncNodeAppend(SSyncNode* ths, SSyncRaftEntry* pEntry) { if (syncLogBufferAppend(ths->pLogBuf, ths, pEntry) < 0) { sError("vgId:%d, failed to enqueue sync log buffer, index:%" PRId64, ths->vgId, pEntry->index); terrno = TSDB_CODE_SYN_BUFFER_FULL; - (void)syncLogFsmExecute(ths, ths->pFsm, ths->state, ths->pRaftStore->currentTerm, pEntry, - TSDB_CODE_SYN_BUFFER_FULL); + (void)syncLogFsmExecute(ths, ths->pFsm, ths->state, ths->raftStore.currentTerm, pEntry, TSDB_CODE_SYN_BUFFER_FULL); syncEntryDestroy(pEntry); return -1; } @@ -2468,7 +2455,7 @@ bool syncNodeSnapshotRecving(SSyncNode* pSyncNode) { static int32_t syncNodeAppendNoop(SSyncNode* ths) { SyncIndex index = syncLogBufferGetEndIndex(ths->pLogBuf); - SyncTerm term = ths->pRaftStore->currentTerm; + SyncTerm term = ths->raftStore.currentTerm; SSyncRaftEntry* pEntry = syncEntryBuildNoop(term, index, ths->vgId); if (pEntry == NULL) { @@ -2484,7 +2471,7 @@ static int32_t syncNodeAppendNoopOld(SSyncNode* ths) { int32_t ret = 0; SyncIndex index = ths->pLogStore->syncLogWriteIndex(ths->pLogStore); - SyncTerm term = ths->pRaftStore->currentTerm; + SyncTerm term = ths->raftStore.currentTerm; SSyncRaftEntry* pEntry = syncEntryBuildNoop(term, index, ths->vgId); ASSERT(pEntry != NULL); @@ -2526,12 +2513,12 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) { SyncHeartbeatReply* pMsgReply = rpcMsg.pCont; pMsgReply->destId = pMsg->srcId; pMsgReply->srcId = ths->myRaftId; - pMsgReply->term = ths->pRaftStore->currentTerm; + pMsgReply->term = ths->raftStore.currentTerm; pMsgReply->privateTerm = 8864; // magic number pMsgReply->startTime = ths->startTime; pMsgReply->timeStamp = tsMs; - if (pMsg->term == ths->pRaftStore->currentTerm && ths->state != TAOS_SYNC_STATE_LEADER) { + if (pMsg->term == ths->raftStore.currentTerm && ths->state != TAOS_SYNC_STATE_LEADER) { syncIndexMgrSetRecvTime(ths->pNextIndex, &(pMsg->srcId), tsMs); syncNodeResetElectTimer(ths); @@ -2560,7 +2547,7 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) { } } - if (pMsg->term >= ths->pRaftStore->currentTerm && ths->state != TAOS_SYNC_STATE_FOLLOWER) { + if (pMsg->term >= ths->raftStore.currentTerm && ths->state != TAOS_SYNC_STATE_FOLLOWER) { // syncNodeStepDown(ths, pMsg->term); SRpcMsg rpcMsgLocalCmd = {0}; (void)syncBuildLocalCmd(&rpcMsgLocalCmd, ths->vgId); @@ -2687,7 +2674,7 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn int32_t code = 0; SyncIndex index = syncLogBufferGetEndIndex(ths->pLogBuf); - SyncTerm term = ths->pRaftStore->currentTerm; + SyncTerm term = ths->raftStore.currentTerm; SSyncRaftEntry* pEntry = NULL; if (pMsg->msgType == TDMT_SYNC_CLIENT_REQUEST) { pEntry = syncEntryBuildFromClientRequest(pMsg->pCont, term, index); @@ -2721,7 +2708,7 @@ int32_t syncNodeOnClientRequestOld(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRe int32_t code = 0; SyncIndex index = ths->pLogStore->syncLogWriteIndex(ths->pLogStore); - SyncTerm term = ths->pRaftStore->currentTerm; + SyncTerm term = ths->raftStore.currentTerm; SSyncRaftEntry* pEntry; if (pMsg->msgType == TDMT_SYNC_CLIENT_REQUEST) { @@ -2755,7 +2742,7 @@ int32_t syncNodeOnClientRequestOld(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRe .state = ths->state, .seqNum = pEntry->seqNum, .term = pEntry->term, - .currentTerm = ths->pRaftStore->currentTerm, + .currentTerm = ths->raftStore.currentTerm, .flag = 0, }; ths->pFsm->FpCommitCb(ths->pFsm, pMsg, &cbMeta); @@ -2833,7 +2820,7 @@ int32_t syncDoLeaderTransfer(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftEntry* p return 0; } - if (pEntry->term < ths->pRaftStore->currentTerm) { + if (pEntry->term < ths->raftStore.currentTerm) { sNTrace(ths, "little term:%" PRId64 ", can not do leader transfer", pEntry->term); return 0; } @@ -2871,7 +2858,7 @@ int32_t syncDoLeaderTransfer(SSyncNode* ths, SRpcMsg* pRpcMsg, SSyncRaftEntry* p if (ths->pFsm->FpLeaderTransferCb != NULL) { SFsmCbMeta cbMeta = { .code = 0, - .currentTerm = ths->pRaftStore->currentTerm, + .currentTerm = ths->raftStore.currentTerm, .flag = 0, .index = pEntry->index, .lastConfigIndex = syncNodeGetSnapshotConfigIndex(ths, pEntry->index), @@ -2987,7 +2974,7 @@ int32_t syncNodeDoCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endInde .state = ths->state, .seqNum = pEntry->seqNum, .term = pEntry->term, - .currentTerm = ths->pRaftStore->currentTerm, + .currentTerm = ths->raftStore.currentTerm, .flag = flag, }; diff --git a/source/libs/sync/src/syncMessage.c b/source/libs/sync/src/syncMessage.c index 467b4e2219..29f327c35c 100644 --- a/source/libs/sync/src/syncMessage.c +++ b/source/libs/sync/src/syncMessage.c @@ -176,7 +176,7 @@ int32_t syncBuildAppendEntriesFromRaftLog(SSyncNode* pNode, SSyncRaftEntry* pEnt pMsg->prevLogTerm = prevLogTerm; pMsg->vgId = pNode->vgId; pMsg->srcId = pNode->myRaftId; - pMsg->term = pNode->pRaftStore->currentTerm; + pMsg->term = pNode->raftStore.currentTerm; pMsg->commitIndex = pNode->commitIndex; pMsg->privateTerm = 0; return 0; diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index f878044bca..b1f955b8df 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -285,9 +285,9 @@ SyncTerm syncLogBufferGetLastMatchTerm(SSyncLogBuffer* pBuf) { int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEntry* pEntry, SyncTerm prevTerm) { taosThreadMutexLock(&pBuf->mutex); syncLogBufferValidate(pBuf); - int32_t ret = -1; - SyncIndex index = pEntry->index; - SyncIndex prevIndex = pEntry->index - 1; + int32_t ret = -1; + SyncIndex index = pEntry->index; + SyncIndex prevIndex = pEntry->index - 1; SyncTerm lastMatchTerm = syncLogBufferGetLastMatchTermWithoutLock(pBuf); SSyncRaftEntry* pExist = NULL; bool inBuf = true; @@ -509,7 +509,7 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm SSyncLogStore* pLogStore = pNode->pLogStore; SSyncFSM* pFsm = pNode->pFsm; ESyncState role = pNode->state; - SyncTerm term = pNode->pRaftStore->currentTerm; + SyncTerm term = pNode->raftStore.currentTerm; SyncGroupId vgId = pNode->vgId; int32_t ret = -1; int64_t upperIndex = TMIN(commitIndex, pBuf->matchIndex); @@ -571,7 +571,7 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm _out: // mark as restored if needed if (!pNode->restoreFinish && pBuf->commitIndex >= pNode->commitIndex && pEntry != NULL && - pNode->pRaftStore->currentTerm <= pEntry->term) { + pNode->raftStore.currentTerm <= pEntry->term) { pNode->pFsm->FpRestoreFinishCb(pNode->pFsm); pNode->restoreFinish = true; sInfo("vgId:%d, restore finished. log buffer: [%" PRId64 " %" PRId64 " %" PRId64 ", %" PRId64 ")", pNode->vgId, @@ -614,9 +614,9 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { return -1; } - int32_t ret = -1; - bool retried = false; - int64_t retryWaitMs = syncLogGetRetryBackoffTimeMs(pMgr); + int32_t ret = -1; + bool retried = false; + int64_t retryWaitMs = syncLogGetRetryBackoffTimeMs(pMgr); int64_t nowMs = taosGetMonoTimestampMs(); int count = 0; int64_t firstIndex = -1; @@ -807,9 +807,9 @@ int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode } (void)syncLogReplMgrReset(pMgr); - SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; - bool barrier = false; - SyncTerm term = -1; + SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; + bool barrier = false; + SyncTerm term = -1; if (syncLogBufferReplicateOneTo(pMgr, pNode, index, &term, pDestId, &barrier) < 0) { sError("vgId:%d, failed to replicate log entry since %s. index: %" PRId64 ", dest: 0x%016" PRIx64 "", pNode->vgId, terrstr(), index, pDestId->addr); @@ -836,11 +836,11 @@ int32_t syncLogReplMgrReplicateProbeOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { ASSERT(pMgr->restored); - SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; - int32_t batchSize = TMAX(1, pMgr->size >> (4 + pMgr->retryBackoff)); - int32_t count = 0; - int64_t nowMs = taosGetMonoTimestampMs(); - int64_t limit = pMgr->size >> 1; + SRaftId* pDestId = &pNode->replicasId[pMgr->peerId]; + int32_t batchSize = TMAX(1, pMgr->size >> (4 + pMgr->retryBackoff)); + int32_t count = 0; + int64_t nowMs = taosGetMonoTimestampMs(); + int64_t limit = pMgr->size >> 1; SyncTerm term = -1; SyncIndex firstIndex = -1; @@ -891,13 +891,13 @@ int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* p int32_t syncLogReplMgrProcessReplyInNormalMode(SSyncLogReplMgr* pMgr, SSyncNode* pNode, SyncAppendEntriesReply* pMsg) { ASSERT(pMgr->restored == true); if (pMgr->startIndex <= pMsg->lastSendIndex && pMsg->lastSendIndex < pMgr->endIndex) { - if (pMgr->startIndex < pMgr->matchIndex && pMgr->retryBackoff > 0) { - int64_t firstSentMs = pMgr->states[pMgr->startIndex % pMgr->size].timeMs; - int64_t lastSentMs = pMgr->states[(pMgr->endIndex - 1) % pMgr->size].timeMs; - int64_t timeDiffMs = lastSentMs - firstSentMs; - if (timeDiffMs > 0 && timeDiffMs < (SYNC_LOG_REPL_RETRY_WAIT_MS << (pMgr->retryBackoff - 1))) { - pMgr->retryBackoff -= 1; - } + if (pMgr->startIndex < pMgr->matchIndex && pMgr->retryBackoff > 0) { + int64_t firstSentMs = pMgr->states[pMgr->startIndex % pMgr->size].timeMs; + int64_t lastSentMs = pMgr->states[(pMgr->endIndex - 1) % pMgr->size].timeMs; + int64_t timeDiffMs = lastSentMs - firstSentMs; + if (timeDiffMs > 0 && timeDiffMs < (SYNC_LOG_REPL_RETRY_WAIT_MS << (pMgr->retryBackoff - 1))) { + pMgr->retryBackoff -= 1; + } } pMgr->states[pMsg->lastSendIndex % pMgr->size].acked = true; pMgr->matchIndex = TMAX(pMgr->matchIndex, pMsg->matchIndex); diff --git a/source/libs/sync/src/syncRaftStore.c b/source/libs/sync/src/syncRaftStore.c index b19cda2a44..197d1463fd 100644 --- a/source/libs/sync/src/syncRaftStore.c +++ b/source/libs/sync/src/syncRaftStore.c @@ -16,156 +16,161 @@ #define _DEFAULT_SOURCE #include "syncRaftStore.h" #include "syncUtil.h" +#include "tjson.h" -// private function -static int32_t raftStoreInit(SRaftStore *pRaftStore); -static bool raftStoreFileExist(char *path); +static int32_t raftStoreDecode(const SJson *pJson, SRaftStore *pStore) { + int32_t code = 0; -// public function -SRaftStore *raftStoreOpen(const char *path) { - int32_t ret; + tjsonGetNumberValue(pJson, "current_term", pStore->currentTerm, code); + if (code < 0) return -1; + tjsonGetNumberValue(pJson, "vote_for_addr", pStore->voteFor.addr, code); + if (code < 0) return -1; + tjsonGetInt32ValueFromDouble(pJson, "vote_for_vgid", pStore->voteFor.vgId, code); + if (code < 0) return -1; - SRaftStore *pRaftStore = taosMemoryCalloc(1, sizeof(SRaftStore)); - if (pRaftStore == NULL) { + return 0; +} + +int32_t raftStoreReadFile(SSyncNode *pNode) { + int32_t code = -1; + TdFilePtr pFile = NULL; + char *pData = NULL; + SJson *pJson = NULL; + const char *file = pNode->raftStorePath; + SRaftStore *pStore = &pNode->raftStore; + + if (taosStatFile(file, NULL, NULL) < 0) { + sInfo("vgId:%d, raft store file:%s not exist, use default value", pNode->vgId, file); + pStore->currentTerm = 0; + pStore->voteFor.addr = 0; + pStore->voteFor.vgId = 0; + return raftStoreWriteFile(pNode); + } + + pFile = taosOpenFile(file, TD_FILE_READ); + if (pFile == NULL) { + terrno = TAOS_SYSTEM_ERROR(errno); + sError("vgId:%d, failed to open raft store file:%s since %s", pNode->vgId, file, terrstr()); + goto _OVER; + } + + int64_t size = 0; + if (taosFStatFile(pFile, &size, NULL) < 0) { + terrno = TAOS_SYSTEM_ERROR(errno); + sError("vgId:%d, failed to fstat raft store file:%s since %s", pNode->vgId, file, terrstr()); + goto _OVER; + } + + pData = taosMemoryMalloc(size + 1); + if (pData == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; - return NULL; + goto _OVER; } - snprintf(pRaftStore->path, sizeof(pRaftStore->path), "%s", path); - if (!raftStoreFileExist(pRaftStore->path)) { - ret = raftStoreInit(pRaftStore); - ASSERT(ret == 0); + if (taosReadFile(pFile, pData, size) != size) { + terrno = TAOS_SYSTEM_ERROR(errno); + sError("vgId:%d, failed to read raft store file:%s since %s", pNode->vgId, file, terrstr()); + goto _OVER; } - char storeBuf[RAFT_STORE_BLOCK_SIZE] = {0}; - pRaftStore->pFile = taosOpenFile(path, TD_FILE_READ | TD_FILE_WRITE); - ASSERT(pRaftStore->pFile != NULL); + pData[size] = '\0'; - int len = taosReadFile(pRaftStore->pFile, storeBuf, RAFT_STORE_BLOCK_SIZE); - ASSERT(len > 0); + pJson = tjsonParse(pData); + if (pJson == NULL) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } - ret = raftStoreDeserialize(pRaftStore, storeBuf, len); - ASSERT(ret == 0); + if (raftStoreDecode(pJson, pStore) < 0) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } - return pRaftStore; + code = 0; + sInfo("vgId:%d, succceed to read raft store file %s", pNode->vgId, file); + +_OVER: + if (pData != NULL) taosMemoryFree(pData); + if (pJson != NULL) cJSON_Delete(pJson); + if (pFile != NULL) taosCloseFile(&pFile); + + if (code != 0) { + sError("vgId:%d, failed to read raft store file:%s since %s", pNode->vgId, file, terrstr()); + } + return code; } -static int32_t raftStoreInit(SRaftStore *pRaftStore) { - ASSERT(pRaftStore != NULL); - - pRaftStore->pFile = taosOpenFile(pRaftStore->path, TD_FILE_CREATE | TD_FILE_WRITE); - ASSERT(pRaftStore->pFile != NULL); - - pRaftStore->currentTerm = 0; - pRaftStore->voteFor.addr = 0; - pRaftStore->voteFor.vgId = 0; - - int32_t ret = raftStorePersist(pRaftStore); - ASSERT(ret == 0); - - taosCloseFile(&pRaftStore->pFile); +static int32_t raftStoreEncode(SJson *pJson, SRaftStore *pStore) { + if (tjsonAddIntegerToObject(pJson, "current_term", pStore->currentTerm) < 0) return -1; + if (tjsonAddIntegerToObject(pJson, "vote_for_addr", pStore->voteFor.addr) < 0) return -1; + if (tjsonAddDoubleToObject(pJson, "vote_for_vgid", pStore->voteFor.vgId) < 0) return -1; return 0; } -int32_t raftStoreClose(SRaftStore *pRaftStore) { - if (pRaftStore == NULL) return 0; +int32_t raftStoreWriteFile(SSyncNode *pNode) { + int32_t code = -1; + char *buffer = NULL; + SJson *pJson = NULL; + TdFilePtr pFile = NULL; + const char *realfile = pNode->raftStorePath; + SRaftStore *pStore = &pNode->raftStore; + char file[PATH_MAX] = {0}; + snprintf(file, sizeof(file), "%s.bak", realfile); - taosCloseFile(&pRaftStore->pFile); - taosMemoryFree(pRaftStore); - pRaftStore = NULL; - return 0; + terrno = TSDB_CODE_OUT_OF_MEMORY; + pJson = tjsonCreateObject(); + if (pJson == NULL) goto _OVER; + if (raftStoreEncode(pJson, pStore) != 0) goto _OVER; + buffer = tjsonToString(pJson); + if (buffer == NULL) goto _OVER; + terrno = 0; + + pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); + if (pFile == NULL) goto _OVER; + + int32_t len = strlen(buffer); + if (taosWriteFile(pFile, buffer, len) <= 0) goto _OVER; + if (taosFsyncFile(pFile) < 0) goto _OVER; + + taosCloseFile(&pFile); + if (taosRenameFile(file, realfile) != 0) goto _OVER; + + code = 0; + sInfo("vgId:%d, succeed to write raft store file:%s, len:%d", pNode->vgId, realfile, len); + +_OVER: + if (pJson != NULL) tjsonDelete(pJson); + if (buffer != NULL) taosMemoryFree(buffer); + if (pFile != NULL) taosCloseFile(&pFile); + + if (code != 0) { + if (terrno == 0) terrno = TAOS_SYSTEM_ERROR(errno); + sError("vgId:%d, failed to write raft store file:%s since %s", pNode->vgId, realfile, terrstr()); + } + return code; } -int32_t raftStorePersist(SRaftStore *pRaftStore) { - ASSERT(pRaftStore != NULL); - - int32_t ret; - char storeBuf[RAFT_STORE_BLOCK_SIZE] = {0}; - ret = raftStoreSerialize(pRaftStore, storeBuf, sizeof(storeBuf)); - ASSERT(ret == 0); - - taosLSeekFile(pRaftStore->pFile, 0, SEEK_SET); - - ret = taosWriteFile(pRaftStore->pFile, storeBuf, sizeof(storeBuf)); - ASSERT(ret == RAFT_STORE_BLOCK_SIZE); - - taosFsyncFile(pRaftStore->pFile); - return 0; -} - -static bool raftStoreFileExist(char *path) { - bool b = taosStatFile(path, NULL, NULL) >= 0; - return b; -} - -int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len) { - ASSERT(pRaftStore != NULL); - - cJSON *pRoot = cJSON_CreateObject(); - - char u64Buf[128] = {0}; - snprintf(u64Buf, sizeof(u64Buf), "%" PRIu64 "", pRaftStore->currentTerm); - cJSON_AddStringToObject(pRoot, "current_term", u64Buf); - - snprintf(u64Buf, sizeof(u64Buf), "%" PRIu64 "", pRaftStore->voteFor.addr); - cJSON_AddStringToObject(pRoot, "vote_for_addr", u64Buf); - - cJSON_AddNumberToObject(pRoot, "vote_for_vgid", pRaftStore->voteFor.vgId); - - char *serialized = cJSON_Print(pRoot); - int len2 = strlen(serialized); - ASSERT(len2 < len); - memset(buf, 0, len); - snprintf(buf, len, "%s", serialized); - taosMemoryFree(serialized); - - cJSON_Delete(pRoot); - return 0; -} - -int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len) { - ASSERT(pRaftStore != NULL); - - ASSERT(len > 0 && len <= RAFT_STORE_BLOCK_SIZE); - cJSON *pRoot = cJSON_Parse(buf); - - cJSON *pCurrentTerm = cJSON_GetObjectItem(pRoot, "current_term"); - ASSERT(cJSON_IsString(pCurrentTerm)); - sscanf(pCurrentTerm->valuestring, "%" PRIu64 "", &(pRaftStore->currentTerm)); - - cJSON *pVoteForAddr = cJSON_GetObjectItem(pRoot, "vote_for_addr"); - ASSERT(cJSON_IsString(pVoteForAddr)); - sscanf(pVoteForAddr->valuestring, "%" PRIu64 "", &(pRaftStore->voteFor.addr)); - - cJSON *pVoteForVgid = cJSON_GetObjectItem(pRoot, "vote_for_vgid"); - pRaftStore->voteFor.vgId = pVoteForVgid->valueint; - - cJSON_Delete(pRoot); - return 0; -} - -bool raftStoreHasVoted(SRaftStore *pRaftStore) { - bool b = syncUtilEmptyId(&(pRaftStore->voteFor)); +bool raftStoreHasVoted(SSyncNode *pNode) { + bool b = syncUtilEmptyId(&pNode->raftStore.voteFor); return (!b); } -void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId) { - ASSERT(!syncUtilEmptyId(pRaftId)); - pRaftStore->voteFor = *pRaftId; - raftStorePersist(pRaftStore); +void raftStoreVote(SSyncNode *pNode, SRaftId *pRaftId) { + pNode->raftStore.voteFor = *pRaftId; + (void)raftStoreWriteFile(pNode); } -void raftStoreClearVote(SRaftStore *pRaftStore) { - pRaftStore->voteFor = EMPTY_RAFT_ID; - raftStorePersist(pRaftStore); +void raftStoreClearVote(SSyncNode *pNode) { + pNode->raftStore.voteFor = EMPTY_RAFT_ID; + (void)raftStoreWriteFile(pNode); } -void raftStoreNextTerm(SRaftStore *pRaftStore) { - ++(pRaftStore->currentTerm); - raftStorePersist(pRaftStore); +void raftStoreNextTerm(SSyncNode *pNode) { + pNode->raftStore.currentTerm++; + (void)raftStoreWriteFile(pNode); } -void raftStoreSetTerm(SRaftStore *pRaftStore, SyncTerm term) { - pRaftStore->currentTerm = term; - raftStorePersist(pRaftStore); +void raftStoreSetTerm(SSyncNode *pNode, SyncTerm term) { + pNode->raftStore.currentTerm = term; + (void)raftStoreWriteFile(pNode); } diff --git a/source/libs/sync/src/syncReplication.c b/source/libs/sync/src/syncReplication.c index e3058768f8..1aa476e84e 100644 --- a/source/libs/sync/src/syncReplication.c +++ b/source/libs/sync/src/syncReplication.c @@ -122,7 +122,7 @@ int32_t syncNodeReplicateOne(SSyncNode* pSyncNode, SRaftId* pDestId, bool snapsh ASSERT(pMsg != NULL); pMsg->srcId = pSyncNode->myRaftId; pMsg->destId = *pDestId; - pMsg->term = pSyncNode->pRaftStore->currentTerm; + pMsg->term = pSyncNode->raftStore.currentTerm; pMsg->prevLogIndex = preLogIndex; pMsg->prevLogTerm = preLogTerm; pMsg->commitIndex = pSyncNode->commitIndex; @@ -245,7 +245,7 @@ int32_t syncNodeHeartbeatPeers(SSyncNode* pSyncNode) { SyncHeartbeat* pSyncMsg = rpcMsg.pCont; pSyncMsg->srcId = pSyncNode->myRaftId; pSyncMsg->destId = pSyncNode->peersId[i]; - pSyncMsg->term = pSyncNode->pRaftStore->currentTerm; + pSyncMsg->term = pSyncNode->raftStore.currentTerm; pSyncMsg->commitIndex = pSyncNode->commitIndex; pSyncMsg->minMatchIndex = syncMinMatchIndex(pSyncNode); pSyncMsg->privateTerm = 0; diff --git a/source/libs/sync/src/syncRequestVote.c b/source/libs/sync/src/syncRequestVote.c index 773befe1e4..e9a18dfe86 100644 --- a/source/libs/sync/src/syncRequestVote.c +++ b/source/libs/sync/src/syncRequestVote.c @@ -44,12 +44,12 @@ // /\ UNCHANGED <> // -static bool syncNodeOnRequestVoteLogOK(SSyncNode* pSyncNode, SyncRequestVote* pMsg) { - SyncTerm myLastTerm = syncNodeGetLastTerm(pSyncNode); - SyncIndex myLastIndex = syncNodeGetLastIndex(pSyncNode); +static bool syncNodeOnRequestVoteLogOK(SSyncNode* ths, SyncRequestVote* pMsg) { + SyncTerm myLastTerm = syncNodeGetLastTerm(ths); + SyncIndex myLastIndex = syncNodeGetLastIndex(ths); - if (pMsg->lastLogIndex < pSyncNode->commitIndex) { - sNTrace(pSyncNode, + if (pMsg->lastLogIndex < ths->commitIndex) { + sNTrace(ths, "logok:0, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 ", recv-term:%" PRIu64 "}", myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); @@ -58,7 +58,7 @@ static bool syncNodeOnRequestVoteLogOK(SSyncNode* pSyncNode, SyncRequestVote* pM } if (myLastTerm == SYNC_TERM_INVALID) { - sNTrace(pSyncNode, + sNTrace(ths, "logok:0, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 ", recv-term:%" PRIu64 "}", myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); @@ -66,7 +66,7 @@ static bool syncNodeOnRequestVoteLogOK(SSyncNode* pSyncNode, SyncRequestVote* pM } if (pMsg->lastLogTerm > myLastTerm) { - sNTrace(pSyncNode, + sNTrace(ths, "logok:1, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 ", recv-term:%" PRIu64 "}", myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); @@ -74,14 +74,14 @@ static bool syncNodeOnRequestVoteLogOK(SSyncNode* pSyncNode, SyncRequestVote* pM } if (pMsg->lastLogTerm == myLastTerm && pMsg->lastLogIndex >= myLastIndex) { - sNTrace(pSyncNode, + sNTrace(ths, "logok:1, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 ", recv-term:%" PRIu64 "}", myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); return true; } - sNTrace(pSyncNode, + sNTrace(ths, "logok:0, {my-lterm:%" PRIu64 ", my-lindex:%" PRId64 ", recv-lterm:%" PRIu64 ", recv-lindex:%" PRId64 ", recv-term:%" PRIu64 "}", myLastTerm, myLastIndex, pMsg->lastLogTerm, pMsg->lastLogIndex, pMsg->term); @@ -93,7 +93,7 @@ int32_t syncNodeOnRequestVote(SSyncNode* ths, const SRpcMsg* pRpcMsg) { SyncRequestVote* pMsg = pRpcMsg->pCont; // if already drop replica, do not process - if (!syncNodeInRaftGroup(ths, &(pMsg->srcId))) { + if (!syncNodeInRaftGroup(ths, &pMsg->srcId)) { syncLogRecvRequestVote(ths, pMsg, -1, "not in my config"); return -1; } @@ -101,21 +101,21 @@ int32_t syncNodeOnRequestVote(SSyncNode* ths, const SRpcMsg* pRpcMsg) { bool logOK = syncNodeOnRequestVoteLogOK(ths, pMsg); // maybe update term - if (pMsg->term > ths->pRaftStore->currentTerm) { + if (pMsg->term > ths->raftStore.currentTerm) { syncNodeStepDown(ths, pMsg->term); // syncNodeUpdateTerm(ths, pMsg->term); } - ASSERT(pMsg->term <= ths->pRaftStore->currentTerm); + ASSERT(pMsg->term <= ths->raftStore.currentTerm); - bool grant = (pMsg->term == ths->pRaftStore->currentTerm) && logOK && - ((!raftStoreHasVoted(ths->pRaftStore)) || (syncUtilSameId(&(ths->pRaftStore->voteFor), &(pMsg->srcId)))); + bool grant = (pMsg->term == ths->raftStore.currentTerm) && logOK && + ((!raftStoreHasVoted(ths)) || (syncUtilSameId(&ths->raftStore.voteFor, &pMsg->srcId))); if (grant) { // maybe has already voted for pMsg->srcId // vote again, no harm - raftStoreVote(ths->pRaftStore, &(pMsg->srcId)); + raftStoreVote(ths, &(pMsg->srcId)); // candidate ? - syncNodeStepDown(ths, ths->pRaftStore->currentTerm); + syncNodeStepDown(ths, ths->raftStore.currentTerm); // forbid elect for this round syncNodeResetElectTimer(ths); @@ -129,7 +129,7 @@ int32_t syncNodeOnRequestVote(SSyncNode* ths, const SRpcMsg* pRpcMsg) { SyncRequestVoteReply* pReply = rpcMsg.pCont; pReply->srcId = ths->myRaftId; pReply->destId = pMsg->srcId; - pReply->term = ths->pRaftStore->currentTerm; + pReply->term = ths->raftStore.currentTerm; pReply->voteGranted = grant; // trace log diff --git a/source/libs/sync/src/syncRequestVoteReply.c b/source/libs/sync/src/syncRequestVoteReply.c index 563f475070..a0d6cbf597 100644 --- a/source/libs/sync/src/syncRequestVoteReply.c +++ b/source/libs/sync/src/syncRequestVoteReply.c @@ -49,25 +49,25 @@ int32_t syncNodeOnRequestVoteReply(SSyncNode* ths, const SRpcMsg* pRpcMsg) { } // drop stale response - if (pMsg->term < ths->pRaftStore->currentTerm) { + if (pMsg->term < ths->raftStore.currentTerm) { syncLogRecvRequestVoteReply(ths, pMsg, "drop stale response"); return -1; } - // ASSERT(!(pMsg->term > ths->pRaftStore->currentTerm)); + // ASSERT(!(pMsg->term > ths->raftStore.currentTerm)); // no need this code, because if I receive reply.term, then I must have sent for that term. - // if (pMsg->term > ths->pRaftStore->currentTerm) { + // if (pMsg->term > ths->raftStore.currentTerm) { // syncNodeUpdateTerm(ths, pMsg->term); // } - if (pMsg->term > ths->pRaftStore->currentTerm) { + if (pMsg->term > ths->raftStore.currentTerm) { syncLogRecvRequestVoteReply(ths, pMsg, "error term"); syncNodeStepDown(ths, pMsg->term); return -1; } syncLogRecvRequestVoteReply(ths, pMsg, ""); - ASSERT(pMsg->term == ths->pRaftStore->currentTerm); + ASSERT(pMsg->term == ths->raftStore.currentTerm); // This tallies votes even when the current state is not Candidate, // but they won't be looked at, so it doesn't matter. diff --git a/source/libs/sync/src/syncRespMgr.c b/source/libs/sync/src/syncRespMgr.c index b55aae4c76..9373eccaef 100644 --- a/source/libs/sync/src/syncRespMgr.c +++ b/source/libs/sync/src/syncRespMgr.c @@ -143,7 +143,7 @@ static void syncRespCleanByTTL(SSyncRespMgr *pObj, int64_t ttl, bool rsp) { .state = pNode->state, .seqNum = *pSeqNum, .term = SYNC_TERM_INVALID, - .currentTerm = pNode->pRaftStore->currentTerm, + .currentTerm = pNode->raftStore.currentTerm, .flag = 0, }; diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index defb7402f4..880c76e4dd 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -43,7 +43,7 @@ SSyncSnapshotSender *snapshotSenderCreate(SSyncNode *pSyncNode, int32_t replicaI pSender->sendingMS = SYNC_SNAPSHOT_RETRY_MS; pSender->pSyncNode = pSyncNode; pSender->replicaIndex = replicaIndex; - pSender->term = pSyncNode->pRaftStore->currentTerm; + pSender->term = pSyncNode->raftStore.currentTerm; pSender->startTime = 0; pSender->endTime = 0; pSender->pSyncNode->pFsm->FpGetSnapshotInfo(pSender->pSyncNode->pFsm, &pSender->snapshot); @@ -90,7 +90,7 @@ int32_t snapshotSenderStart(SSyncSnapshotSender *pSender) { memset(&pSender->lastConfig, 0, sizeof(pSender->lastConfig)); pSender->sendingMS = 0; - pSender->term = pSender->pSyncNode->pRaftStore->currentTerm; + pSender->term = pSender->pSyncNode->raftStore.currentTerm; pSender->startTime = taosGetTimestampMs(); pSender->lastSendTime = pSender->startTime; pSender->finish = false; @@ -105,7 +105,7 @@ int32_t snapshotSenderStart(SSyncSnapshotSender *pSender) { SyncSnapshotSend *pMsg = rpcMsg.pCont; pMsg->srcId = pSender->pSyncNode->myRaftId; pMsg->destId = pSender->pSyncNode->replicasId[pSender->replicaIndex]; - pMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; + pMsg->term = pSender->pSyncNode->raftStore.currentTerm; pMsg->beginIndex = pSender->snapshotParam.start; pMsg->lastIndex = pSender->snapshot.lastApplyIndex; pMsg->lastTerm = pSender->snapshot.lastApplyTerm; @@ -185,7 +185,7 @@ static int32_t snapshotSend(SSyncSnapshotSender *pSender) { SyncSnapshotSend *pMsg = rpcMsg.pCont; pMsg->srcId = pSender->pSyncNode->myRaftId; pMsg->destId = pSender->pSyncNode->replicasId[pSender->replicaIndex]; - pMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; + pMsg->term = pSender->pSyncNode->raftStore.currentTerm; pMsg->beginIndex = pSender->snapshotParam.start; pMsg->lastIndex = pSender->snapshot.lastApplyIndex; pMsg->lastTerm = pSender->snapshot.lastApplyTerm; @@ -226,7 +226,7 @@ int32_t snapshotReSend(SSyncSnapshotSender *pSender) { SyncSnapshotSend *pMsg = rpcMsg.pCont; pMsg->srcId = pSender->pSyncNode->myRaftId; pMsg->destId = pSender->pSyncNode->replicasId[pSender->replicaIndex]; - pMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; + pMsg->term = pSender->pSyncNode->raftStore.currentTerm; pMsg->beginIndex = pSender->snapshotParam.start; pMsg->lastIndex = pSender->snapshot.lastApplyIndex; pMsg->lastTerm = pSender->snapshot.lastApplyTerm; @@ -314,7 +314,7 @@ SSyncSnapshotReceiver *snapshotReceiverCreate(SSyncNode *pSyncNode, SRaftId from pReceiver->pWriter = NULL; pReceiver->pSyncNode = pSyncNode; pReceiver->fromId = fromId; - pReceiver->term = pSyncNode->pRaftStore->currentTerm; + pReceiver->term = pSyncNode->raftStore.currentTerm; pReceiver->snapshot.data = NULL; pReceiver->snapshot.lastApplyIndex = SYNC_INDEX_INVALID; pReceiver->snapshot.lastApplyTerm = 0; @@ -380,7 +380,7 @@ void snapshotReceiverStart(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *p pReceiver->start = true; pReceiver->ack = SYNC_SNAPSHOT_SEQ_PRE_SNAPSHOT; - pReceiver->term = pReceiver->pSyncNode->pRaftStore->currentTerm; + pReceiver->term = pReceiver->pSyncNode->raftStore.currentTerm; pReceiver->fromId = pPreMsg->srcId; pReceiver->startTime = pPreMsg->startTime; @@ -437,9 +437,9 @@ static int32_t snapshotReceiverFinish(SSyncSnapshotReceiver *pReceiver, SyncSnap } // maybe update term - if (pReceiver->snapshot.lastApplyTerm > pReceiver->pSyncNode->pRaftStore->currentTerm) { - pReceiver->pSyncNode->pRaftStore->currentTerm = pReceiver->snapshot.lastApplyTerm; - raftStorePersist(pReceiver->pSyncNode->pRaftStore); + if (pReceiver->snapshot.lastApplyTerm > pReceiver->pSyncNode->raftStore.currentTerm) { + pReceiver->pSyncNode->raftStore.currentTerm = pReceiver->snapshot.lastApplyTerm; + (void)raftStoreWriteFile(pReceiver->pSyncNode); } // stop writer, apply data @@ -592,7 +592,7 @@ _SEND_REPLY: SyncSnapshotRsp *pRspMsg = rpcMsg.pCont; pRspMsg->srcId = pSyncNode->myRaftId; pRspMsg->destId = pMsg->srcId; - pRspMsg->term = pSyncNode->pRaftStore->currentTerm; + pRspMsg->term = pSyncNode->raftStore.currentTerm; pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; pRspMsg->startTime = pReceiver->startTime; @@ -648,7 +648,7 @@ _SEND_REPLY: SyncSnapshotRsp *pRspMsg = rpcMsg.pCont; pRspMsg->srcId = pSyncNode->myRaftId; pRspMsg->destId = pMsg->srcId; - pRspMsg->term = pSyncNode->pRaftStore->currentTerm; + pRspMsg->term = pSyncNode->raftStore.currentTerm; pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; pRspMsg->startTime = pReceiver->startTime; @@ -698,7 +698,7 @@ static int32_t syncNodeOnSnapshotReceive(SSyncNode *pSyncNode, SyncSnapshotSend SyncSnapshotRsp *pRspMsg = rpcMsg.pCont; pRspMsg->srcId = pSyncNode->myRaftId; pRspMsg->destId = pMsg->srcId; - pRspMsg->term = pSyncNode->pRaftStore->currentTerm; + pRspMsg->term = pSyncNode->raftStore.currentTerm; pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; pRspMsg->startTime = pReceiver->startTime; @@ -745,7 +745,7 @@ static int32_t syncNodeOnSnapshotEnd(SSyncNode *pSyncNode, SyncSnapshotSend *pMs SyncSnapshotRsp *pRspMsg = rpcMsg.pCont; pRspMsg->srcId = pSyncNode->myRaftId; pRspMsg->destId = pMsg->srcId; - pRspMsg->term = pSyncNode->pRaftStore->currentTerm; + pRspMsg->term = pSyncNode->raftStore.currentTerm; pRspMsg->lastIndex = pMsg->lastIndex; pRspMsg->lastTerm = pMsg->lastTerm; pRspMsg->startTime = pReceiver->startTime; @@ -794,13 +794,13 @@ int32_t syncNodeOnSnapshot(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { return -1; } - if (pMsg->term < pSyncNode->pRaftStore->currentTerm) { + if (pMsg->term < pSyncNode->raftStore.currentTerm) { syncLogRecvSyncSnapshotSend(pSyncNode, pMsg, "reject since small term"); terrno = TSDB_CODE_SYN_INTERNAL_ERROR; return -1; } - if (pMsg->term > pSyncNode->pRaftStore->currentTerm) { + if (pMsg->term > pSyncNode->raftStore.currentTerm) { syncNodeStepDown(pSyncNode, pMsg->term); } syncNodeResetElectTimer(pSyncNode); @@ -808,7 +808,7 @@ int32_t syncNodeOnSnapshot(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { // state, term, seq/ack int32_t code = 0; if (pSyncNode->state == TAOS_SYNC_STATE_FOLLOWER) { - if (pMsg->term == pSyncNode->pRaftStore->currentTerm) { + if (pMsg->term == pSyncNode->raftStore.currentTerm) { if (pMsg->seq == SYNC_SNAPSHOT_SEQ_PRE_SNAPSHOT) { syncLogRecvSyncSnapshotSend(pSyncNode, pMsg, "process seq pre-snapshot"); code = syncNodeOnSnapshotPre(pSyncNode, pMsg); @@ -892,7 +892,7 @@ static int32_t syncNodeOnSnapshotPreRsp(SSyncNode *pSyncNode, SSyncSnapshotSende SyncSnapshotSend *pSendMsg = rpcMsg.pCont; pSendMsg->srcId = pSender->pSyncNode->myRaftId; pSendMsg->destId = pSender->pSyncNode->replicasId[pSender->replicaIndex]; - pSendMsg->term = pSender->pSyncNode->pRaftStore->currentTerm; + pSendMsg->term = pSender->pSyncNode->raftStore.currentTerm; pSendMsg->beginIndex = pSender->snapshotParam.start; pSendMsg->lastIndex = pSender->snapshot.lastApplyIndex; pSendMsg->lastTerm = pSender->snapshot.lastApplyTerm; @@ -951,10 +951,10 @@ int32_t syncNodeOnSnapshotRsp(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) { goto _ERROR; } - if (pMsg->term != pSyncNode->pRaftStore->currentTerm) { + if (pMsg->term != pSyncNode->raftStore.currentTerm) { syncLogRecvSyncSnapshotRsp(pSyncNode, pMsg, "snapshot sender and receiver term not match"); sSError(pSender, "snapshot sender term not equal, msg term:%" PRId64 " currentTerm:%" PRId64, pMsg->term, - pSyncNode->pRaftStore->currentTerm); + pSyncNode->raftStore.currentTerm); terrno = TSDB_CODE_SYN_INTERNAL_ERROR; goto _ERROR; } diff --git a/source/libs/sync/src/syncUtil.c b/source/libs/sync/src/syncUtil.c index e4a65837f7..b246d9a79d 100644 --- a/source/libs/sync/src/syncUtil.c +++ b/source/libs/sync/src/syncUtil.c @@ -158,8 +158,8 @@ static void syncPeerState2Str(SSyncNode* pSyncNode, char* buf, int32_t bufLen) { } void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNode* pNode, const char* format, ...) { - if (pNode == NULL || pNode->pRaftStore == NULL || pNode->pLogStore == NULL) return; - int64_t currentTerm = pNode->pRaftStore->currentTerm; + if (pNode == NULL || pNode->pLogStore == NULL) return; + int64_t currentTerm = pNode->raftStore.currentTerm; // save error code, otherwise it will be overwritten int32_t errCode = terrno; @@ -228,7 +228,7 @@ void syncPrintNodeLog(const char* flags, ELogLevel level, int32_t dflag, SSyncNo void syncPrintSnapshotSenderLog(const char* flags, ELogLevel level, int32_t dflag, SSyncSnapshotSender* pSender, const char* format, ...) { SSyncNode* pNode = pSender->pSyncNode; - if (pNode == NULL || pNode->pRaftStore == NULL || pNode->pLogStore == NULL) return; + if (pNode == NULL || pNode->pLogStore == NULL) return; SSnapshot snapshot = {.data = NULL, .lastApplyIndex = -1, .lastApplyTerm = 0}; if (pNode->pFsm != NULL && pNode->pFsm->FpGetSnapshotInfo != NULL) { @@ -264,7 +264,7 @@ void syncPrintSnapshotSenderLog(const char* flags, ELogLevel level, int32_t dfla pNode->vgId, eventLog, syncStr(pNode->state), pSender, pSender->snapshotParam.start, pSender->snapshotParam.end, pSender->snapshot.lastApplyIndex, pSender->snapshot.lastApplyTerm, pSender->snapshot.lastConfigIndex, pSender->seq, pSender->ack, pSender->finish, pSender->replicaIndex, - DID(&pNode->replicasId[pSender->replicaIndex]), pNode->pRaftStore->currentTerm, pNode->commitIndex, + DID(&pNode->replicasId[pSender->replicaIndex]), pNode->raftStore.currentTerm, pNode->commitIndex, logBeginIndex, logLastIndex, pNode->minMatchIndex, snapshot.lastApplyIndex, snapshot.lastApplyTerm, pNode->raftCfg.isStandBy, pNode->raftCfg.snapshotStrategy, pNode->raftCfg.batchSize, pNode->replicaNum, pNode->raftCfg.lastConfigIndex, pNode->changing, pNode->restoreFinish, syncNodeDynamicQuorum(pNode), @@ -274,7 +274,7 @@ void syncPrintSnapshotSenderLog(const char* flags, ELogLevel level, int32_t dfla void syncPrintSnapshotReceiverLog(const char* flags, ELogLevel level, int32_t dflag, SSyncSnapshotReceiver* pReceiver, const char* format, ...) { SSyncNode* pNode = pReceiver->pSyncNode; - if (pNode == NULL || pNode->pRaftStore == NULL || pNode->pLogStore == NULL) return; + if (pNode == NULL || pNode->pLogStore == NULL) return; SSnapshot snapshot = {.data = NULL, .lastApplyIndex = -1, .lastApplyTerm = 0}; if (pNode->pFsm != NULL && pNode->pFsm->FpGetSnapshotInfo != NULL) { @@ -311,7 +311,7 @@ void syncPrintSnapshotReceiverLog(const char* flags, ELogLevel level, int32_t df pNode->vgId, eventLog, syncStr(pNode->state), pReceiver, pReceiver->start, pReceiver->ack, pReceiver->term, pReceiver->startTime, DID(&pReceiver->fromId), pReceiver->snapshotParam.start, pReceiver->snapshotParam.end, pReceiver->snapshot.lastApplyIndex, pReceiver->snapshot.lastApplyTerm, - pReceiver->snapshot.lastConfigIndex, pNode->pRaftStore->currentTerm, pNode->commitIndex, logBeginIndex, + pReceiver->snapshot.lastConfigIndex, pNode->raftStore.currentTerm, pNode->commitIndex, logBeginIndex, logLastIndex, pNode->minMatchIndex, snapshot.lastApplyIndex, snapshot.lastApplyTerm, pNode->raftCfg.isStandBy, pNode->raftCfg.snapshotStrategy, pNode->raftCfg.batchSize, pNode->replicaNum, pNode->raftCfg.lastConfigIndex, pNode->changing, pNode->restoreFinish, syncNodeDynamicQuorum(pNode), diff --git a/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c b/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c index f1db2f0204..a3e76eabcc 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c +++ b/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c @@ -80,7 +80,7 @@ cJSON* syncNode2Json(const SSyncNode* pSyncNode) { // tla+ server vars cJSON_AddNumberToObject(pRoot, "state", pSyncNode->state); cJSON_AddStringToObject(pRoot, "state_str", syncStr(pSyncNode->state)); - cJSON_AddItemToObject(pRoot, "pRaftStore", raftStore2Json(pSyncNode->pRaftStore)); + cJSON_AddItemToObject(pRoot, "pRaftStore", raftStore2Json(&pSyncNode.raftStore)); // tla+ candidate vars cJSON_AddItemToObject(pRoot, "pVotesGranted", voteGranted2Json(pSyncNode->pVotesGranted)); @@ -199,7 +199,7 @@ inline char* syncNode2SimpleStr(const SSyncNode* pSyncNode) { ", sby:%d, " "r-num:%d, " "lcfg:%" PRId64 ", chging:%d, rsto:%d", - pSyncNode->vgId, syncStr(pSyncNode->state), pSyncNode->pRaftStore->currentTerm, pSyncNode->commitIndex, + pSyncNode->vgId, syncStr(pSyncNode->state), pSyncNode->raftStore.currentTerm, pSyncNode->commitIndex, logBeginIndex, logLastIndex, snapshot.lastApplyIndex, pSyncNode->raftCfg.isStandBy, pSyncNode->replicaNum, pSyncNode->raftCfg.lastConfigIndex, pSyncNode->changing, pSyncNode->restoreFinish); diff --git a/source/libs/sync/test/sync_test_lib/src/syncSnapshotDebug.c b/source/libs/sync/test/sync_test_lib/src/syncSnapshotDebug.c index f1237e5282..d8740de16a 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncSnapshotDebug.c +++ b/source/libs/sync/test/sync_test_lib/src/syncSnapshotDebug.c @@ -137,7 +137,7 @@ int32_t syncNodeOnPreSnapshot(SSyncNode *ths, SyncPreSnapshot *pMsg) { SyncPreSnapshotReply *pMsgReply = syncPreSnapshotReplyBuild(ths->vgId); pMsgReply->srcId = ths->myRaftId; pMsgReply->destId = pMsg->srcId; - pMsgReply->term = ths->pRaftStore->currentTerm; + pMsgReply->term = ths->raftStore.currentTerm; SSyncLogStoreData *pData = ths->pLogStore->data; SWal *pWal = pData->pWal; From 9a9e93b6feb0ae4a4540e34d53241940f04601b4 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 12:06:20 +0800 Subject: [PATCH 019/139] fix: compile error in mac --- source/libs/sync/test/syncLocalCmdTest.cpp | 4 +- source/libs/sync/test/syncRaftStoreTest.cpp | 40 +++++++++---------- .../sync/test/syncSnapshotReceiverTest.cpp | 2 +- .../libs/sync/test/syncSnapshotSenderTest.cpp | 2 +- .../test/sync_test_lib/src/syncMainDebug.c | 2 +- .../test/sync_test_lib/src/syncMessageDebug.c | 8 ++-- .../sync_test_lib/src/syncRaftStoreDebug.c | 4 +- source/util/src/tlog.c | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/source/libs/sync/test/syncLocalCmdTest.cpp b/source/libs/sync/test/syncLocalCmdTest.cpp index 8003cce7cc..2c839d0acb 100644 --- a/source/libs/sync/test/syncLocalCmdTest.cpp +++ b/source/libs/sync/test/syncLocalCmdTest.cpp @@ -16,8 +16,8 @@ SyncLocalCmd *createMsg() { pMsg->srcId.vgId = 100; pMsg->destId.addr = syncUtilAddr2U64("127.0.0.1", 5678); pMsg->destId.vgId = 100; - pMsg->sdNewTerm = 123; - pMsg->fcIndex = 456; + // pMsg->sdNewTerm = 123; + // pMsg->fcIndex = 456; pMsg->cmd = SYNC_LOCAL_CMD_STEP_DOWN; return pMsg; diff --git a/source/libs/sync/test/syncRaftStoreTest.cpp b/source/libs/sync/test/syncRaftStoreTest.cpp index 87798a7d80..a8022184ef 100644 --- a/source/libs/sync/test/syncRaftStoreTest.cpp +++ b/source/libs/sync/test/syncRaftStoreTest.cpp @@ -33,35 +33,35 @@ int main() { initRaftId(); - SRaftStore* pRaftStore = raftStoreOpen("./test_raft_store.json"); - assert(pRaftStore != NULL); - raftStoreLog2((char*)"==raftStoreOpen==", pRaftStore); + // SRaftStore* pRaftStore = raftStoreOpen("./test_raft_store.json"); + // assert(pRaftStore != NULL); + // raftStoreLog2((char*)"==raftStoreOpen==", pRaftStore); - raftStoreSetTerm(pRaftStore, 100); - raftStoreLog2((char*)"==raftStoreSetTerm==", pRaftStore); + // raftStoreSetTerm(pRaftStore, 100); + // raftStoreLog2((char*)"==raftStoreSetTerm==", pRaftStore); - raftStoreVote(pRaftStore, &ids[0]); - raftStoreLog2((char*)"==raftStoreVote==", pRaftStore); + // raftStoreVote(pRaftStore, &ids[0]); + // raftStoreLog2((char*)"==raftStoreVote==", pRaftStore); - raftStoreClearVote(pRaftStore); - raftStoreLog2((char*)"==raftStoreClearVote==", pRaftStore); + // raftStoreClearVote(pRaftStore); + // raftStoreLog2((char*)"==raftStoreClearVote==", pRaftStore); - raftStoreVote(pRaftStore, &ids[1]); - raftStoreLog2((char*)"==raftStoreVote==", pRaftStore); + // raftStoreVote(pRaftStore, &ids[1]); + // raftStoreLog2((char*)"==raftStoreVote==", pRaftStore); - raftStoreNextTerm(pRaftStore); - raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); + // raftStoreNextTerm(pRaftStore); + // raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); - raftStoreNextTerm(pRaftStore); - raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); + // raftStoreNextTerm(pRaftStore); + // raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); - raftStoreNextTerm(pRaftStore); - raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); + // raftStoreNextTerm(pRaftStore); + // raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); - raftStoreNextTerm(pRaftStore); - raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); + // raftStoreNextTerm(pRaftStore); + // raftStoreLog2((char*)"==raftStoreNextTerm==", pRaftStore); - raftStoreClose(pRaftStore); + // raftStoreClose(pRaftStore); return 0; } diff --git a/source/libs/sync/test/syncSnapshotReceiverTest.cpp b/source/libs/sync/test/syncSnapshotReceiverTest.cpp index 49b06a7d1b..1fca04a1ad 100644 --- a/source/libs/sync/test/syncSnapshotReceiverTest.cpp +++ b/source/libs/sync/test/syncSnapshotReceiverTest.cpp @@ -29,7 +29,7 @@ int32_t SnapshotDoWrite(struct SSyncFSM* pFsm, void* pWriter, void* pBuf, int32_ SSyncSnapshotReceiver* createReceiver() { SSyncNode* pSyncNode = (SSyncNode*)taosMemoryMalloc(sizeof(*pSyncNode)); - pSyncNode->pRaftStore = (SRaftStore*)taosMemoryMalloc(sizeof(*(pSyncNode->pRaftStore))); + // pSyncNode->pRaftStore = (SRaftStore*)taosMemoryMalloc(sizeof(*(pSyncNode->pRaftStore))); pSyncNode->pFsm = (SSyncFSM*)taosMemoryMalloc(sizeof(*(pSyncNode->pFsm))); #if 0 diff --git a/source/libs/sync/test/syncSnapshotSenderTest.cpp b/source/libs/sync/test/syncSnapshotSenderTest.cpp index bb697d541a..a1768c2ce5 100644 --- a/source/libs/sync/test/syncSnapshotSenderTest.cpp +++ b/source/libs/sync/test/syncSnapshotSenderTest.cpp @@ -29,7 +29,7 @@ int32_t SnapshotDoWrite(struct SSyncFSM* pFsm, void* pWriter, void* pBuf, int32_ SSyncSnapshotSender* createSender() { SSyncNode* pSyncNode = (SSyncNode*)taosMemoryMalloc(sizeof(*pSyncNode)); - pSyncNode->pRaftStore = (SRaftStore*)taosMemoryMalloc(sizeof(*(pSyncNode->pRaftStore))); + // pSyncNode->pRaftStore = (SRaftStore*)taosMemoryMalloc(sizeof(*(pSyncNode->pRaftStore))); pSyncNode->pFsm = (SSyncFSM*)taosMemoryMalloc(sizeof(*(pSyncNode->pFsm))); #if 0 diff --git a/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c b/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c index a3e76eabcc..1dbf4fb4fb 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c +++ b/source/libs/sync/test/sync_test_lib/src/syncMainDebug.c @@ -80,7 +80,7 @@ cJSON* syncNode2Json(const SSyncNode* pSyncNode) { // tla+ server vars cJSON_AddNumberToObject(pRoot, "state", pSyncNode->state); cJSON_AddStringToObject(pRoot, "state_str", syncStr(pSyncNode->state)); - cJSON_AddItemToObject(pRoot, "pRaftStore", raftStore2Json(&pSyncNode.raftStore)); + // cJSON_AddItemToObject(pRoot, "pRaftStore", raftStore2Json(&pSyncNode.raftStore)); // tla+ candidate vars cJSON_AddItemToObject(pRoot, "pVotesGranted", voteGranted2Json(pSyncNode->pVotesGranted)); diff --git a/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c b/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c index ae83bf9ead..5f011ffe69 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c +++ b/source/libs/sync/test/sync_test_lib/src/syncMessageDebug.c @@ -2858,11 +2858,11 @@ cJSON* syncLocalCmd2Json(const SyncLocalCmd* pMsg) { cJSON_AddNumberToObject(pRoot, "cmd", pMsg->cmd); - snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->sdNewTerm); - cJSON_AddStringToObject(pRoot, "sd-new-term", u64buf); + // snprintf(u64buf, sizeof(u64buf), "%" PRIu64, pMsg->sdNewTerm); + // cJSON_AddStringToObject(pRoot, "sd-new-term", u64buf); - snprintf(u64buf, sizeof(u64buf), "%" PRId64, pMsg->fcIndex); - cJSON_AddStringToObject(pRoot, "fc-index", u64buf); + // snprintf(u64buf, sizeof(u64buf), "%" PRId64, pMsg->fcIndex); + // cJSON_AddStringToObject(pRoot, "fc-index", u64buf); } cJSON* pJson = cJSON_CreateObject(); diff --git a/source/libs/sync/test/sync_test_lib/src/syncRaftStoreDebug.c b/source/libs/sync/test/sync_test_lib/src/syncRaftStoreDebug.c index c462b3275d..f6cd381e54 100644 --- a/source/libs/sync/test/sync_test_lib/src/syncRaftStoreDebug.c +++ b/source/libs/sync/test/sync_test_lib/src/syncRaftStoreDebug.c @@ -41,8 +41,8 @@ cJSON *raftStore2Json(SRaftStore *pRaftStore) { cJSON_AddNumberToObject(pVoteFor, "vgId", pRaftStore->voteFor.vgId); cJSON_AddItemToObject(pRoot, "voteFor", pVoteFor); - int hasVoted = raftStoreHasVoted(pRaftStore); - cJSON_AddNumberToObject(pRoot, "hasVoted", hasVoted); + // int hasVoted = raftStoreHasVoted(pRaftStore); + // cJSON_AddNumberToObject(pRoot, "hasVoted", hasVoted); } cJSON *pJson = cJSON_CreateObject(); diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index d9cbde5714..34ad9ae6bc 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -1045,7 +1045,7 @@ bool taosAssertRelease(bool condition) { int32_t dflag = 255; // tsLogEmbedded ? 255 : uDebugFlag taosPrintLog(flags, level, dflag, "tAssert called in release mode, exit:%d", tsAssert); - taosPrintTrace(flags, level, dflag); + taosPrintTrace(flags, level, dflag, 0); if (tsAssert) { taosMsleep(300); From 71d59160307101773e05c80b827f59a0b5d47567 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 9 Jan 2023 13:22:11 +0800 Subject: [PATCH 020/139] fix: error code not returned issue --- source/libs/executor/src/tsort.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index 03be1ee6f2..661e9f97b7 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -251,7 +251,8 @@ static int32_t sortComparInit(SMsortComparParam* pParam, SArray* pSources, int32 if (pHandle->pBuf == NULL) { if (!osTempSpaceAvailable()) { code = TSDB_CODE_NO_AVAIL_DISK; - qError("Sort compare init failed since %s, %s", terrstr(code), pHandle->idStr); + terrno = code; + qError("Sort compare init failed since %s, %s", tstrerror(code), pHandle->idStr); return code; } @@ -259,6 +260,7 @@ static int32_t sortComparInit(SMsortComparParam* pParam, SArray* pSources, int32 "sortComparInit", tsTempDir); dBufSetPrintInfo(pHandle->pBuf); if (code != TSDB_CODE_SUCCESS) { + terrno = code; return code; } } @@ -282,6 +284,7 @@ static int32_t sortComparInit(SMsortComparParam* pParam, SArray* pSources, int32 code = blockDataFromBuf(pSource->src.pBlock, pPage); if (code != TSDB_CODE_SUCCESS) { + terrno = code; return code; } From 907cb73243807fd6846658bf43bde0daea3b29e4 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 16:31:16 +0800 Subject: [PATCH 021/139] fix: return dropping dnode in status resp --- source/dnode/mnode/impl/inc/mndDnode.h | 1 - source/dnode/mnode/impl/src/mndDnode.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndDnode.h b/source/dnode/mnode/impl/inc/mndDnode.h index ebbabdfa33..cf1e7422be 100644 --- a/source/dnode/mnode/impl/inc/mndDnode.h +++ b/source/dnode/mnode/impl/inc/mndDnode.h @@ -29,7 +29,6 @@ void mndReleaseDnode(SMnode *pMnode, SDnodeObj *pDnode); SEpSet mndGetDnodeEpset(SDnodeObj *pDnode); int32_t mndGetDnodeSize(SMnode *pMnode); bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs); -void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeEps); #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index c7a416d444..ddb54a95ea 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -308,7 +308,8 @@ void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeEps) { void *pIter = NULL; while (1) { SDnodeObj *pDnode = NULL; - pIter = sdbFetch(pSdb, SDB_DNODE, pIter, (void **)&pDnode); + ESdbStatus objStatus = 0; + pIter = sdbFetchAll(pSdb, SDB_DNODE, pIter, (void **)&pDnode, &objStatus, true); if (pIter == NULL) break; SDnodeEp dnodeEp = {0}; From 284dd88b6f17ea89fba4f30aef4592b935ba6803 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 16:49:58 +0800 Subject: [PATCH 022/139] enh: add version for show cluster --- source/common/src/systable.c | 2 ++ source/dnode/mnode/impl/src/mndCluster.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 60a673ef9c..6c86743b69 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -67,6 +67,8 @@ static const SSysDbTableSchema clusterSchema[] = { {.name = "name", .bytes = TSDB_CLUSTER_ID_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, {.name = "uptime", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true}, {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, + {.name = "version", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true}, + {.name = "expire_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true}, }; static const SSysDbTableSchema userDBSchema[] = { diff --git a/source/dnode/mnode/impl/src/mndCluster.c b/source/dnode/mnode/impl/src/mndCluster.c index ca03207d2b..e0d8ecb3eb 100644 --- a/source/dnode/mnode/impl/src/mndCluster.c +++ b/source/dnode/mnode/impl/src/mndCluster.c @@ -20,6 +20,8 @@ #define CLUSTER_VER_NUMBE 1 #define CLUSTER_RESERVE_SIZE 60 +char tsVersionName[16] = "community"; +int64_t tsExpireTime = 0; static SSdbRaw *mndClusterActionEncode(SClusterObj *pCluster); static SSdbRow *mndClusterActionDecode(SSdbRaw *pRaw); @@ -291,6 +293,18 @@ static int32_t mndRetrieveClusters(SRpcMsg *pMsg, SShowObj *pShow, SSDataBlock * pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)&pCluster->createdTime, false); + char ver[12] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(ver, tsVersionName, pShow->pMeta->pSchemas[cols].bytes); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)ver, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + if (tsExpireTime <= 0) { + colDataAppendNULL(pColInfo, numOfRows); + } else { + colDataAppend(pColInfo, numOfRows, (const char *)&tsExpireTime, false); + } + sdbRelease(pSdb, pCluster); numOfRows++; } From 6ba5b6a287879076599eac8acaa2bfb9bf159d2c Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 17:28:27 +0800 Subject: [PATCH 023/139] fix: compile error --- source/dnode/mnode/impl/inc/mndDnode.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source/dnode/mnode/impl/inc/mndDnode.h b/source/dnode/mnode/impl/inc/mndDnode.h index cf1e7422be..ebbabdfa33 100644 --- a/source/dnode/mnode/impl/inc/mndDnode.h +++ b/source/dnode/mnode/impl/inc/mndDnode.h @@ -29,6 +29,7 @@ void mndReleaseDnode(SMnode *pMnode, SDnodeObj *pDnode); SEpSet mndGetDnodeEpset(SDnodeObj *pDnode); int32_t mndGetDnodeSize(SMnode *pMnode); bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs); +void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeEps); #ifdef __cplusplus } From 012dbf3176e9023605a2cb637aa1072a01a6b2b5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 9 Jan 2023 18:47:27 +0800 Subject: [PATCH 024/139] enh: read mnode file --- source/dnode/mgmt/mgmt_mnode/src/mmFile.c | 152 ++++++++++------------ 1 file changed, 66 insertions(+), 86 deletions(-) diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c index dd05fe673a..f06669a610 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c @@ -17,117 +17,97 @@ #include "mmInt.h" #include "tjson.h" -int32_t mmReadFile(const char *path, SMnodeOpt *pOption) { - int32_t code = TSDB_CODE_INVALID_JSON_FORMAT; - int32_t len = 0; - int32_t maxLen = 4096; - char *content = taosMemoryCalloc(1, maxLen + 1); - cJSON *root = NULL; - char file[PATH_MAX] = {0}; - TdFilePtr pFile = NULL; +static int32_t mmDecodeOption(SJson *pJson, SMnodeOpt *pOption) { + int32_t code = 0; + tjsonGetInt32ValueFromDouble(pJson, "deployed", pOption->deploy, code); + if (code < 0) return -1; + tjsonGetInt32ValueFromDouble(pJson, "selfIndex", pOption->selfIndex, code); + if (code < 0) return 0; + + SJson *replicas = tjsonGetObjectItem(pJson, "replicas"); + if (replicas == NULL) return 0; + pOption->numOfReplicas = tjsonGetArraySize(replicas); + + for (int32_t i = 0; i < pOption->numOfReplicas; ++i) { + SJson *replica = tjsonGetArrayItem(replicas, i); + if (replica == NULL) return -1; + + SReplica *pReplica = pOption->replicas + i; + tjsonGetInt32ValueFromDouble(replica, "id", pReplica->id, code); + if (code < 0) return -1; + code = tjsonGetStringValue(replica, "fqdn", pReplica->fqdn); + if (code < 0) return -1; + tjsonGetUInt16ValueFromDouble(replica, "port", pReplica->port, code); + if (code < 0) return -1; + } + + return 0; +} + +int32_t mmReadFile(const char *path, SMnodeOpt *pOption) { + int32_t code = -1; + TdFilePtr pFile = NULL; + char *pData = NULL; + SJson *pJson = NULL; + char file[PATH_MAX] = {0}; snprintf(file, sizeof(file), "%s%smnode.json", path, TD_DIRSEP); + + if (taosStatFile(file, NULL, NULL) < 0) { + dInfo("mnode file:%s not exist", file); + return 0; + } + pFile = taosOpenFile(file, TD_FILE_READ); if (pFile == NULL) { - code = 0; + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to open mnode file:%s since %s", file, terrstr()); goto _OVER; } - len = (int32_t)taosReadFile(pFile, content, maxLen); - if (len <= 0) { - dError("failed to read %s since content is null", file); + int64_t size = 0; + if (taosFStatFile(pFile, &size, NULL) < 0) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to fstat mnode file:%s since %s", file, terrstr()); goto _OVER; } - content[len] = 0; - root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read %s since invalid json format", file); + pData = taosMemoryMalloc(size + 1); + if (pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; goto _OVER; } - cJSON *deployed = cJSON_GetObjectItem(root, "deployed"); - if (!deployed || deployed->type != cJSON_Number) { - dError("failed to read %s since deployed not found", file); + if (taosReadFile(pFile, pData, size) != size) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to read mnode file:%s since %s", file, terrstr()); goto _OVER; } - pOption->deploy = deployed->valueint; - cJSON *selfIndex = cJSON_GetObjectItem(root, "selfIndex"); - if (selfIndex) { - if (selfIndex->type != cJSON_Number) { - dError("failed to read %s since selfIndex not found", file); - goto _OVER; - } - pOption->selfIndex = selfIndex->valueint; + pData[size] = '\0'; + + pJson = tjsonParse(pData); + if (pJson == NULL) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; } - cJSON *replicas = cJSON_GetObjectItem(root, "replicas"); - if (replicas) { - if (replicas->type != cJSON_Array) { - dError("failed to read %s since replicas not found", file); - goto _OVER; - } - - int32_t numOfReplicas = cJSON_GetArraySize(replicas); - if (numOfReplicas <= 0) { - dError("failed to read %s since numOfReplicas:%d invalid", file, numOfReplicas); - goto _OVER; - } - pOption->numOfReplicas = numOfReplicas; - - for (int32_t i = 0; i < numOfReplicas; ++i) { - SReplica *pReplica = pOption->replicas + i; - - cJSON *replica = cJSON_GetArrayItem(replicas, i); - if (replica == NULL) break; - - cJSON *id = cJSON_GetObjectItem(replica, "id"); - if (id) { - if (id->type != cJSON_Number) { - dError("failed to read %s since id not found", file); - goto _OVER; - } - if (pReplica) { - pReplica->id = id->valueint; - } - } - - cJSON *fqdn = cJSON_GetObjectItem(replica, "fqdn"); - if (fqdn) { - if (fqdn->type != cJSON_String || fqdn->valuestring == NULL) { - dError("failed to read %s since fqdn not found", file); - goto _OVER; - } - if (pReplica) { - tstrncpy(pReplica->fqdn, fqdn->valuestring, TSDB_FQDN_LEN); - } - } - - cJSON *port = cJSON_GetObjectItem(replica, "port"); - if (port) { - if (port->type != cJSON_Number) { - dError("failed to read %s since port not found", file); - goto _OVER; - } - if (pReplica) { - pReplica->port = (uint16_t)port->valueint; - } - } - } + if (mmDecodeOption(pJson, pOption) < 0) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; } code = 0; + dInfo("succceed to read mnode file %s", file); _OVER: - if (content != NULL) taosMemoryFree(content); - if (root != NULL) cJSON_Delete(root); + if (pData != NULL) taosMemoryFree(pData); + if (pJson != NULL) cJSON_Delete(pJson); if (pFile != NULL) taosCloseFile(&pFile); - if (code == 0) { - dDebug("succcessed to read file %s, deployed:%d", file, pOption->deploy); - } - terrno = code; + if (code != 0) { + dError("failed to read mnode file:%s since %s", file, terrstr()); + } return code; } From 1d83a8ff01df46c7544cb860b2d2fe820553b978 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 9 Jan 2023 19:06:22 +0800 Subject: [PATCH 025/139] fix: install script don't install new cfg on fresh new system (#19451) --- packaging/tools/install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packaging/tools/install.sh b/packaging/tools/install.sh index 63009e5421..2a078b5eab 100755 --- a/packaging/tools/install.sh +++ b/packaging/tools/install.sh @@ -481,11 +481,11 @@ function install_adapter_config() { ${csudo}mkdir -p ${cfg_install_dir} [ -f ${script_dir}/cfg/${adapterName}.toml ] && ${csudo}cp ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir} [ -f ${cfg_install_dir}/${adapterName}.toml ] && ${csudo}chmod 644 ${cfg_install_dir}/${adapterName}.toml + else + [ -f ${script_dir}/cfg/${adapterName}.toml ] && + ${csudo}cp -f ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir}/${adapterName}.toml.new fi - [ -f ${script_dir}/cfg/${adapterName}.toml ] && - ${csudo}cp -f ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir}/${adapterName}.toml.new - [ -f ${cfg_install_dir}/${adapterName}.toml ] && ${csudo}ln -s ${cfg_install_dir}/${adapterName}.toml ${install_main_dir}/cfg/${adapterName}.toml @@ -499,9 +499,10 @@ function install_config() { ${csudo}mkdir -p ${cfg_install_dir} [ -f ${script_dir}/cfg/${configFile} ] && ${csudo}cp ${script_dir}/cfg/${configFile} ${cfg_install_dir} ${csudo}chmod 644 ${cfg_install_dir}/* + else + ${csudo}cp -f ${script_dir}/cfg/${configFile} ${cfg_install_dir}/${configFile}.new fi - ${csudo}cp -f ${script_dir}/cfg/${configFile} ${cfg_install_dir}/${configFile}.new ${csudo}ln -s ${cfg_install_dir}/${configFile} ${install_main_dir}/cfg [ ! -z $1 ] && return 0 || : # only install client From 4bfc2fab45dd20b19019483ca11259da5c887b2d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 9 Jan 2023 19:19:12 +0800 Subject: [PATCH 026/139] fix: add test cases; --- tests/script/tsim/parser/regressiontest.sim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/script/tsim/parser/regressiontest.sim b/tests/script/tsim/parser/regressiontest.sim index 98cb0248a1..1b127155cb 100644 --- a/tests/script/tsim/parser/regressiontest.sim +++ b/tests/script/tsim/parser/regressiontest.sim @@ -58,4 +58,9 @@ if $data40 != @18-09-17 09:06:49.600@ then return -1 endi +sql select * from $tb order by ts desc; +if $rows != 8198 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT From 16f0900fe994a417ec106d594b1b7e5d77474115 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 9 Jan 2023 19:26:39 +0800 Subject: [PATCH 027/139] fix(query): fix error for retrieve data only in last files. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 64 ++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index dcfc78fd1a..91690af4c8 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2834,7 +2834,37 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { TSDBKEY keyInBuf = getCurrentKeyInBuf(pScanInfo, pReader); if (pBlockInfo == NULL) { // build data block from last data file - code = buildComposedDataBlock(pReader); + SBlockData* pBData = &pReader->status.fileBlockData; + tBlockDataReset(pBData); + + SSDataBlock* pResBlock = pReader->pResBlock; + tsdbDebug("load data in last block firstly, due to desc scan data, %s", pReader->idStr); + + int64_t st = taosGetTimestampUs(); + + while (1) { + bool hasBlockLData = hasDataInLastBlock(pLastBlockReader); + + // no data in last block and block, no need to proceed. + if (hasBlockLData == false) { + break; + } + + buildComposedDataBlockImpl(pReader, pScanInfo, &pReader->status.fileBlockData, pLastBlockReader); + if (pResBlock->info.rows >= pReader->capacity) { + break; + } + } + + double el = (taosGetTimestampUs() - st) / 1000.0; + updateComposedBlockInfo(pReader, el, pScanInfo); + + if (pResBlock->info.rows > 0) { + tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 + " rows:%d, elapsed time:%.2f ms %s", + pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey, + pResBlock->info.rows, el, pReader->idStr); + } } else if (fileBlockShouldLoad(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader)) { code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); if (code != TSDB_CODE_SUCCESS) { @@ -2853,10 +2883,38 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { // only return the rows in last block int64_t tsLast = getCurrentKeyInLastBlock(pLastBlockReader); ASSERT(tsLast >= pBlock->maxKey.ts); - tBlockDataReset(&pReader->status.fileBlockData); + SBlockData* pBData = &pReader->status.fileBlockData; + tBlockDataReset(pBData); + + SSDataBlock* pResBlock = pReader->pResBlock; tsdbDebug("load data in last block firstly, due to desc scan data, %s", pReader->idStr); - code = buildComposedDataBlock(pReader); + + int64_t st = taosGetTimestampUs(); + + while (1) { + bool hasBlockLData = hasDataInLastBlock(pLastBlockReader); + + // no data in last block and block, no need to proceed. + if (hasBlockLData == false) { + break; + } + + buildComposedDataBlockImpl(pReader, pScanInfo, &pReader->status.fileBlockData, pLastBlockReader); + if (pResBlock->info.rows >= pReader->capacity) { + break; + } + } + + double el = (taosGetTimestampUs() - st) / 1000.0; + updateComposedBlockInfo(pReader, el, pScanInfo); + + if (pResBlock->info.rows > 0) { + tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 + " rows:%d, elapsed time:%.2f ms %s", + pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey, + pResBlock->info.rows, el, pReader->idStr); + } } else { // whole block is required, return it directly SDataBlockInfo* pInfo = &pReader->pResBlock->info; pInfo->rows = pBlock->nRow; From df2175087b9c04c073d7b258b6fec037002a1676 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 9 Jan 2023 19:47:17 +0800 Subject: [PATCH 028/139] fix: memory leak and invalid read issue --- source/dnode/vnode/src/tsdb/tsdbUtil.c | 83 +++++++++++++++++++++----- 1 file changed, 67 insertions(+), 16 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index a9c31c19cb..9bc903a0ba 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -682,6 +682,16 @@ int32_t tRowMergerInit2(SRowMerger *pMerger, STSchema *pResTSchema, TSDBROW *pRo } tsdbRowGetColVal(pRow, pTSchema, jCol++, pColVal); + if ((!COL_VAL_IS_NONE(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { + uint8_t *pVal = pColVal->value.pData; + + pColVal->value.pData = NULL; + code = tRealloc(&pColVal->value.pData, pColVal->value.nData); + if (code) goto _exit; + + memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + } + if (taosArrayPush(pMerger->pArray, pColVal) == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _exit; @@ -720,12 +730,28 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { if (key.version > pMerger->version) { if (!COL_VAL_IS_NONE(pColVal)) { - taosArraySet(pMerger->pArray, iCol, pColVal); + if (IS_VAR_DATA_TYPE(pColVal->type)) { + SColVal *tColVal = taosArrayGet(pMerger->pArray, iCol); + code = tRealloc(&tColVal->value.pData, pColVal->value.nData); + if (code) return code; + + memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + } else { + taosArraySet(pMerger->pArray, iCol, pColVal); + } } } else if (key.version < pMerger->version) { SColVal *tColVal = (SColVal *)taosArrayGet(pMerger->pArray, iCol); if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal)) { - taosArraySet(pMerger->pArray, iCol, pColVal); + if (IS_VAR_DATA_TYPE(pColVal->type)) { + SColVal *tColVal = taosArrayGet(pMerger->pArray, iCol); + code = tRealloc(&tColVal->value.pData, pColVal->value.nData); + if (code) return code; + + memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + } else { + taosArraySet(pMerger->pArray, iCol, pColVal); + } } } else { ASSERT(0 && "dup versions not allowed"); @@ -765,6 +791,16 @@ int32_t tRowMergerInit(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { // other for (int16_t iCol = 1; iCol < pTSchema->numOfCols; iCol++) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); + if ((!COL_VAL_IS_NONE(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { + uint8_t *pVal = pColVal->value.pData; + + pColVal->value.pData = NULL; + code = tRealloc(&pColVal->value.pData, pColVal->value.nData); + if (code) goto _exit; + + memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + } + if (taosArrayPush(pMerger->pArray, pColVal) == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _exit; @@ -776,12 +812,10 @@ _exit: } void tRowMergerClear(SRowMerger *pMerger) { - if (pMerger->merged) { - for (int32_t iCol = 1; iCol < pMerger->pTSchema->numOfCols; iCol++) { - SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); - if (IS_VAR_DATA_TYPE(pTColVal->type)) { - tFree(pTColVal->value.pData); - } + for (int32_t iCol = 1; iCol < pMerger->pTSchema->numOfCols; iCol++) { + SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); + if (IS_VAR_DATA_TYPE(pTColVal->type)) { + tFree(pTColVal->value.pData); } } @@ -802,13 +836,17 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { if (!COL_VAL_IS_NONE(pColVal)) { if (IS_VAR_DATA_TYPE(pColVal->type)) { SColVal *pTColVal = taosArrayGet(pMerger->pArray, iCol); + if (!COL_VAL_IS_NULL(pColVal)) { + code = tRealloc(&pTColVal->value.pData, pColVal->value.nData); + if (code) goto _exit; - pTColVal->value.pData = NULL; - code = tRealloc(&pTColVal->value.pData, pColVal->value.nData); - if (code) goto _exit; - - pTColVal->value.nData = pColVal->value.nData; - memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal->value.nData); + pTColVal->value.nData = pColVal->value.nData; + memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal->value.nData); + } else { + tFree(pTColVal->value.pData); + pTColVal->value.pData = NULL; + taosArraySet(pMerger->pArray, iCol, pColVal); + } } else { taosArraySet(pMerger->pArray, iCol, pColVal); } @@ -816,7 +854,21 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { } else if (key.version < pMerger->version) { SColVal *tColVal = (SColVal *)taosArrayGet(pMerger->pArray, iCol); if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal)) { - taosArraySet(pMerger->pArray, iCol, pColVal); + if (IS_VAR_DATA_TYPE(pColVal->type)) { + if (!COL_VAL_IS_NULL(pColVal)) { + code = tRealloc(&tColVal->value.pData, pColVal->value.nData); + if (code) goto _exit; + + tColVal->value.nData = pColVal->value.nData; + memcpy(tColVal->value.pData, pColVal->value.pData, tColVal->value.nData); + } else { + tFree(tColVal->value.pData); + tColVal->value.pData = NULL; + taosArraySet(pMerger->pArray, iCol, pColVal); + } + } else { + taosArraySet(pMerger->pArray, iCol, pColVal); + } } } else { ASSERT(0); @@ -824,7 +876,6 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { } pMerger->version = key.version; - pMerger->merged = true; _exit: return code; From 6a6d53b89623cf07ef051e7fdb670a913f357b9f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 9 Jan 2023 20:55:34 +0800 Subject: [PATCH 029/139] fix(query): fix error for retrieve data only in last files. (#19457) * fix: add test cases; * fix(query): fix error for retrieve data only in last files. --- source/dnode/vnode/src/tsdb/tsdbRead.c | 64 ++++++++++++++++++++- tests/script/tsim/parser/regressiontest.sim | 5 ++ 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index dcfc78fd1a..91690af4c8 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2834,7 +2834,37 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { TSDBKEY keyInBuf = getCurrentKeyInBuf(pScanInfo, pReader); if (pBlockInfo == NULL) { // build data block from last data file - code = buildComposedDataBlock(pReader); + SBlockData* pBData = &pReader->status.fileBlockData; + tBlockDataReset(pBData); + + SSDataBlock* pResBlock = pReader->pResBlock; + tsdbDebug("load data in last block firstly, due to desc scan data, %s", pReader->idStr); + + int64_t st = taosGetTimestampUs(); + + while (1) { + bool hasBlockLData = hasDataInLastBlock(pLastBlockReader); + + // no data in last block and block, no need to proceed. + if (hasBlockLData == false) { + break; + } + + buildComposedDataBlockImpl(pReader, pScanInfo, &pReader->status.fileBlockData, pLastBlockReader); + if (pResBlock->info.rows >= pReader->capacity) { + break; + } + } + + double el = (taosGetTimestampUs() - st) / 1000.0; + updateComposedBlockInfo(pReader, el, pScanInfo); + + if (pResBlock->info.rows > 0) { + tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 + " rows:%d, elapsed time:%.2f ms %s", + pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey, + pResBlock->info.rows, el, pReader->idStr); + } } else if (fileBlockShouldLoad(pReader, pBlockInfo, pBlock, pScanInfo, keyInBuf, pLastBlockReader)) { code = doLoadFileBlockData(pReader, pBlockIter, &pStatus->fileBlockData, pScanInfo->uid); if (code != TSDB_CODE_SUCCESS) { @@ -2853,10 +2883,38 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) { // only return the rows in last block int64_t tsLast = getCurrentKeyInLastBlock(pLastBlockReader); ASSERT(tsLast >= pBlock->maxKey.ts); - tBlockDataReset(&pReader->status.fileBlockData); + SBlockData* pBData = &pReader->status.fileBlockData; + tBlockDataReset(pBData); + + SSDataBlock* pResBlock = pReader->pResBlock; tsdbDebug("load data in last block firstly, due to desc scan data, %s", pReader->idStr); - code = buildComposedDataBlock(pReader); + + int64_t st = taosGetTimestampUs(); + + while (1) { + bool hasBlockLData = hasDataInLastBlock(pLastBlockReader); + + // no data in last block and block, no need to proceed. + if (hasBlockLData == false) { + break; + } + + buildComposedDataBlockImpl(pReader, pScanInfo, &pReader->status.fileBlockData, pLastBlockReader); + if (pResBlock->info.rows >= pReader->capacity) { + break; + } + } + + double el = (taosGetTimestampUs() - st) / 1000.0; + updateComposedBlockInfo(pReader, el, pScanInfo); + + if (pResBlock->info.rows > 0) { + tsdbDebug("%p uid:%" PRIu64 ", composed data block created, brange:%" PRIu64 "-%" PRIu64 + " rows:%d, elapsed time:%.2f ms %s", + pReader, pResBlock->info.id.uid, pResBlock->info.window.skey, pResBlock->info.window.ekey, + pResBlock->info.rows, el, pReader->idStr); + } } else { // whole block is required, return it directly SDataBlockInfo* pInfo = &pReader->pResBlock->info; pInfo->rows = pBlock->nRow; diff --git a/tests/script/tsim/parser/regressiontest.sim b/tests/script/tsim/parser/regressiontest.sim index 98cb0248a1..1b127155cb 100644 --- a/tests/script/tsim/parser/regressiontest.sim +++ b/tests/script/tsim/parser/regressiontest.sim @@ -58,4 +58,9 @@ if $data40 != @18-09-17 09:06:49.600@ then return -1 endi +sql select * from $tb order by ts desc; +if $rows != 8198 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT From a0d2da630e913d3d1acef62bf24823770ab24c73 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 10 Jan 2023 09:28:04 +0800 Subject: [PATCH 030/139] fix: no core file on linux --- source/client/src/clientEnv.c | 4 ++++ source/dnode/mgmt/exe/dmMain.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 2ecade58f9..495c2cca9a 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -420,7 +420,11 @@ _return: taosLogCrashInfo("taos", pMsg, msgLen, signum, sigInfo); +#ifdef _TD_DARWIN_64 exit(signum); +#elif defined(WINDOWS) + exit(signum); +#endif } void crashReportThreadFuncUnexpectedStopped(void) { atomic_store_32(&clientStop, -1); } diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 711280ea58..4910b0ac3f 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -100,7 +100,11 @@ _return: taosLogCrashInfo("taosd", pMsg, msgLen, signum, sigInfo); +#ifdef _TD_DARWIN_64 exit(signum); +#elif defined(WINDOWS) + exit(signum); +#endif } static void dmSetSignalHandle() { From 91821c9bb45e21ce80d1db1d6190cf0feb7dfca2 Mon Sep 17 00:00:00 2001 From: jiajingbin Date: Tue, 10 Jan 2023 09:41:20 +0800 Subject: [PATCH 031/139] test: add cases for ts-2440 --- tests/system-test/1-insert/time_range_wise.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/system-test/1-insert/time_range_wise.py b/tests/system-test/1-insert/time_range_wise.py index 3d5c9197d1..df1cc516c5 100644 --- a/tests/system-test/1-insert/time_range_wise.py +++ b/tests/system-test/1-insert/time_range_wise.py @@ -600,6 +600,11 @@ class TDTestCase: tdLog.printNoPrefix("==========step4:after wal, all check again ") self.all_test() + # add for TS-2440 + for i in range(self.rows): + tdSql.execute("drop database if exists db3 ") + tdSql.execute("create database db3 retentions 1s:4m,2s:8m,3s:12m") + def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") From e244a484f8edb5201eb42bd628032041eea15c96 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 10 Jan 2023 10:49:35 +0800 Subject: [PATCH 032/139] fix(query): add additional check for imem/mem --- source/dnode/vnode/src/tsdb/tsdbRead.c | 49 +++++++++++++------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 91690af4c8..b21050b2ae 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -2333,32 +2333,33 @@ static int32_t buildComposedDataBlockImpl(STsdbReader* pReader, STableBlockScanI SBlockData* pBlockData, SLastBlockReader* pLastBlockReader) { SFileBlockDumpInfo* pDumpInfo = &pReader->status.fBlockDumpInfo; + TSDBROW *pRow = NULL, *piRow = NULL; int64_t key = (pBlockData->nRow > 0 && (!pDumpInfo->allDumped)) ? pBlockData->aTSKEY[pDumpInfo->rowIndex] : INT64_MIN; - if (pBlockScanInfo->iter.hasVal && pBlockScanInfo->iiter.hasVal) { - return doMergeMultiLevelRows(pReader, pBlockScanInfo, pBlockData, pLastBlockReader); - } else { - TSDBROW *pRow = NULL, *piRow = NULL; - if (pBlockScanInfo->iter.hasVal) { - pRow = getValidMemRow(&pBlockScanInfo->iter, pBlockScanInfo->delSkyline, pReader); - } - - if (pBlockScanInfo->iiter.hasVal) { - piRow = getValidMemRow(&pBlockScanInfo->iiter, pBlockScanInfo->delSkyline, pReader); - } - - // imem + file + last block - if (pBlockScanInfo->iiter.hasVal) { - return doMergeBufAndFileRows(pReader, pBlockScanInfo, piRow, &pBlockScanInfo->iiter, key, pLastBlockReader); - } - - // mem + file + last block - if (pBlockScanInfo->iter.hasVal) { - return doMergeBufAndFileRows(pReader, pBlockScanInfo, pRow, &pBlockScanInfo->iter, key, pLastBlockReader); - } - - // files data blocks + last block - return mergeFileBlockAndLastBlock(pReader, pLastBlockReader, key, pBlockScanInfo, pBlockData); + if (pBlockScanInfo->iter.hasVal) { + pRow = getValidMemRow(&pBlockScanInfo->iter, pBlockScanInfo->delSkyline, pReader); } + + if (pBlockScanInfo->iiter.hasVal) { + piRow = getValidMemRow(&pBlockScanInfo->iiter, pBlockScanInfo->delSkyline, pReader); + } + + // two levels of mem-table does contain the valid rows + if (pRow != NULL && piRow != NULL) { + return doMergeMultiLevelRows(pReader, pBlockScanInfo, pBlockData, pLastBlockReader); + } + + // imem + file + last block + if (pBlockScanInfo->iiter.hasVal) { + return doMergeBufAndFileRows(pReader, pBlockScanInfo, piRow, &pBlockScanInfo->iiter, key, pLastBlockReader); + } + + // mem + file + last block + if (pBlockScanInfo->iter.hasVal) { + return doMergeBufAndFileRows(pReader, pBlockScanInfo, pRow, &pBlockScanInfo->iter, key, pLastBlockReader); + } + + // files data blocks + last block + return mergeFileBlockAndLastBlock(pReader, pLastBlockReader, key, pBlockScanInfo, pBlockData); } static int32_t loadNeighborIfOverlap(SFileDataBlockInfo* pBlockInfo, STableBlockScanInfo* pBlockScanInfo, From df6e9631e162ec82be3374e298c456a64e301499 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Tue, 10 Jan 2023 11:23:52 +0800 Subject: [PATCH 033/139] fix: synchronize access within walFsync --- source/libs/wal/src/walWrite.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 51307dc17d..db31692da9 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -635,6 +635,7 @@ int32_t walWrite(SWal *pWal, int64_t index, tmsg_t msgType, const void *body, in } void walFsync(SWal *pWal, bool forceFsync) { + taosThreadMutexLock(&pWal->mutex); if (forceFsync || (pWal->cfg.level == TAOS_WAL_FSYNC && pWal->cfg.fsyncPeriod == 0)) { wTrace("vgId:%d, fileId:%" PRId64 ".idx, do fsync", pWal->cfg.vgId, walGetCurFileFirstVer(pWal)); if (taosFsyncFile(pWal->pIdxFile) < 0) { @@ -647,4 +648,5 @@ void walFsync(SWal *pWal, bool forceFsync) { strerror(errno)); } } + taosThreadMutexUnlock(&pWal->mutex); } From bfc483aa30ef156fba14eb4c8d8593371249d534 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 10 Jan 2023 11:32:13 +0800 Subject: [PATCH 034/139] fix: row merge flag issue --- source/dnode/vnode/src/tsdb/tsdbUtil.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 9bc903a0ba..ede1e9a424 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -682,13 +682,13 @@ int32_t tRowMergerInit2(SRowMerger *pMerger, STSchema *pResTSchema, TSDBROW *pRo } tsdbRowGetColVal(pRow, pTSchema, jCol++, pColVal); - if ((!COL_VAL_IS_NONE(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { + if ((!COL_VAL_IS_NONE(pColVal)) && (!COL_VAL_IS_NULL(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { uint8_t *pVal = pColVal->value.pData; pColVal->value.pData = NULL; code = tRealloc(&pColVal->value.pData, pColVal->value.nData); if (code) goto _exit; - + memcpy(pColVal->value.pData, pVal, pColVal->value.nData); } @@ -730,12 +730,14 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { if (key.version > pMerger->version) { if (!COL_VAL_IS_NONE(pColVal)) { - if (IS_VAR_DATA_TYPE(pColVal->type)) { + if ((!COL_VAL_IS_NULL(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { SColVal *tColVal = taosArrayGet(pMerger->pArray, iCol); code = tRealloc(&tColVal->value.pData, pColVal->value.nData); if (code) return code; - + + tColVal->value.nData = pColVal->value.nData; memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + tColVal->flag = 0; } else { taosArraySet(pMerger->pArray, iCol, pColVal); } @@ -743,12 +745,13 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { } else if (key.version < pMerger->version) { SColVal *tColVal = (SColVal *)taosArrayGet(pMerger->pArray, iCol); if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal)) { - if (IS_VAR_DATA_TYPE(pColVal->type)) { - SColVal *tColVal = taosArrayGet(pMerger->pArray, iCol); + if ((!COL_VAL_IS_NULL(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { code = tRealloc(&tColVal->value.pData, pColVal->value.nData); if (code) return code; - + + tColVal->value.nData = pColVal->value.nData; memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + tColVal->flag = 0; } else { taosArraySet(pMerger->pArray, iCol, pColVal); } @@ -791,7 +794,7 @@ int32_t tRowMergerInit(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { // other for (int16_t iCol = 1; iCol < pTSchema->numOfCols; iCol++) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); - if ((!COL_VAL_IS_NONE(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { + if ((!COL_VAL_IS_NONE(pColVal)) && (!COL_VAL_IS_NULL(pColVal)) && IS_VAR_DATA_TYPE(pColVal->type)) { uint8_t *pVal = pColVal->value.pData; pColVal->value.pData = NULL; @@ -842,6 +845,7 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { pTColVal->value.nData = pColVal->value.nData; memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal->value.nData); + pTColVal->flag = 0; } else { tFree(pTColVal->value.pData); pTColVal->value.pData = NULL; @@ -861,6 +865,7 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { tColVal->value.nData = pColVal->value.nData; memcpy(tColVal->value.pData, pColVal->value.pData, tColVal->value.nData); + tColVal->flag = 0; } else { tFree(tColVal->value.pData); tColVal->value.pData = NULL; From 459d2932b1727fc3eee0cb529ae25ab2a01914f5 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 10 Jan 2023 13:44:24 +0800 Subject: [PATCH 035/139] fix: memcpy empty value issue --- source/dnode/vnode/src/tsdb/tsdbUtil.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index ede1e9a424..86adc1dc80 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -689,7 +689,9 @@ int32_t tRowMergerInit2(SRowMerger *pMerger, STSchema *pResTSchema, TSDBROW *pRo code = tRealloc(&pColVal->value.pData, pColVal->value.nData); if (code) goto _exit; - memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + if (pColVal->value.nData) { + memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + } } if (taosArrayPush(pMerger->pArray, pColVal) == NULL) { @@ -736,7 +738,9 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { if (code) return code; tColVal->value.nData = pColVal->value.nData; - memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + if (pColVal->value.nData) { + memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + } tColVal->flag = 0; } else { taosArraySet(pMerger->pArray, iCol, pColVal); @@ -750,7 +754,9 @@ int32_t tRowMergerAdd(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { if (code) return code; tColVal->value.nData = pColVal->value.nData; - memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + if (pColVal->value.nData) { + memcpy(tColVal->value.pData, pColVal->value.pData, pColVal->value.nData); + } tColVal->flag = 0; } else { taosArraySet(pMerger->pArray, iCol, pColVal); @@ -800,8 +806,10 @@ int32_t tRowMergerInit(SRowMerger *pMerger, TSDBROW *pRow, STSchema *pTSchema) { pColVal->value.pData = NULL; code = tRealloc(&pColVal->value.pData, pColVal->value.nData); if (code) goto _exit; - - memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + + if (pColVal->value.nData) { + memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + } } if (taosArrayPush(pMerger->pArray, pColVal) == NULL) { @@ -844,7 +852,9 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { if (code) goto _exit; pTColVal->value.nData = pColVal->value.nData; - memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal->value.nData); + if (pTColVal->value.nData) { + memcpy(pTColVal->value.pData, pColVal->value.pData, pTColVal->value.nData); + } pTColVal->flag = 0; } else { tFree(pTColVal->value.pData); @@ -864,7 +874,9 @@ int32_t tRowMerge(SRowMerger *pMerger, TSDBROW *pRow) { if (code) goto _exit; tColVal->value.nData = pColVal->value.nData; - memcpy(tColVal->value.pData, pColVal->value.pData, tColVal->value.nData); + if (tColVal->value.nData) { + memcpy(tColVal->value.pData, pColVal->value.pData, tColVal->value.nData); + } tColVal->flag = 0; } else { tFree(tColVal->value.pData); From fcbac7236e3b9effb813d2183259b1eb76929a50 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 10 Jan 2023 13:47:18 +0800 Subject: [PATCH 036/139] fix: reset table scan status --- source/libs/executor/src/scanoperator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 1d7f27d0cf..eb38299938 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -173,7 +173,7 @@ static SResultRow* getTableGroupOutputBuf(SOperatorInfo* pOperator, uint64_t gro if (NULL == *pPage) { return NULL; } - + return (SResultRow*)((char*)(*pPage) + p1->offset); } @@ -1729,6 +1729,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { /*resetTableScanInfo(pTSInfo, pWin);*/ tsdbReaderClose(pTSInfo->base.dataReader); pTSInfo->base.dataReader = NULL; + pInfo->pTableScanOp->status = OP_OPENED; pTSInfo->scanTimes = 0; pTSInfo->currentGroupId = -1; From fd0d4bb83031d99807974616d413c367b0317625 Mon Sep 17 00:00:00 2001 From: dapan1121 <72057773+dapan1121@users.noreply.github.com> Date: Tue, 10 Jan 2023 15:39:16 +0800 Subject: [PATCH 037/139] Update tsdb.h fix: remove tmp field --- source/dnode/vnode/src/inc/tsdb.h | 1 - 1 file changed, 1 deletion(-) diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 77a3bb7a2f..5a2e462c8c 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -573,7 +573,6 @@ struct STSDBRowIter { struct SRowMerger { STSchema *pTSchema; int64_t version; - bool merged; SArray *pArray; // SArray }; From 3b4ff4d09442ab08e784ed7ba5a9c528d0b153a2 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 10 Jan 2023 20:32:31 +0800 Subject: [PATCH 038/139] fix:add logic for scan ins_columns --- include/common/tmsg.h | 7 + source/common/src/systable.c | 3 +- source/dnode/mnode/impl/src/mndShow.c | 4 + source/dnode/mnode/impl/src/mndStb.c | 449 +++++++++++++++++++++ source/dnode/vnode/inc/vnode.h | 2 +- source/dnode/vnode/src/meta/metaQuery.c | 4 +- source/libs/executor/src/sysscanoperator.c | 135 +++++-- 7 files changed, 562 insertions(+), 42 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 5c1288e391..678a744950 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -382,6 +382,13 @@ static FORCE_INLINE void tDeleteSSchemaWrapper(SSchemaWrapper* pSchemaWrapper) { } } +static FORCE_INLINE void tDeleteSSchemaWrapperForHash(void* pSchemaWrapper) { + if (pSchemaWrapper) { + taosMemoryFree(((SSchemaWrapper*)pSchemaWrapper)->pSchema); + taosMemoryFree(pSchemaWrapper); + } +} + static FORCE_INLINE int32_t taosEncodeSSchema(void** buf, const SSchema* pSchema) { int32_t tlen = 0; tlen += taosEncodeFixedI8(buf, pSchema->type); diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 43abcf1624..4d45b69703 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -178,13 +178,14 @@ static const SSysDbTableSchema userTagsSchema[] = { static const SSysDbTableSchema userColsSchema[] = { {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "table_type", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_name", .bytes = TSDB_COL_NAME_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_type", .bytes = 32 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_length", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, {.name = "col_precision", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, {.name = "col_scale", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, - {.name = "col_nullable", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "col_nullable", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false} }; static const SSysDbTableSchema userTblDistSchema[] = { diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index 4f644d4be1..cd8f41812b 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -19,6 +19,7 @@ #include "systable.h" #define SHOW_STEP_SIZE 100 +#define SHOW_COLS_STEP_SIZE 4096 static SShowObj *mndCreateShowObj(SMnode *pMnode, SRetrieveTableReq *pReq); static void mndFreeShowObj(SShowObj *pShow); @@ -228,6 +229,9 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { } } + if(pShow->type == TSDB_MGMT_TABLE_COL){ // expend capacity for ins_columns + rowsToRead = SHOW_COLS_STEP_SIZE; + } ShowRetrieveFp retrieveFp = pMgmt->retrieveFps[pShow->type]; if (retrieveFp == NULL) { mndReleaseShowObj(pShow, false); diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index d504a94700..b40b0e84aa 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -43,6 +43,7 @@ static int32_t mndProcessAlterStbReq(SRpcMsg *pReq); static int32_t mndProcessDropStbReq(SRpcMsg *pReq); static int32_t mndProcessTableMetaReq(SRpcMsg *pReq); static int32_t mndRetrieveStb(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); +static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); static void mndCancelGetNextStb(SMnode *pMnode, void *pIter); static int32_t mndProcessTableCfgReq(SRpcMsg *pReq); static int32_t mndAlterStbImp(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SStbObj *pStb, bool needRsp, @@ -69,10 +70,14 @@ int32_t mndInitStb(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_MND_TABLE_META, mndProcessTableMetaReq); mndSetMsgHandle(pMnode, TDMT_MND_TTL_TIMER, mndProcessTtlTimer); mndSetMsgHandle(pMnode, TDMT_MND_TABLE_CFG, mndProcessTableCfgReq); +// mndSetMsgHandle(pMnode, TDMT_MND_SYSTABLE_RETRIEVE, mndProcessRetrieveStbReq); mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_STB, mndRetrieveStb); mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_STB, mndCancelGetNextStb); + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_COL, mndRetrieveStbCol); + mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_COL, mndCancelGetNextStb); + return sdbSetTable(pMnode->pSdb, table); } @@ -2489,6 +2494,283 @@ void mndExtractTbNameFromStbFullName(const char *stbFullName, char *dst, int32_t } } +//static int32_t mndProcessRetrieveStbReq(SRpcMsg *pReq) { +// SMnode *pMnode = pReq->info.node; +// SShowMgmt *pMgmt = &pMnode->showMgmt; +// SShowObj *pShow = NULL; +// int32_t rowsToRead = SHOW_STEP_SIZE; +// int32_t rowsRead = 0; +// +// SRetrieveTableReq retrieveReq = {0}; +// if (tDeserializeSRetrieveTableReq(pReq->pCont, pReq->contLen, &retrieveReq) != 0) { +// terrno = TSDB_CODE_INVALID_MSG; +// return -1; +// } +// +// SMnode *pMnode = pReq->info.node; +// SSdb *pSdb = pMnode->pSdb; +// int32_t numOfRows = 0; +// SDbObj *pDb = NULL; +// ESdbStatus objStatus = 0; +// +// SUserObj *pUser = mndAcquireUser(pMnode, pReq->info.conn.user); +// if (pUser == NULL) return 0; +// bool sysinfo = pUser->sysInfo; +// +// // Append the information_schema database into the result. +//// if (!pShow->sysDbRsp) { +//// SDbObj infoschemaDb = {0}; +//// setInformationSchemaDbCfg(pMnode, &infoschemaDb); +//// size_t numOfTables = 0; +//// getVisibleInfosTablesNum(sysinfo, &numOfTables); +//// mndDumpDbInfoData(pMnode, pBlock, &infoschemaDb, pShow, numOfRows, numOfTables, true, 0, 1); +//// +//// numOfRows += 1; +//// +//// SDbObj perfschemaDb = {0}; +//// setPerfSchemaDbCfg(pMnode, &perfschemaDb); +//// numOfTables = 0; +//// getPerfDbMeta(NULL, &numOfTables); +//// mndDumpDbInfoData(pMnode, pBlock, &perfschemaDb, pShow, numOfRows, numOfTables, true, 0, 1); +//// +//// numOfRows += 1; +//// pShow->sysDbRsp = true; +//// } +// +// SSDataBlock* p = buildInfoSchemaTableMetaBlock(TSDB_INS_TABLE_COLS); +// blockDataEnsureCapacity(p, rowsToRead); +// +// size_t size = 0; +// const SSysTableMeta* pSysDbTableMeta = NULL; +// +// getInfosDbMeta(&pSysDbTableMeta, &size); +// p->info.rows = buildDbColsInfoBlock(sysinfo, p, pSysDbTableMeta, size, TSDB_INFORMATION_SCHEMA_DB); +// +// getPerfDbMeta(&pSysDbTableMeta, &size); +// p->info.rows = buildDbColsInfoBlock(sysinfo, p, pSysDbTableMeta, size, TSDB_PERFORMANCE_SCHEMA_DB); +// +// blockDataDestroy(p); +// +// +// while (numOfRows < rowsToRead) { +// pShow->pIter = sdbFetchAll(pSdb, SDB_DB, pShow->pIter, (void **)&pDb, &objStatus, true); +// if (pShow->pIter == NULL) break; +// if (strncmp(retrieveReq.db, pDb->name, strlen(retrieveReq.db)) != 0){ +// continue; +// } +// if (mndCheckDbPrivilege(pMnode, pReq->info.conn.user, MND_OPER_READ_OR_WRITE_DB, pDb) != 0) { +// continue; +// } +// +// while (numOfRows < rowsToRead) { +// pShow->pIter = sdbFetch(pSdb, SDB_STB, pShow->pIter, (void **)&pStb); +// if (pShow->pIter == NULL) break; +// +// if (pDb != NULL && pStb->dbUid != pDb->uid) { +// sdbRelease(pSdb, pStb); +// continue; +// } +// +// cols = 0; +// +// SName name = {0}; +// char stbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; +// mndExtractTbNameFromStbFullName(pStb->name, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN); +// varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE])); +// +// SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)stbName, false); +// +// char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; +// tNameFromString(&name, pStb->db, T_NAME_ACCT | T_NAME_DB); +// tNameGetDbName(&name, varDataVal(db)); +// varDataSetLen(db, strlen(varDataVal(db))); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)db, false); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)&pStb->createdTime, false); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)&pStb->numOfColumns, false); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)&pStb->numOfTags, false); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)&pStb->updateTime, false); // number of tables +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// if (pStb->commentLen > 0) { +// char comment[TSDB_TB_COMMENT_LEN + VARSTR_HEADER_SIZE] = {0}; +// STR_TO_VARSTR(comment, pStb->comment); +// colDataAppend(pColInfo, numOfRows, comment, false); +// } else if (pStb->commentLen == 0) { +// char comment[VARSTR_HEADER_SIZE + VARSTR_HEADER_SIZE] = {0}; +// STR_TO_VARSTR(comment, ""); +// colDataAppend(pColInfo, numOfRows, comment, false); +// } else { +// colDataAppendNULL(pColInfo, numOfRows); +// } +// +// char watermark[64 + VARSTR_HEADER_SIZE] = {0}; +// sprintf(varDataVal(watermark), "%" PRId64 "a,%" PRId64 "a", pStb->watermark[0], pStb->watermark[1]); +// varDataSetLen(watermark, strlen(varDataVal(watermark))); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)watermark, false); +// +// char maxDelay[64 + VARSTR_HEADER_SIZE] = {0}; +// sprintf(varDataVal(maxDelay), "%" PRId64 "a,%" PRId64 "a", pStb->maxdelay[0], pStb->maxdelay[1]); +// varDataSetLen(maxDelay, strlen(varDataVal(maxDelay))); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)maxDelay, false); +// +// char rollup[160 + VARSTR_HEADER_SIZE] = {0}; +// int32_t rollupNum = (int32_t)taosArrayGetSize(pStb->pFuncs); +// char *sep = ", "; +// int32_t sepLen = strlen(sep); +// int32_t rollupLen = sizeof(rollup) - VARSTR_HEADER_SIZE - 2; +// for (int32_t i = 0; i < rollupNum; ++i) { +// char *funcName = taosArrayGet(pStb->pFuncs, i); +// if (i) { +// strncat(varDataVal(rollup), sep, rollupLen); +// rollupLen -= sepLen; +// } +// strncat(varDataVal(rollup), funcName, rollupLen); +// rollupLen -= strlen(funcName); +// } +// varDataSetLen(rollup, strlen(varDataVal(rollup))); +// +// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); +// colDataAppend(pColInfo, numOfRows, (const char *)rollup, false); +// +// numOfRows++; +// sdbRelease(pSdb, pStb); +// } +// +// if (pDb != NULL) { +// mndReleaseDb(pMnode, pDb); +// } +// +// sdbRelease(pSdb, pDb); +// } +// +// pShow->numOfRows += numOfRows; +// mndReleaseUser(pMnode, pUser); +// +// +// +// +// +// +// +// +// ShowRetrieveFp retrieveFp = pMgmt->retrieveFps[pShow->type]; +// if (retrieveFp == NULL) { +// mndReleaseShowObj(pShow, false); +// terrno = TSDB_CODE_MSG_NOT_PROCESSED; +// mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, terrstr()); +// return -1; +// } +// +// mDebug("show:0x%" PRIx64 ", start retrieve data, type:%d", pShow->id, pShow->type); +// if (retrieveReq.user[0] != 0) { +// memcpy(pReq->info.conn.user, retrieveReq.user, TSDB_USER_LEN); +// } else { +// memcpy(pReq->info.conn.user, TSDB_DEFAULT_USER, strlen(TSDB_DEFAULT_USER) + 1); +// } +// if (retrieveReq.db[0] && mndCheckShowPrivilege(pMnode, pReq->info.conn.user, pShow->type, retrieveReq.db) != 0) { +// return -1; +// } +// +// int32_t numOfCols = pShow->pMeta->numOfColumns; +// +// SSDataBlock *pBlock = createDataBlock(); +// for (int32_t i = 0; i < numOfCols; ++i) { +// SColumnInfoData idata = {0}; +// +// SSchema *p = &pShow->pMeta->pSchemas[i]; +// +// idata.info.bytes = p->bytes; +// idata.info.type = p->type; +// idata.info.colId = p->colId; +// blockDataAppendColInfo(pBlock, &idata); +// } +// +// blockDataEnsureCapacity(pBlock, rowsToRead); +// +// if (mndCheckRetrieveFinished(pShow)) { +// mDebug("show:0x%" PRIx64 ", read finished, numOfRows:%d", pShow->id, pShow->numOfRows); +// rowsRead = 0; +// } else { +// rowsRead = (*retrieveFp)(pReq, pShow, pBlock, rowsToRead); +// if (rowsRead < 0) { +// terrno = rowsRead; +// mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id); +// mndReleaseShowObj(pShow, true); +// blockDataDestroy(pBlock); +// return -1; +// } +// +// pBlock->info.rows = rowsRead; +// mDebug("show:0x%" PRIx64 ", stop retrieve data, rowsRead:%d numOfRows:%d", pShow->id, rowsRead, pShow->numOfRows); +// } +// +// size = sizeof(SRetrieveMetaTableRsp) + sizeof(int32_t) + sizeof(SSysTableSchema) * pShow->pMeta->numOfColumns + +// blockDataGetSize(pBlock) + blockDataGetSerialMetaSize(taosArrayGetSize(pBlock->pDataBlock)); +// +// SRetrieveMetaTableRsp *pRsp = rpcMallocCont(size); +// if (pRsp == NULL) { +// mndReleaseShowObj(pShow, false); +// terrno = TSDB_CODE_OUT_OF_MEMORY; +// mError("show:0x%" PRIx64 ", failed to retrieve data since %s", pShow->id, terrstr()); +// blockDataDestroy(pBlock); +// return -1; +// } +// +// pRsp->handle = htobe64(pShow->id); +// +// if (rowsRead > 0) { +// char *pStart = pRsp->data; +// SSchema *ps = pShow->pMeta->pSchemas; +// +// *(int32_t *)pStart = htonl(pShow->pMeta->numOfColumns); +// pStart += sizeof(int32_t); // number of columns +// +// for (int32_t i = 0; i < pShow->pMeta->numOfColumns; ++i) { +// SSysTableSchema *pSchema = (SSysTableSchema *)pStart; +// pSchema->bytes = htonl(ps[i].bytes); +// pSchema->colId = htons(ps[i].colId); +// pSchema->type = ps[i].type; +// +// pStart += sizeof(SSysTableSchema); +// } +// +// int32_t len = blockEncode(pBlock, pStart, pShow->pMeta->numOfColumns); +// } +// +// pRsp->numOfRows = htonl(rowsRead); +// pRsp->precision = TSDB_TIME_PRECISION_MILLI; // millisecond time precision +// pReq->info.rsp = pRsp; +// pReq->info.rspLen = size; +// +// if (rowsRead == 0 || rowsRead < rowsToRead) { +// pRsp->completed = 1; +// mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id); +// mndReleaseShowObj(pShow, true); +// } else { +// mDebug("show:0x%" PRIx64 ", retrieve not completed yet", pShow->id); +// mndReleaseShowObj(pShow, false); +// } +// +// blockDataDestroy(pBlock); +// return TSDB_CODE_SUCCESS; +//} + + static int32_t mndRetrieveStb(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { SMnode *pMnode = pReq->info.node; SSdb *pSdb = pMnode->pSdb; @@ -2599,6 +2881,173 @@ static int32_t mndRetrieveStb(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc return numOfRows; } +static int32_t buildDbColsInfoBlock(const SSDataBlock* p, const SSysTableMeta* pSysDbTableMeta, size_t size, + const char* dbName) { + char tName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + char dName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + int32_t numOfRows = p->info.rows; + + STR_TO_VARSTR(dName, dbName); + STR_TO_VARSTR(typeName, "SYSTEM_TABLE"); + + for (int32_t i = 0; i < size; ++i) { + const SSysTableMeta* pm = &pSysDbTableMeta[i]; +// if (pm->sysInfo) { +// continue; +// } + STR_TO_VARSTR(tName, pm->name); + + for(int32_t j = 0; j < pm->colNum; j++){ + // table name + SColumnInfoData* pColInfoData = taosArrayGet(p->pDataBlock, 0); + colDataAppend(pColInfoData, numOfRows, tName, false); + + pColInfoData = taosArrayGet(p->pDataBlock, 1); + colDataAppend(pColInfoData, numOfRows, typeName, false); + + // database name + pColInfoData = taosArrayGet(p->pDataBlock, 2); + colDataAppend(pColInfoData, numOfRows, dName, false); + + // col name + char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(colName, pm->schema[j].name); + pColInfoData = taosArrayGet(p->pDataBlock, 3); + colDataAppend(pColInfoData, numOfRows, colName, false); + + // col type + int8_t colType = pm->schema[j].type; + pColInfoData = taosArrayGet(p->pDataBlock, 4); + char colTypeStr[VARSTR_HEADER_SIZE + 32]; + int colTypeLen = sprintf(varDataVal(colTypeStr), "%s", tDataTypes[colType].name); + if (colType == TSDB_DATA_TYPE_VARCHAR) { + colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)", + (int32_t)(pm->schema[j].bytes - VARSTR_HEADER_SIZE)); + } else if (colType == TSDB_DATA_TYPE_NCHAR) { + colTypeLen += sprintf( + varDataVal(colTypeStr) + colTypeLen, "(%d)", + (int32_t)((pm->schema[j].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); + } + varDataSetLen(colTypeStr, colTypeLen); + colDataAppend(pColInfoData, numOfRows, (char*)colTypeStr, false); + + pColInfoData = taosArrayGet(p->pDataBlock, 5); + colDataAppend(pColInfoData, numOfRows, (const char*)&pm->schema[j].bytes, false); + for (int32_t k = 6; k <= 8; ++k) { + pColInfoData = taosArrayGet(p->pDataBlock, k); + colDataAppendNULL(pColInfoData, numOfRows); + } + + numOfRows += 1; + } + } + + return numOfRows; +} + +static int32_t buildSysDbColsInfo(SSDataBlock* p) { + size_t size = 0; + const SSysTableMeta* pSysDbTableMeta = NULL; + + getInfosDbMeta(&pSysDbTableMeta, &size); + p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_INFORMATION_SCHEMA_DB); + + getPerfDbMeta(&pSysDbTableMeta, &size); + p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_PERFORMANCE_SCHEMA_DB); + + return p->info.rows; +} + +static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + SStbObj *pStb = NULL; + int32_t cols = 0; + + int32_t numOfRows = buildSysDbColsInfo(pBlock); + SDbObj *pDb = NULL; + if (strlen(pShow->db) > 0) { + pDb = mndAcquireDb(pMnode, pShow->db); + if (pDb == NULL) return terrno; + } + + char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(typeName, "SUPER_TABLE"); + while (numOfRows < rows) { + pShow->pIter = sdbFetch(pSdb, SDB_STB, pShow->pIter, (void **)&pStb); + if (pShow->pIter == NULL) break; + + if (pDb != NULL && pStb->dbUid != pDb->uid) { + sdbRelease(pSdb, pStb); + continue; + } + + cols = 0; + + SName name = {0}; + char stbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + mndExtractTbNameFromStbFullName(pStb->name, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN); + varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE])); + + char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + tNameFromString(&name, pStb->db, T_NAME_ACCT | T_NAME_DB); + tNameGetDbName(&name, varDataVal(db)); + varDataSetLen(db, strlen(varDataVal(db))); + + for(int i = 0; i < pStb->numOfColumns; i++){ + SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)stbName, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, typeName, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)db, false); + + // col name + char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_TO_VARSTR(colName, pStb->pColumns[i].name); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, colName, false); + + // col type + int8_t colType = pStb->pColumns[i].type; + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + char colTypeStr[VARSTR_HEADER_SIZE + 32]; + int colTypeLen = sprintf(varDataVal(colTypeStr), "%s", tDataTypes[colType].name); + if (colType == TSDB_DATA_TYPE_VARCHAR) { + colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)", + (int32_t)(pStb->pColumns[i].bytes - VARSTR_HEADER_SIZE)); + } else if (colType == TSDB_DATA_TYPE_NCHAR) { + colTypeLen += sprintf( + varDataVal(colTypeStr) + colTypeLen, "(%d)", + (int32_t)((pStb->pColumns[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); + } + varDataSetLen(colTypeStr, colTypeLen); + colDataAppend(pColInfo, numOfRows, (char*)colTypeStr, false); + + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char*)&pStb->pColumns[i].bytes, false); + while(cols < pShow->numOfColumns) { + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppendNULL(pColInfo, numOfRows); + } + + } + + numOfRows++; + sdbRelease(pSdb, pStb); + } + + if (pDb != NULL) { + mndReleaseDb(pMnode, pDb); + } + + pShow->numOfRows += numOfRows; + return numOfRows; +} + static void mndCancelGetNextStb(SMnode *pMnode, void *pIter) { SSdb *pSdb = pMnode->pSdb; sdbCancelFetch(pSdb, pIter); diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index a7564e352c..b0c8178519 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -150,7 +150,7 @@ typedef struct SMTbCursor SMTbCursor; SMTbCursor *metaOpenTbCursor(SMeta *pMeta); void metaCloseTbCursor(SMTbCursor *pTbCur); -int32_t metaTbCursorNext(SMTbCursor *pTbCur); +int32_t metaTbCursorNext(SMTbCursor *pTbCur, ETableType jumpTableType); #endif // tsdb diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index 0697f68f89..2544070f15 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -310,7 +310,7 @@ void metaCloseTbCursor(SMTbCursor *pTbCur) { } } -int metaTbCursorNext(SMTbCursor *pTbCur) { +int metaTbCursorNext(SMTbCursor *pTbCur, ETableType jumpTableType) { int ret; void *pBuf; STbCfg tbCfg; @@ -324,7 +324,7 @@ int metaTbCursorNext(SMTbCursor *pTbCur) { tDecoderClear(&pTbCur->mr.coder); metaGetTableEntryByVersion(&pTbCur->mr, ((SUidIdxVal *)pTbCur->pVal)[0].version, *(tb_uid_t *)pTbCur->pKey); - if (pTbCur->mr.me.type == TSDB_SUPER_TABLE) { + if (pTbCur->mr.me.type == jumpTableType) { continue; } diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 33fa23fc38..d8a4660811 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -67,6 +67,7 @@ typedef struct SSysTableScanInfo { SLoadRemoteDataInfo loadInfo; int32_t tbnameSlotId; + bool isGetStableCols; } SSysTableScanInfo; typedef struct { @@ -140,8 +141,9 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, SMetaReader* smrChildTable, const char* dbname, const char* tableName, int32_t* pNumOfRows, const SSDataBlock* dataBlock); -static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo, SMetaReader* smrTable, const char* dbname, - int32_t* pNumOfRows, const SSDataBlock* dataBlock); +static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo, const char* dbname, + int32_t* pNumOfRows, const SSDataBlock* dataBlock, + char* tName, SSchemaWrapper* schemaRow, char* tableType); static void relocateAndFilterSysTagsScanResult(SSysTableScanInfo* pInfo, int32_t numOfRows, SSDataBlock* dataBlock, SFilterInfo* pFilterInfo); @@ -457,14 +459,38 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { return NULL; } - if (smrTable.me.type == TSDB_CHILD_TABLE) { + if (smrTable.me.type == TSDB_SUPER_TABLE) { metaReaderClear(&smrTable); blockDataDestroy(dataBlock); pInfo->loadInfo.totalRows = 0; return NULL; } - sysTableUserColsFillOneTableCols(pInfo, &smrTable, dbname, &numOfRows, dataBlock); + if (smrTable.me.type == TSDB_CHILD_TABLE) { + int64_t suid = smrTable.me.ctbEntry.suid; + metaReaderClear(&smrTable); + metaReaderInit(&smrTable, pInfo->readHandle.meta, 0); + code = metaGetTableEntryByUid(&smrTable, suid); + if (code != TSDB_CODE_SUCCESS) { + // terrno has been set by metaGetTableEntryByName, therefore, return directly + metaReaderClear(&smrTable); + blockDataDestroy(dataBlock); + pInfo->loadInfo.totalRows = 0; + return NULL; + } + } + + char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + SSchemaWrapper *schemaRow = NULL; + if(smrTable.me.type == TSDB_SUPER_TABLE){ + schemaRow = &smrTable.me.stbEntry.schemaRow; + STR_TO_VARSTR(typeName, "CHILD_TABLE"); + }else if(smrTable.me.type == TSDB_NORMAL_TABLE){ + schemaRow = &smrTable.me.ntbEntry.schemaRow; + STR_TO_VARSTR(typeName, "NORMAL_TABLE"); + } + + sysTableUserColsFillOneTableCols(pInfo, dbname, &numOfRows, dataBlock, tableName, schemaRow, typeName); metaReaderClear(&smrTable); if (numOfRows > 0) { @@ -482,12 +508,50 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { pInfo->pCur = metaOpenTbCursor(pInfo->readHandle.meta); } - while ((ret = metaTbCursorNext(pInfo->pCur)) == 0) { - if (pInfo->pCur->mr.me.type == TSDB_CHILD_TABLE) { + SHashObj *stableSchema = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK); + taosHashSetFreeFp(stableSchema, tDeleteSSchemaWrapperForHash); + while ((ret = metaTbCursorNext(pInfo->pCur, TSDB_TABLE_MAX)) == 0) { + char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; + char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + + SSchemaWrapper *schemaRow = NULL; + + if(pInfo->pCur->mr.me.type == TSDB_SUPER_TABLE){ + void *schema = taosHashGet(stableSchema, &pInfo->pCur->mr.me.uid, sizeof(int64_t)); + if(schema == NULL){ + SSchemaWrapper *schemaWrapper = tCloneSSchemaWrapper(&pInfo->pCur->mr.me.stbEntry.schemaRow); + taosHashPut(stableSchema, &pInfo->pCur->mr.me.uid, sizeof(int64_t), &schemaWrapper, POINTER_BYTES); + } + continue; + }else if (pInfo->pCur->mr.me.type == TSDB_CHILD_TABLE) { + STR_TO_VARSTR(typeName, "CHILD_TABLE"); + STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); + + int64_t suid = pInfo->pCur->mr.me.ctbEntry.suid; + void *schema = taosHashGet(stableSchema, &pInfo->pCur->mr.me.ctbEntry.suid, sizeof(int64_t)); + if(schema != NULL){ + schemaRow = *(SSchemaWrapper **)schema; + }else{ + tDecoderClear(&pInfo->pCur->mr.coder); + int code = metaGetTableEntryByUid(&pInfo->pCur->mr, suid); + if (code != TSDB_CODE_SUCCESS) { + // terrno has been set by metaGetTableEntryByName, therefore, return directly + qError("sysTableScanUserCols get meta by suid:%"PRId64 " error, code:%d", suid, code); + blockDataDestroy(dataBlock); + pInfo->loadInfo.totalRows = 0; + return NULL; + } + schemaRow = &pInfo->pCur->mr.me.stbEntry.schemaRow; + } + }else if(pInfo->pCur->mr.me.type == TSDB_NORMAL_TABLE){ + schemaRow = &pInfo->pCur->mr.me.ntbEntry.schemaRow; + STR_TO_VARSTR(typeName, "NORMAL_TABLE"); + STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); + }else{ continue; } - sysTableUserColsFillOneTableCols(pInfo, &pInfo->pCur->mr, dbname, &numOfRows, dataBlock); + sysTableUserColsFillOneTableCols(pInfo, dbname, &numOfRows, dataBlock, tableName, schemaRow, typeName); if (numOfRows >= pOperator->resultInfo.capacity) { relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); @@ -593,7 +657,7 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) { pInfo->pCur = metaOpenTbCursor(pInfo->readHandle.meta); } - while ((ret = metaTbCursorNext(pInfo->pCur)) == 0) { + while ((ret = metaTbCursorNext(pInfo->pCur, TSDB_SUPER_TABLE)) == 0) { if (pInfo->pCur->mr.me.type != TSDB_CHILD_TABLE) { continue; } @@ -830,64 +894,59 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, return TSDB_CODE_SUCCESS; } -static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo, SMetaReader* smrTable, const char* dbname, - int32_t* pNumOfRows, const SSDataBlock* dataBlock) { - char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - STR_TO_VARSTR(tableName, smrTable->me.name); - - SSchemaWrapper schemaRow = {0}; - if(smrTable->me.type == TSDB_SUPER_TABLE){ - schemaRow = smrTable->me.stbEntry.schemaRow; - }else if(smrTable->me.type == TSDB_NORMAL_TABLE){ - schemaRow = smrTable->me.ntbEntry.schemaRow; +static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo, const char* dbname, + int32_t* pNumOfRows, const SSDataBlock* dataBlock, char* tName, + SSchemaWrapper* schemaRow, char* tableType) { + if(schemaRow == NULL){ + qError("sysTableUserColsFillOneTableCols schemaRow is NULL"); + return TSDB_CODE_SUCCESS; } int32_t numOfRows = *pNumOfRows; - int32_t numOfCols = schemaRow.nCols; + int32_t numOfCols = schemaRow->nCols; for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pColInfoData = NULL; // table name pColInfoData = taosArrayGet(dataBlock->pDataBlock, 0); - colDataAppend(pColInfoData, numOfRows, tableName, tableName == NULL ? true : false); + colDataAppend(pColInfoData, numOfRows, tName, false); + + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 1); + colDataAppend(pColInfoData, numOfRows, tableType, false); // database name - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 1); + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 2); colDataAppend(pColInfoData, numOfRows, dbname, false); // col name char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - STR_TO_VARSTR(colName, schemaRow.pSchema[i].name); - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 2); + STR_TO_VARSTR(colName, schemaRow->pSchema[i].name); + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 3); colDataAppend(pColInfoData, numOfRows, colName, false); // col type - int8_t colType = schemaRow.pSchema[i].type; - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 3); + int8_t colType = schemaRow->pSchema[i].type; + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 4); char colTypeStr[VARSTR_HEADER_SIZE + 32]; int colTypeLen = sprintf(varDataVal(colTypeStr), "%s", tDataTypes[colType].name); if (colType == TSDB_DATA_TYPE_VARCHAR) { colTypeLen += sprintf(varDataVal(colTypeStr) + colTypeLen, "(%d)", - (int32_t)(schemaRow.pSchema[i].bytes - VARSTR_HEADER_SIZE)); + (int32_t)(schemaRow->pSchema[i].bytes - VARSTR_HEADER_SIZE)); } else if (colType == TSDB_DATA_TYPE_NCHAR) { colTypeLen += sprintf( varDataVal(colTypeStr) + colTypeLen, "(%d)", - (int32_t)((schemaRow.pSchema[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); + (int32_t)((schemaRow->pSchema[i].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE)); } varDataSetLen(colTypeStr, colTypeLen); colDataAppend(pColInfoData, numOfRows, (char*)colTypeStr, false); - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 4); - colDataAppend(pColInfoData, numOfRows, (const char*)&schemaRow.pSchema[i].bytes, false); - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 5); - colDataAppend(pColInfoData, numOfRows, NULL, true); + colDataAppend(pColInfoData, numOfRows, (const char*)&schemaRow->pSchema[i].bytes, false); - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 6); - colDataAppend(pColInfoData, numOfRows, NULL, true); - - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 7); - colDataAppend(pColInfoData, numOfRows, NULL, true); + for (int32_t j = 6; j <= 8; ++j) { + pColInfoData = taosArrayGet(dataBlock->pDataBlock, j); + colDataAppendNULL(pColInfoData, numOfRows); + } ++numOfRows; } @@ -1197,7 +1256,7 @@ static SSDataBlock* sysTableBuildUserTables(SOperatorInfo* pOperator) { char n[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; int32_t ret = 0; - while ((ret = metaTbCursorNext(pInfo->pCur)) == 0) { + while ((ret = metaTbCursorNext(pInfo->pCur, TSDB_SUPER_TABLE)) == 0) { STR_TO_VARSTR(n, pInfo->pCur->mr.me.name); // table name @@ -1489,7 +1548,7 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { pBlock = sysTableScanUserTables(pOperator); } else if (strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { pBlock = sysTableScanUserTags(pOperator); - } else if (strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0) { + } else if (strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0 && pInfo->readHandle.mnd == NULL) { pBlock = sysTableScanUserCols(pOperator); } else if (strncasecmp(name, TSDB_INS_TABLE_STABLES, TSDB_TABLE_FNAME_LEN) == 0 && pInfo->showRewrite && IS_SYS_DBNAME(dbName)) { From 3eadb9b921c0c9d1ca9e9e55bd8cba8b2bb581d4 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 10 Jan 2023 23:08:25 +0800 Subject: [PATCH 039/139] enh(query): disable the memset when allocate the memory for dataBlock. --- source/common/src/tdatablock.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 171679baae..a5869c9305 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1161,15 +1161,16 @@ void blockDataEmpty(SSDataBlock* pDataBlock) { pInfo->window.skey = 0; } -// todo temporarily disable it +/* + * NOTE: the type of the input column may be TSDB_DATA_TYPE_NULL, which is used to denote + * the all NULL value in this column. It is an internal representation of all NULL value column, and no visible to + * any users. The length of TSDB_DATA_TYPE_NULL is 0, and it is an special case. + */ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pBlockInfo, uint32_t numOfRows, bool clearPayload) { if (numOfRows <= 0 || numOfRows <= pBlockInfo->capacity) { return TSDB_CODE_SUCCESS; } - // todo temp disable it - // ASSERT(pColumn->info.bytes != 0); - int32_t existedRows = pBlockInfo->rows; if (IS_VAR_DATA_TYPE(pColumn->info.type)) { @@ -1194,7 +1195,8 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* return TSDB_CODE_FAILED; } - // make sure the allocated memory is MALLOC_ALIGN_BYTES aligned + // here we employ the aligned malloc function, to make sure that the address of allocated memory is aligned + // to MALLOC_ALIGN_BYTES tmp = taosMemoryMallocAlign(MALLOC_ALIGN_BYTES, numOfRows * pColumn->info.bytes); if (tmp == NULL) { return TSDB_CODE_OUT_OF_MEMORY; @@ -1208,7 +1210,7 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* pColumn->pData = tmp; - // todo remove it soon + // check if the allocated memory is aligned to the requried bytes. #if defined LINUX if ((((uint64_t)pColumn->pData) & (MALLOC_ALIGN_BYTES - 1)) != 0x0) { return TSDB_CODE_FAILED; @@ -1216,7 +1218,7 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* #endif if (clearPayload) { - memset(tmp + pColumn->info.bytes * existedRows, 0, pColumn->info.bytes * (numOfRows - existedRows)); +// memset(tmp + pColumn->info.bytes * existedRows, 0, pColumn->info.bytes * (numOfRows - existedRows)); } } From abae9e07905021bdfbe93bb1714f20110da94a48 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 10 Jan 2023 23:40:16 +0800 Subject: [PATCH 040/139] fix(query): set 0 when result is not qualified. --- source/libs/scalar/src/filter.c | 1 + tests/script/tsim/parser/alter1.sim | 1 + 2 files changed, 2 insertions(+) diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index de660ae958..74d555af77 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -3181,6 +3181,7 @@ bool filterExecuteImplRange(void *pinfo, int32_t numOfRows, SColumnInfoData *pRe void *colData = colDataGetData(pData, i); if (colData == NULL || colDataIsNull_s(pData, i)) { all = false; + p[i] = 0; continue; } diff --git a/tests/script/tsim/parser/alter1.sim b/tests/script/tsim/parser/alter1.sim index 369419dcd9..cf9da46fba 100644 --- a/tests/script/tsim/parser/alter1.sim +++ b/tests/script/tsim/parser/alter1.sim @@ -88,6 +88,7 @@ sql insert into car1 values (now, 1, 1,1 ) (now +1s, 2,2,2) car2 values (now, 1, sql select c1+speed from stb where c1 > 0 if $rows != 3 then + print $rows , expect 3 return -1 endi From 75f4e64326d5ab3cd55b3e38cb37135644e7985b Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 10 Jan 2023 23:45:49 +0800 Subject: [PATCH 041/139] enh(query): adjust the memset rule when creating new datablock. --- include/common/tdatablock.h | 1 - source/common/src/tdatablock.c | 21 +-------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/include/common/tdatablock.h b/include/common/tdatablock.h index e1d3b01611..7209d45a6d 100644 --- a/include/common/tdatablock.h +++ b/include/common/tdatablock.h @@ -231,7 +231,6 @@ int32_t blockDataSort_rv(SSDataBlock* pDataBlock, SArray* pOrderInfo, bool nullF int32_t colInfoDataEnsureCapacity(SColumnInfoData* pColumn, uint32_t numOfRows, bool clearPayload); int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows); -int32_t blockDataEnsureCapacityNoClear(SSDataBlock* pDataBlock, uint32_t numOfRows); void colInfoDataCleanup(SColumnInfoData* pColumn, uint32_t numOfRows); void blockDataCleanup(SSDataBlock* pDataBlock); diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index a5869c9305..1f5748ebbd 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -1218,7 +1218,7 @@ static int32_t doEnsureCapacity(SColumnInfoData* pColumn, const SDataBlockInfo* #endif if (clearPayload) { -// memset(tmp + pColumn->info.bytes * existedRows, 0, pColumn->info.bytes * (numOfRows - existedRows)); + memset(tmp + pColumn->info.bytes * existedRows, 0, pColumn->info.bytes * (numOfRows - existedRows)); } } @@ -1251,25 +1251,6 @@ int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows) { return TSDB_CODE_SUCCESS; } - size_t numOfCols = taosArrayGetSize(pDataBlock->pDataBlock); - for (int32_t i = 0; i < numOfCols; ++i) { - SColumnInfoData* p = taosArrayGet(pDataBlock->pDataBlock, i); - code = doEnsureCapacity(p, &pDataBlock->info, numOfRows, true); - if (code) { - return code; - } - } - - pDataBlock->info.capacity = numOfRows; - return TSDB_CODE_SUCCESS; -} - -int32_t blockDataEnsureCapacityNoClear(SSDataBlock* pDataBlock, uint32_t numOfRows) { - int32_t code = 0; - if (numOfRows == 0 || numOfRows <= pDataBlock->info.capacity) { - return TSDB_CODE_SUCCESS; - } - size_t numOfCols = taosArrayGetSize(pDataBlock->pDataBlock); for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* p = taosArrayGet(pDataBlock->pDataBlock, i); From b8183580cb954668a21a72a1b53d29bfb1cf5c45 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Wed, 11 Jan 2023 09:22:31 +0800 Subject: [PATCH 042/139] feat: add an event_window clause for the explain command --- source/libs/command/inc/commandInt.h | 3 + source/libs/command/src/explain.c | 154 ++++++--------------------- tests/script/tsim/query/event.sim | 69 ++++++++++++ 3 files changed, 103 insertions(+), 123 deletions(-) create mode 100644 tests/script/tsim/query/event.sim diff --git a/source/libs/command/inc/commandInt.h b/source/libs/command/inc/commandInt.h index 6acf19218d..764553f1e9 100644 --- a/source/libs/command/inc/commandInt.h +++ b/source/libs/command/inc/commandInt.h @@ -64,6 +64,9 @@ extern "C" { #define EXPLAIN_IGNORE_GROUPID_FORMAT "Ignore Group Id: %s" #define EXPLAIN_PARTITION_KETS_FORMAT "Partition Key: " #define EXPLAIN_INTERP_FORMAT "Interp" +#define EXPLAIN_EVENT_FORMAT "Event" +#define EXPLAIN_EVENT_START_FORMAT "Start Cond: " +#define EXPLAIN_EVENT_END_FORMAT "End Cond: " #define EXPLAIN_PLANNING_TIME_FORMAT "Planning Time: %.3f ms" #define EXPLAIN_EXEC_TIME_FORMAT "Execution Time: %.3f ms" diff --git a/source/libs/command/src/explain.c b/source/libs/command/src/explain.c index 253718048d..4624e471bf 100644 --- a/source/libs/command/src/explain.c +++ b/source/libs/command/src/explain.c @@ -114,129 +114,7 @@ _return: int32_t qExplainGenerateResChildren(SPhysiNode *pNode, SExplainGroup *group, SNodeList **pChildren) { int32_t tlen = 0; - SNodeList *pPhysiChildren = NULL; - - switch (pNode->type) { - case QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN: { - STagScanPhysiNode *pTagScanNode = (STagScanPhysiNode *)pNode; - pPhysiChildren = pTagScanNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_TABLE_SEQ_SCAN: - case QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN: { - STableScanPhysiNode *pTblScanNode = (STableScanPhysiNode *)pNode; - pPhysiChildren = pTblScanNode->scan.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN: { - SSystemTableScanPhysiNode *pSTblScanNode = (SSystemTableScanPhysiNode *)pNode; - pPhysiChildren = pSTblScanNode->scan.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_PROJECT: { - SProjectPhysiNode *pPrjNode = (SProjectPhysiNode *)pNode; - pPhysiChildren = pPrjNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN: { - SSortMergeJoinPhysiNode *pJoinNode = (SSortMergeJoinPhysiNode *)pNode; - pPhysiChildren = pJoinNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_HASH_AGG: { - SAggPhysiNode *pAggNode = (SAggPhysiNode *)pNode; - pPhysiChildren = pAggNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_EXCHANGE: { - SExchangePhysiNode *pExchNode = (SExchangePhysiNode *)pNode; - pPhysiChildren = pExchNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_SORT: { - SSortPhysiNode *pSortNode = (SSortPhysiNode *)pNode; - pPhysiChildren = pSortNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_HASH_INTERVAL: { - SIntervalPhysiNode *pIntNode = (SIntervalPhysiNode *)pNode; - pPhysiChildren = pIntNode->window.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION: { - SSessionWinodwPhysiNode *pSessNode = (SSessionWinodwPhysiNode *)pNode; - pPhysiChildren = pSessNode->window.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_MERGE_STATE: { - SStateWinodwPhysiNode *pStateNode = (SStateWinodwPhysiNode *)pNode; - pPhysiChildren = pStateNode->window.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_PARTITION: { - SPartitionPhysiNode *partitionPhysiNode = (SPartitionPhysiNode *)pNode; - pPhysiChildren = partitionPhysiNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_MERGE: { - SMergePhysiNode *mergePhysiNode = (SMergePhysiNode *)pNode; - pPhysiChildren = mergePhysiNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_INDEF_ROWS_FUNC: { - SIndefRowsFuncPhysiNode *indefPhysiNode = (SIndefRowsFuncPhysiNode *)pNode; - pPhysiChildren = indefPhysiNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_MERGE_ALIGNED_INTERVAL: { - SMergeAlignedIntervalPhysiNode *intPhysiNode = (SMergeAlignedIntervalPhysiNode *)pNode; - pPhysiChildren = intPhysiNode->window.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_FILL: { - SFillPhysiNode *fillPhysiNode = (SFillPhysiNode *)pNode; - pPhysiChildren = fillPhysiNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN: { - STableMergeScanPhysiNode *mergePhysiNode = (STableMergeScanPhysiNode *)pNode; - pPhysiChildren = mergePhysiNode->scan.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN: { - SBlockDistScanPhysiNode *distPhysiNode = (SBlockDistScanPhysiNode *)pNode; - pPhysiChildren = distPhysiNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN: { - SLastRowScanPhysiNode *lastRowPhysiNode = (SLastRowScanPhysiNode *)pNode; - pPhysiChildren = lastRowPhysiNode->scan.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_TABLE_COUNT_SCAN: { - STableCountScanPhysiNode *tableCountPhysiNode = (STableCountScanPhysiNode *)pNode; - pPhysiChildren = tableCountPhysiNode->scan.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_GROUP_SORT: { - SGroupSortPhysiNode *groupSortPhysiNode = (SGroupSortPhysiNode *)pNode; - pPhysiChildren = groupSortPhysiNode->node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_MERGE_INTERVAL: { - SMergeIntervalPhysiNode *mergeIntPhysiNode = (SMergeIntervalPhysiNode *)pNode; - pPhysiChildren = mergeIntPhysiNode->window.node.pChildren; - break; - } - case QUERY_NODE_PHYSICAL_PLAN_INTERP_FUNC: { - SInterpFuncPhysiNode *interpPhysiNode = (SInterpFuncPhysiNode *)pNode; - pPhysiChildren = interpPhysiNode->node.pChildren; - break; - } - default: - qError("not supported physical node type %d", pNode->type); - QRY_ERR_RET(TSDB_CODE_APP_ERROR); - } + SNodeList *pPhysiChildren = pNode->pChildren; if (pPhysiChildren) { *pChildren = nodesMakeList(); @@ -1583,6 +1461,36 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i } break; } + case QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT: { + SEventWinodwPhysiNode *pEventNode = (SEventWinodwPhysiNode *)pNode; + EXPLAIN_ROW_NEW(level, EXPLAIN_EVENT_FORMAT); + EXPLAIN_ROW_APPEND(EXPLAIN_LEFT_PARENTHESIS_FORMAT); + if (pResNode->pExecInfo) { + QRY_ERR_RET(qExplainBufAppendExecInfo(pResNode->pExecInfo, tbuf, &tlen)); + EXPLAIN_ROW_APPEND(EXPLAIN_BLANK_FORMAT); + } + EXPLAIN_ROW_APPEND(EXPLAIN_FUNCTIONS_FORMAT, pEventNode->window.pFuncs->length); + EXPLAIN_ROW_APPEND(EXPLAIN_BLANK_FORMAT); + EXPLAIN_ROW_APPEND(EXPLAIN_WIDTH_FORMAT, pEventNode->window.node.pOutputDataBlockDesc->totalRowSize); + EXPLAIN_ROW_APPEND(EXPLAIN_RIGHT_PARENTHESIS_FORMAT); + EXPLAIN_ROW_END(); + QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level)); + + if (verbose) { + EXPLAIN_ROW_NEW(level + 1, EXPLAIN_EVENT_START_FORMAT); + QRY_ERR_RET(nodesNodeToSQL(pEventNode->pStartCond, tbuf + VARSTR_HEADER_SIZE, + TSDB_EXPLAIN_RESULT_ROW_SIZE, &tlen)); + EXPLAIN_ROW_END(); + QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1)); + + EXPLAIN_ROW_NEW(level + 1, EXPLAIN_EVENT_END_FORMAT); + QRY_ERR_RET(nodesNodeToSQL(pEventNode->pEndCond, tbuf + VARSTR_HEADER_SIZE, + TSDB_EXPLAIN_RESULT_ROW_SIZE, &tlen)); + EXPLAIN_ROW_END(); + QRY_ERR_RET(qExplainResAppendRow(ctx, tbuf, tlen, level + 1)); + } + break; + } default: qError("not supported physical node type %d", pNode->type); return TSDB_CODE_APP_ERROR; diff --git a/tests/script/tsim/query/event.sim b/tests/script/tsim/query/event.sim new file mode 100644 index 0000000000..c72b7ba125 --- /dev/null +++ b/tests/script/tsim/query/event.sim @@ -0,0 +1,69 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +print ======== prepare data + +sql drop database if exists db1; +sql create database db1 vgroups 5; +sql use db1; +sql create stable sta (ts timestamp, f1 int, f2 binary(10), f3 bool) tags(t1 int, t2 bool, t3 binary(10)); +sql create table tba1 using sta tags(0, false, '0'); +sql create table tba2 using sta tags(1, true, '1'); +sql create table tba3 using sta tags(null, null, ''); +sql create table tba4 using sta tags(1, false, null); +sql create table tba5 using sta tags(3, true, 'aa'); +sql insert into tba1 values ('2022-09-26 15:15:01', 0, "a", false); +sql insert into tba1 values ('2022-09-26 15:15:02', 1, "0", true); +sql insert into tba1 values ('2022-09-26 15:15:03', 5, "5", false); +sql insert into tba1 values ('2022-09-26 15:15:04', 3, 'b', false); +sql insert into tba1 values ('2022-09-26 15:15:05', 0, '1', false); +sql insert into tba1 values ('2022-09-26 15:15:06', 2, 'd', true); + +sql insert into tba2 values ('2022-09-27 15:15:01', 0, "a", false); +sql insert into tba2 values ('2022-09-27 15:15:02', 1, "0", true); +sql insert into tba2 values ('2022-09-27 15:15:03', 5, "5", false); +sql insert into tba2 values ('2022-09-27 15:15:04', null, null, null); + +# child table: no window +print ====> select count(*) from tba1 event_window start with f1 = 0 end with f2 = 'c'; +sql select count(*) from tba1 event_window start with f1 = 0 end with f2 = 'c'; +if $rows != 0 then + return -1 +endi + +# child table: single row window +print ====> select count(*) from tba1 event_window start with f1 = 0 end with f3 = false; +sql select count(*) from tba1 event_window start with f1 = 0 end with f3 = false +if $rows != 1 then + return -1 +endi +if $data00 != 1 then + return -1 +endi + +# child table: multi rows window +print ====> select count(*) from tba1 event_window start with f1 = 0 end with f2 = 'b'; +sql select count(*) from tba1 event_window start with f1 = 0 end with f2 = 'b'; +if $rows != 1 then + return -1 +endi +if $data00 != 4 then + return -1 +endi + +# child table: multi windows +print ====> select count(*) from tba1 event_window start with f1 >= 0 end with f3 = true; +sql select count(*) from tba1 event_window start with f1 >= 0 end with f3 = true; +if $rows != 2 then + return -1 +endi +if $data00 != 2 then + return -1 +endi +if $data00 != 4 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT From f02f3e7a07ce04d3be6e657d0a8aafe9b6263879 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 10:12:54 +0800 Subject: [PATCH 043/139] fix: allow mnode start even dnode in dropping state --- source/dnode/mnode/impl/src/mndMnode.c | 5 ++--- source/dnode/mnode/sdb/inc/sdb.h | 1 + source/dnode/mnode/sdb/src/sdbHash.c | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index 9b3934c40c..add32fd335 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -15,13 +15,13 @@ #define _DEFAULT_SOURCE #include "mndMnode.h" +#include "mndCluster.h" #include "mndDnode.h" #include "mndPrivilege.h" #include "mndShow.h" #include "mndSync.h" #include "mndTrans.h" #include "tmisce.h" -#include "mndCluster.h" #define MNODE_VER_NUMBER 1 #define MNODE_RESERVE_SIZE 64 @@ -181,9 +181,8 @@ _OVER: static int32_t mndMnodeActionInsert(SSdb *pSdb, SMnodeObj *pObj) { mTrace("mnode:%d, perform insert action, row:%p", pObj->id, pObj); - pObj->pDnode = sdbAcquire(pSdb, SDB_DNODE, &pObj->id); + pObj->pDnode = sdbAcquireNotReadyObj(pSdb, SDB_DNODE, &pObj->id); if (pObj->pDnode == NULL) { - terrno = TSDB_CODE_MND_DNODE_NOT_EXIST; mError("mnode:%d, failed to perform insert action since %s", pObj->id, terrstr()); return -1; } diff --git a/source/dnode/mnode/sdb/inc/sdb.h b/source/dnode/mnode/sdb/inc/sdb.h index e799f08a17..5a44e4279f 100644 --- a/source/dnode/mnode/sdb/inc/sdb.h +++ b/source/dnode/mnode/sdb/inc/sdb.h @@ -291,6 +291,7 @@ int32_t sdbWriteWithoutFree(SSdb *pSdb, SSdbRaw *pRaw); * @return void* The object of the row. */ void *sdbAcquire(SSdb *pSdb, ESdbType type, const void *pKey); +void *sdbAcquireNotReadyObj(SSdb *pSdb, ESdbType type, const void *pKey); /** * @brief Release a row from sdb. diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c index 32b34ea3a3..505dee3d87 100644 --- a/source/dnode/mnode/sdb/src/sdbHash.c +++ b/source/dnode/mnode/sdb/src/sdbHash.c @@ -270,7 +270,7 @@ int32_t sdbWrite(SSdb *pSdb, SSdbRaw *pRaw) { return code; } -void *sdbAcquire(SSdb *pSdb, ESdbType type, const void *pKey) { +void *sdbAcquireAll(SSdb *pSdb, ESdbType type, const void *pKey, bool onlyReady) { terrno = 0; SHashObj *hash = sdbGetHash(pSdb, type); @@ -306,10 +306,24 @@ void *sdbAcquire(SSdb *pSdb, ESdbType type, const void *pKey) { break; } + if (pRet == NULL) { + if (!onlyReady) { + terrno = 0; + atomic_add_fetch_32(&pRow->refCount, 1); + pRet = pRow->pObj; + sdbPrintOper(pSdb, pRow, "acquire"); + } + } + sdbUnLock(pSdb, type); return pRet; } +void *sdbAcquire(SSdb *pSdb, ESdbType type, const void *pKey) { return sdbAcquireAll(pSdb, type, pKey, true); } +void *sdbAcquireNotReadyObj(SSdb *pSdb, ESdbType type, const void *pKey) { + return sdbAcquireAll(pSdb, type, pKey, false); +} + static void sdbCheckRow(SSdb *pSdb, SSdbRow *pRow) { int32_t type = pRow->type; sdbWriteLock(pSdb, type); From e0dbe221992f9e78e062dbd186012902d1e8c27e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 11 Jan 2023 10:27:23 +0800 Subject: [PATCH 044/139] fix(query): fix uninitialized memory buffer accessed. --- include/common/tdatablock.h | 9 ++++++++- source/common/src/tdatablock.c | 4 ++-- source/libs/executor/src/projectoperator.c | 1 - source/libs/executor/src/sysscanoperator.c | 7 +++++++ source/libs/function/src/builtinsimpl.c | 17 ++++++++--------- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/common/tdatablock.h b/include/common/tdatablock.h index 7209d45a6d..9c5b712db6 100644 --- a/include/common/tdatablock.h +++ b/include/common/tdatablock.h @@ -41,6 +41,12 @@ typedef struct SBlockOrderInfo { BMCharPos(bm_, r_) |= (1u << (7u - BitPos(r_))); \ } while (0) +#define colDataSetNull_f_s(c_, r_) \ + do { \ + colDataSetNull_f((c_)->nullbitmap, r_); \ + memset(((char*)(c_)->pData) + (c_)->info.bytes * (r_), 0, (c_)->info.bytes); \ + } while (0) + #define colDataClearNull_f(bm_, r_) \ do { \ BMCharPos(bm_, r_) &= ((char)(~(1u << (7u - BitPos(r_))))); \ @@ -136,7 +142,7 @@ static FORCE_INLINE void colDataAppendNULL(SColumnInfoData* pColumnInfoData, uin if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) { colDataSetNull_var(pColumnInfoData, currentRow); // it is a null value of VAR type. } else { - colDataSetNull_f(pColumnInfoData->nullbitmap, currentRow); + colDataSetNull_f_s(pColumnInfoData, currentRow); } pColumnInfoData->hasNull = true; @@ -151,6 +157,7 @@ static FORCE_INLINE void colDataAppendNNULL(SColumnInfoData* pColumnInfoData, ui for (int32_t i = start; i < start + nRows; ++i) { colDataSetNull_f(pColumnInfoData->nullbitmap, i); } + memset(pColumnInfoData->pData + start * pColumnInfoData->info.bytes, 0, pColumnInfoData->info.bytes * nRows); } pColumnInfoData->hasNull = true; diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 1f5748ebbd..43f272d599 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -69,7 +69,7 @@ int32_t colDataAppend(SColumnInfoData* pColumnInfoData, uint32_t currentRow, con if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) { pColumnInfoData->varmeta.offset[currentRow] = -1; // it is a null value of VAR type. } else { - colDataSetNull_f(pColumnInfoData->nullbitmap, currentRow); + colDataSetNull_f_s(pColumnInfoData, currentRow); } pColumnInfoData->hasNull = true; @@ -825,7 +825,7 @@ static int32_t blockDataAssign(SColumnInfoData* pCols, const SSDataBlock* pDataB } else { for (int32_t j = 0; j < pDataBlock->info.rows; ++j) { if (colDataIsNull_f(pSrc->nullbitmap, index[j])) { - colDataSetNull_f(pDst->nullbitmap, j); + colDataSetNull_f_s(pDst, j); continue; } memcpy(pDst->pData + j * pDst->info.bytes, pSrc->pData + index[j] * pDst->info.bytes, pDst->info.bytes); diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 926720fc65..4d38f2c8e9 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -279,7 +279,6 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { // for stream interval if (pBlock->info.type == STREAM_RETRIEVE || pBlock->info.type == STREAM_DELETE_RESULT || pBlock->info.type == STREAM_DELETE_DATA) { - // printDataBlock1(pBlock, "project1"); return pBlock; } diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index ac32b54f56..05570eda2f 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -1918,6 +1918,13 @@ static SSDataBlock* doBlockInfoScan(SOperatorInfo* pOperator) { colDataAppend(pColInfo, 0, p, false); taosMemoryFree(p); + // make the valgrind happy that all memory buffer has been initialized already. + if (slotId != 0) { + SColumnInfoData* p1 = taosArrayGet(pBlock->pDataBlock, 0); + int64_t v = 0; + colDataAppendInt64(p1, 0, &v); + } + pBlock->info.rows = 1; pOperator->status = OP_EXEC_DONE; return pBlock; diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 8fde27e046..2beb53a312 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -2645,7 +2645,7 @@ static int32_t doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int32_t v = *(int32_t*)pv; int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { - colDataSetNull_f(pOutput->nullbitmap, pos); + colDataSetNull_f_s(pOutput, pos); } else { colDataAppendInt64(pOutput, pos, &delta); } @@ -2658,7 +2658,7 @@ static int32_t doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int8_t v = *(int8_t*)pv; int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { - colDataSetNull_f(pOutput->nullbitmap, pos); + colDataSetNull_f_s(pOutput, pos); } else { colDataAppendInt64(pOutput, pos, &delta); } @@ -2669,7 +2669,7 @@ static int32_t doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int16_t v = *(int16_t*)pv; int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { - colDataSetNull_f(pOutput->nullbitmap, pos); + colDataSetNull_f_s(pOutput, pos); } else { colDataAppendInt64(pOutput, pos, &delta); } @@ -2681,7 +2681,7 @@ static int32_t doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int64_t v = *(int64_t*)pv; int64_t delta = factor * (v - pDiffInfo->prev.i64); // direct previous may be null if (delta < 0 && pDiffInfo->ignoreNegative) { - colDataSetNull_f(pOutput->nullbitmap, pos); + colDataSetNull_f_s(pOutput, pos); } else { colDataAppendInt64(pOutput, pos, &delta); } @@ -2692,7 +2692,7 @@ static int32_t doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, float v = *(float*)pv; double delta = factor * (v - pDiffInfo->prev.d64); // direct previous may be null if ((delta < 0 && pDiffInfo->ignoreNegative) || isinf(delta) || isnan(delta)) { // check for overflow - colDataSetNull_f(pOutput->nullbitmap, pos); + colDataSetNull_f_s(pOutput, pos); } else { colDataAppendDouble(pOutput, pos, &delta); } @@ -2703,7 +2703,7 @@ static int32_t doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, double v = *(double*)pv; double delta = factor * (v - pDiffInfo->prev.d64); // direct previous may be null if ((delta < 0 && pDiffInfo->ignoreNegative) || isinf(delta) || isnan(delta)) { // check for overflow - colDataSetNull_f(pOutput->nullbitmap, pos); + colDataSetNull_f_s(pOutput, pos); } else { colDataAppendDouble(pOutput, pos, &delta); } @@ -2738,7 +2738,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { if (pDiffInfo->includeNull) { - colDataSetNull_f(pOutput->nullbitmap, pos); + colDataSetNull_f_s(pOutput, pos); numOfElems += 1; } @@ -2776,8 +2776,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { if (colDataIsNull_f(pInputCol->nullbitmap, i)) { if (pDiffInfo->includeNull) { - colDataSetNull_f(pOutput->nullbitmap, pos); - + colDataSetNull_f_s(pOutput, pos); numOfElems += 1; } continue; From 9a95c3d7ab89cf28cc1d62df7c2b6db5fba4869e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 10:44:07 +0800 Subject: [PATCH 045/139] enh: refact vmFile.c --- source/dnode/mgmt/mgmt_vnode/src/vmFile.c | 173 +++++++++++----------- 1 file changed, 89 insertions(+), 84 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c index 8337fb5d10..17f20fdd7d 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c @@ -14,8 +14,8 @@ */ #define _DEFAULT_SOURCE -#include "vmInt.h" #include "tjson.h" +#include "vmInt.h" #define MAX_CONTENT_LEN 2 * 1024 * 1024 @@ -46,102 +46,107 @@ SVnodeObj **vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes) { return pVnodes; } -int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes) { - int32_t code = TSDB_CODE_INVALID_JSON_FORMAT; - int32_t len = 0; - int32_t maxLen = MAX_CONTENT_LEN; - char *content = taosMemoryCalloc(1, maxLen + 1); - cJSON *root = NULL; - FILE *fp = NULL; - char file[PATH_MAX] = {0}; +static int32_t vmDecodeVnodeList(SJson *pJson, SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes) { + int32_t code = -1; SWrapperCfg *pCfgs = NULL; - TdFilePtr pFile = NULL; - snprintf(file, sizeof(file), "%s%svnodes.json", pMgmt->path, TD_DIRSEP); - - pFile = taosOpenFile(file, TD_FILE_READ); - if (pFile == NULL) { - dInfo("file %s not exist", file); - code = 0; - goto _OVER; - } - - if (content == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return -1; - } - - len = (int32_t)taosReadFile(pFile, content, maxLen); - if (len <= 0) { - dError("failed to read %s since content is null", file); - goto _OVER; - } - - content[len] = 0; - root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read %s since invalid json format", file); - goto _OVER; - } - - cJSON *vnodes = cJSON_GetObjectItem(root, "vnodes"); - if (!vnodes || vnodes->type != cJSON_Array) { - dError("failed to read %s since vnodes not found", file); - goto _OVER; - } + SJson *vnodes = tjsonGetObjectItem(pJson, "vnodes"); + if (vnodes == NULL) return -1; int32_t vnodesNum = cJSON_GetArraySize(vnodes); if (vnodesNum > 0) { pCfgs = taosMemoryCalloc(vnodesNum, sizeof(SWrapperCfg)); - if (pCfgs == NULL) { - dError("failed to read %s since out of memory", file); - code = TSDB_CODE_OUT_OF_MEMORY; - goto _OVER; - } - - for (int32_t i = 0; i < vnodesNum; ++i) { - cJSON *vnode = cJSON_GetArrayItem(vnodes, i); - SWrapperCfg *pCfg = &pCfgs[i]; - - cJSON *vgId = cJSON_GetObjectItem(vnode, "vgId"); - if (!vgId || vgId->type != cJSON_Number) { - dError("failed to read %s since vgId not found", file); - taosMemoryFree(pCfgs); - goto _OVER; - } - pCfg->vgId = vgId->valueint; - snprintf(pCfg->path, sizeof(pCfg->path), "%s%svnode%d", pMgmt->path, TD_DIRSEP, pCfg->vgId); - - cJSON *dropped = cJSON_GetObjectItem(vnode, "dropped"); - if (!dropped || dropped->type != cJSON_Number) { - dError("failed to read %s since dropped not found", file); - taosMemoryFree(pCfgs); - goto _OVER; - } - pCfg->dropped = dropped->valueint; - - cJSON *vgVersion = cJSON_GetObjectItem(vnode, "vgVersion"); - if (!vgVersion || vgVersion->type != cJSON_Number) { - dError("failed to read %s since vgVersion not found", file); - taosMemoryFree(pCfgs); - goto _OVER; - } - pCfg->vgVersion = vgVersion->valueint; - } - - *ppCfgs = pCfgs; + if (pCfgs == NULL) return -1; + } + + for (int32_t i = 0; i < vnodesNum; ++i) { + SJson *vnode = tjsonGetArrayItem(vnodes, i); + if (vnode == NULL) goto _OVER; + + SWrapperCfg *pCfg = &pCfgs[i]; + tjsonGetInt32ValueFromDouble(vnode, "id", pCfg->vgId, code); + if (code < 0) goto _OVER; + tjsonGetInt32ValueFromDouble(vnode, "dropped", pCfg->dropped, code); + if (code < 0) goto _OVER; + tjsonGetInt32ValueFromDouble(vnode, "vgVersion", pCfg->vgVersion, code); + if (code < 0) goto _OVER; + + snprintf(pCfg->path, sizeof(pCfg->path), "%s%svnode%d", pMgmt->path, TD_DIRSEP, pCfg->vgId); } - *numOfVnodes = vnodesNum; code = 0; - dInfo("succcessed to read file %s, numOfVnodes:%d", file, vnodesNum); + *ppCfgs = pCfgs; + *numOfVnodes = vnodesNum; _OVER: - if (content != NULL) taosMemoryFree(content); - if (root != NULL) cJSON_Delete(root); + if (*ppCfgs == NULL) taosMemoryFree(pCfgs); + return code; +} + +int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes) { + int32_t code = -1; + TdFilePtr pFile = NULL; + char *pData = NULL; + SJson *pJson = NULL; + char file[PATH_MAX] = {0}; + SWrapperCfg *pCfgs = NULL; + snprintf(file, sizeof(file), "%s%svnodes.json", pMgmt->path, TD_DIRSEP); + + if (taosStatFile(file, NULL, NULL) < 0) { + dInfo("vnode file:%s not exist", file); + return 0; + } + + pFile = taosOpenFile(file, TD_FILE_READ); + if (pFile == NULL) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to open vnode file:%s since %s", file, terrstr()); + goto _OVER; + } + + int64_t size = 0; + if (taosFStatFile(pFile, &size, NULL) < 0) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to fstat mnode file:%s since %s", file, terrstr()); + goto _OVER; + } + + pData = taosMemoryMalloc(size + 1); + if (pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + + if (taosReadFile(pFile, pData, size) != size) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to read vnode file:%s since %s", file, terrstr()); + goto _OVER; + } + + pData[size] = '\0'; + + pJson = tjsonParse(pData); + if (pJson == NULL) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } + + if (vmDecodeVnodeList(pJson, pMgmt, ppCfgs, numOfVnodes) < 0) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } + + code = 0; + dInfo("succceed to read vnode file %s", file); + +_OVER: + if (pData != NULL) taosMemoryFree(pData); + if (pJson != NULL) cJSON_Delete(pJson); if (pFile != NULL) taosCloseFile(&pFile); - terrno = code; + if (code != 0) { + dError("failed to read vnode file:%s since %s", file, terrstr()); + } return code; } From 4de9f965f462c3adb2a8228c5c1b14adcba6f34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 11 Jan 2023 10:58:30 +0800 Subject: [PATCH 046/139] test: refine query cases --- tests/parallel_test/cases.task | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1205da31b3..d4fe45d42b 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1039,6 +1039,11 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/out_of_order.py +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/out_of_order.py -R +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/out_of_order.py -Q 2 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/out_of_order.py -Q 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/out_of_order.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py From 5db74213dab678f853da5f3bb217fd9368589e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 11 Jan 2023 10:58:44 +0800 Subject: [PATCH 047/139] test: refine query cases --- tests/system-test/2-query/nestedQuery.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/system-test/2-query/nestedQuery.py b/tests/system-test/2-query/nestedQuery.py index 034ab8dcdc..3d0db9a562 100755 --- a/tests/system-test/2-query/nestedQuery.py +++ b/tests/system-test/2-query/nestedQuery.py @@ -851,6 +851,7 @@ class TDTestCase: tdLog.info("========mark==%s==="% mark); try: tdSql.query(sql,queryTimes=1) + self.explain_sql(sql) except: tdLog.info("sql is not support :=====%s; " %sql) tdSql.error(sql) @@ -4995,9 +4996,7 @@ class TDTestCase: sql += "%s ;" % random.choice(self.limit_u_where) tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.data_check(sql,mark='15-2') tdSql.query("select 15-2.2 from stable_1;") for i in range(self.fornum): @@ -5013,9 +5012,7 @@ class TDTestCase: sql += "%s ;" % random.choice(self.limit_u_where) tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.data_check(sql,mark='15-2.2') self.restartDnodes() tdSql.query("select 15-3 from stable_1;") @@ -5033,9 +5030,7 @@ class TDTestCase: sql += "%s " % random.choice(self.limit_where) tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.data_check(sql,mark='15-3') tdSql.query("select 15-4 from stable_1;") for i in range(self.fornum): @@ -5052,9 +5047,7 @@ class TDTestCase: sql += "%s " % random.choice(self.limit_u_where) tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.data_check(sql,mark='15-4') tdSql.query("select 15-4.2 from stable_1;") for i in range(self.fornum): @@ -5087,8 +5080,7 @@ class TDTestCase: tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.data_check(sql,mark='15-5') #16 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by limit offset ) #self.dropandcreateDB_random("%s" %db, 1) From 07adf3097ad00c59b34f07401a53fa15a89cd986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 11 Jan 2023 10:58:57 +0800 Subject: [PATCH 048/139] test: refine query cases --- tests/system-test/2-query/out_of_order.py | 191 ++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 tests/system-test/2-query/out_of_order.py diff --git a/tests/system-test/2-query/out_of_order.py b/tests/system-test/2-query/out_of_order.py new file mode 100644 index 0000000000..5b52661bae --- /dev/null +++ b/tests/system-test/2-query/out_of_order.py @@ -0,0 +1,191 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +import os +import random + +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import * + + +class TDTestCase: + def init(self, conn, logSql, replicaVar): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def getBuildPath(self): + selfPath = os.path.dirname(os.path.realpath(__file__)) + + if ("community" in selfPath): + projPath = selfPath[:selfPath.find("community")] + else: + projPath = selfPath[:selfPath.find("tests")] + + for root, dirs, files in os.walk(projPath): + if ("taosd" in files): + rootRealPath = os.path.dirname(os.path.realpath(root)) + if ("packaging" not in rootRealPath): + buildPath = root[:len(root)-len("/build/bin")] + break + return buildPath + + def run_benchmark(self,dbname,tables,per_table_num,order,replica): + #O :Out of order + #A :Repliaca + buildPath = self.getBuildPath() + if (buildPath == ""): + tdLog.exit("taosd not found!") + else: + tdLog.info("taosd found in %s" % buildPath) + binPath = buildPath+ "/build/bin/" + + os.system("%staosBenchmark -d %s -t %d -n %d -O %d -a %d -b float,double,nchar\(200\),binary\(50\) -T 50 -y " % (binPath,dbname,tables,per_table_num,order,replica)) + + def sql_base(self,dbname): + self.check_sub(dbname) + sql1 = "select count(*) from %s.meters" %dbname + self.sql_base_check(sql1,sql1) + + self.check_sub(dbname) + sql2 = "select count(ts) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(_c0) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c0) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c1) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c2) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c3) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(t0) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(t1) from %s.meters" %dbname + self.sql_base_check(sql1,sql2) + + + self.check_sub(dbname) + sql2 = "select count(ts) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(_c0) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c0) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c1) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c2) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(c3) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(t0) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + self.check_sub(dbname) + sql2 = "select count(t1) from (select * from %s.meters)" %dbname + self.sql_base_check(sql1,sql2) + + + def sql_base_check(self,sql1,sql2): + tdSql.query(sql1) + sql1_result = tdSql.getData(0,0) + tdLog.info("sql:%s , result: %s" %(sql1,sql1_result)) + + tdSql.query(sql2) + sql2_result = tdSql.getData(0,0) + tdLog.info("sql:%s , result: %s" %(sql2,sql2_result)) + + if sql1_result==sql2_result: + tdLog.info(f"checkEqual success, sql1_result={sql1_result},sql2_result={sql2_result}") + else : + tdLog.exit(f"checkEqual error, sql1_result=={sql1_result},sql2_result={sql2_result}") + + def run_sql(self,dbname): + self.sql_base(dbname) + + tdSql.execute(" flush database %s;" %dbname) + + self.sql_base(dbname) + + def check_sub(self,dbname): + + sql = "select count(*) from (select distinct(tbname) from %s.meters)" %dbname + tdSql.query(sql) + num = tdSql.getData(0,0) + + for i in range(0,num): + sql1 = "select count(*) from %s.d%d" %(dbname,i) + tdSql.query(sql1) + sql1_result = tdSql.getData(0,0) + tdLog.info("sql:%s , result: %s" %(sql1,sql1_result)) + + def check_out_of_order(self,dbname,tables,per_table_num,order,replica): + self.run_benchmark(dbname,tables,per_table_num,order,replica) + print("sleep 10 seconds") + #time.sleep(10) + print("sleep 10 seconds finish") + + self.run_sql(dbname) + + def run(self): + startTime = time.time() + + #self.check_out_of_order('db1',10,random.randint(10000,50000),random.randint(1,10),1) + self.check_out_of_order('db1',random.randint(50,200),random.randint(10000,20000),random.randint(1,5),1) + + # self.check_out_of_order('db2',random.randint(50,200),random.randint(10000,50000),random.randint(5,50),1) + + # self.check_out_of_order('db3',random.randint(50,200),random.randint(10000,50000),random.randint(50,100),1) + + # self.check_out_of_order('db4',random.randint(50,200),random.randint(10000,50000),100,1) + + endTime = time.time() + print("total time %ds" % (endTime - startTime)) + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) From ba7f9f1df15f40587cf17cde65c9d6cf848dd52e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 11:06:16 +0800 Subject: [PATCH 049/139] enh: refact dmEps.c --- source/dnode/mgmt/node_util/src/dmEps.c | 172 ++++++++++-------------- 1 file changed, 70 insertions(+), 102 deletions(-) diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 3e2d8b53aa..6eb4d44294 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -41,14 +41,49 @@ static void dmGetDnodeEp(SDnodeData *pData, int32_t dnodeId, char *pEp, char *pF taosThreadRwlockUnlock(&pData->lock); } +static int32_t dmDecodeEps(SJson *pJson, SDnodeData *pData) { + int32_t code = 0; + + tjsonGetInt32ValueFromDouble(pJson, "dnodeId", pData->dnodeId, code); + if (code < 0) return -1; + tjsonGetNumberValue(pJson, "dnodeVer", pData->dnodeVer, code); + if (code < 0) return -1; + tjsonGetNumberValue(pJson, "clusterId", pData->clusterId, code); + if (code < 0) return -1; + tjsonGetInt32ValueFromDouble(pJson, "dropped", pData->dropped, code); + if (code < 0) return -1; + + SJson *dnodes = tjsonGetObjectItem(pJson, "dnodes"); + if (dnodes == NULL) return 0; + int32_t numOfDnodes = tjsonGetArraySize(dnodes); + + for (int32_t i = 0; i < numOfDnodes; ++i) { + SJson *dnode = tjsonGetArrayItem(dnodes, i); + if (dnode == NULL) return -1; + + SDnodeEp dnodeEp = {0}; + tjsonGetInt32ValueFromDouble(dnode, "id", dnodeEp.id, code); + if (code < 0) return -1; + code = tjsonGetStringValue(dnode, "fqdn", dnodeEp.ep.fqdn); + if (code < 0) return -1; + tjsonGetUInt16ValueFromDouble(dnode, "port", dnodeEp.ep.port, code); + if (code < 0) return -1; + tjsonGetInt8ValueFromDouble(dnode, "isMnode", dnodeEp.isMnode, code); + if (code < 0) return -1; + + if (taosArrayPush(pData->dnodeEps, &dnodeEp) == NULL) return -1; + } + + return 0; +} + int32_t dmReadEps(SDnodeData *pData) { - int32_t code = TSDB_CODE_INVALID_JSON_FORMAT; - int32_t len = 0; - int32_t maxLen = 256 * 1024; - char *content = taosMemoryCalloc(1, maxLen + 1); - cJSON *root = NULL; - char file[PATH_MAX] = {0}; + int32_t code = -1; TdFilePtr pFile = NULL; + char *content = NULL; + SJson *pJson = NULL; + char file[PATH_MAX] = {0}; + snprintf(file, sizeof(file), "%s%sdnode%sdnode.json", tsDataDir, TD_DIRSEP, TD_DIRSEP); pData->dnodeEps = taosArrayInit(1, sizeof(SDnodeEp)); if (pData->dnodeEps == NULL) { @@ -56,129 +91,62 @@ int32_t dmReadEps(SDnodeData *pData) { goto _OVER; } - snprintf(file, sizeof(file), "%s%sdnode%sdnode.json", tsDataDir, TD_DIRSEP, TD_DIRSEP); - pFile = taosOpenFile(file, TD_FILE_READ); - if (pFile == NULL) { + if (taosStatFile(file, NULL, NULL) < 0) { + dInfo("dnode file:%s not exist", file); code = 0; goto _OVER; } - len = (int32_t)taosReadFile(pFile, content, maxLen); - if (len <= 0) { - dError("failed to read %s since content is null", file); + pFile = taosOpenFile(file, TD_FILE_READ); + if (pFile == NULL) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to open dnode file:%s since %s", file, terrstr()); goto _OVER; } - content[len] = 0; - root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read %s since invalid json format", file); + int64_t size = 0; + if (taosFStatFile(pFile, &size, NULL) < 0) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to fstat dnode file:%s since %s", file, terrstr()); goto _OVER; } - cJSON *dnodeId = cJSON_GetObjectItem(root, "dnodeId"); - if (!dnodeId || dnodeId->type != cJSON_Number) { - dError("failed to read %s since dnodeId not found", file); - goto _OVER; - } - pData->dnodeId = dnodeId->valueint; - - cJSON *dnodeVer = cJSON_GetObjectItem(root, "dnodeVer"); - if (!dnodeVer || dnodeVer->type != cJSON_String) { - dError("failed to read %s since dnodeVer not found", file); - goto _OVER; - } - pData->dnodeVer = atoll(dnodeVer->valuestring); - - cJSON *clusterId = cJSON_GetObjectItem(root, "clusterId"); - if (!clusterId || clusterId->type != cJSON_String) { - dError("failed to read %s since clusterId not found", file); - goto _OVER; - } - pData->clusterId = atoll(clusterId->valuestring); - - cJSON *dropped = cJSON_GetObjectItem(root, "dropped"); - if (!dropped || dropped->type != cJSON_Number) { - dError("failed to read %s since dropped not found", file); - goto _OVER; - } - pData->dropped = dropped->valueint; - - cJSON *dnodes = cJSON_GetObjectItem(root, "dnodes"); - if (!dnodes || dnodes->type != cJSON_Array) { - dError("failed to read %s since dnodes not found", file); + content = taosMemoryMalloc(size + 1); + if (content == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; goto _OVER; } - int32_t numOfDnodes = cJSON_GetArraySize(dnodes); - if (numOfDnodes <= 0) { - dError("failed to read %s since numOfDnodes:%d invalid", file, numOfDnodes); + if (taosReadFile(pFile, content, size) != size) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to read dnode file:%s since %s", file, terrstr()); goto _OVER; } - for (int32_t i = 0; i < numOfDnodes; ++i) { - cJSON *node = cJSON_GetArrayItem(dnodes, i); - if (node == NULL) break; + content[size] = '\0'; - SDnodeEp dnodeEp = {0}; + pJson = tjsonParse(content); + if (pJson == NULL) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } - cJSON *did = cJSON_GetObjectItem(node, "id"); - if (!did || did->type != cJSON_Number) { - dError("failed to read %s since dnodeId not found", file); - goto _OVER; - } - - dnodeEp.id = did->valueint; - - cJSON *dnodeFqdn = cJSON_GetObjectItem(node, "fqdn"); - if (!dnodeFqdn || dnodeFqdn->type != cJSON_String || dnodeFqdn->valuestring == NULL) { - dError("failed to read %s since dnodeFqdn not found", file); - goto _OVER; - } - tstrncpy(dnodeEp.ep.fqdn, dnodeFqdn->valuestring, TSDB_FQDN_LEN); - - cJSON *dnodePort = cJSON_GetObjectItem(node, "port"); - if (!dnodePort || dnodePort->type != cJSON_Number) { - dError("failed to read %s since dnodePort not found", file); - goto _OVER; - } - - dnodeEp.ep.port = dnodePort->valueint; - - cJSON *isMnode = cJSON_GetObjectItem(node, "isMnode"); - if (!isMnode || isMnode->type != cJSON_Number) { - dError("failed to read %s since isMnode not found", file); - goto _OVER; - } - dnodeEp.isMnode = isMnode->valueint; - - taosArrayPush(pData->dnodeEps, &dnodeEp); + if (dmDecodeEps(pJson, pData) < 0) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; } code = 0; - dDebug("succcessed to read file %s", file); + dInfo("succceed to read mnode file %s", file); _OVER: if (content != NULL) taosMemoryFree(content); - if (root != NULL) cJSON_Delete(root); + if (pJson != NULL) cJSON_Delete(pJson); if (pFile != NULL) taosCloseFile(&pFile); - if (taosArrayGetSize(pData->dnodeEps) == 0) { - SDnodeEp dnodeEp = {0}; - dnodeEp.isMnode = 1; - taosGetFqdnPortFromEp(tsFirst, &dnodeEp.ep); - taosArrayPush(pData->dnodeEps, &dnodeEp); + if (code != 0) { + dError("failed to read dnode file:%s since %s", file, terrstr()); } - - dDebug("reset dnode list on startup"); - dmResetEps(pData, pData->dnodeEps); - - if (dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { - dError("localEp %s different with %s and need reconfigured", tsLocalEp, file); - return -1; - } - - terrno = code; return code; } From 8c9daa32fc7d96ab7e36393de725f016a16262d5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 11:18:39 +0800 Subject: [PATCH 050/139] enh: refact dmFile.c --- source/dnode/mgmt/node_util/src/dmFile.c | 77 +++++++++++++++++------- 1 file changed, 55 insertions(+), 22 deletions(-) diff --git a/source/dnode/mgmt/node_util/src/dmFile.c b/source/dnode/mgmt/node_util/src/dmFile.c index 4dcc962a20..fb05f08c0c 100644 --- a/source/dnode/mgmt/node_util/src/dmFile.c +++ b/source/dnode/mgmt/node_util/src/dmFile.c @@ -19,48 +19,81 @@ #define MAXLEN 1024 -int32_t dmReadFile(const char *path, const char *name, bool *pDeployed) { - int32_t code = TSDB_CODE_INVALID_JSON_FORMAT; - int64_t len = 0; - char content[MAXLEN + 1] = {0}; - cJSON *root = NULL; - char file[PATH_MAX] = {0}; - TdFilePtr pFile = NULL; +static int32_t dmDecodeFile(SJson *pJson, bool *deployed) { + int32_t code = 0; + int32_t value = 0; + tjsonGetInt32ValueFromDouble(pJson, "deployed", value, code); + if (code < 0) return -1; + + *deployed = (value != 0); + return code; +} + +int32_t dmReadFile(const char *path, const char *name, bool *pDeployed) { + int32_t code = -1; + TdFilePtr pFile = NULL; + char *content = NULL; + SJson *pJson = NULL; + char file[PATH_MAX] = {0}; snprintf(file, sizeof(file), "%s%s%s.json", path, TD_DIRSEP, name); - pFile = taosOpenFile(file, TD_FILE_READ); - if (pFile == NULL) { + + if (taosStatFile(file, NULL, NULL) < 0) { + dInfo("file:%s not exist", file); code = 0; goto _OVER; } - len = taosReadFile(pFile, content, MAXLEN); - if (len <= 0) { - dError("failed to read %s since content is null", file); + pFile = taosOpenFile(file, TD_FILE_READ); + if (pFile == NULL) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to open file:%s since %s", file, terrstr()); goto _OVER; } - root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read %s since invalid json format", file); + int64_t size = 0; + if (taosFStatFile(pFile, &size, NULL) < 0) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to fstat file:%s since %s", file, terrstr()); goto _OVER; } - cJSON *deployed = cJSON_GetObjectItem(root, "deployed"); - if (!deployed || deployed->type != cJSON_Number) { - dError("failed to read %s since deployed not found", file); + content = taosMemoryMalloc(size + 1); + if (content == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + + if (taosReadFile(pFile, content, size) != size) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to read file:%s since %s", file, terrstr()); + goto _OVER; + } + + content[size] = '\0'; + + pJson = tjsonParse(content); + if (pJson == NULL) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } + + if (dmDecodeFile(pJson, pDeployed) < 0) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; goto _OVER; } - *pDeployed = deployed->valueint != 0; - dDebug("succcessed to read file %s, deployed:%d", file, *pDeployed); code = 0; + dInfo("succceed to read mnode file %s", file); _OVER: - if (root != NULL) cJSON_Delete(root); + if (content != NULL) taosMemoryFree(content); + if (pJson != NULL) cJSON_Delete(pJson); if (pFile != NULL) taosCloseFile(&pFile); - terrno = code; + if (code != 0) { + dError("failed to read dnode file:%s since %s", file, terrstr()); + } return code; } From dfed4e7650dd079b1a18922e10847b9e41f8bd8b Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 11 Jan 2023 11:32:46 +0800 Subject: [PATCH 051/139] fix: taos-tools deb rpm compn for main (#19489) * fix: taos-tools deb/rpm compn for main * fix: update taos-tools 5aa25e9 --- cmake/taostools_CMakeLists.txt.in | 2 +- packaging/release.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 599b508c93..d01928cfe8 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG 94d6895 + GIT_TAG 5aa25e9 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/packaging/release.sh b/packaging/release.sh index 7a8a08352f..1dfbf2b112 100755 --- a/packaging/release.sh +++ b/packaging/release.sh @@ -273,7 +273,7 @@ if [ "$osType" != "Darwin" ]; then [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" ${csudo}./make-taos-tools-deb.sh ${top_dir} \ - ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} + ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} ${verNumberComp} fi fi else @@ -298,7 +298,7 @@ if [ "$osType" != "Darwin" ]; then [ -z "$taos_tools_ver" ] && taos_tools_ver="0.1.0" ${csudo}./make-taos-tools-rpm.sh ${top_dir} \ - ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} + ${compile_dir} ${output_dir} ${taos_tools_ver} ${cpuType} ${osType} ${verMode} ${verType} ${verNumberComp} fi fi else From 71ef10409ce34ca8782c71090b86951630ca98f0 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 11:37:59 +0800 Subject: [PATCH 052/139] enh: adjust dmEps.c --- source/dnode/mgmt/node_util/src/dmEps.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 6eb4d44294..7bae703753 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -147,6 +147,22 @@ _OVER: if (code != 0) { dError("failed to read dnode file:%s since %s", file, terrstr()); } + + if (taosArrayGetSize(pData->dnodeEps) == 0) { + SDnodeEp dnodeEp = {0}; + dnodeEp.isMnode = 1; + taosGetFqdnPortFromEp(tsFirst, &dnodeEp.ep); + taosArrayPush(pData->dnodeEps, &dnodeEp); + } + + dDebug("reset dnode list on startup"); + dmResetEps(pData, pData->dnodeEps); + + if (dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { + dError("localEp %s different with %s and need reconfigured", tsLocalEp, file); + return -1; + } + return code; } @@ -215,7 +231,7 @@ _OVER: if (code != 0) { if (terrno == 0) terrno = TAOS_SYSTEM_ERROR(errno); - dInfo("succeed to write dnode file:%s since %s, dnodeVer:%" PRId64, realfile, terrstr(), pData->dnodeVer); + dError("failed to write dnode file:%s since %s, dnodeVer:%" PRId64, realfile, terrstr(), pData->dnodeVer); } return code; } From c5959c5b1927a8c6002c4ae10e77944de5501084 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 12:24:44 +0800 Subject: [PATCH 053/139] fix: invalid json item --- source/dnode/mgmt/mgmt_vnode/src/vmFile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c index 17f20fdd7d..bf176ebb40 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c @@ -49,6 +49,7 @@ SVnodeObj **vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes) { static int32_t vmDecodeVnodeList(SJson *pJson, SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes) { int32_t code = -1; SWrapperCfg *pCfgs = NULL; + *ppCfgs = NULL; SJson *vnodes = tjsonGetObjectItem(pJson, "vnodes"); if (vnodes == NULL) return -1; @@ -64,7 +65,7 @@ static int32_t vmDecodeVnodeList(SJson *pJson, SVnodeMgmt *pMgmt, SWrapperCfg ** if (vnode == NULL) goto _OVER; SWrapperCfg *pCfg = &pCfgs[i]; - tjsonGetInt32ValueFromDouble(vnode, "id", pCfg->vgId, code); + tjsonGetInt32ValueFromDouble(vnode, "vgId", pCfg->vgId, code); if (code < 0) goto _OVER; tjsonGetInt32ValueFromDouble(vnode, "dropped", pCfg->dropped, code); if (code < 0) goto _OVER; From 3a848ccb360ceae85ee5abe3511f6ddc56ffc4bd Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 11 Jan 2023 13:19:17 +0800 Subject: [PATCH 054/139] fix(query): fix the invalid return value check for percentile function. --- source/libs/function/src/builtinsimpl.c | 6 ++++-- source/libs/function/src/tpercentile.c | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 2beb53a312..4a0b2682cb 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -1662,6 +1662,8 @@ int32_t percentileFunction(SqlFunctionCtx* pCtx) { int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { SVariant* pVal = &pCtx->param[1].param; + terrno = 0; + double v = 0; GET_TYPED_DATA(v, double, pVal->nType, &pVal->i); @@ -1675,8 +1677,8 @@ int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { tMemBucketDestroy(pMemBucket); - if (ppInfo->result < 0) { - return TSDB_CODE_NO_AVAIL_DISK; + if (terrno != TSDB_CODE_SUCCESS) { + return terrno; } return functionFinalize(pCtx, pBlock); diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index 04472c42ec..d4a362659c 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -92,6 +92,7 @@ static void resetPosInfo(SSlotInfo *pInfo) { double findOnlyResult(tMemBucket *pMemBucket) { ASSERT(pMemBucket->total == 1); + terrno = 0; for (int32_t i = 0; i < pMemBucket->numOfSlots; ++i) { tMemBucketSlot *pSlot = &pMemBucket->pSlots[i]; @@ -108,8 +109,10 @@ double findOnlyResult(tMemBucket *pMemBucket) { int32_t *pageId = taosArrayGet(list, 0); SFilePage *pPage = getBufPage(pMemBucket->pBuffer, *pageId); if (pPage == NULL) { - return -1; + terrno = TSDB_CODE_NO_AVAIL_DISK; + return 0; } + ASSERT(pPage->num == 1); double v = 0; @@ -546,9 +549,7 @@ double getPercentile(tMemBucket *pMemBucket, double percent) { // if only one elements exists, return it if (pMemBucket->total == 1) { - if (findOnlyResult(pMemBucket) < 0) { - return -1; - } + return findOnlyResult(pMemBucket); } percent = fabs(percent); From 60c4efbc8ced02cf3ee544417bc4fc721b79ed45 Mon Sep 17 00:00:00 2001 From: jiacy-jcy <714897623@qq.com> Date: Wed, 11 Jan 2023 13:43:36 +0800 Subject: [PATCH 055/139] add test case --- .../0-others/information_schema.py | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 tests/system-test/0-others/information_schema.py diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py new file mode 100644 index 0000000000..1b82fa6e64 --- /dev/null +++ b/tests/system-test/0-others/information_schema.py @@ -0,0 +1,113 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + + +from util.log import * +from util.cases import * +from util.sql import * +from util.common import * +from util.sqlset import * + +class TDTestCase: + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor()) + self.setsql = TDSetSql() + self.dbname = 'db' + self.stbname = 'stb' + self.binary_length = 20 # the length of binary for column_dict + self.nchar_length = 20 # the length of nchar for column_dict + self.ts = 1537146000000 + self.column_dict = { + 'ts' : 'timestamp', + 'col1': 'tinyint', + 'col2': 'smallint', + 'col3': 'int', + 'col4': 'bigint', + 'col5': 'tinyint unsigned', + 'col6': 'smallint unsigned', + 'col7': 'int unsigned', + 'col8': 'bigint unsigned', + 'col9': 'float', + 'col10': 'double', + 'col11': 'bool', + 'col12': f'binary({self.binary_length})', + 'col13': f'nchar({self.nchar_length})' + } + self.tbnum = 20 + self.rowNum = 10 + self.tag_dict = { + 't0':'int' + } + self.tag_values = [ + f'1' + ] + self.binary_str = 'taosdata' + self.nchar_str = '涛思数据' + self.ins_list = ['ins_dnodes','ins_mnodes','ins_modules','ins_qnodes','ins_snodes','ins_cluster','ins_databases','ins_functions',\ + 'ins_indexes','ins_stables','ins_tables','ins_tags','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\ + 'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges'] + self.perf_list = ['perf_connections','perf_queries','perf_consumers','perf_trans','perf_apps'] + def insert_data(self,column_dict,tbname,row_num): + insert_sql = self.setsql.set_insertsql(column_dict,tbname,self.binary_str,self.nchar_str) + for i in range(row_num): + insert_list = [] + self.setsql.insert_values(column_dict,i,insert_sql,insert_list,self.ts) + def prepare_data(self): + tdSql.execute(f"create database if not exists {self.dbname} vgroups 2") + tdSql.execute(f'use {self.dbname}') + tdSql.execute(self.setsql.set_create_stable_sql(self.stbname,self.column_dict,self.tag_dict)) + for i in range(self.tbnum): + tdSql.execute(f"create table {self.stbname}_{i} using {self.stbname} tags({self.tag_values[0]})") + self.insert_data(self.column_dict,f'{self.stbname}_{i}',self.rowNum) + def count_check(self): + tdSql.query('select count(*) from information_schema.ins_tables') + tdSql.checkEqual(tdSql.queryResult[0][0],self.tbnum+len(self.ins_list)+len(self.perf_list)) + tdSql.query(f'select count(*) from information_schema.ins_tables where db_name = "{self.dbname}"') + tdSql.checkEqual(tdSql.queryResult[0][0],self.tbnum) + tdSql.query(f'select count(*) from information_schema.ins_tables where db_name = "{self.dbname}" and stable_name = "{self.stbname}"') + tdSql.checkEqual(tdSql.queryResult[0][0],self.tbnum) + tdSql.execute('create database db1') + tdSql.execute('create table stb1 (ts timestamp,c0 int) tags(t0 int)') + tdSql.execute('create table tb1 using stb1 tags(1)') + tdSql.query(f'select db_name, stable_name, count(*) from information_schema.ins_tables group by db_name, stable_name') + for i in tdSql.queryResult: + if i[0].lower() == 'information_schema': + tdSql.checkEqual(i[2],len(self.ins_list)) + elif i[0].lower() == self.dbname and i[1] == self.stbname: + tdSql.checkEqual(i[2],self.tbnum) + elif i[0].lower() == self.dbname and i[1] == 'stb1': + tdSql.checkEqual(i[2],1) + elif i[0].lower() == 'performance_schema': + tdSql.checkEqual(i[2],len(self.perf_list)) + tdSql.execute('create table db1.ntb (ts timestamp,c0 int)') + tdSql.query(f'select db_name, count(*) from information_schema.ins_tables group by db_name') + print(tdSql.queryResult) + for i in tdSql.queryResult: + if i[0].lower() == 'information_schema': + tdSql.checkEqual(i[1],len(self.ins_list)) + elif i[0].lower() == 'performance_schema': + tdSql.checkEqual(i[1],len(self.perf_list)) + elif i[0].lower() == self.dbname: + tdSql.checkEqual(i[1],self.tbnum+1) + def run(self): + self.prepare_data() + self.count_check() + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file From 64364de839d5443afe3bde9b11e287292704bf78 Mon Sep 17 00:00:00 2001 From: jiacy-jcy <714897623@qq.com> Date: Wed, 11 Jan 2023 13:44:48 +0800 Subject: [PATCH 056/139] add test case into ci --- tests/parallel_test/cases.task | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1205da31b3..1cd2f33a51 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -445,6 +445,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/database_pre_suf.py ,,y,system-test,./pytest.sh python3 ./test.py -f 1-insert/InsertFuturets.py ,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/show.py +,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/information_schema.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/abs.py -R ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/and_or_for_byte.py From 118c01e6a2377908f7bb6eab6a97787cedff0071 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 13:58:22 +0800 Subject: [PATCH 057/139] fix: minor changes --- source/dnode/mgmt/mgmt_mnode/src/mmFile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c index f06669a610..1a91fe9d56 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c @@ -26,7 +26,7 @@ static int32_t mmDecodeOption(SJson *pJson, SMnodeOpt *pOption) { if (code < 0) return 0; SJson *replicas = tjsonGetObjectItem(pJson, "replicas"); - if (replicas == NULL) return 0; + if (replicas == NULL) return -1; pOption->numOfReplicas = tjsonGetArraySize(replicas); for (int32_t i = 0; i < pOption->numOfReplicas; ++i) { From 3e7aaf6adc7779e09bc84856d04d6c001d7d5c64 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 11 Jan 2023 14:27:36 +0800 Subject: [PATCH 058/139] fix:add logic for ins_columns --- source/libs/executor/src/sysscanoperator.c | 3 +++ source/libs/parser/src/parTranslater.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index d8a4660811..6c31d5e592 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -539,6 +539,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { qError("sysTableScanUserCols get meta by suid:%"PRId64 " error, code:%d", suid, code); blockDataDestroy(dataBlock); pInfo->loadInfo.totalRows = 0; + taosHashCleanup(stableSchema); return NULL; } schemaRow = &pInfo->pCur->mr.me.stbEntry.schemaRow; @@ -563,6 +564,8 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { } } + taosHashCleanup(stableSchema); + if (numOfRows > 0) { relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); numOfRows = 0; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 951966d436..e222bb4690 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -2273,12 +2273,13 @@ static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName, SArray* pVgs = NULL; int32_t code = getVnodeSysTableVgroupList(pCxt, pName, &pVgs, &hasUserDbCond); - if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS) && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS) && + if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TAGS) && isSelectStmt(pCxt->pCurrStmt) && 0 == taosArrayGetSize(pVgs)) { ((SSelectStmt*)pCxt->pCurrStmt)->isEmptyResult = true; } - if (TSDB_CODE_SUCCESS == code && 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) && !hasUserDbCond) { + if (TSDB_CODE_SUCCESS == code && (0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) || + 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS)) && !hasUserDbCond) { code = addMnodeToVgroupList(&pCxt->pParseCxt->mgmtEpSet, &pVgs); } From cc23ecedac7786fde741614ce3745a21f7435689 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 11 Jan 2023 14:50:18 +0800 Subject: [PATCH 059/139] fix:add logic for ins_columns --- include/common/tmsg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 678a744950..b9caed7a89 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -383,9 +383,9 @@ static FORCE_INLINE void tDeleteSSchemaWrapper(SSchemaWrapper* pSchemaWrapper) { } static FORCE_INLINE void tDeleteSSchemaWrapperForHash(void* pSchemaWrapper) { - if (pSchemaWrapper) { - taosMemoryFree(((SSchemaWrapper*)pSchemaWrapper)->pSchema); - taosMemoryFree(pSchemaWrapper); + if (pSchemaWrapper != NULL && *(SSchemaWrapper**)pSchemaWrapper != NULL) { + taosMemoryFree((*(SSchemaWrapper**)pSchemaWrapper)->pSchema); + taosMemoryFree(*(SSchemaWrapper**)pSchemaWrapper); } } From 1872627343b8d499707e6ec8688698363dca1ad0 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 11 Jan 2023 14:53:13 +0800 Subject: [PATCH 060/139] fix(tdb/ofp): upgrade large key ofp case --- source/libs/tdb/src/db/tdbBtree.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index 79d37b7674..029039f911 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -1063,11 +1063,11 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const } else { int nLeftKey = kLen; // pack partial key and nextPgno - memcpy(pCell + nHeader, pKey, nLocal - 4); - nLeft -= nLocal - 4; - nLeftKey -= nLocal - 4; + memcpy(pCell + nHeader, pKey, nLocal - nHeader - sizeof(pgno)); + nLeft -= nLocal - nHeader - sizeof(pgno); + nLeftKey -= nLocal - nHeader - sizeof(pgno); - memcpy(pCell + nHeader + nLocal - 4, &pgno, sizeof(pgno)); + memcpy(pCell + nLocal - sizeof(pgno), &pgno, sizeof(pgno)); int lastKeyPageSpace = 0; // pack left key & val to ovpages @@ -1087,9 +1087,12 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const if (lastKeyPage) { if (lastKeyPageSpace >= vLen) { - memcpy(pBuf + kLen - nLeftKey, pVal, vLen); + if (vLen > 0) { + memcpy(pBuf + kLen - nLeftKey, pVal, vLen); + + nLeft -= vLen; + } - nLeft -= vLen; pgno = 0; } else { memcpy(pBuf + kLen - nLeftKey, pVal, lastKeyPageSpace); @@ -1111,7 +1114,7 @@ static int tdbBtreeEncodePayload(SPage *pPage, SCell *pCell, int nHeader, const } } - memcpy(pBuf + kLen - nLeft, &pgno, sizeof(pgno)); + memcpy(pBuf + bytes, &pgno, sizeof(pgno)); ret = tdbPageInsertCell(ofp, 0, pBuf, bytes + sizeof(pgno), 0); if (ret < 0) { From 19e72938f63d91f75993c518d3beabbba5bc502b Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 11 Jan 2023 15:06:42 +0800 Subject: [PATCH 061/139] fix:add logic for ins_columns --- source/dnode/mnode/impl/src/mndStb.c | 5 +++++ source/libs/executor/src/sysscanoperator.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index b40b0e84aa..5567c48247 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -2966,6 +2966,7 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB int32_t cols = 0; int32_t numOfRows = buildSysDbColsInfo(pBlock); + mDebug("mndRetrieveStbCol get system table cols, rows:%d, db:%s", numOfRows, pShow->db); SDbObj *pDb = NULL; if (strlen(pShow->db) > 0) { pDb = mndAcquireDb(pMnode, pShow->db); @@ -2990,6 +2991,8 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB mndExtractTbNameFromStbFullName(pStb->name, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN); varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE])); + mDebug("mndRetrieveStbCol get stable cols, stable name:%s, db:%s", pStb->name, pStb->db); + char db[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; tNameFromString(&name, pStb->db, T_NAME_ACCT | T_NAME_DB); tNameGetDbName(&name, varDataVal(db)); @@ -3045,6 +3048,8 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB } pShow->numOfRows += numOfRows; + mDebug("mndRetrieveStbCol success, rows:%d, pShow->numOfRows:%d", numOfRows, pShow->numOfRows); + return numOfRows; } diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 6c31d5e592..e5d9e14d9f 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -419,6 +419,7 @@ static bool sysTableIsCondOnOneTable(SNode* pCond, char* condTable) { } static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { + qDebug("sysTableScanUserCols get cols start"); SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SSysTableScanInfo* pInfo = pOperator->info; if (pOperator->status == OP_EXEC_DONE) { @@ -517,6 +518,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { SSchemaWrapper *schemaRow = NULL; if(pInfo->pCur->mr.me.type == TSDB_SUPER_TABLE){ + qDebug("sysTableScanUserCols cursor get super table"); void *schema = taosHashGet(stableSchema, &pInfo->pCur->mr.me.uid, sizeof(int64_t)); if(schema == NULL){ SSchemaWrapper *schemaWrapper = tCloneSSchemaWrapper(&pInfo->pCur->mr.me.stbEntry.schemaRow); @@ -524,6 +526,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { } continue; }else if (pInfo->pCur->mr.me.type == TSDB_CHILD_TABLE) { + qDebug("sysTableScanUserCols cursor get child table"); STR_TO_VARSTR(typeName, "CHILD_TABLE"); STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); @@ -545,10 +548,12 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { schemaRow = &pInfo->pCur->mr.me.stbEntry.schemaRow; } }else if(pInfo->pCur->mr.me.type == TSDB_NORMAL_TABLE){ + qDebug("sysTableScanUserCols cursor get normal table"); schemaRow = &pInfo->pCur->mr.me.ntbEntry.schemaRow; STR_TO_VARSTR(typeName, "NORMAL_TABLE"); STR_TO_VARSTR(tableName, pInfo->pCur->mr.me.name); }else{ + qDebug("sysTableScanUserCols cursor get invalid table"); continue; } @@ -579,6 +584,8 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { } pInfo->loadInfo.totalRows += pInfo->pRes->info.rows; + qDebug("sysTableScanUserCols get cols success, rows:%" PRIu64, pInfo->loadInfo.totalRows); + return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes; } From ad02a39657d54b9ddd55c6394bff87115f0ee22b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 16:05:29 +0800 Subject: [PATCH 062/139] fix: minor changes --- source/dnode/mgmt/mgmt_mnode/src/mmFile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c index 1a91fe9d56..f06669a610 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmFile.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmFile.c @@ -26,7 +26,7 @@ static int32_t mmDecodeOption(SJson *pJson, SMnodeOpt *pOption) { if (code < 0) return 0; SJson *replicas = tjsonGetObjectItem(pJson, "replicas"); - if (replicas == NULL) return -1; + if (replicas == NULL) return 0; pOption->numOfReplicas = tjsonGetArraySize(replicas); for (int32_t i = 0; i < pOption->numOfReplicas; ++i) { From 7b331135cffb065599fcc1858306cc60caefc3bc Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 11 Jan 2023 16:16:05 +0800 Subject: [PATCH 063/139] fix(tdb/ofp): upgrade ofp cell with large key --- source/libs/tdb/src/db/tdbBtree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index 029039f911..4f0682a617 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -1316,11 +1316,11 @@ static int tdbBtreeDecodePayload(SPage *pPage, const SCell *pCell, int nHeader, } TDB_CELLDECODER_SET_FREE_KEY(pDecoder); - memcpy(pDecoder->pKey, pCell + nHeader, nLocal - 4); - nLeft -= nLocal - 4; - nLeftKey -= nLocal - 4; + memcpy(pDecoder->pKey, pCell + nHeader, nLocal - nHeader - sizeof(pgno)); + nLeft -= nLocal - nHeader - sizeof(pgno); + nLeftKey -= nLocal - nHeader - sizeof(pgno); - memcpy(&pgno, pCell + nHeader + nLocal - 4, sizeof(pgno)); + memcpy(&pgno, pCell + nLocal - sizeof(pgno), sizeof(pgno)); int lastKeyPageSpace = 0; // load left key & val to ovpages @@ -1346,9 +1346,11 @@ static int tdbBtreeDecodePayload(SPage *pPage, const SCell *pCell, int nHeader, if (lastKeyPage) { if (lastKeyPageSpace >= vLen) { - pDecoder->pVal = ofpCell + kLen - nLeftKey; + if (vLen > 0) { + pDecoder->pVal = ofpCell + kLen - nLeftKey; - nLeft -= vLen; + nLeft -= vLen; + } pgno = 0; } else { // read partial val to local From e9c213ff0f9345aeb595dbed03abc4eadefccd0c Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 16:37:45 +0800 Subject: [PATCH 064/139] fix: repeat malloc sdb raw --- source/dnode/mnode/impl/src/mndFunc.c | 2 +- source/dnode/mnode/sdb/src/sdbFile.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndFunc.c b/source/dnode/mnode/impl/src/mndFunc.c index 31f31a15ba..244e6058d4 100644 --- a/source/dnode/mnode/impl/src/mndFunc.c +++ b/source/dnode/mnode/impl/src/mndFunc.c @@ -293,7 +293,7 @@ static int32_t mndProcessCreateFuncReq(SRpcMsg *pReq) { goto _OVER; } - mInfo("func:%s, start to create", createReq.name); + mInfo("func:%s, start to create, size:%d", createReq.name, createReq.codeLen); if (mndCheckOperPrivilege(pMnode, pReq->info.conn.user, MND_OPER_CREATE_FUNC) != 0) { goto _OVER; } diff --git a/source/dnode/mnode/sdb/src/sdbFile.c b/source/dnode/mnode/sdb/src/sdbFile.c index 9e830b83e6..c2d7a9757a 100644 --- a/source/dnode/mnode/sdb/src/sdbFile.c +++ b/source/dnode/mnode/sdb/src/sdbFile.c @@ -228,11 +228,12 @@ static int32_t sdbReadFileImp(SSdb *pSdb) { int32_t readLen = 0; int64_t ret = 0; char file[PATH_MAX] = {0}; + int32_t bufLen = TSDB_MAX_MSG_SIZE; snprintf(file, sizeof(file), "%s%ssdb.data", pSdb->currDir, TD_DIRSEP); mInfo("start to read sdb file:%s", file); - SSdbRaw *pRaw = taosMemoryMalloc(TSDB_MAX_MSG_SIZE + 100); + SSdbRaw *pRaw = taosMemoryMalloc(bufLen + 100); if (pRaw == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; mError("failed read sdb file since %s", terrstr()); @@ -275,14 +276,15 @@ static int32_t sdbReadFileImp(SSdb *pSdb) { } readLen = pRaw->dataLen + sizeof(int32_t); - if (readLen >= pRaw->dataLen) { - SSdbRaw *pNewRaw = taosMemoryMalloc(pRaw->dataLen + TSDB_MAX_MSG_SIZE); + if (readLen >= bufLen) { + bufLen = pRaw->dataLen * 2; + SSdbRaw *pNewRaw = taosMemoryMalloc(bufLen + 100); if (pNewRaw == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; - mError("failed read sdb file since malloc new sdbRaw size:%d failed", pRaw->dataLen + TSDB_MAX_MSG_SIZE); + mError("failed read sdb file since malloc new sdbRaw size:%d failed", bufLen); goto _OVER; } - mInfo("malloc new sdbRaw size:%d, type:%d", pRaw->dataLen + TSDB_MAX_MSG_SIZE, pRaw->type); + mInfo("malloc new sdb raw size:%d, type:%d", bufLen, pRaw->type); memcpy(pNewRaw, pRaw, sizeof(SSdbRaw)); sdbFreeRaw(pRaw); pRaw = pNewRaw; From cff741e4c4b8c72476bf6f2857df33d98aab7544 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 11 Jan 2023 16:56:14 +0800 Subject: [PATCH 065/139] fix: coverity issues --- source/dnode/mgmt/mgmt_vnode/src/vmInt.c | 11 +++++------ source/dnode/mnode/impl/src/mndSma.c | 4 ++-- source/dnode/mnode/impl/src/mndSync.c | 3 --- source/dnode/mnode/impl/src/mndVgroup.c | 4 ++-- source/libs/sync/src/syncMain.c | 3 +-- source/util/src/tworker.c | 1 + 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 693fe97daa..99ba9b9b3b 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -343,13 +343,12 @@ static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) { int32_t numOfVnodes = 0; SVnodeObj **ppVnodes = vmGetVnodeListFromHash(pMgmt, &numOfVnodes); - for (int32_t i = 0; i < numOfVnodes; ++i) { - SVnodeObj *pVnode = ppVnodes[i]; - vnodeSyncCheckTimeout(pVnode->pImpl); - vmReleaseVnode(pMgmt, pVnode); - } - if (ppVnodes != NULL) { + for (int32_t i = 0; i < numOfVnodes; ++i) { + SVnodeObj *pVnode = ppVnodes[i]; + vnodeSyncCheckTimeout(pVnode->pImpl); + vmReleaseVnode(pMgmt, pVnode); + } taosMemoryFree(ppVnodes); } } diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index 141bb1df60..1aa93c6b6f 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -201,8 +201,8 @@ static SSdbRow *mndSmaActionDecode(SSdbRaw *pRaw) { terrno = 0; _OVER: - if (terrno != 0) { - mError("sma:%s, failed to decode from raw:%p since %s", pSma == NULL ? "null" : pSma->name, pRaw, terrstr()); + if (terrno != 0 && pSma != NULL) { + mError("sma:%s, failed to decode from raw:%p since %s", pSma->name, pRaw, terrstr()); taosMemoryFreeClear(pSma->expr); taosMemoryFreeClear(pSma->tagsFilter); taosMemoryFreeClear(pSma->sql); diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 93c9192bed..d10f97a524 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -271,9 +271,6 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) { int32_t mndInitSync(SMnode *pMnode) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; taosThreadMutexInit(&pMgmt->lock, NULL); - pMgmt->transId = 0; - pMgmt->transSec = 0; - pMgmt->transSeq = 0; SSyncInfo syncInfo = { .snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT, diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 2550c68cfb..54ea9e7b24 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -1441,10 +1441,10 @@ static int32_t mndRedistributeVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, { SSdbRaw *pRaw = mndVgroupActionEncode(&newVg); - if (pRaw == NULL) return -1; + if (pRaw == NULL) goto _OVER; if (mndTransAppendCommitlog(pTrans, pRaw) != 0) { sdbFreeRaw(pRaw); - return -1; + goto _OVER; } (void)sdbSetRawStatus(pRaw, SDB_STATUS_READY); } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index a339cb9857..239a87345a 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1703,8 +1703,7 @@ void syncNodeDoConfigChange(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncInde _END: // log end config change - sNInfo(pSyncNode, "end do config change, from %d to %d", pSyncNode->vgId, oldConfig.replicaNum, - pNewConfig->replicaNum); + sNInfo(pSyncNode, "end do config change, from %d to %d", oldConfig.replicaNum, pNewConfig->replicaNum); } // raft state change -------------- diff --git a/source/util/src/tworker.c b/source/util/src/tworker.c index a9a84c1860..bb2d59463d 100644 --- a/source/util/src/tworker.c +++ b/source/util/src/tworker.c @@ -228,6 +228,7 @@ STaosQueue *tAutoQWorkerAllocQueue(SAutoQWorkerPool *pool, void *ahandle, FItem taosMemoryFree(worker); taosCloseQueue(queue); terrno = TSDB_CODE_OUT_OF_MEMORY; + taosThreadMutexUnlock(&pool->mutex); return NULL; } worker->id = curWorkerNum; From 06c747c04014d342fba28870d2195b7fef2de468 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 11 Jan 2023 17:05:54 +0800 Subject: [PATCH 066/139] fix: wait for trans completion in testcase 5dnode3mnodeDrop.py --- .../system-test/6-cluster/5dnode3mnodeDrop.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/system-test/6-cluster/5dnode3mnodeDrop.py b/tests/system-test/6-cluster/5dnode3mnodeDrop.py index de9207ddd8..4f3916a487 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeDrop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeDrop.py @@ -112,7 +112,8 @@ class TDTestCase: dnode_first_port = dnode.cfgDict["firstEp"].split(":")[-1] cmd = f" taos -h {dnode_first_host} -P {dnode_first_port} -s ' create dnode \"{dnode_id} \" ' ;" tdLog.debug(cmd) - os.system(cmd) + if os.system(cmd) != 0: + raise Exception("failed to execute system command. cmd: %s" % cmd) time.sleep(2) tdLog.info(" create cluster with %d dnode done! " %dnodes_nums) @@ -292,6 +293,8 @@ class TDTestCase: tdLog.debug("drop mnode %d successfully"%(i+1)) break count+=1 + self.wait_for_transactions(20) + tdLog.debug("create mnode on dnode %d"%(i+1)) tdSql.execute("create mnode on dnode %d"%(i+1)) count=0 @@ -299,12 +302,24 @@ class TDTestCase: time.sleep(1) tdSql.query("select * from information_schema.ins_mnodes;") if tdSql.checkRows(3): - tdLog.debug("drop mnode %d successfully"%(i+1)) + tdLog.debug("create mnode %d successfully"%(i+1)) break count+=1 + self.wait_for_transactions(20) dropcount+=1 self.check3mnode() + def wait_for_transactions(self, timeout): + count=0 + while count= timeout: + tdLog.debug("transactions not finished before timeout (%d secs)", timeout) def getConnection(self, dnode): host = dnode.cfgDict["fqdn"] From 67a291955e96a31e09ea6970b5acc658c6006f98 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 11 Jan 2023 17:36:01 +0800 Subject: [PATCH 067/139] fix(query): initialize output buffer for each output. --- source/libs/executor/inc/executorimpl.h | 1 + source/libs/executor/src/eventwindowoperator.c | 2 ++ source/libs/executor/src/executorimpl.c | 14 ++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index d957dd987b..dcb4a8a0ed 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -729,6 +729,7 @@ void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle); void setTbNameColData(const SSDataBlock* pBlock, SColumnInfoData* pColInfoData, int32_t functionId, const char* name); void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numOfOutput, int32_t* rowEntryInfoOffset); +void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput); SResultRow* doSetResultOutBufByKey(SDiskbasedBuf* pResultBuf, SResultRowInfo* pResultRowInfo, char* pData, int16_t bytes, bool masterscan, uint64_t groupId, SExecTaskInfo* pTaskInfo, diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c index 1480ac0451..215636a567 100644 --- a/source/libs/executor/src/eventwindowoperator.c +++ b/source/libs/executor/src/eventwindowoperator.c @@ -213,6 +213,8 @@ static int32_t setSingleOutputTupleBufv1(SResultRowInfo* pResultRowInfo, STimeWi } (*pResult)->win = *win; + + clearResultRowInitFlag(pExprSup->pCtx, pExprSup->numOfExprs); setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 41f93a62c5..79ecd8189e 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -813,6 +813,20 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO } } +void clearResultRowInitFlag(SqlFunctionCtx* pCtx, int32_t numOfOutput) { + for (int32_t i = 0; i < numOfOutput; ++i) { + SResultRowEntryInfo* pResInfo = pCtx[i].resultInfo; + if (pResInfo == NULL) { + continue; + } + + pResInfo->initialized = false; + pResInfo->numOfRes = 0; + pResInfo->isNullRes = 0; + pResInfo->complete = false; + } +} + void doFilter(SSDataBlock* pBlock, SFilterInfo* pFilterInfo, SColMatchInfo* pColMatchInfo) { if (pFilterInfo == NULL || pBlock->info.rows == 0) { return; From 7efdc9e27a32e212bef13efa201c5d170c044f42 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 11 Jan 2023 18:00:36 +0800 Subject: [PATCH 068/139] fix(query): fix memory leak. --- .../libs/executor/src/eventwindowoperator.c | 19 +++++++++++++++++++ tests/script/tsim/query/event.sim | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c index 215636a567..0dbc05ceef 100644 --- a/source/libs/executor/src/eventwindowoperator.c +++ b/source/libs/executor/src/eventwindowoperator.c @@ -157,6 +157,20 @@ void destroyEWindowOperatorInfo(void* param) { return; } + if (pInfo->pRow != NULL) { + taosMemoryFree(pInfo->pRow); + } + + if (pInfo->pStartCondInfo != NULL) { + filterFreeInfo(pInfo->pStartCondInfo); + pInfo->pStartCondInfo = NULL; + } + + if (pInfo->pEndCondInfo != NULL) { + filterFreeInfo(pInfo->pEndCondInfo); + pInfo->pEndCondInfo = NULL; + } + cleanupBasicInfo(&pInfo->binfo); colDataDestroy(&pInfo->twAggSup.timeWindowData); @@ -315,4 +329,9 @@ void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInf } } } + + colDataDestroy(ps); + taosMemoryFree(ps); + colDataDestroy(pe); + taosMemoryFree(pe); } diff --git a/tests/script/tsim/query/event.sim b/tests/script/tsim/query/event.sim index c72b7ba125..adc94a34de 100644 --- a/tests/script/tsim/query/event.sim +++ b/tests/script/tsim/query/event.sim @@ -36,7 +36,7 @@ endi # child table: single row window print ====> select count(*) from tba1 event_window start with f1 = 0 end with f3 = false; sql select count(*) from tba1 event_window start with f1 = 0 end with f3 = false -if $rows != 1 then +if $rows != 2 then return -1 endi if $data00 != 1 then @@ -62,7 +62,7 @@ endi if $data00 != 2 then return -1 endi -if $data00 != 4 then +if $data10 != 4 then return -1 endi From 871a585a61e98fc0e84975d6898b1472c60c90b3 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 11 Jan 2023 18:28:45 +0800 Subject: [PATCH 069/139] enh: fsync each WAL log after appending when wal_level=2 and wal_fsync_period=0 --- source/libs/sync/src/syncRaftLog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/libs/sync/src/syncRaftLog.c b/source/libs/sync/src/syncRaftLog.c index 03c3fe154d..ca6d3c314f 100644 --- a/source/libs/sync/src/syncRaftLog.c +++ b/source/libs/sync/src/syncRaftLog.c @@ -192,6 +192,8 @@ SyncTerm raftLogLastTerm(struct SSyncLogStore* pLogStore) { return SYNC_TERM_INVALID; } +static inline bool raftLogForceSync(SSyncRaftEntry* pEntry) { return (pEntry->originalRpcType == TDMT_VND_COMMIT); } + static int32_t raftLogAppendEntry(struct SSyncLogStore* pLogStore, SSyncRaftEntry* pEntry) { SSyncLogStoreData* pData = pLogStore->data; SWal* pWal = pData->pWal; @@ -219,9 +221,8 @@ static int32_t raftLogAppendEntry(struct SSyncLogStore* pLogStore, SSyncRaftEntr ASSERT(pEntry->index == index); - if (pEntry->originalRpcType == TDMT_VND_COMMIT) { - walFsync(pWal, true); - } + bool forceSync = raftLogForceSync(pEntry); + walFsync(pWal, forceSync); sNTrace(pData->pSyncNode, "write index:%" PRId64 ", type:%s, origin type:%s, elapsed:%" PRId64, pEntry->index, TMSG_INFO(pEntry->msgType), TMSG_INFO(pEntry->originalRpcType), tsElapsed); From 672378f000024ea555234004949843f6e7e5e7dc Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 11 Jan 2023 18:54:43 +0800 Subject: [PATCH 070/139] fix:add logic for ins_columns --- source/common/src/systable.c | 2 +- source/dnode/mnode/impl/src/mndShow.c | 4 +++- source/dnode/mnode/impl/src/mndStb.c | 19 ++++++++----------- source/libs/executor/src/sysscanoperator.c | 22 ++++++++++------------ 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 4d45b69703..fe5fcfbe8a 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -178,8 +178,8 @@ static const SSysDbTableSchema userTagsSchema[] = { static const SSysDbTableSchema userColsSchema[] = { {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, - {.name = "table_type", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "table_type", .bytes = 21 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_name", .bytes = TSDB_COL_NAME_LEN - 1 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_type", .bytes = 32 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "col_length", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index cd8f41812b..c149d306e5 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -193,13 +193,15 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) { int32_t rowsToRead = SHOW_STEP_SIZE; int32_t size = 0; int32_t rowsRead = 0; - + mDebug("mndProcessRetrieveSysTableReq start"); SRetrieveTableReq retrieveReq = {0}; if (tDeserializeSRetrieveTableReq(pReq->pCont, pReq->contLen, &retrieveReq) != 0) { terrno = TSDB_CODE_INVALID_MSG; return -1; } + mDebug("mndProcessRetrieveSysTableReq tb:%s", retrieveReq.tb); + if (retrieveReq.showId == 0) { STableMetaRsp *pMeta = taosHashGet(pMnode->infosMeta, retrieveReq.tb, strlen(retrieveReq.tb)); if (pMeta == NULL) { diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 5567c48247..7a019f90ad 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -2903,13 +2903,13 @@ static int32_t buildDbColsInfoBlock(const SSDataBlock* p, const SSysTableMeta* p SColumnInfoData* pColInfoData = taosArrayGet(p->pDataBlock, 0); colDataAppend(pColInfoData, numOfRows, tName, false); - pColInfoData = taosArrayGet(p->pDataBlock, 1); - colDataAppend(pColInfoData, numOfRows, typeName, false); - // database name - pColInfoData = taosArrayGet(p->pDataBlock, 2); + pColInfoData = taosArrayGet(p->pDataBlock, 1); colDataAppend(pColInfoData, numOfRows, dName, false); + pColInfoData = taosArrayGet(p->pDataBlock, 2); + colDataAppend(pColInfoData, numOfRows, typeName, false); + // col name char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; STR_TO_VARSTR(colName, pm->schema[j].name); @@ -2963,7 +2963,6 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB SMnode *pMnode = pReq->info.node; SSdb *pSdb = pMnode->pSdb; SStbObj *pStb = NULL; - int32_t cols = 0; int32_t numOfRows = buildSysDbColsInfo(pBlock); mDebug("mndRetrieveStbCol get system table cols, rows:%d, db:%s", numOfRows, pShow->db); @@ -2984,8 +2983,6 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB continue; } - cols = 0; - SName name = {0}; char stbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; mndExtractTbNameFromStbFullName(pStb->name, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN); @@ -2999,14 +2996,15 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB varDataSetLen(db, strlen(varDataVal(db))); for(int i = 0; i < pStb->numOfColumns; i++){ + int32_t cols = 0; SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)stbName, false); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataAppend(pColInfo, numOfRows, typeName, false); + colDataAppend(pColInfo, numOfRows, (const char *)db, false); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); - colDataAppend(pColInfo, numOfRows, (const char *)db, false); + colDataAppend(pColInfo, numOfRows, typeName, false); // col name char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; @@ -3036,10 +3034,9 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppendNULL(pColInfo, numOfRows); } - + numOfRows++; } - numOfRows++; sdbRelease(pSdb, pStb); } diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index e5d9e14d9f..0402b1f186 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -67,7 +67,6 @@ typedef struct SSysTableScanInfo { SLoadRemoteDataInfo loadInfo; int32_t tbnameSlotId; - bool isGetStableCols; } SSysTableScanInfo; typedef struct { @@ -921,13 +920,13 @@ static int32_t sysTableUserColsFillOneTableCols(const SSysTableScanInfo* pInfo, pColInfoData = taosArrayGet(dataBlock->pDataBlock, 0); colDataAppend(pColInfoData, numOfRows, tName, false); - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 1); - colDataAppend(pColInfoData, numOfRows, tableType, false); - // database name - pColInfoData = taosArrayGet(dataBlock->pDataBlock, 2); + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 1); colDataAppend(pColInfoData, numOfRows, dbname, false); + pColInfoData = taosArrayGet(dataBlock->pDataBlock, 2); + colDataAppend(pColInfoData, numOfRows, tableType, false); + // col name char colName[TSDB_COL_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; STR_TO_VARSTR(colName, schemaRow->pSchema[i].name); @@ -1549,10 +1548,10 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { char dbName[TSDB_DB_NAME_LEN] = {0}; const char* name = tNameGetTableName(&pInfo->name); - if (pInfo->showRewrite) { - getDBNameFromCondition(pInfo->pCondition, dbName); - sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); - } + getDBNameFromCondition(pInfo->pCondition, dbName); + strcpy(pInfo->req.db, dbName); +// sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); + SSDataBlock* pBlock = NULL; if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0) { pBlock = sysTableScanUserTables(pOperator); @@ -1630,7 +1629,7 @@ static SSDataBlock* sysTableScanFromMNode(SOperatorInfo* pOperator, SSysTableSca tsem_wait(&pInfo->ready); if (pTaskInfo->code) { - qDebug("%s load meta data from mnode failed, totalRows:%" PRIu64 ", code:%s", GET_TASKID(pTaskInfo), + qError("%s load meta data from mnode failed, totalRows:%" PRIu64 ", code:%s", GET_TASKID(pTaskInfo), pInfo->loadInfo.totalRows, tstrerror(pTaskInfo->code)); return NULL; } @@ -1703,8 +1702,7 @@ SOperatorInfo* createSysTableScanOperatorInfo(void* readHandle, SSystemTableScan const char* name = tNameGetTableName(&pInfo->name); if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0 || - strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0 || - strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0) { + strncasecmp(name, TSDB_INS_TABLE_TAGS, TSDB_TABLE_FNAME_LEN) == 0) { pInfo->readHandle = *(SReadHandle*)readHandle; } else { tsem_init(&pInfo->ready, 0, 0); From 97ce96a2faf7cd8928c09fd8ec527abba0ddafe5 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 11 Jan 2023 19:24:51 +0800 Subject: [PATCH 071/139] enh: not fsync idx file in walFsync --- source/libs/wal/src/walWrite.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index db31692da9..d4ea526b78 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -637,11 +637,6 @@ int32_t walWrite(SWal *pWal, int64_t index, tmsg_t msgType, const void *body, in void walFsync(SWal *pWal, bool forceFsync) { taosThreadMutexLock(&pWal->mutex); if (forceFsync || (pWal->cfg.level == TAOS_WAL_FSYNC && pWal->cfg.fsyncPeriod == 0)) { - wTrace("vgId:%d, fileId:%" PRId64 ".idx, do fsync", pWal->cfg.vgId, walGetCurFileFirstVer(pWal)); - if (taosFsyncFile(pWal->pIdxFile) < 0) { - wError("vgId:%d, file:%" PRId64 ".idx, fsync failed since %s", pWal->cfg.vgId, walGetCurFileFirstVer(pWal), - strerror(errno)); - } wTrace("vgId:%d, fileId:%" PRId64 ".log, do fsync", pWal->cfg.vgId, walGetCurFileFirstVer(pWal)); if (taosFsyncFile(pWal->pLogFile) < 0) { wError("vgId:%d, file:%" PRId64 ".log, fsync failed since %s", pWal->cfg.vgId, walGetCurFileFirstVer(pWal), From 8af5230bc8e76cc1a02c428f017b04f40bf70dd2 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 11 Jan 2023 23:55:53 +0800 Subject: [PATCH 072/139] fix:add logic for ins_columns --- include/common/tmsg.h | 1 + source/common/src/tmsg.c | 2 ++ source/dnode/mnode/impl/inc/mndDef.h | 1 + source/dnode/mnode/impl/src/mndShow.c | 1 + source/dnode/mnode/impl/src/mndStb.c | 22 +++++++++++++++++----- source/libs/executor/src/sysscanoperator.c | 18 +++++++++++------- source/libs/parser/src/parAstParser.c | 2 +- source/libs/parser/src/parTranslater.c | 4 ++-- 8 files changed, 36 insertions(+), 15 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index b9caed7a89..54556b4df3 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1400,6 +1400,7 @@ typedef struct { char db[TSDB_DB_FNAME_LEN]; char tb[TSDB_TABLE_NAME_LEN]; char user[TSDB_USER_LEN]; + char filterTb[TSDB_TABLE_NAME_LEN]; int64_t showId; } SRetrieveTableReq; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 83f447fd0e..8c5d82a795 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3191,6 +3191,7 @@ int32_t tSerializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableReq if (tEncodeI64(&encoder, pReq->showId) < 0) return -1; if (tEncodeCStr(&encoder, pReq->db) < 0) return -1; if (tEncodeCStr(&encoder, pReq->tb) < 0) return -1; + if (tEncodeCStr(&encoder, pReq->filterTb) < 0) return -1; if (tEncodeCStr(&encoder, pReq->user) < 0) return -1; tEndEncode(&encoder); @@ -3207,6 +3208,7 @@ int32_t tDeserializeSRetrieveTableReq(void *buf, int32_t bufLen, SRetrieveTableR if (tDecodeI64(&decoder, &pReq->showId) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->tb) < 0) return -1; + if (tDecodeCStrTo(&decoder, pReq->filterTb) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->user) < 0) return -1; tEndDecode(&decoder); diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 2f824b48b4..1cbd9bfb66 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -444,6 +444,7 @@ typedef struct { STableMetaRsp* pMeta; bool sysDbRsp; char db[TSDB_DB_FNAME_LEN]; + char filterTb[TSDB_TABLE_NAME_LEN]; } SShowObj; typedef struct { diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index c149d306e5..48d8e89bfe 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -134,6 +134,7 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SRetrieveTableReq *pReq) { showObj.pMnode = pMnode; showObj.type = convertToRetrieveType(pReq->tb, tListLen(pReq->tb)); memcpy(showObj.db, pReq->db, TSDB_DB_FNAME_LEN); + strncpy(showObj.filterTb, pReq->filterTb, TSDB_TABLE_NAME_LEN); int32_t keepTime = tsShellActivityTimer * 6 * 1000; SShowObj *pShow = taosCachePut(pMgmt->cache, &showId, sizeof(int64_t), &showObj, size, keepTime); diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 7a019f90ad..c243e83a15 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -2882,7 +2882,7 @@ static int32_t mndRetrieveStb(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc } static int32_t buildDbColsInfoBlock(const SSDataBlock* p, const SSysTableMeta* pSysDbTableMeta, size_t size, - const char* dbName) { + const char* dbName, const char* tbName) { char tName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; char dName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; @@ -2896,6 +2896,10 @@ static int32_t buildDbColsInfoBlock(const SSDataBlock* p, const SSysTableMeta* p // if (pm->sysInfo) { // continue; // } + if(tbName[0] && strncmp(tbName, pm->name, TSDB_TABLE_NAME_LEN) != 0){ + continue; + } + STR_TO_VARSTR(tName, pm->name); for(int32_t j = 0; j < pm->colNum; j++){ @@ -2946,15 +2950,19 @@ static int32_t buildDbColsInfoBlock(const SSDataBlock* p, const SSysTableMeta* p return numOfRows; } -static int32_t buildSysDbColsInfo(SSDataBlock* p) { +static int32_t buildSysDbColsInfo(SSDataBlock* p, char* db, char* tb) { size_t size = 0; const SSysTableMeta* pSysDbTableMeta = NULL; + if(db[0] && strncmp(db, TSDB_INFORMATION_SCHEMA_DB, TSDB_DB_FNAME_LEN) != 0 && strncmp(db, TSDB_PERFORMANCE_SCHEMA_DB, TSDB_DB_FNAME_LEN) != 0){ + return p->info.rows; + } + getInfosDbMeta(&pSysDbTableMeta, &size); - p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_INFORMATION_SCHEMA_DB); + p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_INFORMATION_SCHEMA_DB, tb); getPerfDbMeta(&pSysDbTableMeta, &size); - p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_PERFORMANCE_SCHEMA_DB); + p->info.rows = buildDbColsInfoBlock(p, pSysDbTableMeta, size, TSDB_PERFORMANCE_SCHEMA_DB, tb); return p->info.rows; } @@ -2964,7 +2972,7 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB SSdb *pSdb = pMnode->pSdb; SStbObj *pStb = NULL; - int32_t numOfRows = buildSysDbColsInfo(pBlock); + int32_t numOfRows = buildSysDbColsInfo(pBlock, pShow->db, pShow->filterTb); mDebug("mndRetrieveStbCol get system table cols, rows:%d, db:%s", numOfRows, pShow->db); SDbObj *pDb = NULL; if (strlen(pShow->db) > 0) { @@ -2986,6 +2994,10 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB SName name = {0}; char stbName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; mndExtractTbNameFromStbFullName(pStb->name, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN); + if(pShow->filterTb[0] && strncmp(pShow->filterTb, &stbName[VARSTR_HEADER_SIZE], TSDB_TABLE_NAME_LEN) != 0){ + sdbRelease(pSdb, pStb); + continue; + } varDataSetLen(stbName, strlen(&stbName[VARSTR_HEADER_SIZE])); mDebug("mndRetrieveStbCol get stable cols, stable name:%s, db:%s", pStb->name, pStb->db); diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 0402b1f186..bb10aa8028 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -442,15 +442,14 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { tNameGetDbName(&sn, varDataVal(dbname)); varDataSetLen(dbname, strlen(varDataVal(dbname))); - char condTableName[TSDB_TABLE_NAME_LEN] = {0}; // optimize when sql like where table_name='tablename' and xxx. - if (pInfo->pCondition && sysTableIsCondOnOneTable(pInfo->pCondition, condTableName)) { + if (pInfo->req.filterTb[0]) { char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; - STR_TO_VARSTR(tableName, condTableName); + STR_TO_VARSTR(tableName, pInfo->req.filterTb); SMetaReader smrTable = {0}; metaReaderInit(&smrTable, pInfo->readHandle.meta, 0); - int32_t code = metaGetTableEntryByName(&smrTable, condTableName); + int32_t code = metaGetTableEntryByName(&smrTable, pInfo->req.filterTb); if (code != TSDB_CODE_SUCCESS) { // terrno has been set by metaGetTableEntryByName, therefore, return directly metaReaderClear(&smrTable); @@ -1548,9 +1547,14 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) { char dbName[TSDB_DB_NAME_LEN] = {0}; const char* name = tNameGetTableName(&pInfo->name); - getDBNameFromCondition(pInfo->pCondition, dbName); - strcpy(pInfo->req.db, dbName); -// sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); + if (pInfo->showRewrite) { + getDBNameFromCondition(pInfo->pCondition, dbName); + sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); + }else if(strncasecmp(name, TSDB_INS_TABLE_COLS, TSDB_TABLE_FNAME_LEN) == 0){ + getDBNameFromCondition(pInfo->pCondition, dbName); + if(dbName[0]) sprintf(pInfo->req.db, "%d.%s", pInfo->accountId, dbName); + sysTableIsCondOnOneTable(pInfo->pCondition, pInfo->req.filterTb); + } SSDataBlock* pBlock = NULL; if (strncasecmp(name, TSDB_INS_TABLE_TABLES, TSDB_TABLE_FNAME_LEN) == 0) { diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index fae62626fa..126027c78f 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -166,7 +166,7 @@ static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, const c code = reserveDnodeRequiredInCache(pCxt->pMetaCache); } if (TSDB_CODE_SUCCESS == code && - (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS) || 0 == strcmp(pTable, TSDB_INS_TABLE_TABLES)) && + (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS) || 0 == strcmp(pTable, TSDB_INS_TABLE_TABLES) || 0 == strcmp(pTable, TSDB_INS_TABLE_COLS)) && QUERY_NODE_SELECT_STMT == nodeType(pCxt->pStmt)) { code = collectMetaKeyFromInsTags(pCxt); } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index e222bb4690..4bd3f06d1f 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -2278,8 +2278,8 @@ static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName, ((SSelectStmt*)pCxt->pCurrStmt)->isEmptyResult = true; } - if (TSDB_CODE_SUCCESS == code && (0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) || - 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS)) && !hasUserDbCond) { + if (TSDB_CODE_SUCCESS == code && (0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) && !hasUserDbCond) || + 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS)) { code = addMnodeToVgroupList(&pCxt->pParseCxt->mgmtEpSet, &pVgs); } From 50bb847ff90fb411a91634b9e1d06349de28474f Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Thu, 12 Jan 2023 09:06:58 +0800 Subject: [PATCH 073/139] fix: no stable null group when no normal table --- source/libs/executor/src/scanoperator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index eb38299938..d5b83c07b0 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -3222,7 +3222,9 @@ static void buildVnodeGroupedNtbTableCount(STableCountScanOperatorInfo* pInfo, S uint64_t groupId = calcGroupId(fullStbName, strlen(fullStbName)); pRes->info.id.groupId = groupId; int64_t ntbNum = metaGetNtbNum(pInfo->readHandle.meta); - fillTableCountScanDataBlock(pSupp, dbName, "", ntbNum, pRes); + if (ntbNum != 0) { + fillTableCountScanDataBlock(pSupp, dbName, "", ntbNum, pRes); + } } static void buildVnodeGroupedStbTableCount(STableCountScanOperatorInfo* pInfo, STableCountScanSupp* pSupp, From 040c975eb2c1305f7b1b8b8d0deb5ddc60569511 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 12 Jan 2023 15:13:49 +0800 Subject: [PATCH 074/139] fix: memory leak in mnode --- source/dnode/mnode/impl/src/mndSync.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 93c9192bed..8581d5fe8b 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -369,6 +369,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { if (pMgmt->transId != 0) { mError("trans:%d, can't be proposed since trans:%d already waiting for confirm", transId, pMgmt->transId); taosThreadMutexUnlock(&pMgmt->lock); + rpcFreeCont(req.pCont); terrno = TSDB_CODE_MND_LAST_TRANS_NOT_FINISHED; return terrno; } From c8b04f27f0aa0429eb9b8750c83ffc526dbf7a5b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 12 Jan 2023 15:19:52 +0800 Subject: [PATCH 075/139] fix: reset timeout def --- include/util/tdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/util/tdef.h b/include/util/tdef.h index 9626180b99..3a152a36a1 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -499,7 +499,7 @@ enum { #define DEFAULT_PAGESIZE 4096 #define VNODE_TIMEOUT_SEC 60 -#define MNODE_TIMEOUT_SEC 10 +#define MNODE_TIMEOUT_SEC 60 #ifdef __cplusplus } From e6b403148724a67761da5bb80c88d64f4901fd4e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 12 Jan 2023 16:04:57 +0800 Subject: [PATCH 076/139] fix: coverity issues --- source/dnode/mnode/impl/src/mndSma.c | 14 ++++++++------ source/dnode/mnode/impl/src/mndSync.c | 5 +++++ source/util/src/tworker.c | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index 1aa93c6b6f..fe0dc9e857 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -201,12 +201,14 @@ static SSdbRow *mndSmaActionDecode(SSdbRaw *pRaw) { terrno = 0; _OVER: - if (terrno != 0 && pSma != NULL) { - mError("sma:%s, failed to decode from raw:%p since %s", pSma->name, pRaw, terrstr()); - taosMemoryFreeClear(pSma->expr); - taosMemoryFreeClear(pSma->tagsFilter); - taosMemoryFreeClear(pSma->sql); - taosMemoryFreeClear(pSma->ast); + if (terrno != 0) { + if (pSma != NULL) { + mError("sma:%s, failed to decode from raw:%p since %s", pSma->name, pRaw, terrstr()); + taosMemoryFreeClear(pSma->expr); + taosMemoryFreeClear(pSma->tagsFilter); + taosMemoryFreeClear(pSma->sql); + taosMemoryFreeClear(pSma->ast); + } taosMemoryFreeClear(pRow); return NULL; } diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 66d9bdd684..7dc0912403 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -271,6 +271,11 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) { int32_t mndInitSync(SMnode *pMnode) { SSyncMgmt *pMgmt = &pMnode->syncMgmt; taosThreadMutexInit(&pMgmt->lock, NULL); + taosThreadMutexLock(&pMgmt->lock); + pMgmt->transId = 0; + pMgmt->transSec = 0; + pMgmt->transSeq = 0; + taosThreadMutexUnlock(&pMgmt->lock); SSyncInfo syncInfo = { .snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT, diff --git a/source/util/src/tworker.c b/source/util/src/tworker.c index bb2d59463d..5581931178 100644 --- a/source/util/src/tworker.c +++ b/source/util/src/tworker.c @@ -227,8 +227,8 @@ STaosQueue *tAutoQWorkerAllocQueue(SAutoQWorkerPool *pool, void *ahandle, FItem uError("worker:%s:%d failed to create", pool->name, curWorkerNum); taosMemoryFree(worker); taosCloseQueue(queue); - terrno = TSDB_CODE_OUT_OF_MEMORY; taosThreadMutexUnlock(&pool->mutex); + terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } worker->id = curWorkerNum; From cd0404bc25204477c9f836eb9b7d17266bcbdadd Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 12 Jan 2023 17:07:10 +0800 Subject: [PATCH 077/139] refact: adjust return value of tmsgUpdateDnodeInfo --- include/common/tmsgcb.h | 4 ++-- source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 2 +- source/dnode/mgmt/node_util/inc/dmUtil.h | 2 +- source/dnode/mgmt/node_util/src/dmEps.c | 8 ++++---- source/dnode/mnode/impl/src/mndMnode.c | 2 +- source/dnode/mnode/impl/src/mndSync.c | 2 +- source/dnode/vnode/src/vnd/vnodeOpen.c | 2 +- source/libs/sync/src/syncMain.c | 2 +- source/libs/transport/src/tmsgcb.c | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/common/tmsgcb.h b/include/common/tmsgcb.h index a1ebd855cd..7cf092b144 100644 --- a/include/common/tmsgcb.h +++ b/include/common/tmsgcb.h @@ -39,7 +39,7 @@ typedef enum { QUEUE_MAX, } EQueueType; -typedef int32_t (*UpdateDnodeInfoFp)(void* pData, int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); +typedef void (*UpdateDnodeInfoFp)(void* pData, int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); typedef int32_t (*PutToQueueFp)(void* pMgmt, EQueueType qtype, SRpcMsg* pMsg); typedef int32_t (*GetQueueSizeFp)(void* pMgmt, int32_t vgId, EQueueType qtype); typedef int32_t (*SendReqFp)(const SEpSet* pEpSet, SRpcMsg* pMsg); @@ -70,7 +70,7 @@ void tmsgSendRsp(SRpcMsg* pMsg); void tmsgRegisterBrokenLinkArg(SRpcMsg* pMsg); void tmsgReleaseHandle(SRpcHandleInfo* pHandle, int8_t type); void tmsgReportStartup(const char* name, const char* desc); -int32_t tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); +void tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); #ifdef __cplusplus } diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 3ce37a5f8e..220e55f7f3 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -137,7 +137,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) { pNode->nodeId = pCreate->replicas[i].id; pNode->nodePort = pCreate->replicas[i].port; tstrncpy(pNode->nodeFqdn, pCreate->replicas[i].fqdn, TSDB_FQDN_LEN); - (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); } } diff --git a/source/dnode/mgmt/node_util/inc/dmUtil.h b/source/dnode/mgmt/node_util/inc/dmUtil.h index 92b66230e3..8ecce20f53 100644 --- a/source/dnode/mgmt/node_util/inc/dmUtil.h +++ b/source/dnode/mgmt/node_util/inc/dmUtil.h @@ -167,7 +167,7 @@ void dmUpdateEps(SDnodeData *pData, SArray *pDnodeEps); void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); void dmGetMnodeEpSetForRedirect(SDnodeData *pData, SRpcMsg *pMsg, SEpSet *pEpSet); void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); -int32_t dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port); +void dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port); #ifdef __cplusplus } diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 7bae703753..9640c0b5c9 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -332,7 +332,7 @@ void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet) { } } -int32_t dmUpdateDnodeInfo(void *data, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port) { +void dmUpdateDnodeInfo(void *data, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port) { SDnodeData *pData = data; int32_t ret = -1; taosThreadRwlockRdlock(&pData->lock); @@ -342,7 +342,7 @@ int32_t dmUpdateDnodeInfo(void *data, int32_t *dnodeId, int64_t *clusterId, char if (strcmp(pDnodeEp->ep.fqdn, fqdn) == 0 && pDnodeEp->ep.port == *port) { dInfo("dnode:%s:%u, update dnodeId from %d to %d", fqdn, *port, *dnodeId, pDnodeEp->id); *dnodeId = pDnodeEp->id; - *clusterId = pData->clusterId; + if (clusterId != NULL) *clusterId = pData->clusterId; ret = 0; } } @@ -360,12 +360,12 @@ int32_t dmUpdateDnodeInfo(void *data, int32_t *dnodeId, int64_t *clusterId, char dInfo("dnode:%d, update port from %u to %u", *dnodeId, *port, pDnodeEp->ep.port); *port = pDnodeEp->ep.port; } - *clusterId = pData->clusterId; + if (clusterId != NULL) *clusterId = pData->clusterId; ret = 0; } else { dInfo("dnode:%d, failed to update dnode info", *dnodeId); } } taosThreadRwlockUnlock(&pData->lock); - return ret; + // return ret; } \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index add32fd335..7dcd287fb7 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -747,7 +747,7 @@ static void mndReloadSyncConfig(SMnode *pMnode) { pNode->clusterId = mndGetClusterId(pMnode); pNode->nodePort = pObj->pDnode->port; tstrncpy(pNode->nodeFqdn, pObj->pDnode->fqdn, TSDB_FQDN_LEN); - (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); mInfo("vgId:1, ep:%s:%u dnode:%d", pNode->nodeFqdn, pNode->nodePort, pNode->nodeId); if (pObj->pDnode->id == pMnode->selfDnodeId) { cfg.myIndex = cfg.replicaNum; diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 8581d5fe8b..c429d49fef 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -301,7 +301,7 @@ int32_t mndInitSync(SMnode *pMnode) { pNode->nodeId = pMgmt->replicas[i].id; pNode->nodePort = pMgmt->replicas[i].port; tstrncpy(pNode->nodeFqdn, pMgmt->replicas[i].fqdn, sizeof(pNode->nodeFqdn)); - (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); mInfo("vgId:1, index:%d ep:%s:%u dnode:%d cluster:%" PRId64, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId, pNode->clusterId); } diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 8c07d0cec7..58d9f1a049 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -86,7 +86,7 @@ int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs) { pNode->nodeId = pReq->replicas[i].id; pNode->nodePort = pReq->replicas[i].port; tstrncpy(pNode->nodeFqdn, pReq->replicas[i].fqdn, sizeof(pNode->nodeFqdn)); - (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); vInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d", pReq->vgId, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId); } diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index a339cb9857..65937fcfad 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -898,7 +898,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { sInfo("vgId:%d, start to open sync node, replica:%d selfIndex:%d", pSyncNode->vgId, pCfg->replicaNum, pCfg->myIndex); for (int32_t i = 0; i < pCfg->replicaNum; ++i) { SNodeInfo* pNode = &pCfg->nodeInfo[i]; - (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); sInfo("vgId:%d, index:%d ep:%s:%u dnode:%d cluster:%" PRId64, pSyncNode->vgId, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId, pNode->clusterId); } diff --git a/source/libs/transport/src/tmsgcb.c b/source/libs/transport/src/tmsgcb.c index 4131619ed9..eea0d87684 100644 --- a/source/libs/transport/src/tmsgcb.c +++ b/source/libs/transport/src/tmsgcb.c @@ -59,6 +59,6 @@ void tmsgReleaseHandle(SRpcHandleInfo* pHandle, int8_t type) { (*defaultMsgCb.re void tmsgReportStartup(const char* name, const char* desc) { (*defaultMsgCb.reportStartupFp)(name, desc); } -int32_t tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port) { - return (*defaultMsgCb.updateDnodeInfoFp)(defaultMsgCb.data, dnodeId, clusterId, fqdn, port); +void tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port) { + (*defaultMsgCb.updateDnodeInfoFp)(defaultMsgCb.data, dnodeId, clusterId, fqdn, port); } From 7451ab7e5d83c3c81aeed6e36d1b49939dbe06a7 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 12 Jan 2023 18:06:15 +0800 Subject: [PATCH 078/139] fix: taosbenchmark sanitize for main (#19530) --- cmake/taostools_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index d01928cfe8..bc3fe87884 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG 5aa25e9 + GIT_TAG f80dd7e SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From a696cd9f7d0b304d1b9c5da7d3e3826c9a50e30b Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 12 Jan 2023 18:06:56 +0800 Subject: [PATCH 079/139] fix: taosbenchmark sanitize (#19529) * fix: taosbenchmark sanitize 6a15f64 * fix: update taos-tools 97c2a09 * fix: update taos-tools 11fa5c1 * fix: update taos-tools 00ee0ec * fix: update taos-tools ec64787 * fix: update taos-tools f80dd7e --- cmake/taostools_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 599b508c93..bc3fe87884 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG 94d6895 + GIT_TAG f80dd7e SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From 7411643c8ecc84089c1dbaea58df1f11f6b5eb0f Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 12 Jan 2023 18:24:01 +0800 Subject: [PATCH 080/139] test:modify failed cases in ci --- tests/system-test/2-query/nestedQuery.py | 6 +++--- tests/system-test/2-query/stablity.py | 6 +++--- tests/system-test/6-cluster/5dnode3mnodeDrop.py | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/system-test/2-query/nestedQuery.py b/tests/system-test/2-query/nestedQuery.py index 3d0db9a562..6557aad05f 100755 --- a/tests/system-test/2-query/nestedQuery.py +++ b/tests/system-test/2-query/nestedQuery.py @@ -24,9 +24,9 @@ from util.dnodes import tdDnodes from util.dnodes import * class TDTestCase: - updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 , - "jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143, - "wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"fnDebugFlag":143} + updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 131 ,"cDebugFlag":131,"uDebugFlag":131 ,"rpcDebugFlag":131 , "tmrDebugFlag":131 , + "jniDebugFlag":131 ,"simDebugFlag":131,"dDebugFlag":131, "dDebugFlag":131,"vDebugFlag":131,"mDebugFlag":131,"qDebugFlag":131, + "wDebugFlag":131,"sDebugFlag":131,"tsdbDebugFlag":131,"tqDebugFlag":131 ,"fsDebugFlag":131 ,"fnDebugFlag":131} def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) diff --git a/tests/system-test/2-query/stablity.py b/tests/system-test/2-query/stablity.py index ff026bf120..5e4d5dcbaf 100755 --- a/tests/system-test/2-query/stablity.py +++ b/tests/system-test/2-query/stablity.py @@ -24,9 +24,9 @@ from util.dnodes import tdDnodes from util.dnodes import * class TDTestCase: - updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 , - "jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143, - "wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"fnDebugFlag":143} + updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 131 ,"cDebugFlag":131,"uDebugFlag":131 ,"rpcDebugFlag":131 , "tmrDebugFlag":131 , + "jniDebugFlag":131 ,"simDebugFlag":131,"dDebugFlag":131, "dDebugFlag":131,"vDebugFlag":131,"mDebugFlag":131,"qDebugFlag":131, + "wDebugFlag":131,"sDebugFlag":131,"tsdbDebugFlag":131,"tqDebugFlag":131 ,"fsDebugFlag":131 ,"fnDebugFlag":131} def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) diff --git a/tests/system-test/6-cluster/5dnode3mnodeDrop.py b/tests/system-test/6-cluster/5dnode3mnodeDrop.py index 4f3916a487..45830af698 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeDrop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeDrop.py @@ -314,7 +314,8 @@ class TDTestCase: while count Date: Thu, 12 Jan 2023 21:13:15 +0800 Subject: [PATCH 081/139] fix: tsma transaction refactor --- source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 4 ++++ source/dnode/mnode/impl/src/mndSma.c | 18 ++++++++++++++++-- source/dnode/vnode/src/sma/smaTimeRange.c | 4 +--- source/libs/executor/src/scanoperator.c | 1 + .../script/tsim/sma/tsmaCreateInsertQuery.sim | 1 + 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 3ce37a5f8e..e2887d979c 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -157,6 +157,7 @@ static int32_t vmTsmaAdjustDays(SVnodeCfg *pCfg, SCreateVnodeReq *pReq) { return 0; } +#if 0 static int32_t vmTsmaProcessCreate(SVnode *pVnode, SCreateVnodeReq *pReq) { if (pReq->isTsma) { SMsgHead *smaMsg = pReq->pTsma; @@ -165,6 +166,7 @@ static int32_t vmTsmaProcessCreate(SVnode *pVnode, SCreateVnodeReq *pReq) { } return 0; } +#endif int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SCreateVnodeReq req = {0}; @@ -245,12 +247,14 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { goto _OVER; } +#if 0 code = vmTsmaProcessCreate(pImpl, &req); if (code != 0) { dError("vgId:%d, failed to create tsma since %s", req.vgId, terrstr()); code = terrno; goto _OVER; } +#endif code = vnodeStart(pImpl); if (code != 0) { diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index 141bb1df60..bc806aa5d0 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -457,8 +457,10 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans, int32_t contLen = 0; void *pReq = mndBuildCreateVnodeReq(pMnode, pDnode, pDb, pVgroup, &contLen); - taosMemoryFreeClear(pSmaReq); - if (pReq == NULL) return -1; + if (pReq == NULL) { + taosMemoryFreeClear(pSmaReq); + return -1; + } action.pCont = pReq; action.contLen = contLen; @@ -466,6 +468,18 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans, action.acceptableCode = TSDB_CODE_VND_ALREADY_EXIST; if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFreeClear(pSmaReq); + taosMemoryFree(pReq); + return -1; + } + + action.pCont = pSmaReq; + action.contLen = smaContLen; + action.msgType = TDMT_VND_CREATE_SMA; + action.acceptableCode = TSDB_CODE_TSMA_ALREADY_EXIST; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFreeClear(pSmaReq); taosMemoryFree(pReq); return -1; } diff --git a/source/dnode/vnode/src/sma/smaTimeRange.c b/source/dnode/vnode/src/sma/smaTimeRange.c index 65c3bf3095..2702d11949 100644 --- a/source/dnode/vnode/src/sma/smaTimeRange.c +++ b/source/dnode/vnode/src/sma/smaTimeRange.c @@ -25,14 +25,13 @@ static int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char * static int32_t tdProcessTSmaInsertImpl(SSma *pSma, int64_t indexUid, const char *msg); static int32_t tdProcessTSmaGetDaysImpl(SVnodeCfg *pCfg, void *pCont, uint32_t contLen, int32_t *days); -// TODO: Who is responsible for resource allocate and release? int32_t tdProcessTSmaInsert(SSma *pSma, int64_t indexUid, const char *msg) { int32_t code = TSDB_CODE_SUCCESS; if ((code = tdProcessTSmaInsertImpl(pSma, indexUid, msg)) < 0) { smaWarn("vgId:%d, insert tsma data failed since %s", SMA_VID(pSma), tstrerror(terrno)); } - // TODO: destroy SSDataBlocks(msg) + return code; } @@ -42,7 +41,6 @@ int32_t tdProcessTSmaCreate(SSma *pSma, int64_t version, const char *msg) { if ((code = tdProcessTSmaCreateImpl(pSma, version, msg)) < 0) { smaWarn("vgId:%d, create tsma failed since %s", SMA_VID(pSma), tstrerror(terrno)); } - // TODO: destroy SSDataBlocks(msg) return code; } diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index deae38b331..ef6733a4f2 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1716,6 +1716,7 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { /*resetTableScanInfo(pTSInfo, pWin);*/ tsdbReaderClose(pTSInfo->base.dataReader); pTSInfo->base.dataReader = NULL; + pInfo->pTableScanOp->status = OP_OPENED; pTSInfo->scanTimes = 0; pTSInfo->currentGroupId = -1; diff --git a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim index 442b4970e4..118ca42808 100644 --- a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim +++ b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim @@ -6,6 +6,7 @@ sql connect print =============== create database sql create database d1 keep 36500d vgroups 1 +sql alter local 'querySmaOptimize' '1'; sql use d1 print =============== create super table, include column type for count/sum/min/max/first From 707ad8f397f2e8e2e4de6d9ba5722ed61044f06e Mon Sep 17 00:00:00 2001 From: kailixu Date: Thu, 12 Jan 2023 21:20:53 +0800 Subject: [PATCH 082/139] fix: dismiss double free --- source/dnode/mnode/impl/src/mndSma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index bc806aa5d0..d7205e6497 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -480,7 +480,6 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans, if (mndTransAppendRedoAction(pTrans, &action) != 0) { taosMemoryFreeClear(pSmaReq); - taosMemoryFree(pReq); return -1; } From b5e4861c50bdd5b32f0759ba8a7087b13d27224c Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 12 Jan 2023 23:57:06 +0800 Subject: [PATCH 083/139] fix:add test cases for odbc interface --- source/client/src/clientMain.c | 6 +-- tests/parallel_test/cases.task | 1 + tests/system-test/2-query/odbc.py | 76 +++++++++++++++++++++++++++++++ utils/test/c/CMakeLists.txt | 9 ++++ utils/test/c/get_db_name_test.c | 65 ++++++++++++++++++++++++++ 5 files changed, 153 insertions(+), 4 deletions(-) create mode 100644 tests/system-test/2-query/odbc.py create mode 100644 utils/test/c/get_db_name_test.c diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 70b6b22c84..2da079b873 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -698,10 +698,8 @@ int taos_get_current_db(TAOS *taos, char *database, int len, int *required) { if(database == NULL || len <= 0){ if(required != NULL) *required = strlen(pTscObj->db) + 1; terrno = TSDB_CODE_INVALID_PARA; - return -1; - } - - if(len < strlen(pTscObj->db) + 1){ + code = -1; + }else if(len < strlen(pTscObj->db) + 1){ tstrncpy(database, pTscObj->db, len); if(required) *required = strlen(pTscObj->db) + 1; terrno = TSDB_CODE_INVALID_PARA; diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index d55e4f919b..6f18fd3b33 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1044,6 +1044,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -Q 4 +,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/odbc.py ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 4 ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py diff --git a/tests/system-test/2-query/odbc.py b/tests/system-test/2-query/odbc.py new file mode 100644 index 0000000000..09000fb3d2 --- /dev/null +++ b/tests/system-test/2-query/odbc.py @@ -0,0 +1,76 @@ +import taos +import sys +import datetime +import inspect + +from util.log import * +from util.sql import * +from util.cases import * +from util.common import tdCom + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + self.replicaVar = int(replicaVar) + tdLog.debug(f"start to excute {__file__}") + tdSql.init(conn.cursor(), False) + + def check_ins_cols(self): + tdSql.execute("create database if not exists db") + tdSql.execute("create table db.ntb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 tinyint unsigned, c7 smallint unsigned, c8 int unsigned, c9 bigint unsigned, c10 float, c11 double, c12 varchar(100), c13 nchar(100))") + tdSql.execute("create table db.stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 tinyint unsigned, c7 smallint unsigned, c8 int unsigned, c9 bigint unsigned, c10 float, c11 double, c12 varchar(100), c13 nchar(100)) tags(t int)") + tdSql.execute("insert into db.ctb using db.stb tags(1) (ts, c1) values (now, 1)") + + tdSql.query("select count(*) from information_schema.ins_columns") + tdSql.checkData(0, 0, 265) + + tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'") + tdSql.checkRows(14) + tdSql.checkData(0, 2, "NORMAL_TABLE") + + + tdSql.query("select * from information_schema.ins_columns where table_name = 'stb'") + tdSql.checkRows(14) + tdSql.checkData(0, 2, "SUPER_TABLE") + + + tdSql.query("select db_name,table_type,col_name,col_type,col_length from information_schema.ins_columns where table_name = 'ctb'") + tdSql.checkRows(14) + tdSql.checkData(0, 0, "db") + tdSql.checkData(1, 1, "CHILD_TABLE") + tdSql.checkData(3, 2, "c3") + tdSql.checkData(4, 3, "INT") + tdSql.checkData(5, 4, 8) + + tdSql.query("desc information_schema.ins_columns") + tdSql.checkRows(9) + tdSql.checkData(0, 0, "table_name") + tdSql.checkData(5, 0, "col_length") + tdSql.checkData(1, 2, 64) + + def check_get_db_name(self): + buildPath = tdCom.getBuildPath() + cmdStr = '%s/build/bin/get_db_name_test'%(buildPath) + tdLog.info(cmdStr) + ret = os.system(cmdStr) + if ret != 0: + tdLog.exit("sml_test get_db_name_test != 0") + + def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring + tdSql.prepare(replica = self.replicaVar) + + tdLog.printNoPrefix("==========start check_ins_cols run ...............") + self.check_ins_cols() + tdLog.printNoPrefix("==========end check_ins_cols run ...............") + + tdLog.printNoPrefix("==========start check_get_db_name run ...............") + self.check_get_db_name() + tdLog.printNoPrefix("==========end check_get_db_name run ...............") + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase()) diff --git a/utils/test/c/CMakeLists.txt b/utils/test/c/CMakeLists.txt index b048b79e9b..6ca266c555 100644 --- a/utils/test/c/CMakeLists.txt +++ b/utils/test/c/CMakeLists.txt @@ -4,6 +4,7 @@ add_executable(tmq_sim tmqSim.c) add_executable(create_table createTable.c) add_executable(tmq_taosx_ci tmq_taosx_ci.c) add_executable(sml_test sml_test.c) +add_executable(get_db_name_test get_db_name_test.c) target_link_libraries( create_table PUBLIC taos_static @@ -40,3 +41,11 @@ target_link_libraries( PUBLIC common PUBLIC os ) + +target_link_libraries( + get_db_name_test + PUBLIC taos_static + PUBLIC util + PUBLIC common + PUBLIC os +) diff --git a/utils/test/c/get_db_name_test.c b/utils/test/c/get_db_name_test.c new file mode 100644 index 0000000000..4802ef25c3 --- /dev/null +++ b/utils/test/c/get_db_name_test.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include +#include "taos.h" +#include "types.h" +#include "tlog.h" + +int get_db_test() { + TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0); + + TAOS_RES *pRes = taos_query(taos, "create database if not exists sml_db"); + taos_free_result(pRes); + + pRes = taos_query(taos, "use sml_db"); + int code = taos_errno(pRes); + taos_free_result(pRes); + ASSERT(code == 0); + + code = taos_get_current_db(taos, NULL, 0, NULL); + ASSERT(code != 0); + + int required = 0; + code = taos_get_current_db(taos, NULL, 0, &required); + ASSERT(code != 0); + ASSERT(required == 7); + + char database[10] = {0}; + code = taos_get_current_db(taos, database, 3, &required); + ASSERT(code != 0); + ASSERT(required == 7); + ASSERT(strcpy(database, "sm")); + + char database1[10] = {0}; + code = taos_get_current_db(taos, database1, 10, &required); + ASSERT(code == 0); + ASSERT(strcpy(database1, "sml_db")); + + taos_close(taos); + + return code; +} + +int main(int argc, char *argv[]) { + int ret = 0; + ret = get_db_test(); + ASSERT(!ret); + return ret; +} From 6851a7db0441e7231308731098b3b450b73ef619 Mon Sep 17 00:00:00 2001 From: kailixu Date: Fri, 13 Jan 2023 02:12:04 +0800 Subject: [PATCH 084/139] fix: memory leak --- source/common/src/tmsg.c | 2 +- source/dnode/vnode/src/sma/smaTimeRange.c | 36 +++++++++++------------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 83f447fd0e..2c4fc98750 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3001,7 +3001,7 @@ int32_t tSerializeSTableIndexRsp(void *buf, int32_t bufLen, const STableIndexRsp void tFreeSerializeSTableIndexRsp(STableIndexRsp *pRsp) { if (pRsp->pIndex != NULL) { - taosArrayDestroy(pRsp->pIndex); + tFreeSTableIndexRsp(pRsp); pRsp->pIndex = NULL; } } diff --git a/source/dnode/vnode/src/sma/smaTimeRange.c b/source/dnode/vnode/src/sma/smaTimeRange.c index 2702d11949..1b191dd5a5 100644 --- a/source/dnode/vnode/src/sma/smaTimeRange.c +++ b/source/dnode/vnode/src/sma/smaTimeRange.c @@ -256,28 +256,23 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema * int32_t rows = pDataBlock->info.rows; - SSubmitTbData *pTbData = (SSubmitTbData *)taosMemoryCalloc(1, sizeof(SSubmitTbData)); - if (!pTbData) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto _end; - } + SSubmitTbData tbData = {0}; + - if (!(pTbData->aRowP = taosArrayInit(rows, sizeof(SRow *)))) { - taosMemoryFree(pTbData); + if (!(tbData.aRowP = taosArrayInit(rows, sizeof(SRow *)))) { goto _end; } - pTbData->suid = suid; - pTbData->uid = 0; // uid is assigned by vnode - pTbData->sver = pTSchema->version; + tbData.suid = suid; + tbData.uid = 0; // uid is assigned by vnode + tbData.sver = pTSchema->version; if (createTb) { - pTbData->pCreateTbReq = taosArrayGetP(createTbArray, i); - if (pTbData->pCreateTbReq) pTbData->flags = SUBMIT_REQ_AUTO_CREATE_TABLE; + tbData.pCreateTbReq = taosArrayGetP(createTbArray, i); + if (tbData.pCreateTbReq) tbData.flags = SUBMIT_REQ_AUTO_CREATE_TABLE; } if (!pVals && !(pVals = taosArrayInit(pTSchema->numOfCols, sizeof(SColVal)))) { - taosArrayDestroy(pTbData->aRowP); - taosMemoryFree(pTbData); + taosArrayDestroy(tbData.aRowP); goto _end; } @@ -305,14 +300,13 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema * } SRow *pRow = NULL; if ((terrno = tRowBuild(pVals, (STSchema *)pTSchema, &pRow)) < 0) { - tDestroySSubmitTbData(pTbData, TSDB_MSG_FLG_ENCODE); + tDestroySSubmitTbData(&tbData, TSDB_MSG_FLG_ENCODE); goto _end; } - ASSERT(pRow); - taosArrayPush(pTbData->aRowP, &pRow); + taosArrayPush(tbData.aRowP, &pRow); } - taosArrayPush(pReq->aSubmitTbData, pTbData); + taosArrayPush(pReq->aSubmitTbData, &tbData); } // encode @@ -334,9 +328,13 @@ int32_t smaBlockToSubmit(SVnode *pVnode, const SArray *pBlocks, const STSchema * tEncoderClear(&encoder); } _end: + taosArrayDestroy(createTbArray); taosArrayDestroy(tagArray); taosArrayDestroy(pVals); - tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE); + if (pReq) { + tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE); + taosMemoryFree(pReq); + } if (terrno != 0) { rpcFreeCont(pBuf); From 718f777edce771b6fb95f195c5844a0c83f93f5a Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 13 Jan 2023 09:49:24 +0800 Subject: [PATCH 085/139] enhance: add test case for table count scan --- .../develop-test/2-query/table_count_scan.py | 238 ++++++++++++++++ tests/develop-test/table_count_scan.py | 256 ++++++++++++++++++ tests/parallel_test/cases.task | 1 + 3 files changed, 495 insertions(+) create mode 100644 tests/develop-test/2-query/table_count_scan.py create mode 100644 tests/develop-test/table_count_scan.py diff --git a/tests/develop-test/2-query/table_count_scan.py b/tests/develop-test/2-query/table_count_scan.py new file mode 100644 index 0000000000..6260f9eea1 --- /dev/null +++ b/tests/develop-test/2-query/table_count_scan.py @@ -0,0 +1,238 @@ +import sys +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import tdDnodes +from math import inf + +class TDTestCase: + def caseDescription(self): + ''' + case1: [TD-11204]Difference improvement that can ignore negative + ''' + return + + def init(self, conn, logSql, replicaVer=1): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), False) + self._conn = conn + + def restartTaosd(self, index=1, dbname="db"): + tdDnodes.stop(index) + tdDnodes.startWithoutSleep(index) + tdSql.execute(f"use tbl_count") + + def run(self): + print("running {}".format(__file__)) + tdSql.execute("drop database if exists tbl_count") + tdSql.execute("create database if not exists tbl_count") + tdSql.execute('use tbl_count') + tdSql.execute('create table stb1 (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') + + tdSql.execute("create table tb1 using stb1 tags(1,'1',1.0);") + + tdSql.execute("create table tb2 using stb1 tags(2,'2',2.0);") + + tdSql.execute("create table tb3 using stb1 tags(3,'3',3.0);") + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"123","1234",1,1,1,1);') + + tdSql.execute("insert into tb1 values ('2021-11-11 09:00:01',true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);") + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:02\',true,2,NULL,2,NULL,2,NULL,"234",NULL,2,NULL,2,NULL);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:03\',false,NULL,3,NULL,3,NULL,3,NULL,"3456",NULL,3,NULL,3);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:04\',true,4,4,4,4,4,4,"456","4567",4,4,4,4);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:05\',true,127,32767,2147483647,9223372036854775807,3.402823466e+38,1.79769e+308,"567","5678",254,65534,4294967294,9223372036854775807);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:06\',true,-127,-32767,-2147483647,-9223372036854775807,-3.402823466e+38,-1.79769e+308,"678","6789",0,0,0,0);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:01\',true,2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:02\',true,3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:04\',true,5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:05\',true,6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:06\',true,7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 1, 'information_schema') + tdSql.checkData(0, 2, None) + tdSql.checkData(1, 0, 3) + tdSql.checkData(1, 1, 'tbl_count') + tdSql.checkData(1, 2, 'stb1') + tdSql.checkData(2, 0, 5) + tdSql.checkData(2, 1, 'performance_schema') + tdSql.checkData(2, 2, None) + + tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 1, 'information_schema') + tdSql.checkData(0, 2, None) + tdSql.checkData(1, 0, 5) + tdSql.checkData(1, 1, 'performance_schema') + tdSql.checkData(1, 2, None) + tdSql.checkData(2, 0, 3) + tdSql.checkData(2, 1, 'tbl_count') + tdSql.checkData(2, 2, 'stb1') + + tdSql.query('select count(1),db_name from information_schema.ins_tables group by db_name') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 5) + tdSql.checkData(0, 1, 'performance_schema') + tdSql.checkData(1, 0, 3) + tdSql.checkData(1, 1, 'tbl_count') + tdSql.checkData(2, 0, 23) + tdSql.checkData(2, 1, 'information_schema') + + tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 3) + + tdSql.query('select count(*) from information_schema.ins_tables where db_name=\'tbl_count\' and stable_name="stb1";') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 3) + + tdSql.query('select count(*) from information_schema.ins_tables') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 31) + + + tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') + + tdSql.execute("create table tba1 using stba tags(1,'1',1.0);") + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:00\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:01\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:02\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:04\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:05\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:06\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:07\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:08\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:09\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') + + self.restartTaosd(1, dbname='tbl_count') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:10\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:11\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:12\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:13\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:14\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:15\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:16\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:17\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:18\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:19\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') + + self.restartTaosd(1, dbname='tbl_count') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:20\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:21\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:22\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:23\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:24\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:25\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:26\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:27\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:28\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:29\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') + + tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(4) + tdSql.checkData(0, 0, 1) + tdSql.checkData(0, 1, 'tbl_count') + tdSql.checkData(0, 2, 'stba') + tdSql.checkData(1, 0, 23) + tdSql.checkData(1, 1, 'information_schema') + tdSql.checkData(1, 2, None) + tdSql.checkData(2, 0, 3) + tdSql.checkData(2, 1, 'tbl_count') + tdSql.checkData(2, 2, 'stb1') + tdSql.checkData(3, 0, 5) + tdSql.checkData(3, 1, 'performance_schema') + tdSql.checkData(3, 2, None) + + tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(4) + tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 1, 'information_schema') + tdSql.checkData(0, 2, None) + tdSql.checkData(1, 0, 5) + tdSql.checkData(1, 1, 'performance_schema') + tdSql.checkData(1, 2, None) + tdSql.checkData(2, 0, 1) + tdSql.checkData(2, 1, 'tbl_count') + tdSql.checkData(2, 2, 'stba') + tdSql.checkData(3, 0, 3) + tdSql.checkData(3, 1, 'tbl_count') + tdSql.checkData(3, 2, 'stb1') + + tdSql.query('select count(1),db_name from information_schema.ins_tables group by db_name') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 5) + tdSql.checkData(0, 1, 'performance_schema') + tdSql.checkData(1, 0, 4) + tdSql.checkData(1, 1, 'tbl_count') + tdSql.checkData(2, 0, 23) + tdSql.checkData(2, 1, 'information_schema') + + tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 4) + + tdSql.query('select count(*) from information_schema.ins_tables where db_name=\'tbl_count\' and stable_name="stb1";') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 3) + + tdSql.query('select count(*) from information_schema.ins_tables') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 32) + + + tdSql.execute('drop database tbl_count') + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/develop-test/table_count_scan.py b/tests/develop-test/table_count_scan.py new file mode 100644 index 0000000000..9ea9a24213 --- /dev/null +++ b/tests/develop-test/table_count_scan.py @@ -0,0 +1,256 @@ +import sys +from util.log import * +from util.cases import * +from util.sql import * +from util.dnodes import tdDnodes +from math import inf + +class TDTestCase: + def caseDescription(self): + ''' + case1: [TD-11204]Difference improvement that can ignore negative + ''' + return + + def init(self, conn, logSql, replicaVer=1): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), False) + self._conn = conn + + def restartTaosd(self, index=1, dbname="db"): + tdDnodes.stop(index) + tdDnodes.startWithoutSleep(index) + tdSql.execute(f"use tbl_count") + + def run(self): + print("running {}".format(__file__)) + tdSql.execute("drop database if exists tbl_count") + tdSql.execute("create database if not exists tbl_count") + tdSql.execute('use tbl_count') + tdSql.execute('create table stb1 (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') + + tdSql.execute("create table tb1 using stb1 tags(1,'1',1.0);") + + tdSql.execute("create table tb2 using stb1 tags(2,'2',2.0);") + + tdSql.execute("create table tb3 using stb1 tags(3,'3',3.0);") + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"123","1234",1,1,1,1);') + + tdSql.execute("insert into tb1 values ('2021-11-11 09:00:01',true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);") + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:02\',true,2,NULL,2,NULL,2,NULL,"234",NULL,2,NULL,2,NULL);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:03\',false,NULL,3,NULL,3,NULL,3,NULL,"3456",NULL,3,NULL,3);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:04\',true,4,4,4,4,4,4,"456","4567",4,4,4,4);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:05\',true,127,32767,2147483647,9223372036854775807,3.402823466e+38,1.79769e+308,"567","5678",254,65534,4294967294,9223372036854775807);') + + tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:06\',true,-127,-32767,-2147483647,-9223372036854775807,-3.402823466e+38,-1.79769e+308,"678","6789",0,0,0,0);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:01\',true,2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:02\',true,3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:04\',true,5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:05\',true,6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:06\',true,7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 1, 'information_schema') + tdSql.checkData(0, 2, None) + tdSql.checkData(1, 0, 3) + tdSql.checkData(1, 1, 'tbl_count') + tdSql.checkData(1, 2, 'stb1') + tdSql.checkData(2, 0, 5) + tdSql.checkData(2, 1, 'performance_schema') + tdSql.checkData(2, 2, None) + + tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 1, 'information_schema') + tdSql.checkData(0, 2, None) + tdSql.checkData(1, 0, 5) + tdSql.checkData(1, 1, 'performance_schema') + tdSql.checkData(1, 2, None) + tdSql.checkData(2, 0, 3) + tdSql.checkData(2, 1, 'tbl_count') + tdSql.checkData(2, 2, 'stb1') + + tdSql.query('select count(1),db_name from information_schema.ins_tables group by db_name') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 5) + tdSql.checkData(0, 1, 'performance_schema') + tdSql.checkData(1, 0, 3) + tdSql.checkData(1, 1, 'tbl_count') + tdSql.checkData(2, 0, 23) + tdSql.checkData(2, 1, 'information_schema') + + tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 3) + + tdSql.query('select count(*) from information_schema.ins_tables where db_name=\'tbl_count\' and stable_name="stb1";') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 3) + + tdSql.query('select count(*) from information_schema.ins_tables') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 31) + + + tdSql.execute('create table tbn (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned);') + + tdSql.execute('insert into tbn values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tbn values (\'2021-11-11 09:00:01\',true,2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tbn values (\'2021-11-11 09:00:02\',true,3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tbn values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tbn values (\'2021-11-11 09:00:04\',true,5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') + + tdSql.execute("create table tba1 using stba tags(1,'1',1.0);") + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:00\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:01\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:02\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:04\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:05\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:06\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:07\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:08\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:09\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') + + self.restartTaosd(1, dbname='tbl_count') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:10\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:11\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:12\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:13\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:14\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:15\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:16\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:17\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:18\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:19\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') + + self.restartTaosd(1, dbname='tbl_count') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:20\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:21\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:22\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:23\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:24\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:25\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:26\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:27\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:28\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') + + tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:29\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') + + tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(5) + tdSql.checkData(0, 0, 1) + tdSql.checkData(0, 1, 'tbl_count') + tdSql.checkData(0, 2, 'stba') + tdSql.checkData(1, 0, 23) + tdSql.checkData(1, 1, 'information_schema') + tdSql.checkData(1, 2, None) + tdSql.checkData(2, 0, 3) + tdSql.checkData(2, 1, 'tbl_count') + tdSql.checkData(2, 2, 'stb1') + tdSql.checkData(3, 0, 1) + tdSql.checkData(3, 1, 'tbl_count') + tdSql.checkData(3, 2, None) + tdSql.checkData(4, 0, 5) + tdSql.checkData(4, 1, 'performance_schema') + tdSql.checkData(4, 2, None) + + tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') + tdSql.checkRows(5) + tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 1, 'information_schema') + tdSql.checkData(0, 2, None) + tdSql.checkData(1, 0, 1) + tdSql.checkData(1, 1, 'tbl_count') + tdSql.checkData(1, 2, None) + tdSql.checkData(2, 0, 5) + tdSql.checkData(2, 1, 'performance_schema') + tdSql.checkData(2, 2, None) + tdSql.checkData(3, 0, 1) + tdSql.checkData(3, 1, 'tbl_count') + tdSql.checkData(3, 2, 'stba') + tdSql.checkData(4, 0, 3) + tdSql.checkData(4, 1, 'tbl_count') + tdSql.checkData(4, 2, 'stb1') + + tdSql.query('select count(1),db_name from information_schema.ins_tables group by db_name') + tdSql.checkRows(3) + tdSql.checkData(0, 0, 5) + tdSql.checkData(0, 1, 'performance_schema') + tdSql.checkData(1, 0, 5) + tdSql.checkData(1, 1, 'tbl_count') + tdSql.checkData(2, 0, 23) + tdSql.checkData(2, 1, 'information_schema') + + tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 5) + + tdSql.query('select count(*) from information_schema.ins_tables where db_name=\'tbl_count\' and stable_name="stb1";') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 3) + + tdSql.query('select count(*) from information_schema.ins_tables') + tdSql.checkRows(1) + tdSql.checkData(0, 0, 33) + + + tdSql.execute('drop database tbl_count') + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index c8a42e11b8..63f1b69fb8 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1050,6 +1050,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py #develop test +,,y,develop-test,python3 ./test.py -f 2-query/table_count_scan.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py From f40865980a9c0e6b4cf2e8da1e1e698f5a9f6282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Fri, 13 Jan 2023 10:02:14 +0800 Subject: [PATCH 086/139] test: refine query cases --- tests/parallel_test/cases.task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index c8a42e11b8..6213a9619a 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -669,7 +669,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 6 -M 3 -n 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3 -,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 +#,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 From b9e6be4e7a3e1e6a088c08ccc4563824f81c3e98 Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 13 Jan 2023 10:03:26 +0800 Subject: [PATCH 087/139] fix: remove redundant table count scan --- tests/develop-test/table_count_scan.py | 256 ------------------------- 1 file changed, 256 deletions(-) delete mode 100644 tests/develop-test/table_count_scan.py diff --git a/tests/develop-test/table_count_scan.py b/tests/develop-test/table_count_scan.py deleted file mode 100644 index 9ea9a24213..0000000000 --- a/tests/develop-test/table_count_scan.py +++ /dev/null @@ -1,256 +0,0 @@ -import sys -from util.log import * -from util.cases import * -from util.sql import * -from util.dnodes import tdDnodes -from math import inf - -class TDTestCase: - def caseDescription(self): - ''' - case1: [TD-11204]Difference improvement that can ignore negative - ''' - return - - def init(self, conn, logSql, replicaVer=1): - tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor(), False) - self._conn = conn - - def restartTaosd(self, index=1, dbname="db"): - tdDnodes.stop(index) - tdDnodes.startWithoutSleep(index) - tdSql.execute(f"use tbl_count") - - def run(self): - print("running {}".format(__file__)) - tdSql.execute("drop database if exists tbl_count") - tdSql.execute("create database if not exists tbl_count") - tdSql.execute('use tbl_count') - tdSql.execute('create table stb1 (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') - - tdSql.execute("create table tb1 using stb1 tags(1,'1',1.0);") - - tdSql.execute("create table tb2 using stb1 tags(2,'2',2.0);") - - tdSql.execute("create table tb3 using stb1 tags(3,'3',3.0);") - - tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"123","1234",1,1,1,1);') - - tdSql.execute("insert into tb1 values ('2021-11-11 09:00:01',true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);") - - tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:02\',true,2,NULL,2,NULL,2,NULL,"234",NULL,2,NULL,2,NULL);') - - tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:03\',false,NULL,3,NULL,3,NULL,3,NULL,"3456",NULL,3,NULL,3);') - - tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:04\',true,4,4,4,4,4,4,"456","4567",4,4,4,4);') - - tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:05\',true,127,32767,2147483647,9223372036854775807,3.402823466e+38,1.79769e+308,"567","5678",254,65534,4294967294,9223372036854775807);') - - tdSql.execute('insert into tb1 values (\'2021-11-11 09:00:06\',true,-127,-32767,-2147483647,-9223372036854775807,-3.402823466e+38,-1.79769e+308,"678","6789",0,0,0,0);') - - tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"111","1111",1,1,1,1);') - - tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:01\',true,2,2,2,2,2,2,"222","2222",2,2,2,2);') - - tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:02\',true,3,3,2,3,3,3,"333","3333",3,3,3,3);') - - tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') - - tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:04\',true,5,5,5,5,5,5,"555","5555",5,5,5,5);') - - tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:05\',true,6,6,6,6,6,6,"666","6666",6,6,6,6);') - - tdSql.execute('insert into tb2 values (\'2021-11-11 09:00:06\',true,7,7,7,7,7,7,"777","7777",7,7,7,7);') - - tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') - tdSql.checkRows(3) - tdSql.checkData(0, 0, 23) - tdSql.checkData(0, 1, 'information_schema') - tdSql.checkData(0, 2, None) - tdSql.checkData(1, 0, 3) - tdSql.checkData(1, 1, 'tbl_count') - tdSql.checkData(1, 2, 'stb1') - tdSql.checkData(2, 0, 5) - tdSql.checkData(2, 1, 'performance_schema') - tdSql.checkData(2, 2, None) - - tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') - tdSql.checkRows(3) - tdSql.checkData(0, 0, 23) - tdSql.checkData(0, 1, 'information_schema') - tdSql.checkData(0, 2, None) - tdSql.checkData(1, 0, 5) - tdSql.checkData(1, 1, 'performance_schema') - tdSql.checkData(1, 2, None) - tdSql.checkData(2, 0, 3) - tdSql.checkData(2, 1, 'tbl_count') - tdSql.checkData(2, 2, 'stb1') - - tdSql.query('select count(1),db_name from information_schema.ins_tables group by db_name') - tdSql.checkRows(3) - tdSql.checkData(0, 0, 5) - tdSql.checkData(0, 1, 'performance_schema') - tdSql.checkData(1, 0, 3) - tdSql.checkData(1, 1, 'tbl_count') - tdSql.checkData(2, 0, 23) - tdSql.checkData(2, 1, 'information_schema') - - tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") - tdSql.checkRows(1) - tdSql.checkData(0, 0, 3) - - tdSql.query('select count(*) from information_schema.ins_tables where db_name=\'tbl_count\' and stable_name="stb1";') - tdSql.checkRows(1) - tdSql.checkData(0, 0, 3) - - tdSql.query('select count(*) from information_schema.ins_tables') - tdSql.checkRows(1) - tdSql.checkData(0, 0, 31) - - - tdSql.execute('create table tbn (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned);') - - tdSql.execute('insert into tbn values (\'2021-11-11 09:00:00\',true,1,1,1,1,1,1,"111","1111",1,1,1,1);') - - tdSql.execute('insert into tbn values (\'2021-11-11 09:00:01\',true,2,2,2,2,2,2,"222","2222",2,2,2,2);') - - tdSql.execute('insert into tbn values (\'2021-11-11 09:00:02\',true,3,3,2,3,3,3,"333","3333",3,3,3,3);') - - tdSql.execute('insert into tbn values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') - - tdSql.execute('insert into tbn values (\'2021-11-11 09:00:04\',true,5,5,5,5,5,5,"555","5555",5,5,5,5);') - - tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') - - tdSql.execute("create table tba1 using stba tags(1,'1',1.0);") - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:00\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:01\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:02\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:03\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:04\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:05\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:06\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:07\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:08\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:09\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') - - self.restartTaosd(1, dbname='tbl_count') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:10\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:11\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:12\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:13\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:14\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:15\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:16\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:17\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:18\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:19\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') - - self.restartTaosd(1, dbname='tbl_count') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:20\',true, 1,1,1,1,1,1,"111","1111",1,1,1,1);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:21\',true, 2,2,2,2,2,2,"222","2222",2,2,2,2);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:22\',true, 3,3,2,3,3,3,"333","3333",3,3,3,3);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:23\',false,4,4,4,4,4,4,"444","4444",4,4,4,4);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:24\',true, 5,5,5,5,5,5,"555","5555",5,5,5,5);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:25\',true, 6,6,6,6,6,6,"666","6666",6,6,6,6);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:26\',true, 7,7,7,7,7,7,"777","7777",7,7,7,7);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:27\',true, 8,8,8,8,8,8,"888","8888",8,8,8,8);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:28\',true, 9,9,9,9,9,9,"999","9999",9,9,9,9);') - - tdSql.execute('insert into tba1 values (\'2021-11-11 09:00:29\',true, 0,0,0,0,0,0,"000","0000",0,0,0,0);') - - tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') - tdSql.checkRows(5) - tdSql.checkData(0, 0, 1) - tdSql.checkData(0, 1, 'tbl_count') - tdSql.checkData(0, 2, 'stba') - tdSql.checkData(1, 0, 23) - tdSql.checkData(1, 1, 'information_schema') - tdSql.checkData(1, 2, None) - tdSql.checkData(2, 0, 3) - tdSql.checkData(2, 1, 'tbl_count') - tdSql.checkData(2, 2, 'stb1') - tdSql.checkData(3, 0, 1) - tdSql.checkData(3, 1, 'tbl_count') - tdSql.checkData(3, 2, None) - tdSql.checkData(4, 0, 5) - tdSql.checkData(4, 1, 'performance_schema') - tdSql.checkData(4, 2, None) - - tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') - tdSql.checkRows(5) - tdSql.checkData(0, 0, 23) - tdSql.checkData(0, 1, 'information_schema') - tdSql.checkData(0, 2, None) - tdSql.checkData(1, 0, 1) - tdSql.checkData(1, 1, 'tbl_count') - tdSql.checkData(1, 2, None) - tdSql.checkData(2, 0, 5) - tdSql.checkData(2, 1, 'performance_schema') - tdSql.checkData(2, 2, None) - tdSql.checkData(3, 0, 1) - tdSql.checkData(3, 1, 'tbl_count') - tdSql.checkData(3, 2, 'stba') - tdSql.checkData(4, 0, 3) - tdSql.checkData(4, 1, 'tbl_count') - tdSql.checkData(4, 2, 'stb1') - - tdSql.query('select count(1),db_name from information_schema.ins_tables group by db_name') - tdSql.checkRows(3) - tdSql.checkData(0, 0, 5) - tdSql.checkData(0, 1, 'performance_schema') - tdSql.checkData(1, 0, 5) - tdSql.checkData(1, 1, 'tbl_count') - tdSql.checkData(2, 0, 23) - tdSql.checkData(2, 1, 'information_schema') - - tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") - tdSql.checkRows(1) - tdSql.checkData(0, 0, 5) - - tdSql.query('select count(*) from information_schema.ins_tables where db_name=\'tbl_count\' and stable_name="stb1";') - tdSql.checkRows(1) - tdSql.checkData(0, 0, 3) - - tdSql.query('select count(*) from information_schema.ins_tables') - tdSql.checkRows(1) - tdSql.checkData(0, 0, 33) - - - tdSql.execute('drop database tbl_count') - def stop(self): - tdSql.close() - tdLog.success("%s successfully executed" % __file__) - -tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) From c1bb36c1ded9cd79166885e474b4e4abe9d510d0 Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 13 Jan 2023 10:13:39 +0800 Subject: [PATCH 088/139] fix: modify test case description --- tests/develop-test/2-query/table_count_scan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/develop-test/2-query/table_count_scan.py b/tests/develop-test/2-query/table_count_scan.py index 6260f9eea1..1ef65bfc67 100644 --- a/tests/develop-test/2-query/table_count_scan.py +++ b/tests/develop-test/2-query/table_count_scan.py @@ -8,7 +8,7 @@ from math import inf class TDTestCase: def caseDescription(self): ''' - case1: [TD-11204]Difference improvement that can ignore negative + case1: [TD-21890] table count scan test case ''' return From 5714b5ef5e84449f2056e09c862d1732ff816b3a Mon Sep 17 00:00:00 2001 From: Hui Li <52318143+plum-lihui@users.noreply.github.com> Date: Fri, 13 Jan 2023 10:14:43 +0800 Subject: [PATCH 089/139] test: refine query cases #19549 test: refine query cases #19549 --- tests/parallel_test/cases.task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index c2810dbffc..66a71bfae1 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -675,7 +675,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 7 -M 3 -C 6 -n 3 -,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 +#,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 From 3ec1560faadbfa61643c9c917202f672a24186ee Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Thu, 12 Jan 2023 18:02:09 +0800 Subject: [PATCH 090/139] create stream and use existing super table --- include/common/tmsg.h | 7 +- include/libs/qcom/query.h | 6 + source/common/src/tmsg.c | 2 + source/dnode/mnode/impl/src/mndStream.c | 38 ++- source/dnode/vnode/src/tq/tqSink.c | 81 +++-- source/libs/parser/src/parTranslater.c | 8 +- tests/parallel_test/cases.task | 4 +- .../script/tsim/stream/checkStreamSTable.sim | 310 ++++++++++++++++++ .../{tableAndTag0.sim => udTableAndTag0.sim} | 99 ++++++ .../{tableAndTag1.sim => udTableAndTag1.sim} | 98 ++++++ 10 files changed, 611 insertions(+), 42 deletions(-) create mode 100644 tests/script/tsim/stream/checkStreamSTable.sim rename tests/script/tsim/stream/{tableAndTag0.sim => udTableAndTag0.sim} (73%) rename tests/script/tsim/stream/{tableAndTag1.sim => udTableAndTag1.sim} (74%) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 800f9e2eb7..cf57165e54 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -343,7 +343,8 @@ void tFreeSSubmitRsp(SSubmitRsp* pRsp); #define COL_IS_SET(FLG) (((FLG) & (COL_SET_VAL | COL_SET_NULL)) != 0) #define COL_CLR_SET(FLG) ((FLG) &= (~(COL_SET_VAL | COL_SET_NULL))) -#define IS_BSMA_ON(s) (((s)->flags & 0x01) == COL_SMA_ON) +#define IS_BSMA_ON(s) (((s)->flags & 0x01) == COL_SMA_ON) +#define IS_SET_NULL(s) (((s)->flags & COL_SET_NULL) == COL_SET_NULL) #define SSCHMEA_TYPE(s) ((s)->type) #define SSCHMEA_FLAGS(s) ((s)->flags) @@ -1771,7 +1772,9 @@ typedef struct { // 3.0.20 int64_t checkpointFreq; // ms // 3.0.2.3 - int8_t createStb; + int8_t createStb; + uint64_t targetStbUid; + SArray* fillNullCols; } SCMCreateStreamReq; typedef struct { diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index bbf332c4d4..57ddeb657c 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -207,6 +207,12 @@ typedef struct SQueryNodeStat { int32_t tableNum; // vg table number, unit is TSDB_TABLE_NUM_UNIT } SQueryNodeStat; +typedef struct SColLocation { + int16_t slotId; + col_id_t colId; + int8_t type; +} SColLocation; + int32_t initTaskQueue(); int32_t cleanupTaskQueue(); diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 83f447fd0e..dde7d50c32 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -5425,6 +5425,7 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS if (tEncodeCStr(&encoder, pField->name) < 0) return -1; } if (tEncodeI8(&encoder, pReq->createStb) < 0) return -1; + if (tEncodeU64(&encoder, pReq->targetStbUid) < 0) return -1; tEndEncode(&encoder); @@ -5486,6 +5487,7 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea } } if (tDecodeI8(&decoder, &pReq->createStb) < 0) return -1; + if (tDecodeU64(&decoder, &pReq->targetStbUid) < 0) return -1; tEndDecode(&decoder); diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 8a435c4887..6b54a36a6f 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -314,7 +314,11 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj, } tstrncpy(pObj->targetDb, pTargetDb->name, TSDB_DB_FNAME_LEN); - pObj->targetStbUid = mndGenerateUid(pObj->targetSTbName, TSDB_TABLE_FNAME_LEN); + if (pCreate->createStb == STREAM_CREATE_STABLE_TRUE) { + pObj->targetStbUid = mndGenerateUid(pObj->targetSTbName, TSDB_TABLE_FNAME_LEN); + } else { + pObj->targetStbUid = pCreate->targetStbUid; + } pObj->targetDbUid = pTargetDb->uid; mndReleaseDb(pMnode, pTargetDb); @@ -334,6 +338,38 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj, goto FAIL; } + int32_t numOfNULL = taosArrayGetSize(pCreate->fillNullCols); + if(numOfNULL > 0) { + pObj->outputSchema.nCols += numOfNULL; + SSchema* pFullSchema = taosMemoryCalloc(pObj->outputSchema.nCols, sizeof(SSchema)); + if (!pFullSchema) { + goto FAIL; + } + + int32_t nullIndex = 0; + int32_t dataIndex = 0; + for (int16_t i = 0; i < pObj->outputSchema.nCols; i++) { + SColLocation* pos = taosArrayGet(pCreate->fillNullCols, nullIndex); + if (i < pos->slotId) { + pFullSchema[i].bytes = pObj->outputSchema.pSchema[dataIndex].bytes; + pFullSchema[i].colId = i + 1; // pObj->outputSchema.pSchema[dataIndex].colId; + pFullSchema[i].flags = pObj->outputSchema.pSchema[dataIndex].flags; + strcpy(pFullSchema[i].name, pObj->outputSchema.pSchema[dataIndex].name); + pFullSchema[i].type = pObj->outputSchema.pSchema[dataIndex].type; + dataIndex++; + } else { + pFullSchema[i].bytes = 0; + pFullSchema[i].colId = pos->colId; + pFullSchema[i].flags = COL_SET_NULL; + memset(pFullSchema[i].name, 0, TSDB_COL_NAME_LEN); + pFullSchema[i].type = pos->type; + nullIndex++; + } + } + taosMemoryFree(pObj->outputSchema.pSchema); + pObj->outputSchema.pSchema = pFullSchema; + } + SPlanContext cxt = { .pAstRoot = pAst, .topicQuery = false, diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index cc60283c58..f1103ad48a 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -323,19 +323,10 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d taosArrayDestroy(tagArray); } -static int32_t encodeCreateChildTableForRPC(SVCreateTbReq* req, int32_t vgId, void** pBuf, int32_t* contLen) { +static int32_t encodeCreateChildTableForRPC(SVCreateTbBatchReq* pReqs, int32_t vgId, void** pBuf, int32_t* contLen) { int32_t ret = 0; - SVCreateTbBatchReq reqs = {0}; - reqs.pArray = taosArrayInit(1, sizeof(struct SVCreateTbReq)); - if (NULL == reqs.pArray) { - ret = -1; - goto end; - } - taosArrayPush(reqs.pArray, req); - reqs.nReqs = 1; - - tEncodeSize(tEncodeSVCreateTbBatchReq, &reqs, *contLen, ret); + tEncodeSize(tEncodeSVCreateTbBatchReq, pReqs, *contLen, ret); if (ret < 0) { ret = -1; goto end; @@ -350,7 +341,7 @@ static int32_t encodeCreateChildTableForRPC(SVCreateTbReq* req, int32_t vgId, vo ((SMsgHead*)(*pBuf))->contLen = htonl(*contLen); SEncoder coder = {0}; tEncoderInit(&coder, POINTER_SHIFT(*pBuf, sizeof(SMsgHead)), (*contLen) - sizeof(SMsgHead) ); - if (tEncodeSVCreateTbBatchReq(&coder, &reqs) < 0) { + if (tEncodeSVCreateTbBatchReq(&coder, pReqs) < 0) { rpcFreeCont(*pBuf); *pBuf = NULL; *contLen = 0; @@ -361,14 +352,13 @@ static int32_t encodeCreateChildTableForRPC(SVCreateTbReq* req, int32_t vgId, vo tEncoderClear(&coder); end: - taosArrayDestroy(reqs.pArray); return ret; } -int32_t tqPutReqToQueue(SVnode* pVnode, SVCreateTbReq* pReq) { +int32_t tqPutReqToQueue(SVnode* pVnode, SVCreateTbBatchReq* pReqs) { void* buf = NULL; int32_t tlen = 0; - encodeCreateChildTableForRPC(pReq, TD_VID(pVnode), &buf, &tlen); + encodeCreateChildTableForRPC(pReqs, TD_VID(pVnode), &buf, &tlen); SRpcMsg msg = { .msgType = TDMT_VND_CREATE_TABLE, @@ -387,6 +377,7 @@ _error: tqError("failed to encode submit req since %s", terrstr()); return TSDB_CODE_OUT_OF_MEMORY; } + void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* data) { const SArray* pBlocks = (const SArray*)data; SVnode* pVnode = (SVnode*)vnode; @@ -402,6 +393,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* void* pBuf = NULL; SArray* tagArray = NULL; SArray* pVals = NULL; + SArray* crTblArray = NULL; for (int32_t i = 0; i < blockSz; i++) { SSDataBlock* pDataBlock = taosArrayGet(pBlocks, i); @@ -442,8 +434,14 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* tqDebug("failed to put delete req into write-queue since %s", terrstr()); } } else if (pDataBlock->info.type == STREAM_CREATE_CHILD_TABLE) { + SVCreateTbBatchReq reqs = {0}; + crTblArray = reqs.pArray = taosArrayInit(1, sizeof(struct SVCreateTbReq)); + if (NULL == reqs.pArray) { + goto _end; + } for (int32_t rowId = 0; rowId < rows; rowId++) { - SVCreateTbReq* pCreateTbReq = taosMemoryCalloc(1, sizeof(SVCreateStbReq)); + SVCreateTbReq createTbReq = {0}; + SVCreateTbReq* pCreateTbReq = &createTbReq; if (!pCreateTbReq) { goto _end; } @@ -511,6 +509,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* terrno = TSDB_CODE_OUT_OF_MEMORY; goto _end; } + pCreateTbReq->ctb.pTag = (uint8_t*)pTag; // set table name @@ -524,13 +523,15 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* pCreateTbReq->name = taosMemoryCalloc(1, varDataLen(pTbData) + 1); memcpy(pCreateTbReq->name, varDataVal(pTbData), varDataLen(pTbData)); } - - if (tqPutReqToQueue(pVnode, pCreateTbReq) != TSDB_CODE_SUCCESS) { - goto _end; - } - tdDestroySVCreateTbReq(pCreateTbReq); - taosMemoryFreeClear(pCreateTbReq); + taosArrayPush(reqs.pArray, pCreateTbReq); } + reqs.nReqs = taosArrayGetSize(reqs.pArray); + if (tqPutReqToQueue(pVnode, &reqs) != TSDB_CODE_SUCCESS) { + goto _end; + } + tagArray = taosArrayDestroy(tagArray); + taosArrayDestroyEx(crTblArray, (FDelete)tdDestroySVCreateTbReq); + crTblArray = NULL; } else { SSubmitTbData tbData = {0}; tqDebug("tq sink pipe2, convert block1 %d, rows: %d", i, rows); @@ -579,7 +580,7 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* goto _end; } STagVal tagVal = { - .cid = taosArrayGetSize(pDataBlock->pDataBlock) + 1, + .cid = pTSchema->numOfCols + 1, .type = TSDB_DATA_TYPE_UBIGINT, .i64 = (int64_t)pDataBlock->info.id.groupId, }; @@ -638,28 +639,37 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* for (int32_t j = 0; j < rows; j++) { taosArrayClear(pVals); + int32_t dataIndex = 0; for (int32_t k = 0; k < pTSchema->numOfCols; k++) { const STColumn* pCol = &pTSchema->columns[k]; - SColumnInfoData* pColData = taosArrayGet(pDataBlock->pDataBlock, k); if (k == 0) { + SColumnInfoData* pColData = taosArrayGet(pDataBlock->pDataBlock, dataIndex); void* colData = colDataGetData(pColData, j); tqDebug("tq sink pipe2, row %d, col %d ts %" PRId64, j, k, *(int64_t*)colData); } - if (colDataIsNull_s(pColData, j)) { + if (IS_SET_NULL(pCol)) { SColVal cv = COL_VAL_NULL(pCol->colId, pCol->type); taosArrayPush(pVals, &cv); - } else { - void* colData = colDataGetData(pColData, j); - if (IS_STR_DATA_TYPE(pCol->type)) { - SValue sv = - (SValue){.nData = varDataLen(colData), .pData = varDataVal(colData)}; // address copy, no value - SColVal cv = COL_VAL_VALUE(pCol->colId, pCol->type, sv); + } else{ + SColumnInfoData* pColData = taosArrayGet(pDataBlock->pDataBlock, dataIndex); + if (colDataIsNull_s(pColData, j)) { + SColVal cv = COL_VAL_NULL(pCol->colId, pCol->type); taosArrayPush(pVals, &cv); + dataIndex++; } else { - SValue sv; - memcpy(&sv.val, colData, tDataTypes[pCol->type].bytes); - SColVal cv = COL_VAL_VALUE(pCol->colId, pCol->type, sv); - taosArrayPush(pVals, &cv); + void* colData = colDataGetData(pColData, j); + if (IS_STR_DATA_TYPE(pCol->type)) { + SValue sv = + (SValue){.nData = varDataLen(colData), .pData = varDataVal(colData)}; // address copy, no value + SColVal cv = COL_VAL_VALUE(pCol->colId, pCol->type, sv); + taosArrayPush(pVals, &cv); + } else { + SValue sv; + memcpy(&sv.val, colData, tDataTypes[pCol->type].bytes); + SColVal cv = COL_VAL_VALUE(pCol->colId, pCol->type, sv); + taosArrayPush(pVals, &cv); + } + dataIndex++; } } } @@ -716,5 +726,6 @@ void tqSinkToTablePipeline2(SStreamTask* pTask, void* vnode, int64_t ver, void* _end: taosArrayDestroy(tagArray); taosArrayDestroy(pVals); + taosArrayDestroyEx(crTblArray, (FDelete)tdDestroySVCreateTbReq); // TODO: change } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 8d1660be72..df04d92599 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5740,7 +5740,7 @@ static int32_t adjustDataTypeOfProjections(STranslateContext* pCxt, const STable int32_t index = 0; SNode* pProj = NULL; FOREACH(pProj, pProjections) { - SSchema* pSchema = pSchemas + index; + SSchema* pSchema = pSchemas + index++; SDataType dt = {.type = pSchema->type, .bytes = pSchema->bytes}; if (!dataTypeEqual(&dt, &((SExprNode*)pProj)->resType)) { SNode* pFunc = NULL; @@ -5761,7 +5761,7 @@ typedef struct SProjColPos { } SProjColPos; static int32_t projColPosCompar(const void* l, const void* r) { - return ((SProjColPos*)l)->colId < ((SProjColPos*)r)->colId; + return ((SProjColPos*)l)->colId > ((SProjColPos*)r)->colId; } static void projColPosDelete(void* p) { taosMemoryFree(((SProjColPos*)p)->pProj); } @@ -5856,7 +5856,11 @@ static int32_t adjustStreamQueryForExistTable(STranslateContext* pCxt, SCreateSt return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_TABLE_NOT_EXIST, pStmt->targetTabName); } pReq->createStb = STREAM_CREATE_STABLE_TRUE; + pReq->targetStbUid = 0; return TSDB_CODE_SUCCESS; + } else { + pReq->createStb = STREAM_CREATE_STABLE_FALSE; + pReq->targetStbUid = pMeta->suid; } if (TSDB_CODE_SUCCESS == code) { code = adjustStreamQueryForExistTableImpl(pCxt, pStmt, pMeta); diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 66a71bfae1..0946655de6 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -247,8 +247,8 @@ ,,y,script,./test.sh -f tsim/stream/fillIntervalPartitionBy.sim ,,y,script,./test.sh -f tsim/stream/fillIntervalPrevNext.sim ,,y,script,./test.sh -f tsim/stream/fillIntervalValue.sim -,,y,script,./test.sh -f tsim/stream/tableAndTag0.sim -,,y,script,./test.sh -f tsim/stream/tableAndTag1.sim +,,y,script,./test.sh -f tsim/stream/udTableAndTag0.sim +,,y,script,./test.sh -f tsim/stream/udTableAndTag1.sim ,,y,script,./test.sh -f tsim/trans/lossdata1.sim ,,y,script,./test.sh -f tsim/trans/create_db.sim ,,y,script,./test.sh -f tsim/tmq/basic1.sim diff --git a/tests/script/tsim/stream/checkStreamSTable.sim b/tests/script/tsim/stream/checkStreamSTable.sim new file mode 100644 index 0000000000..2ed6958196 --- /dev/null +++ b/tests/script/tsim/stream/checkStreamSTable.sim @@ -0,0 +1,310 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 + +print ===== step1 + +system sh/exec.sh -n dnode1 -s start +sleep 50 +sql connect + +print ===== step2 + +sql create database result vgroups 1; + +sql create database test vgroups 4; +sql use test; + + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +sql create stable result.streamt0(ts timestamp,a int,b int) tags(ta int,tb int,tc int); + +sql create stream streams0 trigger at_once into result.streamt0 as select _wstart, count(*) c1, max(a) c2 from st partition by tbname interval(10s); +sql insert into t1 values(1648791213000,1,2,3); +sql insert into t2 values(1648791213000,2,2,3); + +$loop_count = 0 + +sql select _wstart, count(*) c1, max(a) c2 from st partition by tbname interval(10s); +print $data00, $data01, $data02 +print $data10, $data11, $data12 +print $data20, $data21, $data22 + +loop0: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from result.streamt0 order by ta; + +if $rows != 2 then + print =====rows=$rows + print $data00, $data01, $data02 + print $data10, $data11, $data12 + print $data20, $data21, $data22 + goto loop0 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop0 +endi + +if $data02 != 1 then + print =====data02=$data02 + goto loop0 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop0 +endi + +if $data12 != 2 then + print =====data12=$data12 + goto loop0 +endi + +print ===== step3 + +sql create database result1 vgroups 1; + +sql create database test1 vgroups 4; +sql use test1; + + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +sql create stable result1.streamt1(ts timestamp,a int,b int,c int) tags(ta bigint unsigned,tb int,tc int); + +sql create stream streams1 trigger at_once into result1.streamt1(ts,c,a,b) as select _wstart, count(*) c1, max(a),min(b) c2 from st partition by tbname interval(10s); +sql insert into t1 values(1648791213000,10,20,30); +sql insert into t2 values(1648791213000,40,50,60); + +$loop_count = 0 + +sql select _wstart, count(*) c1, max(a),min(b) c2 from st partition by tbname interval(10s); +print $data00, $data01, $data02, $data03 +print $data10, $data11, $data12, $data13 +print $data20, $data21, $data22, $data23 + +loop1: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from result1.streamt1 order by ta; + +if $rows != 2 then + print =====rows=$rows + print $data00, $data01, $data02, $data03 + print $data10, $data11, $data12, $data13 + print $data20, $data21, $data22, $data23 + goto loop1 +endi + +if $data01 != 10 then + print =====data01=$data01 + goto loop1 +endi + +if $data02 != 20 then + print =====data02=$data02 + goto loop1 +endi + +if $data03 != 1 then + print =====data03=$data03 + goto loop1 +endi + +if $data11 != 40 then + print =====data11=$data11 + goto loop1 +endi + +if $data12 != 50 then + print =====data12=$data12 + goto loop1 +endi + +if $data13 != 1 then + print =====data13=$data13 + goto loop1 +endi + + +print ===== step4 + +sql create database result2 vgroups 1; + +sql create database test2 vgroups 4; +sql use test2; + + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); + +sql create stable result2.streamt2(ts timestamp, a int , b int) tags(ta varchar(20)); + +# tag dest 1, source 2 +##sql_error create stream streams2 trigger at_once into result2.streamt2 TAGS(aa varchar(100), ta int) as select _wstart, count(*) c1, max(a) from st partition by tbname as aa, ta interval(10s); + +# column dest 3, source 4 +sql_error create stream streams2 trigger at_once into result2.streamt2 as select _wstart, count(*) c1, max(a), max(b) from st partition by tbname interval(10s); + +# column dest 3, source 4 +sql_error create stream streams2 trigger at_once into result2.streamt2(ts, a, b) as select _wstart, count(*) c1, max(a), max(b) from st partition by tbname interval(10s); + +# column dest 3, source 2 +sql_error create stream streams2 trigger at_once into result2.streamt2 as select _wstart, count(*) c1 from st partition by tbname interval(10s); + +# column dest 3, source 2 +sql create stream streams2 trigger at_once into result2.streamt2(ts, a) as select _wstart, count(*) c1 from st partition by tbname interval(10s); + + +print ===== step5 + +sql create database result3 vgroups 1; + +sql create database test3 vgroups 4; +sql use test3; + + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,2,3); +sql create table t2 using st tags(4,5,6); + +sql create stable result3.streamt3(ts timestamp,a int,b int,c int, d int) tags(ta int,tb int,tc int); + +sql create stream streams3 trigger at_once into result3.streamt3(ts,c,a,b) as select _wstart, count(*) c1, max(a),min(b) c2 from st interval(10s); + +sql insert into t1 values(1648791213000,10,20,30); +sql insert into t2 values(1648791213000,40,50,60); + +$loop_count = 0 + +sql select _wstart, count(*) c1, max(a),min(b) c2 from st interval(10s); +print $data00, $data01, $data02, $data03, $data04 +print $data10, $data11, $data12, $data13, $data14 +print $data20, $data21, $data22, $data23, $data24 + +loop2: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from result3.streamt3; + +if $rows != 1 then + print =====rows=$rows + print $data00, $data01, $data02, $data03 + print $data10, $data11, $data12, $data13 + print $data20, $data21, $data22, $data23 + goto loop2 +endi + +if $data01 != 40 then + print =====data01=$data01 + goto loop2 +endi + +if $data02 != 20 then + print =====data02=$data02 + goto loop2 +endi + +if $data03 != 2 then + print =====data03=$data03 + goto loop2 +endi + +if $data04 != NULL then + print =====data04=$data04 + goto loop2 +endi + +print ===== step6 + +sql create database result4 vgroups 1; + +sql create database test4 vgroups 4; +sql use test4; + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,2,3); +sql create table t2 using st tags(4,5,6); + +sql create stable result4.streamt4(ts timestamp,a int,b int,c int, d int) tags(ta int,tb int,tc int); + +sql create stream streams4 trigger at_once into result4.streamt4(ts,c,a,b) tags(tg2 int, tg3 varchar(100), tg1 bigint) subtable(concat("tbl-", tg1)) as select _wstart, count(*) c1, max(a),min(b) c2 from st partition by ta+1 as tg1, cast(tb as bigint) as tg2, tc as tg3 interval(10s); + +sql insert into t1 values(1648791213000,10,20,30); +sql insert into t2 values(1648791213000,40,50,60); + +$loop_count = 0 + +sql select _wstart, count(*) c1, max(a),min(b) c2 from st interval(10s); +print $data00, $data01, $data02, $data03 +print $data10, $data11, $data12, $data13 +print $data20, $data21, $data22, $data23 + +loop2: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from result4.streamt4; + +if $rows != 2 then + print =====rows=$rows + print $data00, $data01, $data02, $data03 + print $data10, $data11, $data12, $data13 + print $data20, $data21, $data22, $data23 + goto loop2 +endi + +if $data01 != 40 then + print =====data01=$data01 + goto loop2 +endi + +if $data02 != 20 then + print =====data02=$data02 + goto loop2 +endi + +if $data03 != 2 then + print =====data03=$data03 + goto loop2 +endi + +if $data04 != NULL then + print =====data04=$data04 + goto loop2 +endi + +print ======over + +system sh/stop_dnodes.sh diff --git a/tests/script/tsim/stream/tableAndTag0.sim b/tests/script/tsim/stream/udTableAndTag0.sim similarity index 73% rename from tests/script/tsim/stream/tableAndTag0.sim rename to tests/script/tsim/stream/udTableAndTag0.sim index 5e02171bee..86feca1918 100644 --- a/tests/script/tsim/stream/tableAndTag0.sim +++ b/tests/script/tsim/stream/udTableAndTag0.sim @@ -268,6 +268,105 @@ if $data10 != tbn-t2 then endi +print ===== step5 +print ===== tag name + table name + +sql create database result4 vgroups 1; + +sql create database test4 vgroups 4; +sql use test4; + + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create table t3 using st tags(3,3,3); + +sql create stream streams4 trigger at_once into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", tbname)) as select _wstart, count(*) c1 from st partition by concat("tag-", tbname) as dd, tbname interval(10s); +sql insert into t1 values(1648791213000,1,1,1) t2 values(1648791213000,2,2,2) t3 values(1648791213000,3,3,3); + + +$loop_count = 0 +loop7: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select table_name from information_schema.ins_tables where db_name="result4" order by 1; + +if $rows != 3 then + print =====rows=$rows + print $data00 $data10 + goto loop7 +endi + +if $data00 != tbn-t1 then + print =====data00=$data00 + goto loop7 +endi + +if $data10 != tbn-t2 then + print =====data10=$data10 + goto loop7 +endi + +if $data20 != tbn-t3 then + print =====data20=$data20 + goto loop7 +endi + +$loop_count = 0 +loop8: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from result4.streamt4 order by 3; + +if $rows != 3 then + print =====rows=$rows + print $data00 $data10 + goto loop8 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop8 +endi + +if $data02 != tag-t1 then + print =====data02=$data02 + goto loop8 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop8 +endi + +if $data12 != tag-t2 then + print =====data12=$data12 + goto loop8 +endi + +if $data21 != 1 then + print =====data21=$data21 + goto loop8 +endi + +if $data22 != tag-t3 then + print =====data22=$data22 + goto loop8 +endi + print ======over system sh/stop_dnodes.sh diff --git a/tests/script/tsim/stream/tableAndTag1.sim b/tests/script/tsim/stream/udTableAndTag1.sim similarity index 74% rename from tests/script/tsim/stream/tableAndTag1.sim rename to tests/script/tsim/stream/udTableAndTag1.sim index 74f67c1fb3..a0393a03cd 100644 --- a/tests/script/tsim/stream/tableAndTag1.sim +++ b/tests/script/tsim/stream/udTableAndTag1.sim @@ -269,6 +269,104 @@ if $data10 != tbn-2 then goto loop6 endi +print ===== step5 +print ===== tag name + table name + +sql create database result4 vgroups 1; + +sql create database test4 vgroups 4; +sql use test4; + + +sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int); +sql create table t1 using st tags(1,1,1); +sql create table t2 using st tags(2,2,2); +sql create table t3 using st tags(3,3,3); + +sql create stream streams4 trigger at_once into result4.streamt4 TAGS(dd varchar(100)) SUBTABLE(concat("tbn-", dd)) as select _wstart, count(*) c1 from st partition by concat("t", cast(a as varchar(10) ) ) as dd interval(10s); +sql insert into t1 values(1648791213000,1,1,1) t2 values(1648791213000,2,2,2) t3 values(1648791213000,3,3,3); + + +$loop_count = 0 +loop7: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select table_name from information_schema.ins_tables where db_name="result4" order by 1; + +if $rows != 3 then + print =====rows=$rows + print $data00 $data10 + goto loop7 +endi + +if $data00 != tbn-t1 then + print =====data00=$data00 + goto loop7 +endi + +if $data10 != tbn-t2 then + print =====data10=$data10 + goto loop7 +endi + +if $data20 != tbn-t3 then + print =====data20=$data20 + goto loop7 +endi + +$loop_count = 0 +loop8: + +sleep 300 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from result4.streamt4 order by 3; + +if $rows != 3 then + print =====rows=$rows + print $data00 $data10 + goto loop8 +endi + +if $data01 != 1 then + print =====data01=$data01 + goto loop8 +endi + +if $data02 != t1 then + print =====data02=$data02 + goto loop8 +endi + +if $data11 != 1 then + print =====data11=$data11 + goto loop8 +endi + +if $data12 != t2 then + print =====data12=$data12 + goto loop8 +endi + +if $data21 != 1 then + print =====data21=$data21 + goto loop8 +endi + +if $data22 != t3 then + print =====data22=$data22 + goto loop8 +endi print ======over From ca1e1c1694fb4bd0b099dbf9fc5f7f44aaf306d6 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Fri, 13 Jan 2023 10:30:43 +0800 Subject: [PATCH 091/139] test:modify failed cases in ci --- tests/script/sh/checkAsan.sh | 2 +- tests/system-test/2-query/insert_null_none.py | 2 +- .../system-test/6-cluster/5dnode3mnodeDrop.py | 26 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/script/sh/checkAsan.sh b/tests/script/sh/checkAsan.sh index 7df17b22da..7225722791 100755 --- a/tests/script/sh/checkAsan.sh +++ b/tests/script/sh/checkAsan.sh @@ -39,7 +39,7 @@ python_error=`cat ${LOG_DIR}/*.info | grep -w "stack" | wc -l` # /root/TDengine/source/libs/scalar/src/sclvector.c:1075:66: runtime error: signed integer overflow: 9223372034707292160 + 1668838476672 cannot be represented in type 'long int' # /root/TDengine/source/common/src/tdataformat.c:1876:7: runtime error: signed integer overflow: 8252423483843671206 + 2406154664059062870 cannot be represented in type 'long int' -runtime_error=`cat ${LOG_DIR}/*.asan | grep "runtime error" | grep -v "trees.c:873" | grep -v "sclfunc.c.*outside the range of representable values of type"| grep -v "signed integer overflow" | wc -l` +runtime_error=`cat ${LOG_DIR}/*.asan | grep "runtime error" | grep -v "trees.c:873" | grep -v "sclfunc.c.*outside the range of representable values of type"| grep -v "signed integer overflow" |grep -v "strerror.c"| grep -v "asan_malloc_linux.cc" |wc -l` echo -e "\033[44;32;1m"asan error_num: $error_num"\033[0m" echo -e "\033[44;32;1m"asan memory_leak: $memory_leak"\033[0m" diff --git a/tests/system-test/2-query/insert_null_none.py b/tests/system-test/2-query/insert_null_none.py index cf5636fb1f..4304dee89e 100755 --- a/tests/system-test/2-query/insert_null_none.py +++ b/tests/system-test/2-query/insert_null_none.py @@ -24,7 +24,7 @@ from util.dnodes import tdDnodes from util.dnodes import * class TDTestCase: - updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"querySmaOptimize":1} + updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 131 ,"querySmaOptimize":1} def init(self, conn, logSql, replicaVar): tdLog.debug("start to execute %s" % __file__) diff --git a/tests/system-test/6-cluster/5dnode3mnodeDrop.py b/tests/system-test/6-cluster/5dnode3mnodeDrop.py index 45830af698..9dd3c56805 100644 --- a/tests/system-test/6-cluster/5dnode3mnodeDrop.py +++ b/tests/system-test/6-cluster/5dnode3mnodeDrop.py @@ -121,7 +121,7 @@ class TDTestCase: def check3mnode(self): count=0 while count < 10: - time.sleep(1) + time.sleep(0.1) tdSql.query("select * from information_schema.ins_mnodes;") if tdSql.checkRows(3) : tdLog.debug("mnode is three nodes") @@ -158,7 +158,7 @@ class TDTestCase: def check3mnode1off(self): count=0 while count < 10: - time.sleep(1) + time.sleep(0.1) tdSql.query("select * from information_schema.ins_mnodes;") if tdSql.checkRows(3) : tdLog.debug("mnode is three nodes") @@ -190,7 +190,7 @@ class TDTestCase: def check3mnode2off(self): count=0 while count < 40: - time.sleep(1) + time.sleep(0.1) tdSql.query("select * from information_schema.ins_mnodes;") if tdSql.checkRows(3) : tdLog.debug("mnode is three nodes") @@ -220,7 +220,7 @@ class TDTestCase: def check3mnode3off(self): count=0 while count < 10: - time.sleep(1) + time.sleep(0.1) tdSql.query("select * from information_schema.ins_mnodes;") if tdSql.checkRows(3) : tdLog.debug("mnode is three nodes") @@ -280,32 +280,32 @@ class TDTestCase: # drop follower of mnode dropcount =0 - while dropcount <= 10: + while dropcount <= 5: for i in range(1,3): tdLog.debug("drop mnode on dnode %d"%(i+1)) tdSql.execute("drop mnode on dnode %d"%(i+1)) tdSql.query("select * from information_schema.ins_mnodes;") count=0 while count<10: - time.sleep(1) + time.sleep(0.1) tdSql.query("select * from information_schema.ins_mnodes;") - if tdSql.checkRows(2): + if tdSql.queryRows == 2: tdLog.debug("drop mnode %d successfully"%(i+1)) break count+=1 - self.wait_for_transactions(20) + self.wait_for_transactions(100) tdLog.debug("create mnode on dnode %d"%(i+1)) tdSql.execute("create mnode on dnode %d"%(i+1)) count=0 while count<10: - time.sleep(1) + time.sleep(0.1) tdSql.query("select * from information_schema.ins_mnodes;") - if tdSql.checkRows(3): + if tdSql.queryRows == 3: tdLog.debug("create mnode %d successfully"%(i+1)) break count+=1 - self.wait_for_transactions(20) + self.wait_for_transactions(100) dropcount+=1 self.check3mnode() @@ -314,13 +314,13 @@ class TDTestCase: while count= timeout: - tdLog.debug("transactions not finished before timeout (%d secs)", timeout) + tdLog.debug("transactions not finished before timeout (%d secs)"%timeout) def getConnection(self, dnode): host = dnode.cfgDict["fqdn"] From c2fd6015197516667bca53f22c031bddc9b4a3bf Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 13 Jan 2023 11:14:24 +0800 Subject: [PATCH 092/139] fix: disable address sanitizer for table count scan --- tests/parallel_test/cases.task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 63f1b69fb8..970d9992cc 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1050,7 +1050,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py #develop test -,,y,develop-test,python3 ./test.py -f 2-query/table_count_scan.py +,,n,develop-test,python3 ./test.py -f 2-query/table_count_scan.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py ,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py From a59294b57889fe46118acea931f2f979c3ad8bd0 Mon Sep 17 00:00:00 2001 From: Hui Li <52318143+plum-lihui@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:43:49 +0800 Subject: [PATCH 093/139] Update tmqConsFromTsdb.py --- tests/system-test/7-tmq/tmqConsFromTsdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb.py b/tests/system-test/7-tmq/tmqConsFromTsdb.py index 9bb8c4cc0d..8ed4a6df97 100644 --- a/tests/system-test/7-tmq/tmqConsFromTsdb.py +++ b/tests/system-test/7-tmq/tmqConsFromTsdb.py @@ -130,7 +130,7 @@ class TDTestCase: tdLog.info("expect consume rows: %d, act consume rows: %d"%(expectRowsList[0], resultList[0])) tdLog.exit("%d tmq consume rows error!"%consumerId) - tmqCom.checkFileContent(consumerId, queryString) + # tmqCom.checkFileContent(consumerId, queryString) time.sleep(10) for i in range(len(topicNameList)): From dbe71c3c9ac0c523a7acc6bf93dc08e3a024fd49 Mon Sep 17 00:00:00 2001 From: Hui Li <52318143+plum-lihui@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:44:23 +0800 Subject: [PATCH 094/139] Update tmqConsFromTsdb.py --- tests/system-test/7-tmq/tmqConsFromTsdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb.py b/tests/system-test/7-tmq/tmqConsFromTsdb.py index 9bb8c4cc0d..8ed4a6df97 100644 --- a/tests/system-test/7-tmq/tmqConsFromTsdb.py +++ b/tests/system-test/7-tmq/tmqConsFromTsdb.py @@ -130,7 +130,7 @@ class TDTestCase: tdLog.info("expect consume rows: %d, act consume rows: %d"%(expectRowsList[0], resultList[0])) tdLog.exit("%d tmq consume rows error!"%consumerId) - tmqCom.checkFileContent(consumerId, queryString) + # tmqCom.checkFileContent(consumerId, queryString) time.sleep(10) for i in range(len(topicNameList)): From 792d19fbe772632e1ad2da4cb9e2180c0b5b6efc Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 13 Jan 2023 11:48:26 +0800 Subject: [PATCH 095/139] fix:table num in ins_tables --- tests/script/tsim/query/sys_tbname.sim | 2 +- utils/test/c/get_db_name_test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/script/tsim/query/sys_tbname.sim b/tests/script/tsim/query/sys_tbname.sim index 045e908a57..9b16d98202 100644 --- a/tests/script/tsim/query/sys_tbname.sim +++ b/tests/script/tsim/query/sys_tbname.sim @@ -53,7 +53,7 @@ endi sql select tbname from information_schema.ins_tables; print $rows $data00 -if $rows != 32 then +if $rows != 33 then return -1 endi if $data00 != @ins_tables@ then diff --git a/utils/test/c/get_db_name_test.c b/utils/test/c/get_db_name_test.c index 4802ef25c3..ebbfdc84a7 100644 --- a/utils/test/c/get_db_name_test.c +++ b/utils/test/c/get_db_name_test.c @@ -25,7 +25,7 @@ int get_db_test() { TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0); - TAOS_RES *pRes = taos_query(taos, "create database if not exists sml_db"); + TAOS_RES *pRes = taos_query(taos, "create database if not exists sml_db vgroups 2"); taos_free_result(pRes); pRes = taos_query(taos, "use sml_db"); From 9e50b50597ccab89b95664927d7e95d37f765caa Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Fri, 13 Jan 2023 14:19:24 +0800 Subject: [PATCH 096/139] docs: fix python connector example code mistake for3.0 (#19552) * docs: update csharp connector status * docs: fix csharp ws bulk pulling * docs: clarify database param is optional to websocket dsn * docs: fix python version and a few typos * docs: fix jdbc version in connector matrix * docs: update jdbc demo readme * docs: update dot-net examples link * docs: fix example code mistake * fix: examples/csharp typos * fix: examples/python/native_insert_example.py mistake --- docs/examples/csharp/stmtInsert/Program.cs | 4 ++-- docs/examples/python/connect_rest_examples.py | 8 ++++---- docs/examples/python/native_insert_example.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/examples/csharp/stmtInsert/Program.cs b/docs/examples/csharp/stmtInsert/Program.cs index 87e1971feb..80cadb2ff8 100644 --- a/docs/examples/csharp/stmtInsert/Program.cs +++ b/docs/examples/csharp/stmtInsert/Program.cs @@ -42,7 +42,7 @@ namespace TDengineExample // 5. execute res = TDengine.StmtExecute(stmt); - CheckStmtRes(res, "faild to execute"); + CheckStmtRes(res, "failed to execute"); // 6. free TaosMultiBind.FreeTaosBind(tags); @@ -92,7 +92,7 @@ namespace TDengineExample int code = TDengine.StmtClose(stmt); if (code != 0) { - throw new Exception($"falied to close stmt, {code} reason: {TDengine.StmtErrorStr(stmt)} "); + throw new Exception($"failed to close stmt, {code} reason: {TDengine.StmtErrorStr(stmt)} "); } } } diff --git a/docs/examples/python/connect_rest_examples.py b/docs/examples/python/connect_rest_examples.py index 900ec1022e..dba00b5a82 100644 --- a/docs/examples/python/connect_rest_examples.py +++ b/docs/examples/python/connect_rest_examples.py @@ -15,10 +15,10 @@ cursor.execute("CREATE DATABASE power") cursor.execute("CREATE STABLE power.meters (ts TIMESTAMP, current FLOAT, voltage INT, phase FLOAT) TAGS (location BINARY(64), groupId INT)") # insert data -cursor.execute("""INSERT INTO power.d1001 USING power.meters TAGS(California.SanFrancisco, 2) VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000) ('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000) - power.d1002 USING power.meters TAGS(California.SanFrancisco, 3) VALUES ('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000) - power.d1003 USING power.meters TAGS(California.LosAngeles, 2) VALUES ('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000) ('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000) - power.d1004 USING power.meters TAGS(California.LosAngeles, 3) VALUES ('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000) ('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000)""") +cursor.execute("""INSERT INTO power.d1001 USING power.meters TAGS('California.SanFrancisco', 2) VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000) ('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000) + power.d1002 USING power.meters TAGS('California.SanFrancisco', 3) VALUES ('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000) + power.d1003 USING power.meters TAGS('California.LosAngeles', 2) VALUES ('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000) ('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000) + power.d1004 USING power.meters TAGS('California.LosAngeles', 3) VALUES ('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000) ('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000)""") print("inserted row count:", cursor.rowcount) # query data diff --git a/docs/examples/python/native_insert_example.py b/docs/examples/python/native_insert_example.py index 94fd00a6e9..cdde7d23d2 100644 --- a/docs/examples/python/native_insert_example.py +++ b/docs/examples/python/native_insert_example.py @@ -25,10 +25,10 @@ def create_stable(conn: taos.TaosConnection): # The generated SQL is: -# INSERT INTO d1001 USING meters TAGS(California.SanFrancisco, 2) VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000) ('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000) -# d1002 USING meters TAGS(California.SanFrancisco, 3) VALUES ('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000) -# d1003 USING meters TAGS(California.LosAngeles, 2) VALUES ('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000) ('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000) -# d1004 USING meters TAGS(California.LosAngeles, 3) VALUES ('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000) ('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000) +# INSERT INTO d1001 USING meters TAGS('California.SanFrancisco', 2) VALUES ('2018-10-03 14:38:05.000', 10.30000, 219, 0.31000) ('2018-10-03 14:38:15.000', 12.60000, 218, 0.33000) ('2018-10-03 14:38:16.800', 12.30000, 221, 0.31000) +# d1002 USING meters TAGS('California.SanFrancisco', 3) VALUES ('2018-10-03 14:38:16.650', 10.30000, 218, 0.25000) +# d1003 USING meters TAGS('California.LosAngeles', 2) VALUES ('2018-10-03 14:38:05.500', 11.80000, 221, 0.28000) ('2018-10-03 14:38:16.600', 13.40000, 223, 0.29000) +# d1004 USING meters TAGS('California.LosAngeles', 3) VALUES ('2018-10-03 14:38:05.000', 10.80000, 223, 0.29000) ('2018-10-03 14:38:06.500', 11.50000, 221, 0.35000) def get_sql(): global lines From ad8c73645ba1aab95e904a7c9d0c5c7fce2a91ac Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 13 Jan 2023 15:26:24 +0800 Subject: [PATCH 097/139] fix: update epset on dnode info changed --- include/common/tmsgcb.h | 1 + source/dnode/mgmt/node_util/inc/dmUtil.h | 1 + source/dnode/mgmt/node_util/src/dmEps.c | 50 +++++++++++++--------- source/dnode/mnode/impl/src/mndConsumer.c | 1 + source/dnode/mnode/impl/src/mndDnode.c | 1 + source/dnode/mnode/impl/src/mndSubscribe.c | 21 +++++++++ source/dnode/mnode/impl/src/mndTrans.c | 1 + source/libs/transport/src/tmsgcb.c | 6 +++ 8 files changed, 61 insertions(+), 21 deletions(-) diff --git a/include/common/tmsgcb.h b/include/common/tmsgcb.h index 7cf092b144..eaac319141 100644 --- a/include/common/tmsgcb.h +++ b/include/common/tmsgcb.h @@ -71,6 +71,7 @@ void tmsgRegisterBrokenLinkArg(SRpcMsg* pMsg); void tmsgReleaseHandle(SRpcHandleInfo* pHandle, int8_t type); void tmsgReportStartup(const char* name, const char* desc); void tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); +void tmsgUpdateDnodeEpSet(SEpSet* epset); #ifdef __cplusplus } diff --git a/source/dnode/mgmt/node_util/inc/dmUtil.h b/source/dnode/mgmt/node_util/inc/dmUtil.h index 8ecce20f53..784bb3c5e1 100644 --- a/source/dnode/mgmt/node_util/inc/dmUtil.h +++ b/source/dnode/mgmt/node_util/inc/dmUtil.h @@ -100,6 +100,7 @@ typedef struct { bool stopped; SEpSet mnodeEps; SArray *dnodeEps; + SArray *oldDnodeEps; SHashObj *dnodeHash; TdThreadRwlock lock; SMsgCb msgCb; diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 9640c0b5c9..4285eb5c07 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -332,40 +332,48 @@ void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet) { } } -void dmUpdateDnodeInfo(void *data, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port) { +void dmUpdateDnodeInfo(void *data, int32_t *did, int64_t *clusterId, char *fqdn, uint16_t *port) { SDnodeData *pData = data; - int32_t ret = -1; + int32_t dnodeId = -1; + if (did != NULL) dnodeId = *did; + taosThreadRwlockRdlock(&pData->lock); - if (*dnodeId <= 0) { - for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pData->dnodeEps); ++i) { + + if (pData->oldDnodeEps != NULL) { + int32_t size = (int32_t)taosArrayGetSize(pData->oldDnodeEps); + for (int32_t i = 0; i < size; ++i) { + SDnodeEp *pDnodeEp = taosArrayGet(pData->oldDnodeEps, i); + if (strcmp(pDnodeEp->ep.fqdn, fqdn) == 0 && pDnodeEp->ep.port == *port) { + dInfo("dnode:%d, update ep:%s:%u to %s:%u", dnodeId, fqdn, *port, pDnodeEp->ep.fqdn, pDnodeEp->ep.port); + tstrncpy(fqdn, pDnodeEp->ep.fqdn, TSDB_FQDN_LEN); + *port = pDnodeEp->ep.port; + } + } + } + + if (did != NULL && dnodeId <= 0) { + int32_t size = (int32_t)taosArrayGetSize(pData->dnodeEps); + for (int32_t i = 0; i < size; ++i) { SDnodeEp *pDnodeEp = taosArrayGet(pData->dnodeEps, i); if (strcmp(pDnodeEp->ep.fqdn, fqdn) == 0 && pDnodeEp->ep.port == *port) { - dInfo("dnode:%s:%u, update dnodeId from %d to %d", fqdn, *port, *dnodeId, pDnodeEp->id); - *dnodeId = pDnodeEp->id; + dInfo("dnode:%s:%u, update dnodeId to dnode:%d", fqdn, *port, pDnodeEp->id); + *did = pDnodeEp->id; if (clusterId != NULL) *clusterId = pData->clusterId; - ret = 0; } } - if (ret != 0) { - dInfo("dnode:%s:%u, failed to update dnodeId:%d", fqdn, *port, *dnodeId); - } - } else { - SDnodeEp *pDnodeEp = taosHashGet(pData->dnodeHash, dnodeId, sizeof(int32_t)); + } + + if (dnodeId > 0) { + SDnodeEp *pDnodeEp = taosHashGet(pData->dnodeHash, &dnodeId, sizeof(int32_t)); if (pDnodeEp) { - if (strcmp(pDnodeEp->ep.fqdn, fqdn) != 0) { - dInfo("dnode:%d, update port from %s to %s", *dnodeId, fqdn, pDnodeEp->ep.fqdn); + if (strcmp(pDnodeEp->ep.fqdn, fqdn) != 0 || pDnodeEp->ep.port != *port) { + dInfo("dnode:%d, update ep:%s:%u to %s:%u", dnodeId, fqdn, *port, pDnodeEp->ep.fqdn, pDnodeEp->ep.port); tstrncpy(fqdn, pDnodeEp->ep.fqdn, TSDB_FQDN_LEN); - } - if (pDnodeEp->ep.port != *port) { - dInfo("dnode:%d, update port from %u to %u", *dnodeId, *port, pDnodeEp->ep.port); *port = pDnodeEp->ep.port; } if (clusterId != NULL) *clusterId = pData->clusterId; - ret = 0; - } else { - dInfo("dnode:%d, failed to update dnode info", *dnodeId); } } + taosThreadRwlockUnlock(&pData->lock); - // return ret; } \ No newline at end of file diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 37e2c35225..3bbf4a4279 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -742,6 +742,7 @@ SSdbRow *mndConsumerActionDecode(SSdbRaw *pRaw) { if (tDecodeSMqConsumerObj(buf, pConsumer) == NULL) { goto CM_DECODE_OVER; } + tmsgUpdateDnodeEpSet(&pConsumer->ep); terrno = TSDB_CODE_SUCCESS; diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index ddb54a95ea..f4e6aad7a7 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -180,6 +180,7 @@ static SSdbRow *mndDnodeActionDecode(SSdbRaw *pRaw) { SDB_GET_RESERVE(pRaw, dataPos, TSDB_DNODE_RESERVE_SIZE, _OVER) terrno = 0; + tmsgUpdateDnodeInfo(&pDnode->id, NULL, pDnode->fqdn, &pDnode->port); _OVER: if (terrno != 0) { diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c index b8ef185199..153bb8bd04 100644 --- a/source/dnode/mnode/impl/src/mndSubscribe.c +++ b/source/dnode/mnode/impl/src/mndSubscribe.c @@ -760,6 +760,27 @@ static SSdbRow *mndSubActionDecode(SSdbRaw *pRaw) { goto SUB_DECODE_OVER; } + // update epset saved in mnode + if (pSub->unassignedVgs != NULL) { + int32_t size = (int32_t)taosArrayGetSize(pSub->unassignedVgs); + for (int32_t i = 0; i < size; ++i) { + SMqVgEp *pMqVgEp = taosArrayGet(pSub->unassignedVgs, i); + tmsgUpdateDnodeEpSet(&pMqVgEp->epSet); + } + } + if (pSub->consumerHash != NULL) { + void *pIter = taosHashIterate(pSub->consumerHash, NULL); + while (pIter) { + SMqConsumerEp *pConsumerEp = pIter; + int32_t size = (int32_t)taosArrayGetSize(pConsumerEp->vgs); + for (int32_t i = 0; i < size; ++i) { + SMqVgEp *pMqVgEp = taosArrayGet(pConsumerEp->vgs, i); + tmsgUpdateDnodeEpSet(&pMqVgEp->epSet); + } + pIter = taosHashIterate(pSub->consumerHash, pIter); + } + } + terrno = TSDB_CODE_SUCCESS; SUB_DECODE_OVER: diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 718fc5c73f..dfcd55bcba 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -329,6 +329,7 @@ static SSdbRow *mndTransActionDecode(SSdbRaw *pRaw) { action.pRaw = NULL; } else if (action.actionType == TRANS_ACTION_MSG) { SDB_GET_BINARY(pRaw, dataPos, (void *)&action.epSet, sizeof(SEpSet), _OVER); + tmsgUpdateDnodeEpSet(&action.epSet); SDB_GET_INT16(pRaw, dataPos, &action.msgType, _OVER) SDB_GET_INT8(pRaw, dataPos, &unused /*&action.msgSent*/, _OVER) SDB_GET_INT8(pRaw, dataPos, &unused /*&action.msgReceived*/, _OVER) diff --git a/source/libs/transport/src/tmsgcb.c b/source/libs/transport/src/tmsgcb.c index eea0d87684..af2528bc92 100644 --- a/source/libs/transport/src/tmsgcb.c +++ b/source/libs/transport/src/tmsgcb.c @@ -62,3 +62,9 @@ void tmsgReportStartup(const char* name, const char* desc) { (*defaultMsgCb.repo void tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port) { (*defaultMsgCb.updateDnodeInfoFp)(defaultMsgCb.data, dnodeId, clusterId, fqdn, port); } + +void tmsgUpdateDnodeEpSet(SEpSet* epset) { + for (int32_t i = 0; i < epset->numOfEps; ++i) { + tmsgUpdateDnodeInfo(NULL, NULL, epset->eps[i].fqdn, &epset->eps[i].port); + } +} \ No newline at end of file From 9997362cf7f15575a4e6c9f5c602ce5e04c554c8 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 14 Jan 2023 01:12:15 +0800 Subject: [PATCH 098/139] fix(query): use the recycled blocks to reduce the cached buffer. --- source/libs/executor/src/exchangeoperator.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index 9873c52006..0de2836f55 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -584,7 +584,13 @@ int32_t doExtractResultBlocks(SExchangeInfo* pExchangeInfo, SSourceDataInfo* pDa int32_t index = 0; int32_t code = 0; while (index++ < pRetrieveRsp->numOfBlocks) { - SSDataBlock* pb = createOneDataBlock(pExchangeInfo->pDummyBlock, false); + SSDataBlock* pb = NULL; + if (taosArrayGetSize(pExchangeInfo->pRecycledBlocks) > 0) { + pb = *(SSDataBlock**)taosArrayPop(pExchangeInfo->pRecycledBlocks); + blockDataCleanup(pb); + } else { + pb = createOneDataBlock(pExchangeInfo->pDummyBlock, false); + } code = extractDataBlockFromFetchRsp(pb, pStart, NULL, &pStart); if (code != 0) { From dba94bf5a02e28e3833cae5896e5495dcb558c1a Mon Sep 17 00:00:00 2001 From: Xuefeng Tan <1172915550@qq.com> Date: Sat, 14 Jan 2023 15:29:33 +0800 Subject: [PATCH 099/139] enh(driver-go): redesign of go tmq api (#19553) * enh(driver-go): redesign of go tmq api * docs: add comments for reserved parameter Co-authored-by: Shuduo Sang --- cmake/taosadapter_CMakeLists.txt.in | 2 +- docs/en/07-develop/07-tmq.mdx | 101 ++++++++------------ docs/en/14-reference/03-connector/05-go.mdx | 48 ++++++---- docs/examples/go/go.mod | 2 +- docs/examples/go/sub/main.go | 96 +++++++------------ docs/zh/07-develop/07-tmq.mdx | 101 ++++++++------------ docs/zh/08-connector/20-go.mdx | 59 +++++++----- 7 files changed, 179 insertions(+), 230 deletions(-) diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index ab1609f35f..13b247770e 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG 69eee2e + GIT_TAG 213f8b3 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/docs/en/07-develop/07-tmq.mdx b/docs/en/07-develop/07-tmq.mdx index 17b3f5caa0..94a9dbffbd 100644 --- a/docs/en/07-develop/07-tmq.mdx +++ b/docs/en/07-develop/07-tmq.mdx @@ -117,19 +117,22 @@ class TaosConsumer(): ```go -func NewConsumer(conf *Config) (*Consumer, error) +func NewConsumer(conf *tmq.ConfigMap) (*Consumer, error) -func (c *Consumer) Close() error +// rebalanceCb is reserved for compatibility purpose +func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error -func (c *Consumer) Commit(ctx context.Context, message unsafe.Pointer) error +// rebalanceCb is reserved for compatibility purpose +func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error -func (c *Consumer) FreeMessage(message unsafe.Pointer) +func (c *Consumer) Poll(timeoutMs int) tmq.Event -func (c *Consumer) Poll(timeout time.Duration) (*Result, error) - -func (c *Consumer) Subscribe(topics []string) error +// tmq.TopicPartition is reserved for compatibility purpose +func (c *Consumer) Commit() ([]tmq.TopicPartition, error) func (c *Consumer) Unsubscribe() error + +func (c *Consumer) Close() error ``` @@ -357,50 +360,20 @@ public class MetersDeserializer extends ReferenceDeserializer { ```go -config := tmq.NewConfig() -defer config.Destroy() -err = config.SetGroupID("test") -if err != nil { - panic(err) -} -err = config.SetAutoOffsetReset("earliest") -if err != nil { - panic(err) -} -err = config.SetConnectIP("127.0.0.1") -if err != nil { - panic(err) -} -err = config.SetConnectUser("root") -if err != nil { - panic(err) -} -err = config.SetConnectPass("taosdata") -if err != nil { - panic(err) -} -err = config.SetConnectPort("6030") -if err != nil { - panic(err) -} -err = config.SetMsgWithTableName(true) -if err != nil { - panic(err) -} -err = config.EnableHeartBeat() -if err != nil { - panic(err) -} -err = config.EnableAutoCommit(func(result *wrapper.TMQCommitCallbackResult) { - if result.ErrCode != 0 { - errStr := wrapper.TMQErr2Str(result.ErrCode) - err := errors.NewError(int(result.ErrCode), errStr) - panic(err) - } -}) -if err != nil { - panic(err) +conf := &tmq.ConfigMap{ + "group.id": "test", + "auto.offset.reset": "earliest", + "td.connect.ip": "127.0.0.1", + "td.connect.user": "root", + "td.connect.pass": "taosdata", + "td.connect.port": "6030", + "client.id": "test_tmq_c", + "enable.auto.commit": "false", + "enable.heartbeat.background": "true", + "experimental.snapshot.enable": "true", + "msg.with.table.name": "true", } +consumer, err := NewConsumer(conf) ``` @@ -523,11 +496,7 @@ consumer.subscribe(topics); ```go -consumer, err := tmq.NewConsumer(config) -if err != nil { - panic(err) -} -err = consumer.Subscribe([]string{"example_tmq_topic"}) +err = consumer.Subscribe("example_tmq_topic", nil) if err != nil { panic(err) } @@ -611,13 +580,17 @@ while(running){ ```go for { - result, err := consumer.Poll(time.Second) - if err != nil { - panic(err) + ev := consumer.Poll(0) + if ev != nil { + switch e := ev.(type) { + case *tmqcommon.DataMessage: + fmt.Println(e.Value()) + case tmqcommon.Error: + fmt.Fprintf(os.Stderr, "%% Error: %v: %v\n", e.Code(), e) + panic(e) + } + consumer.Commit() } - fmt.Println(result) - consumer.Commit(context.Background(), result.Message) - consumer.FreeMessage(result.Message) } ``` @@ -729,7 +702,11 @@ consumer.close(); ```go -consumer.Close() +/* Unsubscribe */ +_ = consumer.Unsubscribe() + +/* Close consumer */ +_ = consumer.Close() ``` diff --git a/docs/en/14-reference/03-connector/05-go.mdx b/docs/en/14-reference/03-connector/05-go.mdx index df5b129cea..60407c0735 100644 --- a/docs/en/14-reference/03-connector/05-go.mdx +++ b/docs/en/14-reference/03-connector/05-go.mdx @@ -355,26 +355,29 @@ The `af` package encapsulates TDengine advanced functions such as connection man #### Subscribe -* `func NewConsumer(conf *Config) (*Consumer, error)` +* `func NewConsumer(conf *tmq.ConfigMap) (*Consumer, error)` Creates consumer group. -* `func (c *Consumer) Subscribe(topics []string) error` +* `func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error` +Note: `rebalanceCb` is reserved for compatibility purpose + +Subscribes a topic. + +* `func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error` +Note: `rebalanceCb` is reserved for compatibility purpose Subscribes to topics. -* `func (c *Consumer) Poll(timeout time.Duration) (*Result, error)` +* `func (c *Consumer) Poll(timeoutMs int) tmq.Event` Polling information. -* `func (c *Consumer) Commit(ctx context.Context, message unsafe.Pointer) error` +* `func (c *Consumer) Commit() ([]tmq.TopicPartition, error)` +Note: `tmq.TopicPartition` is reserved for compatibility purpose Commit information. -* `func (c *Consumer) FreeMessage(message unsafe.Pointer)` - -Free information. - * `func (c *Consumer) Unsubscribe() error` Unsubscribe. @@ -441,25 +444,36 @@ Close consumer. ### Subscribe via WebSocket -* `func NewConsumer(config *Config) (*Consumer, error)` +* `func NewConsumer(conf *tmq.ConfigMap) (*Consumer, error)` - Creates consumer group. +Creates consumer group. -* `func (c *Consumer) Subscribe(topic []string) error` +* `func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error` +Note: `rebalanceCb` is reserved for compatibility purpose - Subscribes to topics. +Subscribes a topic. -* `func (c *Consumer) Poll(timeout time.Duration) (*Result, error)` +* `func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error` +Note: `rebalanceCb` is reserved for compatibility purpose - Polling information. +Subscribes to topics. -* `func (c *Consumer) Commit(messageID uint64) error` +* `func (c *Consumer) Poll(timeoutMs int) tmq.Event` - Commit information. +Polling information. + +* `func (c *Consumer) Commit() ([]tmq.TopicPartition, error)` +Note: `tmq.TopicPartition` is reserved for compatibility purpose + +Commit information. + +* `func (c *Consumer) Unsubscribe() error` + +Unsubscribe. * `func (c *Consumer) Close() error` - Close consumer. +Close consumer. For a complete example see [GitHub sample file](https://github.com/taosdata/driver-go/blob/3.0/examples/tmqoverws/main.go) diff --git a/docs/examples/go/go.mod b/docs/examples/go/go.mod index 2bc1a74cb6..6696852312 100644 --- a/docs/examples/go/go.mod +++ b/docs/examples/go/go.mod @@ -2,5 +2,5 @@ module goexample go 1.17 -require github.com/taosdata/driver-go/v3 3.0 +require github.com/taosdata/driver-go/v3 3.1.0 diff --git a/docs/examples/go/sub/main.go b/docs/examples/go/sub/main.go index a13d394a2c..1f7218936f 100644 --- a/docs/examples/go/sub/main.go +++ b/docs/examples/go/sub/main.go @@ -1,17 +1,12 @@ package main import ( - "context" - "encoding/json" "fmt" - "strconv" - "time" + "os" "github.com/taosdata/driver-go/v3/af" "github.com/taosdata/driver-go/v3/af/tmq" - "github.com/taosdata/driver-go/v3/common" - "github.com/taosdata/driver-go/v3/errors" - "github.com/taosdata/driver-go/v3/wrapper" + tmqcommon "github.com/taosdata/driver-go/v3/common/tmq" ) func main() { @@ -28,55 +23,26 @@ func main() { if err != nil { panic(err) } - config := tmq.NewConfig() - defer config.Destroy() - err = config.SetGroupID("test") if err != nil { panic(err) } - err = config.SetAutoOffsetReset("earliest") - if err != nil { - panic(err) - } - err = config.SetConnectIP("127.0.0.1") - if err != nil { - panic(err) - } - err = config.SetConnectUser("root") - if err != nil { - panic(err) - } - err = config.SetConnectPass("taosdata") - if err != nil { - panic(err) - } - err = config.SetConnectPort("6030") - if err != nil { - panic(err) - } - err = config.SetMsgWithTableName(true) - if err != nil { - panic(err) - } - err = config.EnableHeartBeat() - if err != nil { - panic(err) - } - err = config.EnableAutoCommit(func(result *wrapper.TMQCommitCallbackResult) { - if result.ErrCode != 0 { - errStr := wrapper.TMQErr2Str(result.ErrCode) - err := errors.NewError(int(result.ErrCode), errStr) - panic(err) - } + consumer, err := tmq.NewConsumer(&tmqcommon.ConfigMap{ + "group.id": "test", + "auto.offset.reset": "earliest", + "td.connect.ip": "127.0.0.1", + "td.connect.user": "root", + "td.connect.pass": "taosdata", + "td.connect.port": "6030", + "client.id": "test_tmq_client", + "enable.auto.commit": "false", + "enable.heartbeat.background": "true", + "experimental.snapshot.enable": "true", + "msg.with.table.name": "true", }) if err != nil { panic(err) } - consumer, err := tmq.NewConsumer(config) - if err != nil { - panic(err) - } - err = consumer.Subscribe([]string{"example_tmq_topic"}) + err = consumer.Subscribe("example_tmq_topic", nil) if err != nil { panic(err) } @@ -88,19 +54,25 @@ func main() { if err != nil { panic(err) } - for { - result, err := consumer.Poll(time.Second) - if err != nil { - panic(err) + for i := 0; i < 5; i++ { + ev := consumer.Poll(0) + if ev != nil { + switch e := ev.(type) { + case *tmqcommon.DataMessage: + fmt.Println(e.String()) + case tmqcommon.Error: + fmt.Fprintf(os.Stderr, "%% Error: %v: %v\n", e.Code(), e) + panic(e) + } + consumer.Commit() } - if result.Type != common.TMQ_RES_DATA { - panic("want message type 1 got " + strconv.Itoa(int(result.Type))) - } - data, _ := json.Marshal(result.Data) - fmt.Println(string(data)) - consumer.Commit(context.Background(), result.Message) - consumer.FreeMessage(result.Message) - break } - consumer.Close() + err = consumer.Unsubscribe() + if err != nil { + panic(err) + } + err = consumer.Close() + if err != nil { + panic(err) + } } diff --git a/docs/zh/07-develop/07-tmq.mdx b/docs/zh/07-develop/07-tmq.mdx index 1f5a089aaa..039e9eb635 100644 --- a/docs/zh/07-develop/07-tmq.mdx +++ b/docs/zh/07-develop/07-tmq.mdx @@ -115,19 +115,22 @@ class TaosConsumer(): ```go -func NewConsumer(conf *Config) (*Consumer, error) +func NewConsumer(conf *tmq.ConfigMap) (*Consumer, error) -func (c *Consumer) Close() error +// 出于兼容目的保留 rebalanceCb 参数,当前未使用 +func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error -func (c *Consumer) Commit(ctx context.Context, message unsafe.Pointer) error +// 出于兼容目的保留 rebalanceCb 参数,当前未使用 +func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error -func (c *Consumer) FreeMessage(message unsafe.Pointer) +func (c *Consumer) Poll(timeoutMs int) tmq.Event -func (c *Consumer) Poll(timeout time.Duration) (*Result, error) - -func (c *Consumer) Subscribe(topics []string) error +// 出于兼容目的保留 tmq.TopicPartition 参数,当前未使用 +func (c *Consumer) Commit() ([]tmq.TopicPartition, error) func (c *Consumer) Unsubscribe() error + +func (c *Consumer) Close() error ``` @@ -355,50 +358,20 @@ public class MetersDeserializer extends ReferenceDeserializer { ```go -config := tmq.NewConfig() -defer config.Destroy() -err = config.SetGroupID("test") -if err != nil { - panic(err) -} -err = config.SetAutoOffsetReset("earliest") -if err != nil { - panic(err) -} -err = config.SetConnectIP("127.0.0.1") -if err != nil { - panic(err) -} -err = config.SetConnectUser("root") -if err != nil { - panic(err) -} -err = config.SetConnectPass("taosdata") -if err != nil { - panic(err) -} -err = config.SetConnectPort("6030") -if err != nil { - panic(err) -} -err = config.SetMsgWithTableName(true) -if err != nil { - panic(err) -} -err = config.EnableHeartBeat() -if err != nil { - panic(err) -} -err = config.EnableAutoCommit(func(result *wrapper.TMQCommitCallbackResult) { - if result.ErrCode != 0 { - errStr := wrapper.TMQErr2Str(result.ErrCode) - err := errors.NewError(int(result.ErrCode), errStr) - panic(err) - } -}) -if err != nil { - panic(err) +conf := &tmq.ConfigMap{ + "group.id": "test", + "auto.offset.reset": "earliest", + "td.connect.ip": "127.0.0.1", + "td.connect.user": "root", + "td.connect.pass": "taosdata", + "td.connect.port": "6030", + "client.id": "test_tmq_c", + "enable.auto.commit": "false", + "enable.heartbeat.background": "true", + "experimental.snapshot.enable": "true", + "msg.with.table.name": "true", } +consumer, err := NewConsumer(conf) ``` @@ -532,11 +505,7 @@ consumer.subscribe(topics); ```go -consumer, err := tmq.NewConsumer(config) -if err != nil { - panic(err) -} -err = consumer.Subscribe([]string{"example_tmq_topic"}) +err = consumer.Subscribe("example_tmq_topic", nil) if err != nil { panic(err) } @@ -620,13 +589,17 @@ while(running){ ```go for { - result, err := consumer.Poll(time.Second) - if err != nil { - panic(err) + ev := consumer.Poll(0) + if ev != nil { + switch e := ev.(type) { + case *tmqcommon.DataMessage: + fmt.Println(e.Value()) + case tmqcommon.Error: + fmt.Fprintf(os.Stderr, "%% Error: %v: %v\n", e.Code(), e) + panic(e) + } + consumer.Commit() } - fmt.Println(result) - consumer.Commit(context.Background(), result.Message) - consumer.FreeMessage(result.Message) } ``` @@ -738,7 +711,11 @@ consumer.close(); ```go -consumer.Close() +/* Unsubscribe */ +_ = consumer.Unsubscribe() + +/* Close consumer */ +_ = consumer.Close() ``` diff --git a/docs/zh/08-connector/20-go.mdx b/docs/zh/08-connector/20-go.mdx index 0fc4007f63..2aa1a58e49 100644 --- a/docs/zh/08-connector/20-go.mdx +++ b/docs/zh/08-connector/20-go.mdx @@ -15,7 +15,7 @@ import GoOpenTSDBTelnet from "../07-develop/03-insert-data/_go_opts_telnet.mdx" import GoOpenTSDBJson from "../07-develop/03-insert-data/_go_opts_json.mdx" import GoQuery from "../07-develop/04-query-data/_go.mdx" -`driver-go` 是 TDengine 的官方 Go 语言连接器,实现了 Go 语言[ database/sql ](https://golang.org/pkg/database/sql/) 包的接口。Go 开发人员可以通过它开发存取 TDengine 集群数据的应用软件。 +`driver-go` 是 TDengine 的官方 Go 语言连接器,实现了 Go 语言 [database/sql](https://golang.org/pkg/database/sql/) 包的接口。Go 开发人员可以通过它开发存取 TDengine 集群数据的应用软件。 `driver-go` 提供两种建立连接的方式。一种是**原生连接**,它通过 TDengine 客户端驱动程序(taosc)原生连接 TDengine 运行实例,支持数据写入、查询、订阅、schemaless 接口和参数绑定接口等功能。另外一种是 **REST 连接**,它通过 taosAdapter 提供的 REST 接口连接 TDengine 运行实例。REST 连接实现的功能特性集合和原生连接有少量不同。 @@ -112,6 +112,7 @@ REST 连接支持所有能运行 Go 的平台。 ```text username:password@protocol(address)/dbname?param=value ``` + ### 使用连接器进行连接 @@ -176,6 +177,7 @@ func main() { } } ``` + @@ -207,6 +209,7 @@ func main() { } } ``` + @@ -357,33 +360,32 @@ func main() { #### 订阅 -* `func NewConsumer(conf *Config) (*Consumer, error)` +* `func NewConsumer(conf *tmq.ConfigMap) (*Consumer, error)` -创建消费者。 + 创建消费者。 -* `func (c *Consumer) Subscribe(topics []string) error` +* `func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error` +注意:出于兼容目的保留 `rebalanceCb` 参数,当前未使用 -订阅主题。 + 订阅单个主题。 -* `func (c *Consumer) Poll(timeout time.Duration) (*Result, error)` +* `func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error` +注意:出于兼容目的保留 `rebalanceCb` 参数,当前未使用 -轮询消息。 + 订阅主题。 -* `func (c *Consumer) Commit(ctx context.Context, message unsafe.Pointer) error` +* `func (c *Consumer) Poll(timeoutMs int) tmq.Event` -提交消息。 + 轮询消息。 -* `func (c *Consumer) FreeMessage(message unsafe.Pointer)` +* `func (c *Consumer) Commit() ([]tmq.TopicPartition, error)` +注意:出于兼容目的保留 `tmq.TopicPartition` 参数,当前未使用 -释放消息。 - -* `func (c *Consumer) Unsubscribe() error` - -取消订阅。 + 提交消息。 * `func (c *Consumer) Close() error` -关闭消费者。 + 关闭连接。 #### schemaless @@ -443,25 +445,32 @@ func main() { ### 通过 WebSocket 订阅 -* `func NewConsumer(config *Config) (*Consumer, error)` +* `func NewConsumer(conf *tmq.ConfigMap) (*Consumer, error)` - 创建消费者。 + 创建消费者。 -* `func (c *Consumer) Subscribe(topic []string) error` +* `func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error` +注意:出于兼容目的保留 `rebalanceCb` 参数,当前未使用 - 订阅主题。 + 订阅单个主题。 -* `func (c *Consumer) Poll(timeout time.Duration) (*Result, error)` +* `func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) error` +注意:出于兼容目的保留 `rebalanceCb` 参数,当前未使用 - 轮询消息。 + 订阅主题。 -* `func (c *Consumer) Commit(messageID uint64) error` +* `func (c *Consumer) Poll(timeoutMs int) tmq.Event` - 提交消息。 + 轮询消息。 + +* `func (c *Consumer) Commit() ([]tmq.TopicPartition, error)` +注意:出于兼容目的保留 `tmq.TopicPartition` 参数,当前未使用 + + 提交消息。 * `func (c *Consumer) Close() error` - 关闭消费者。 + 关闭连接。 完整订阅示例参见 [GitHub 示例文件](https://github.com/taosdata/driver-go/blob/3.0/examples/tmqoverws/main.go) From 66d84314721be372de3387a85c9f28b3ce7e86ba Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 14 Jan 2023 16:57:44 +0800 Subject: [PATCH 100/139] chore: test case adaption --- tests/script/tsim/sma/tsmaCreateInsertQuery.sim | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim index 118ca42808..442b4970e4 100644 --- a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim +++ b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim @@ -6,7 +6,6 @@ sql connect print =============== create database sql create database d1 keep 36500d vgroups 1 -sql alter local 'querySmaOptimize' '1'; sql use d1 print =============== create super table, include column type for count/sum/min/max/first From 88126dfc813929e09b60d5b540bc1836e8a25446 Mon Sep 17 00:00:00 2001 From: Hui Li <52318143+plum-lihui@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:06:40 +0800 Subject: [PATCH 101/139] Update tmqConsFromTsdb1-mutilVg.py --- tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py index 528b3a8088..da8ac6c57d 100644 --- a/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py +++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-mutilVg.py @@ -116,7 +116,7 @@ class TDTestCase: topicList = topicNameList[0] ifcheckdata = 1 ifManualCommit = 1 - keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest' + keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:200, auto.offset.reset:earliest' tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit) consumerId = 4 @@ -188,7 +188,7 @@ class TDTestCase: topicList = topicNameList[0] ifcheckdata = 1 ifManualCommit = 1 - keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest' + keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:200, auto.offset.reset:earliest' tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit) tdLog.info("start consume processor 0") From e964a4d58c569556b8e42fb7a53dee3e0a0a816c Mon Sep 17 00:00:00 2001 From: Hui Li <52318143+plum-lihui@users.noreply.github.com> Date: Mon, 16 Jan 2023 09:07:07 +0800 Subject: [PATCH 102/139] Update tmqConsFromTsdb1-1ctb.py --- tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py index 009862137f..4dcc0b963f 100644 --- a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py +++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py @@ -116,7 +116,7 @@ class TDTestCase: topicList = topicNameList[0] ifcheckdata = 1 ifManualCommit = 1 - keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest' + keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:200, auto.offset.reset:earliest' tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit) consumerId = 4 @@ -188,7 +188,7 @@ class TDTestCase: topicList = topicNameList[0] ifcheckdata = 1 ifManualCommit = 1 - keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:1000, auto.offset.reset:earliest' + keyList = 'group.id:cgrp1, enable.auto.commit:true, auto.commit.interval.ms:200, auto.offset.reset:earliest' tmqCom.insertConsumerInfo(consumerId, expectrowcnt,topicList,keyList,ifcheckdata,ifManualCommit) tdLog.info("start consume processor 0") From b09b67acd2dc62fbf72ec66498db734918e87c74 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 16 Jan 2023 10:40:15 +0800 Subject: [PATCH 103/139] enh: update epset on dnode info changed --- source/dnode/mgmt/node_mgmt/src/dmMgmt.c | 4 + source/dnode/mgmt/node_util/src/dmEps.c | 169 +++++++++++++++++++++-- 2 files changed, 164 insertions(+), 9 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index b6cce249ea..27673b3dcf 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -83,6 +83,10 @@ static void dmClearVars(SDnode *pDnode) { taosArrayDestroy(pData->dnodeEps); pData->dnodeEps = NULL; } + if (pData->oldDnodeEps != NULL) { + taosArrayDestroy(pData->oldDnodeEps); + pData->oldDnodeEps = NULL; + } if (pData->dnodeHash != NULL) { taosHashCleanup(pData->dnodeHash); pData->dnodeHash = NULL; diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 4285eb5c07..e061a7dfeb 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -18,9 +18,18 @@ #include "tjson.h" #include "tmisce.h" -static void dmPrintEps(SDnodeData *pData); -static bool dmIsEpChanged(SDnodeData *pData, int32_t dnodeId, const char *ep); -static void dmResetEps(SDnodeData *pData, SArray *dnodeEps); +typedef struct { + int32_t id; + uint16_t oldPort; + uint16_t newPort; + char oldFqdn[TSDB_FQDN_LEN]; + char newFqdn[TSDB_FQDN_LEN]; +} SDnodeEpPair; + +static void dmPrintEps(SDnodeData *pData); +static bool dmIsEpChanged(SDnodeData *pData, int32_t dnodeId, const char *ep); +static void dmResetEps(SDnodeData *pData, SArray *dnodeEps); +static int32_t dmReadDnodePairs(SDnodeData *pData); static void dmGetDnodeEp(SDnodeData *pData, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort) { taosThreadRwlockRdlock(&pData->lock); @@ -342,11 +351,11 @@ void dmUpdateDnodeInfo(void *data, int32_t *did, int64_t *clusterId, char *fqdn, if (pData->oldDnodeEps != NULL) { int32_t size = (int32_t)taosArrayGetSize(pData->oldDnodeEps); for (int32_t i = 0; i < size; ++i) { - SDnodeEp *pDnodeEp = taosArrayGet(pData->oldDnodeEps, i); - if (strcmp(pDnodeEp->ep.fqdn, fqdn) == 0 && pDnodeEp->ep.port == *port) { - dInfo("dnode:%d, update ep:%s:%u to %s:%u", dnodeId, fqdn, *port, pDnodeEp->ep.fqdn, pDnodeEp->ep.port); - tstrncpy(fqdn, pDnodeEp->ep.fqdn, TSDB_FQDN_LEN); - *port = pDnodeEp->ep.port; + SDnodeEpPair *pair = taosArrayGet(pData->oldDnodeEps, i); + if (strcmp(pair->oldFqdn, fqdn) == 0 && pair->oldPort == *port) { + dInfo("dnode:%d, update ep:%s:%u to %s:%u", dnodeId, fqdn, *port, pair->newFqdn, pair->newPort); + tstrncpy(fqdn, pair->newFqdn, TSDB_FQDN_LEN); + *port = pair->newPort; } } } @@ -376,4 +385,146 @@ void dmUpdateDnodeInfo(void *data, int32_t *did, int64_t *clusterId, char *fqdn, } taosThreadRwlockUnlock(&pData->lock); -} \ No newline at end of file +} + +static int32_t dmDecodeEpPairs(SJson *pJson, SDnodeData *pData) { + int32_t code = 0; + + SJson *dnodes = tjsonGetObjectItem(pJson, "dnodes"); + if (dnodes == NULL) return 0; + int32_t numOfDnodes = tjsonGetArraySize(dnodes); + + for (int32_t i = 0; i < numOfDnodes; ++i) { + SJson *dnode = tjsonGetArrayItem(dnodes, i); + if (dnode == NULL) return -1; + + SDnodeEpPair pair = {0}; + tjsonGetInt32ValueFromDouble(dnode, "id", pair.id, code); + if (code < 0) return -1; + code = tjsonGetStringValue(dnode, "fqdn", pair.oldFqdn); + if (code < 0) return -1; + tjsonGetUInt16ValueFromDouble(dnode, "port", pair.oldPort, code); + if (code < 0) return -1; + code = tjsonGetStringValue(dnode, "new_fqdn", pair.newFqdn); + if (code < 0) return -1; + tjsonGetUInt16ValueFromDouble(dnode, "new_port", pair.newPort, code); + if (code < 0) return -1; + + if (taosArrayPush(pData->oldDnodeEps, &pair) == NULL) return -1; + } + + return code; +} + +static int32_t dmReadDnodePairs(SDnodeData *pData) { + int32_t code = -1; + TdFilePtr pFile = NULL; + char *content = NULL; + SJson *pJson = NULL; + char file[PATH_MAX] = {0}; + snprintf(file, sizeof(file), "%s%sdnode%sep.json", tsDataDir, TD_DIRSEP, TD_DIRSEP); + + pData->oldDnodeEps = taosArrayInit(1, sizeof(SDnodeEp)); + if (pData->oldDnodeEps == NULL) { + dError("failed to calloc dnodeEp array since %s", strerror(errno)); + goto _OVER; + } + + if (taosStatFile(file, NULL, NULL) < 0) { + dDebug("dnode file:%s not exist", file); + code = 0; + goto _OVER; + } + + pFile = taosOpenFile(file, TD_FILE_READ); + if (pFile == NULL) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to open dnode file:%s since %s", file, terrstr()); + goto _OVER; + } + + int64_t size = 0; + if (taosFStatFile(pFile, &size, NULL) < 0) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to fstat dnode file:%s since %s", file, terrstr()); + goto _OVER; + } + + content = taosMemoryMalloc(size + 1); + if (content == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + goto _OVER; + } + + if (taosReadFile(pFile, content, size) != size) { + terrno = TAOS_SYSTEM_ERROR(errno); + dError("failed to read dnode file:%s since %s", file, terrstr()); + goto _OVER; + } + + content[size] = '\0'; + + pJson = tjsonParse(content); + if (pJson == NULL) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } + + if (dmDecodeEpPairs(pJson, pData) < 0) { + terrno = TSDB_CODE_INVALID_JSON_FORMAT; + goto _OVER; + } + + code = 0; + dInfo("succceed to read mnode file %s", file); + +_OVER: + if (content != NULL) taosMemoryFree(content); + if (pJson != NULL) cJSON_Delete(pJson); + if (pFile != NULL) taosCloseFile(&pFile); + + if (code != 0) { + dError("failed to read dnode file:%s since %s", file, terrstr()); + } + + for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pData->oldDnodeEps); ++i) { + SDnodeEpPair *pair = taosArrayGet(pData->oldDnodeEps, i); + for (int32_t j = 0; j < (int32_t)taosArrayGetSize(pData->dnodeEps); ++j) { + SDnodeEp *pDnodeEp = taosArrayGet(pData->dnodeEps, j); + if (strcmp(pDnodeEp->ep.fqdn, pair->oldFqdn) == 0 && pDnodeEp->ep.port == pair->oldPort) { + dInfo("dnode:%d, will update ep:%s:%u to %s:%u in array", pDnodeEp->id, pDnodeEp->ep.fqdn, pDnodeEp->ep.port, + pair->newFqdn, pair->newPort); + tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); + pDnodeEp->ep.port = pair->newPort; + } + } + void *pIter = taosHashIterate(pData->dnodeHash, NULL); + while (pIter) { + SDnodeEp *pDnodeEp = pIter; + if (strcmp(pDnodeEp->ep.fqdn, pair->oldFqdn) == 0 && pDnodeEp->ep.port == pair->oldPort) { + dDebug("dnode:%d, will update ep:%s:%u to %s:%u in hash", pDnodeEp->id, pDnodeEp->ep.fqdn, pDnodeEp->ep.port, + pair->newFqdn, pair->newPort); + tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); + pDnodeEp->ep.port = pair->newPort; + } + pIter = taosHashIterate(pData->dnodeHash, pIter); + } + } + + if (taosArrayGetSize(pData->dnodeEps) == 0) { + SDnodeEp dnodeEp = {0}; + dnodeEp.isMnode = 1; + taosGetFqdnPortFromEp(tsFirst, &dnodeEp.ep); + taosArrayPush(pData->dnodeEps, &dnodeEp); + } + + dDebug("reset dnode list on startup"); + dmResetEps(pData, pData->dnodeEps); + + if (dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { + dError("localEp %s different with %s and need reconfigured", tsLocalEp, file); + return -1; + } + + return code; +} From 30381ec446ea0ab4a77f806bf93ebec09a9d72e5 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 16 Jan 2023 11:03:53 +0800 Subject: [PATCH 104/139] fix: sma optimize memory leak --- source/libs/planner/src/planOptimizer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 120a853741..b47f0bc043 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -1334,11 +1334,12 @@ static int32_t smaIndexOptApplyIndex(SLogicSubplan* pLogicSubplan, SScanLogicNod if (TSDB_CODE_SUCCESS == code) { code = replaceLogicNode(pLogicSubplan, pScan->node.pParent, pSmaScan); } + if (TSDB_CODE_SUCCESS == code) { + nodesDestroyNode((SNode*)pScan->node.pParent); + } return code; } -static void smaIndexOptDestroySmaIndex(void* p) { taosMemoryFree(((STableIndexInfo*)p)->expr); } - static int32_t smaIndexOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan, SScanLogicNode* pScan) { int32_t code = TSDB_CODE_SUCCESS; int32_t nindexes = taosArrayGetSize(pScan->pSmaIndexes); @@ -1348,8 +1349,6 @@ static int32_t smaIndexOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pLogi code = smaIndexOptCouldApplyIndex(pScan, pIndex, &pSmaCols); if (TSDB_CODE_SUCCESS == code && NULL != pSmaCols) { code = smaIndexOptApplyIndex(pLogicSubplan, pScan, pIndex, pSmaCols); - taosArrayDestroyEx(pScan->pSmaIndexes, smaIndexOptDestroySmaIndex); - pScan->pSmaIndexes = NULL; pCxt->optimized = true; break; } From ce2a0ee7d56bf8f55c802ee2930860250474ecfc Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 16 Jan 2023 11:41:15 +0800 Subject: [PATCH 105/139] fix: taosbenchmark schemaless refine (#19566) * fix: optimize taosbenchmark data preparing for sml json * fix: update taos-tools 5c5e79f * fix: update taos-tools 298a30d * fix: taos-tools 143b9e4 * fix: update taos-tools 0b56d15 * fix: update taos-tools 7375f23 * fix: update taos-tools eaf2309 * fix: update taos-tools 723f696 --- cmake/taostools_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index bc3fe87884..cddc5aee4e 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG f80dd7e + GIT_TAG 723f696 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From da6722d35370aaef0e234d391e1e8c4f88a8c9e0 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 16 Jan 2023 13:28:18 +0800 Subject: [PATCH 106/139] enh: update epset on dnode info changed --- source/dnode/mgmt/node_mgmt/src/dmMgmt.c | 3 +++ source/dnode/mgmt/node_util/inc/dmUtil.h | 1 + source/dnode/mgmt/node_util/src/dmEps.c | 26 ++++++++++++++++++------ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index 27673b3dcf..16d453abb5 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -84,6 +84,9 @@ static void dmClearVars(SDnode *pDnode) { pData->dnodeEps = NULL; } if (pData->oldDnodeEps != NULL) { + if (dmWriteEps(pData) == 0) { + dmRemoveDnodePairs(pData); + } taosArrayDestroy(pData->oldDnodeEps); pData->oldDnodeEps = NULL; } diff --git a/source/dnode/mgmt/node_util/inc/dmUtil.h b/source/dnode/mgmt/node_util/inc/dmUtil.h index 784bb3c5e1..40b171601d 100644 --- a/source/dnode/mgmt/node_util/inc/dmUtil.h +++ b/source/dnode/mgmt/node_util/inc/dmUtil.h @@ -169,6 +169,7 @@ void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); void dmGetMnodeEpSetForRedirect(SDnodeData *pData, SRpcMsg *pMsg, SEpSet *pEpSet); void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); void dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port); +void dmRemoveDnodePairs(SDnodeData *pData); #ifdef __cplusplus } diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index e061a7dfeb..8234787baa 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -155,6 +155,7 @@ _OVER: if (code != 0) { dError("failed to read dnode file:%s since %s", file, terrstr()); + return code; } if (taosArrayGetSize(pData->dnodeEps) == 0) { @@ -164,6 +165,10 @@ _OVER: taosArrayPush(pData->dnodeEps, &dnodeEp); } + if (dmReadDnodePairs(pData) != 0) { + return -1; + } + dDebug("reset dnode list on startup"); dmResetEps(pData, pData->dnodeEps); @@ -416,6 +421,13 @@ static int32_t dmDecodeEpPairs(SJson *pJson, SDnodeData *pData) { return code; } +void dmRemoveDnodePairs(SDnodeData *pData) { + char file[PATH_MAX] = {0}; + snprintf(file, sizeof(file), "%s%sdnode%sep.json", tsDataDir, TD_DIRSEP, TD_DIRSEP); + dInfo("dnode file:%s is removed", file); + (void)taosRemoveFile(file); +} + static int32_t dmReadDnodePairs(SDnodeData *pData) { int32_t code = -1; TdFilePtr pFile = NULL; @@ -424,12 +436,6 @@ static int32_t dmReadDnodePairs(SDnodeData *pData) { char file[PATH_MAX] = {0}; snprintf(file, sizeof(file), "%s%sdnode%sep.json", tsDataDir, TD_DIRSEP, TD_DIRSEP); - pData->oldDnodeEps = taosArrayInit(1, sizeof(SDnodeEp)); - if (pData->oldDnodeEps == NULL) { - dError("failed to calloc dnodeEp array since %s", strerror(errno)); - goto _OVER; - } - if (taosStatFile(file, NULL, NULL) < 0) { dDebug("dnode file:%s not exist", file); code = 0; @@ -470,7 +476,15 @@ static int32_t dmReadDnodePairs(SDnodeData *pData) { goto _OVER; } + pData->oldDnodeEps = taosArrayInit(1, sizeof(SDnodeEp)); + if (pData->oldDnodeEps == NULL) { + dError("failed to calloc dnodeEp array since %s", strerror(errno)); + goto _OVER; + } + if (dmDecodeEpPairs(pJson, pData) < 0) { + taosArrayDestroy(pData->oldDnodeEps); + pData->oldDnodeEps = NULL; terrno = TSDB_CODE_INVALID_JSON_FORMAT; goto _OVER; } From ecd1e499f29136a27b82837e0882f3f8233e26ff Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 16 Jan 2023 14:08:27 +0800 Subject: [PATCH 107/139] test: add test case for tsma --- .../script/tsim/sma/tsmaCreateInsertQuery.sim | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim index 442b4970e4..8aadfb881b 100644 --- a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim +++ b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim @@ -7,9 +7,10 @@ sql connect print =============== create database sql create database d1 keep 36500d vgroups 1 sql use d1 +sql alter local 'querySmaOptimize' '1'; print =============== create super table, include column type for count/sum/min/max/first -sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) +sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double, c4 binary(10),c5 nchar(10)) tags (t1 int unsigned) sql show stables if $rows != 1 then @@ -25,16 +26,33 @@ if $rows != 1 then endi print =============== insert data, mode1: one row one table in sql -sql insert into ct1 values('2022-10-19 09:55:45.682', 10, 2.0, 3.0) -sql insert into ct1 values('2022-10-19 09:55:46.682', 11, 2.1, 3.1)('2022-10-19 09:55:47.682', -12, -2.2, -3.2)('2022-10-19 09:55:48.682', -13, -2.3, -3.3) +sql insert into ct1 values('2022-10-19 09:55:45.682', 10, 2.0, 3.0, "a", "n0") +sql insert into ct1 values('2022-10-19 09:55:46.682', 11, 2.1, 3.1,"b","n1")('2022-10-19 09:55:47.682', -12, -2.2, -3.2,"c","n2")('2022-10-19 09:55:48.682', -13, -2.3, -3.3,"d","n3") print =============== create sma index from super table sql create sma index sma_index_name1 on stb function(max(c1),max(c2),min(c1)) interval(5m,10s) sliding(5m) watermark 1s max_delay 1s -print $data00 $data01 $data02 $data03 +sql create sma index sma_index_name2 on stb function(sum(c1),first(c1), last(c1), first(c4),last(c4),count(c4),first(c5),last(c5),count(c5),apercentile(c1,80,"t-digest"), avg(c2),count(c3), spread(c3), stddev(c2), hyperloglog(c2)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(sum(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(min(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(max(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(avg(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(apercentile(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(spread(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); + +sql_error create sma index sma_index_name3 on stb function(sum(c5)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(min(c5)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(max(c5)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(avg(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(apercentile(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(spread(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); print =============== trigger stream to execute sma aggr task and insert sma data into sma store -sql insert into ct1 values('2022-10-19 09:55:50.682', 20, 20.0, 30.0) +sql insert into ct1 values('2022-10-19 09:55:50.682', 20, 20.0, 30.0,"e","n5") #==================== sleep 2s to wait for tsma result sleep 2000 @@ -42,9 +60,11 @@ print =============== show streams ================================ sql show streams; print $data00 $data01 $data02 -if $data00 != sma_index_name1 then - print $data00 - return -1 +if $data00 != sma_index_name1 then + if $data00 != sma_index_name2 then + print $data00 + return -1 + endi endi print =============== select * from ct1 from memory From b89561c0770b512c99d1813aa81e5a5705c5f532 Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 16 Jan 2023 14:12:44 +0800 Subject: [PATCH 108/139] test: add test case for tsma --- tests/script/tsim/sma/tsmaCreateInsertQuery.sim | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim index 8aadfb881b..27f4a475d2 100644 --- a/tests/script/tsim/sma/tsmaCreateInsertQuery.sim +++ b/tests/script/tsim/sma/tsmaCreateInsertQuery.sim @@ -32,7 +32,8 @@ sql insert into ct1 values('2022-10-19 09:55:46.682', 11, 2.1, 3.1,"b","n1")('20 print =============== create sma index from super table sql create sma index sma_index_name1 on stb function(max(c1),max(c2),min(c1)) interval(5m,10s) sliding(5m) watermark 1s max_delay 1s -sql create sma index sma_index_name2 on stb function(sum(c1),first(c1), last(c1), first(c4),last(c4),count(c4),first(c5),last(c5),count(c5),apercentile(c1,80,"t-digest"), avg(c2),count(c3), spread(c3), stddev(c2), hyperloglog(c2)) interval(5m,10s) sliding(5m); +sql create sma index sma_index_name2 on stb function(sum(c1),first(c1), last(c1), first(c4),last(c4),count(c4),first(c5),last(c5),count(c5),apercentile(c1,80,"t-digest"), avg(c2),count(c3), spread(c3), stddev(c2), hyperloglog(c2), hyperloglog(c4), hyperloglog(c5)) interval(5m,10s) sliding(5m); +# for varchar/binary sql_error create sma index sma_index_name3 on stb function(sum(c4)) interval(5m,10s) sliding(5m); sql_error create sma index sma_index_name3 on stb function(min(c4)) interval(5m,10s) sliding(5m); sql_error create sma index sma_index_name3 on stb function(max(c4)) interval(5m,10s) sliding(5m); @@ -40,16 +41,14 @@ sql_error create sma index sma_index_name3 on stb function(avg(c4)) interval(5m, sql_error create sma index sma_index_name3 on stb function(apercentile(c4)) interval(5m,10s) sliding(5m); sql_error create sma index sma_index_name3 on stb function(spread(c4)) interval(5m,10s) sliding(5m); sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); -sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); - +# for nchar sql_error create sma index sma_index_name3 on stb function(sum(c5)) interval(5m,10s) sliding(5m); sql_error create sma index sma_index_name3 on stb function(min(c5)) interval(5m,10s) sliding(5m); sql_error create sma index sma_index_name3 on stb function(max(c5)) interval(5m,10s) sliding(5m); -sql_error create sma index sma_index_name3 on stb function(avg(c4)) interval(5m,10s) sliding(5m); -sql_error create sma index sma_index_name3 on stb function(apercentile(c4)) interval(5m,10s) sliding(5m); -sql_error create sma index sma_index_name3 on stb function(spread(c4)) interval(5m,10s) sliding(5m); -sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); -sql_error create sma index sma_index_name3 on stb function(stddev(c4)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(avg(c5)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(apercentile(c5)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(spread(c5)) interval(5m,10s) sliding(5m); +sql_error create sma index sma_index_name3 on stb function(stddev(c5)) interval(5m,10s) sliding(5m); print =============== trigger stream to execute sma aggr task and insert sma data into sma store sql insert into ct1 values('2022-10-19 09:55:50.682', 20, 20.0, 30.0,"e","n5") From c4a2ca08db0806e9af11945cd6bd9322ac49b2f2 Mon Sep 17 00:00:00 2001 From: ShuaiQChang Date: Mon, 16 Jan 2023 14:50:13 +0800 Subject: [PATCH 109/139] docs: TM-3239 --- docs/zh/05-get-started/index.md | 8 ++++---- docs/zh/05-get-started/xiaot-new.webp | Bin 0 -> 114792 bytes 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 docs/zh/05-get-started/xiaot-new.webp diff --git a/docs/zh/05-get-started/index.md b/docs/zh/05-get-started/index.md index 832310aa7c..dd4cb8793d 100644 --- a/docs/zh/05-get-started/index.md +++ b/docs/zh/05-get-started/index.md @@ -35,13 +35,13 @@ TDengine 知识地图中涵盖了 TDengine 的各种知识点,揭示了各概 - + - - - + + +
小 T 的二维码小 T 的二维码 TDengine 微信视频号 TDengine 微信公众号
加入“物联网大数据技术前沿群”
与大家进行技术交流
关注 TDengine 微信视频号
收看技术直播与教学视频
关注 TDengine 微信公众号
阅读核心技术与行业案例文章
加入“物联网大数据技术群”
与大家进行技术交流
关注 TDengine 视频号
收看技术直播与教学视频
关注 TDengine 公众号
阅读技术文章与行业案例
diff --git a/docs/zh/05-get-started/xiaot-new.webp b/docs/zh/05-get-started/xiaot-new.webp new file mode 100644 index 0000000000000000000000000000000000000000..483b54d2ef3d8894527aa154a42cf6cd2463c579 GIT binary patch literal 114792 zcmV(`K-0fcNk&FszySbPMM6+kP&iCfzySa+)xxv@jZkbONs=Uu`R?96W~0BrnN@Qb z2_pJG0ep9##(oR@zWBo54+3>-tbiVR(l@iCR_d1c2wJL9(WX2xB0kf zm7AIfAot$_I^o!6Wj-dg0m-JOsX3cwUh~ZKDD7CYKB~Nzn&!5fZ&7X4o9&i-=}gOR zYA2-u-ceIfw}lE*$)zGd3Q^@MQteP3T0Nl=kg@^=C{;dK!2WVgJxsGoN>CHBYO7;g z08Ob45HU*?@XsFmua2i1A4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_5Kc0>-j8c**QJ0VC1IdvjphX@{@eVY*W2S;Bg zeSkB^XP!@oyg71x&6XJt=ot6WbmnQ;0nG|^iR6h8=47X`d2J~~mIabIn?~@S)99H} z4xM-+fQhsiYjk%o(f~!DdQ?jma!c8hEI5y*DR(Y55)4CZ>P0w<%^hU#u#;+N;=#16 zxXEI~G!Th^SkbLxH*q0B`w$?#O_Y}g1aJYt92jv=HGx6S!G?$sA(#Y6phA${j7~Qg7AMs(SQe1y8p2*lprKo~-~ln1cBKJArPER%6cGV}4FhSQ2?oNU4G<#`zF>Urq{SSN QCol5 Date: Mon, 16 Jan 2023 15:06:31 +0800 Subject: [PATCH 110/139] test: adjust test case for ins_columns --- tests/system-test/0-others/information_schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/0-others/information_schema.py b/tests/system-test/0-others/information_schema.py index 1b82fa6e64..720eab74c4 100644 --- a/tests/system-test/0-others/information_schema.py +++ b/tests/system-test/0-others/information_schema.py @@ -56,7 +56,7 @@ class TDTestCase: self.binary_str = 'taosdata' self.nchar_str = '涛思数据' self.ins_list = ['ins_dnodes','ins_mnodes','ins_modules','ins_qnodes','ins_snodes','ins_cluster','ins_databases','ins_functions',\ - 'ins_indexes','ins_stables','ins_tables','ins_tags','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\ + 'ins_indexes','ins_stables','ins_tables','ins_tags','ins_columns','ins_users','ins_grants','ins_vgroups','ins_configs','ins_dnode_variables',\ 'ins_topics','ins_subscriptions','ins_streams','ins_stream_tasks','ins_vnodes','ins_user_privileges'] self.perf_list = ['perf_connections','perf_queries','perf_consumers','perf_trans','perf_apps'] def insert_data(self,column_dict,tbname,row_num): From 20b4c1ca832ddf94e3d6b7e91dbe8bf5def9c8f0 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 16 Jan 2023 15:16:06 +0800 Subject: [PATCH 111/139] test: add new sim to CI. --- tests/parallel_test/cases.task | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1205da31b3..cadfe2cff7 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -145,6 +145,7 @@ ,,y,script,./test.sh -f tsim/parser/precision_ns.sim ,,y,script,./test.sh -f tsim/parser/projection_limit_offset.sim ,,y,script,./test.sh -f tsim/parser/regex.sim +,,y,script,./test.sh -f tsim/parser/regressiontest.sim ,,y,script,./test.sh -f tsim/parser/select_across_vnodes.sim ,,y,script,./test.sh -f tsim/parser/select_distinct_tag.sim ,,y,script,./test.sh -f tsim/parser/select_from_cache_disk.sim From d476b6db13deae5cd81043e3d4316bb240a60486 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 16 Jan 2023 15:41:50 +0800 Subject: [PATCH 112/139] enh: update epset on dnode info changed --- include/common/tmsgcb.h | 4 +- source/dnode/mgmt/node_mgmt/src/dmMgmt.c | 8 +-- source/dnode/mgmt/node_util/inc/dmUtil.h | 2 +- source/dnode/mgmt/node_util/src/dmEps.c | 70 +++++++++++++----------- source/dnode/mnode/impl/src/mndDnode.c | 6 +- source/dnode/mnode/impl/src/mndMnode.c | 2 +- source/dnode/mnode/impl/src/mndSync.c | 2 +- source/dnode/vnode/src/vnd/vnodeOpen.c | 17 +++++- source/libs/sync/src/syncMain.c | 13 ++++- source/libs/transport/src/tmsgcb.c | 4 +- 10 files changed, 80 insertions(+), 48 deletions(-) diff --git a/include/common/tmsgcb.h b/include/common/tmsgcb.h index eaac319141..eca8740d28 100644 --- a/include/common/tmsgcb.h +++ b/include/common/tmsgcb.h @@ -39,7 +39,7 @@ typedef enum { QUEUE_MAX, } EQueueType; -typedef void (*UpdateDnodeInfoFp)(void* pData, int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); +typedef bool (*UpdateDnodeInfoFp)(void* pData, int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); typedef int32_t (*PutToQueueFp)(void* pMgmt, EQueueType qtype, SRpcMsg* pMsg); typedef int32_t (*GetQueueSizeFp)(void* pMgmt, int32_t vgId, EQueueType qtype); typedef int32_t (*SendReqFp)(const SEpSet* pEpSet, SRpcMsg* pMsg); @@ -70,7 +70,7 @@ void tmsgSendRsp(SRpcMsg* pMsg); void tmsgRegisterBrokenLinkArg(SRpcMsg* pMsg); void tmsgReleaseHandle(SRpcHandleInfo* pHandle, int8_t type); void tmsgReportStartup(const char* name, const char* desc); -void tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); +bool tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port); void tmsgUpdateDnodeEpSet(SEpSet* epset); #ifdef __cplusplus diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index 16d453abb5..3dd8a19d92 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -79,10 +79,6 @@ static void dmClearVars(SDnode *pDnode) { SDnodeData *pData = &pDnode->data; taosThreadRwlockWrlock(&pData->lock); - if (pData->dnodeEps != NULL) { - taosArrayDestroy(pData->dnodeEps); - pData->dnodeEps = NULL; - } if (pData->oldDnodeEps != NULL) { if (dmWriteEps(pData) == 0) { dmRemoveDnodePairs(pData); @@ -90,6 +86,10 @@ static void dmClearVars(SDnode *pDnode) { taosArrayDestroy(pData->oldDnodeEps); pData->oldDnodeEps = NULL; } + if (pData->dnodeEps != NULL) { + taosArrayDestroy(pData->dnodeEps); + pData->dnodeEps = NULL; + } if (pData->dnodeHash != NULL) { taosHashCleanup(pData->dnodeHash); pData->dnodeHash = NULL; diff --git a/source/dnode/mgmt/node_util/inc/dmUtil.h b/source/dnode/mgmt/node_util/inc/dmUtil.h index 40b171601d..c2f403dfbb 100644 --- a/source/dnode/mgmt/node_util/inc/dmUtil.h +++ b/source/dnode/mgmt/node_util/inc/dmUtil.h @@ -168,7 +168,7 @@ void dmUpdateEps(SDnodeData *pData, SArray *pDnodeEps); void dmGetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); void dmGetMnodeEpSetForRedirect(SDnodeData *pData, SRpcMsg *pMsg, SEpSet *pEpSet); void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet); -void dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port); +bool dmUpdateDnodeInfo(void *pData, int32_t *dnodeId, int64_t *clusterId, char *fqdn, uint16_t *port); void dmRemoveDnodePairs(SDnodeData *pData); #ifdef __cplusplus diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 8234787baa..0e8a1a0748 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -146,7 +146,7 @@ int32_t dmReadEps(SDnodeData *pData) { } code = 0; - dInfo("succceed to read mnode file %s", file); + dInfo("succceed to read dnode file %s", file); _OVER: if (content != NULL) taosMemoryFree(content); @@ -172,7 +172,7 @@ _OVER: dDebug("reset dnode list on startup"); dmResetEps(pData, pData->dnodeEps); - if (dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { + if (pData->dnodeEps == NULL && dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { dError("localEp %s different with %s and need reconfigured", tsLocalEp, file); return -1; } @@ -236,7 +236,8 @@ int32_t dmWriteEps(SDnodeData *pData) { code = 0; pData->updateTime = taosGetTimestampMs(); - dInfo("succeed to write dnode file:%s, dnodeVer:%" PRId64, realfile, pData->dnodeVer); + dInfo("succeed to write dnode file:%s, num:%d ver:%" PRId64, realfile, (int32_t)taosArrayGetSize(pData->dnodeEps), + pData->dnodeVer); _OVER: if (pJson != NULL) tjsonDelete(pJson); @@ -346,7 +347,8 @@ void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet) { } } -void dmUpdateDnodeInfo(void *data, int32_t *did, int64_t *clusterId, char *fqdn, uint16_t *port) { +bool dmUpdateDnodeInfo(void *data, int32_t *did, int64_t *clusterId, char *fqdn, uint16_t *port) { + bool updated = false; SDnodeData *pData = data; int32_t dnodeId = -1; if (did != NULL) dnodeId = *did; @@ -361,6 +363,7 @@ void dmUpdateDnodeInfo(void *data, int32_t *did, int64_t *clusterId, char *fqdn, dInfo("dnode:%d, update ep:%s:%u to %s:%u", dnodeId, fqdn, *port, pair->newFqdn, pair->newPort); tstrncpy(fqdn, pair->newFqdn, TSDB_FQDN_LEN); *port = pair->newPort; + updated = true; } } } @@ -384,12 +387,14 @@ void dmUpdateDnodeInfo(void *data, int32_t *did, int64_t *clusterId, char *fqdn, dInfo("dnode:%d, update ep:%s:%u to %s:%u", dnodeId, fqdn, *port, pDnodeEp->ep.fqdn, pDnodeEp->ep.port); tstrncpy(fqdn, pDnodeEp->ep.fqdn, TSDB_FQDN_LEN); *port = pDnodeEp->ep.port; + updated = true; } if (clusterId != NULL) *clusterId = pData->clusterId; } } taosThreadRwlockUnlock(&pData->lock); + return updated; } static int32_t dmDecodeEpPairs(SJson *pJson, SDnodeData *pData) { @@ -476,7 +481,7 @@ static int32_t dmReadDnodePairs(SDnodeData *pData) { goto _OVER; } - pData->oldDnodeEps = taosArrayInit(1, sizeof(SDnodeEp)); + pData->oldDnodeEps = taosArrayInit(1, sizeof(SDnodeEpPair)); if (pData->oldDnodeEps == NULL) { dError("failed to calloc dnodeEp array since %s", strerror(errno)); goto _OVER; @@ -490,7 +495,7 @@ static int32_t dmReadDnodePairs(SDnodeData *pData) { } code = 0; - dInfo("succceed to read mnode file %s", file); + dInfo("succceed to read dnode file %s", file); _OVER: if (content != NULL) taosMemoryFree(content); @@ -501,44 +506,43 @@ _OVER: dError("failed to read dnode file:%s since %s", file, terrstr()); } + for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pData->oldDnodeEps); ++i) { + SDnodeEpPair *pair = taosArrayGet(pData->oldDnodeEps, i); + for (int32_t j = 0; j < (int32_t)taosArrayGetSize(pData->dnodeEps); ++j) { + SDnodeEp *pDnodeEp = taosArrayGet(pData->dnodeEps, j); + if (pDnodeEp->id != pair->id && + (strcmp(pDnodeEp->ep.fqdn, pair->newFqdn) == 0 && pDnodeEp->ep.port == pair->newPort)) { + dError("dnode:%d, can't update ep:%s:%u to %s:%u since already exists as dnode:%d", pair->id, pair->oldFqdn, + pair->oldPort, pair->newFqdn, pair->newPort, pDnodeEp->id); + tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); + pDnodeEp->ep.port = pair->newPort; + } + +#if 0 + if (pDnodeEp->id == pair->id && + (strcmp(pDnodeEp->ep.fqdn, pair->oldFqdn) == 0 && pDnodeEp->ep.port == pair->oldPort)) { + dError("dnode:%d, can't update ep:%s:%u to %s:%u since endpoint not matched", pair->id, pair->oldFqdn, + pair->oldPort, pair->newFqdn, pair->newPort, pDnodeEp->id); + tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); + pDnodeEp->ep.port = pair->newPort; + } +#endif + } + } + for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pData->oldDnodeEps); ++i) { SDnodeEpPair *pair = taosArrayGet(pData->oldDnodeEps, i); for (int32_t j = 0; j < (int32_t)taosArrayGetSize(pData->dnodeEps); ++j) { SDnodeEp *pDnodeEp = taosArrayGet(pData->dnodeEps, j); if (strcmp(pDnodeEp->ep.fqdn, pair->oldFqdn) == 0 && pDnodeEp->ep.port == pair->oldPort) { - dInfo("dnode:%d, will update ep:%s:%u to %s:%u in array", pDnodeEp->id, pDnodeEp->ep.fqdn, pDnodeEp->ep.port, + dInfo("dnode:%d, will update ep:%s:%u to %s:%u", pDnodeEp->id, pDnodeEp->ep.fqdn, pDnodeEp->ep.port, pair->newFqdn, pair->newPort); tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); pDnodeEp->ep.port = pair->newPort; } } - void *pIter = taosHashIterate(pData->dnodeHash, NULL); - while (pIter) { - SDnodeEp *pDnodeEp = pIter; - if (strcmp(pDnodeEp->ep.fqdn, pair->oldFqdn) == 0 && pDnodeEp->ep.port == pair->oldPort) { - dDebug("dnode:%d, will update ep:%s:%u to %s:%u in hash", pDnodeEp->id, pDnodeEp->ep.fqdn, pDnodeEp->ep.port, - pair->newFqdn, pair->newPort); - tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); - pDnodeEp->ep.port = pair->newPort; - } - pIter = taosHashIterate(pData->dnodeHash, pIter); - } - } - - if (taosArrayGetSize(pData->dnodeEps) == 0) { - SDnodeEp dnodeEp = {0}; - dnodeEp.isMnode = 1; - taosGetFqdnPortFromEp(tsFirst, &dnodeEp.ep); - taosArrayPush(pData->dnodeEps, &dnodeEp); - } - - dDebug("reset dnode list on startup"); - dmResetEps(pData, pData->dnodeEps); - - if (dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { - dError("localEp %s different with %s and need reconfigured", tsLocalEp, file); - return -1; } + pData->dnodeVer = 0; return code; } diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index f4e6aad7a7..97490beb3c 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -180,7 +180,9 @@ static SSdbRow *mndDnodeActionDecode(SSdbRaw *pRaw) { SDB_GET_RESERVE(pRaw, dataPos, TSDB_DNODE_RESERVE_SIZE, _OVER) terrno = 0; - tmsgUpdateDnodeInfo(&pDnode->id, NULL, pDnode->fqdn, &pDnode->port); + if (tmsgUpdateDnodeInfo(&pDnode->id, NULL, pDnode->fqdn, &pDnode->port)) { + mInfo("dnode:%d, endpoint changed", pDnode->id); + } _OVER: if (terrno != 0) { @@ -189,7 +191,7 @@ _OVER: return NULL; } - mTrace("dnode:%d, decode from raw:%p, row:%p", pDnode->id, pRaw, pDnode); + mTrace("dnode:%d, decode from raw:%p, row:%p ep:%s:%u", pDnode->id, pRaw, pDnode, pDnode->fqdn, pDnode->port); return pRow; } diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index 7dcd287fb7..add32fd335 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -747,7 +747,7 @@ static void mndReloadSyncConfig(SMnode *pMnode) { pNode->clusterId = mndGetClusterId(pMnode); pNode->nodePort = pObj->pDnode->port; tstrncpy(pNode->nodeFqdn, pObj->pDnode->fqdn, TSDB_FQDN_LEN); - tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); mInfo("vgId:1, ep:%s:%u dnode:%d", pNode->nodeFqdn, pNode->nodePort, pNode->nodeId); if (pObj->pDnode->id == pMnode->selfDnodeId) { cfg.myIndex = cfg.replicaNum; diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 6b675586e4..7dc0912403 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -303,7 +303,7 @@ int32_t mndInitSync(SMnode *pMnode) { pNode->nodeId = pMgmt->replicas[i].id; pNode->nodePort = pMgmt->replicas[i].port; tstrncpy(pNode->nodeFqdn, pMgmt->replicas[i].fqdn, sizeof(pNode->nodeFqdn)); - tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); mInfo("vgId:1, index:%d ep:%s:%u dnode:%d cluster:%" PRId64, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId, pNode->clusterId); } diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 743ae17f2b..61cb75b1da 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -86,7 +86,7 @@ int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs) { pNode->nodeId = pReq->replicas[i].id; pNode->nodePort = pReq->replicas[i].port; tstrncpy(pNode->nodeFqdn, pReq->replicas[i].fqdn, sizeof(pNode->nodeFqdn)); - tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + (void)tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); vInfo("vgId:%d, replica:%d ep:%s:%u dnode:%d", pReq->vgId, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId); } @@ -134,6 +134,21 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { return NULL; } + // save vnode info on dnode ep changed + bool updated = false; + SSyncCfg *pCfg = &info.config.syncCfg; + for (int32_t i = 0; i < pCfg->replicaNum; ++i) { + SNodeInfo *pNode = &pCfg->nodeInfo[i]; + if (tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort)) { + updated = true; + } + } + if (updated) { + vInfo("vgId:%d, save vnode info since dnode info changed", info.config.vgId); + (void)vnodeSaveInfo(dir, &info); + (void)vnodeCommitInfo(dir, &info); + } + // create handle pVnode = taosMemoryCalloc(1, sizeof(*pVnode) + strlen(path) + 1); if (pVnode == NULL) { diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 02f9795cad..ac377911eb 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -895,14 +895,25 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) { // init by SSyncInfo pSyncNode->vgId = pSyncInfo->vgId; SSyncCfg* pCfg = &pSyncNode->raftCfg.cfg; + bool updated = false; sInfo("vgId:%d, start to open sync node, replica:%d selfIndex:%d", pSyncNode->vgId, pCfg->replicaNum, pCfg->myIndex); for (int32_t i = 0; i < pCfg->replicaNum; ++i) { SNodeInfo* pNode = &pCfg->nodeInfo[i]; - tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort); + if (tmsgUpdateDnodeInfo(&pNode->nodeId, &pNode->clusterId, pNode->nodeFqdn, &pNode->nodePort)) { + updated = true; + } sInfo("vgId:%d, index:%d ep:%s:%u dnode:%d cluster:%" PRId64, pSyncNode->vgId, i, pNode->nodeFqdn, pNode->nodePort, pNode->nodeId, pNode->clusterId); } + if (updated) { + sInfo("vgId:%d, save config info since dnode info changed", pSyncNode->vgId); + if (syncWriteCfgFile(pSyncNode) != 0) { + sError("vgId:%d, failed to write sync cfg file on dnode info updated", pSyncNode->vgId); + goto _error; + } + } + pSyncNode->pWal = pSyncInfo->pWal; pSyncNode->msgcb = pSyncInfo->msgcb; pSyncNode->syncSendMSg = pSyncInfo->syncSendMSg; diff --git a/source/libs/transport/src/tmsgcb.c b/source/libs/transport/src/tmsgcb.c index af2528bc92..9b8f1dfd07 100644 --- a/source/libs/transport/src/tmsgcb.c +++ b/source/libs/transport/src/tmsgcb.c @@ -59,8 +59,8 @@ void tmsgReleaseHandle(SRpcHandleInfo* pHandle, int8_t type) { (*defaultMsgCb.re void tmsgReportStartup(const char* name, const char* desc) { (*defaultMsgCb.reportStartupFp)(name, desc); } -void tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port) { - (*defaultMsgCb.updateDnodeInfoFp)(defaultMsgCb.data, dnodeId, clusterId, fqdn, port); +bool tmsgUpdateDnodeInfo(int32_t* dnodeId, int64_t* clusterId, char* fqdn, uint16_t* port) { + return (*defaultMsgCb.updateDnodeInfoFp)(defaultMsgCb.data, dnodeId, clusterId, fqdn, port); } void tmsgUpdateDnodeEpSet(SEpSet* epset) { From 6f0a35275e6c9a8ea2ccb3be336fa19d43280581 Mon Sep 17 00:00:00 2001 From: ShuaiQChang Date: Mon, 16 Jan 2023 15:47:23 +0800 Subject: [PATCH 113/139] fix: docs build error --- docs/zh/05-get-started/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/zh/05-get-started/index.md b/docs/zh/05-get-started/index.md index dd4cb8793d..e144c563b9 100644 --- a/docs/zh/05-get-started/index.md +++ b/docs/zh/05-get-started/index.md @@ -4,6 +4,7 @@ description: '快速设置 TDengine 环境并体验其高效写入和查询' --- import xiaot from './xiaot.webp' +import xiaot_new from './xiaot-new.webp' import channel from './channel.webp' import official_account from './official-account.webp' @@ -35,7 +36,7 @@ TDengine 知识地图中涵盖了 TDengine 的各种知识点,揭示了各概 - + From e3248d005369a68dac78dca6a28823c88ff6bf82 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 16 Jan 2023 16:02:23 +0800 Subject: [PATCH 114/139] refactor: disable warning. --- source/libs/executor/src/executil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index a5468008aa..36981f501e 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -954,7 +954,7 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray* return -1; } } else { - qWarn("failed to get tableIds from by table name: %s, reason: %s", name, tstrerror(terrno)); +// qWarn("failed to get tableIds from by table name: %s, reason: %s", name, tstrerror(terrno)); terrno = 0; } } From 478eec76a4e3eb9f77aef91c33b004637d4d6ac9 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 16 Jan 2023 16:34:12 +0800 Subject: [PATCH 115/139] enh: update epset on dnode info changed --- source/dnode/mgmt/node_util/src/dmEps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 0e8a1a0748..2b06a24a54 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -428,9 +428,11 @@ static int32_t dmDecodeEpPairs(SJson *pJson, SDnodeData *pData) { void dmRemoveDnodePairs(SDnodeData *pData) { char file[PATH_MAX] = {0}; + char bak[PATH_MAX] = {0}; snprintf(file, sizeof(file), "%s%sdnode%sep.json", tsDataDir, TD_DIRSEP, TD_DIRSEP); - dInfo("dnode file:%s is removed", file); - (void)taosRemoveFile(file); + snprintf(bak, sizeof(bak), "%s%sdnode%sep.json.bak", tsDataDir, TD_DIRSEP, TD_DIRSEP); + dInfo("dnode file:%s is rename to bak file", file); + (void)taosRenameFile(file, bak); } static int32_t dmReadDnodePairs(SDnodeData *pData) { From 1f82c835a30b42b1348ce5d1918d61599e8efe04 Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 16 Jan 2023 16:45:44 +0800 Subject: [PATCH 116/139] chore: test case adaption --- tests/develop-test/2-query/table_count_scan.py | 16 ++++++++-------- tests/system-test/2-query/odbc.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/develop-test/2-query/table_count_scan.py b/tests/develop-test/2-query/table_count_scan.py index 1ef65bfc67..3ca7e08cd0 100644 --- a/tests/develop-test/2-query/table_count_scan.py +++ b/tests/develop-test/2-query/table_count_scan.py @@ -65,7 +65,7 @@ class TDTestCase: tdSql.query('select count(*),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 0, 24) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 3) @@ -77,7 +77,7 @@ class TDTestCase: tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') tdSql.checkRows(3) - tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 0, 24) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 5) @@ -93,7 +93,7 @@ class TDTestCase: tdSql.checkData(0, 1, 'performance_schema') tdSql.checkData(1, 0, 3) tdSql.checkData(1, 1, 'tbl_count') - tdSql.checkData(2, 0, 23) + tdSql.checkData(2, 0, 24) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -106,7 +106,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 31) + tdSql.checkData(0, 0, 32) tdSql.execute('create table stba (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(10), c9 nchar(10), c10 tinyint unsigned, c11 smallint unsigned, c12 int unsigned, c13 bigint unsigned) TAGS(t1 int, t2 binary(10), t3 double);') @@ -182,7 +182,7 @@ class TDTestCase: tdSql.checkData(0, 0, 1) tdSql.checkData(0, 1, 'tbl_count') tdSql.checkData(0, 2, 'stba') - tdSql.checkData(1, 0, 23) + tdSql.checkData(1, 0, 24) tdSql.checkData(1, 1, 'information_schema') tdSql.checkData(1, 2, None) tdSql.checkData(2, 0, 3) @@ -194,7 +194,7 @@ class TDTestCase: tdSql.query('select count(1),db_name, stable_name from information_schema.ins_tables group by db_name, stable_name;') tdSql.checkRows(4) - tdSql.checkData(0, 0, 23) + tdSql.checkData(0, 0, 24) tdSql.checkData(0, 1, 'information_schema') tdSql.checkData(0, 2, None) tdSql.checkData(1, 0, 5) @@ -213,7 +213,7 @@ class TDTestCase: tdSql.checkData(0, 1, 'performance_schema') tdSql.checkData(1, 0, 4) tdSql.checkData(1, 1, 'tbl_count') - tdSql.checkData(2, 0, 23) + tdSql.checkData(2, 0, 24) tdSql.checkData(2, 1, 'information_schema') tdSql.query("select count(*) from information_schema.ins_tables where db_name='tbl_count'") @@ -226,7 +226,7 @@ class TDTestCase: tdSql.query('select count(*) from information_schema.ins_tables') tdSql.checkRows(1) - tdSql.checkData(0, 0, 32) + tdSql.checkData(0, 0, 33) tdSql.execute('drop database tbl_count') diff --git a/tests/system-test/2-query/odbc.py b/tests/system-test/2-query/odbc.py index 09000fb3d2..c682d79c42 100644 --- a/tests/system-test/2-query/odbc.py +++ b/tests/system-test/2-query/odbc.py @@ -22,7 +22,7 @@ class TDTestCase: tdSql.execute("insert into db.ctb using db.stb tags(1) (ts, c1) values (now, 1)") tdSql.query("select count(*) from information_schema.ins_columns") - tdSql.checkData(0, 0, 265) + tdSql.checkData(0, 0, 267) tdSql.query("select * from information_schema.ins_columns where table_name = 'ntb'") tdSql.checkRows(14) From 6282152ca0751b0abfe768a74694fb075229fc2d Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Mon, 16 Jan 2023 18:38:19 +0800 Subject: [PATCH 117/139] ci:modify the filename of the error log --- tests/parallel_test/run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/parallel_test/run.sh b/tests/parallel_test/run.sh index b5d57265be..43533d4f36 100755 --- a/tests/parallel_test/run.sh +++ b/tests/parallel_test/run.sh @@ -184,6 +184,10 @@ function run_thread() { if [ $? -eq 0 ]; then case_file=`echo "$case_cmd"|grep -o ".*\.py"|awk '{print $NF}'` fi + echo "$case_cmd"|grep -q "^./pytest.sh" + if [ $? -eq 0 ]; then + case_file=`echo "$case_cmd"|grep -o ".*\.py"|awk '{print $NF}'` + fi echo "$case_cmd"|grep -q "\.sim" if [ $? -eq 0 ]; then case_file=`echo "$case_cmd"|grep -o ".*\.sim"|awk '{print $NF}'` From 79b18bc9034998837ba68cb847ee516f6f601a4b Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Mon, 16 Jan 2023 19:18:52 +0800 Subject: [PATCH 118/139] ci:delete para of 'make -j' --- Jenkinsfile2 | 2 +- tests/parallel_test/container_build.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 1920d8da17..54234cc547 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -430,7 +430,7 @@ pipeline { date rm -rf ${WKC}/debug cd ${WKC}/tests/parallel_test - time ./container_build.sh -w ${WKDIR} -t 10 -e + time ./container_build.sh -w ${WKDIR} -e ''' def extra_param = "" def log_server_file = "/home/log_server.json" diff --git a/tests/parallel_test/container_build.sh b/tests/parallel_test/container_build.sh index 5059630a3f..221e549056 100755 --- a/tests/parallel_test/container_build.sh +++ b/tests/parallel_test/container_build.sh @@ -37,9 +37,9 @@ if [ -z "$WORKDIR" ]; then usage exit 1 fi -if [ -z "$THREAD_COUNT" ]; then - THREAD_COUNT=1 -fi +# if [ -z "$THREAD_COUNT" ]; then +# THREAD_COUNT=1 +# fi ulimit -c unlimited @@ -55,7 +55,7 @@ fi date docker run \ -v $REP_MOUNT_PARAM \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true;make -j $THREAD_COUNT || exit 1" + --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true;make -j || exit 1" if [[ -d ${WORKDIR}/debugNoSan ]] ;then echo "delete ${WORKDIR}/debugNoSan" @@ -70,7 +70,7 @@ mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugNoSan date docker run \ -v $REP_MOUNT_PARAM \ - --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DTOOLS_BUILD_TYPE=Debug;make -j $THREAD_COUNT || exit 1 " + --rm --ulimit core=-1 taos_test:v1.0 sh -c "cd $REP_DIR;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DBUILD_TEST=true -DWEBSOCKET=true -DBUILD_SANITIZER=1 -DTOOLS_SANITIZE=true -DTOOLS_BUILD_TYPE=Debug;make -j || exit 1 " mv ${REP_REAL_PATH}/debug ${WORKDIR}/debugSan From 729afc6ab51783d3d991332eeba1fa3bf67b7f8b Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 17 Jan 2023 10:26:59 +0800 Subject: [PATCH 119/139] fix: config error if ep.json invalid --- source/dnode/mgmt/node_util/src/dmEps.c | 35 +++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 2b06a24a54..12827e8413 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -172,8 +172,9 @@ _OVER: dDebug("reset dnode list on startup"); dmResetEps(pData, pData->dnodeEps); - if (pData->dnodeEps == NULL && dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { + if (pData->oldDnodeEps == NULL && dmIsEpChanged(pData, pData->dnodeId, tsLocalEp)) { dError("localEp %s different with %s and need reconfigured", tsLocalEp, file); + terrno = TSDB_CODE_INVALID_CFG; return -1; } @@ -506,8 +507,22 @@ _OVER: if (code != 0) { dError("failed to read dnode file:%s since %s", file, terrstr()); + return code; } + // update old fqdn and port + for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pData->oldDnodeEps); ++i) { + SDnodeEpPair *pair = taosArrayGet(pData->oldDnodeEps, i); + for (int32_t j = 0; j < (int32_t)taosArrayGetSize(pData->dnodeEps); ++j) { + SDnodeEp *pDnodeEp = taosArrayGet(pData->dnodeEps, j); + if (pDnodeEp->id == pair->id) { + tstrncpy(pair->oldFqdn, pDnodeEp->ep.fqdn, TSDB_FQDN_LEN); + pair->oldPort = pair->newPort; + } + } + } + + // check new fqdn and port for (int32_t i = 0; i < (int32_t)taosArrayGetSize(pData->oldDnodeEps); ++i) { SDnodeEpPair *pair = taosArrayGet(pData->oldDnodeEps, i); for (int32_t j = 0; j < (int32_t)taosArrayGetSize(pData->dnodeEps); ++j) { @@ -516,19 +531,11 @@ _OVER: (strcmp(pDnodeEp->ep.fqdn, pair->newFqdn) == 0 && pDnodeEp->ep.port == pair->newPort)) { dError("dnode:%d, can't update ep:%s:%u to %s:%u since already exists as dnode:%d", pair->id, pair->oldFqdn, pair->oldPort, pair->newFqdn, pair->newPort, pDnodeEp->id); - tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); - pDnodeEp->ep.port = pair->newPort; + taosArrayDestroy(pData->oldDnodeEps); + pData->oldDnodeEps = NULL; + terrno = TSDB_CODE_INVALID_CFG; + return -1; } - -#if 0 - if (pDnodeEp->id == pair->id && - (strcmp(pDnodeEp->ep.fqdn, pair->oldFqdn) == 0 && pDnodeEp->ep.port == pair->oldPort)) { - dError("dnode:%d, can't update ep:%s:%u to %s:%u since endpoint not matched", pair->id, pair->oldFqdn, - pair->oldPort, pair->newFqdn, pair->newPort, pDnodeEp->id); - tstrncpy(pDnodeEp->ep.fqdn, pair->newFqdn, TSDB_FQDN_LEN); - pDnodeEp->ep.port = pair->newPort; - } -#endif } } @@ -546,5 +553,5 @@ _OVER: } pData->dnodeVer = 0; - return code; + return 0; } From ca33abe26c8cc4171b2af3b47298334e3a8d87dd Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 17 Jan 2023 10:43:02 +0800 Subject: [PATCH 120/139] fix: more --- source/dnode/mgmt/node_util/src/dmEps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index 12827e8413..b653ef74dc 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -516,7 +516,7 @@ _OVER: for (int32_t j = 0; j < (int32_t)taosArrayGetSize(pData->dnodeEps); ++j) { SDnodeEp *pDnodeEp = taosArrayGet(pData->dnodeEps, j); if (pDnodeEp->id == pair->id) { - tstrncpy(pair->oldFqdn, pDnodeEp->ep.fqdn, TSDB_FQDN_LEN); + tstrncpy(pair->oldFqdn, pair->newFqdn, TSDB_FQDN_LEN); pair->oldPort = pair->newPort; } } From e155757ac6a17eb20ba746aa5b4b6c8626db02d5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 17 Jan 2023 10:46:31 +0800 Subject: [PATCH 121/139] fix: more --- source/dnode/mgmt/node_util/src/dmEps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/node_util/src/dmEps.c b/source/dnode/mgmt/node_util/src/dmEps.c index b653ef74dc..a7a5b8b999 100644 --- a/source/dnode/mgmt/node_util/src/dmEps.c +++ b/source/dnode/mgmt/node_util/src/dmEps.c @@ -516,8 +516,8 @@ _OVER: for (int32_t j = 0; j < (int32_t)taosArrayGetSize(pData->dnodeEps); ++j) { SDnodeEp *pDnodeEp = taosArrayGet(pData->dnodeEps, j); if (pDnodeEp->id == pair->id) { - tstrncpy(pair->oldFqdn, pair->newFqdn, TSDB_FQDN_LEN); - pair->oldPort = pair->newPort; + tstrncpy(pair->oldFqdn, pDnodeEp->ep.fqdn, TSDB_FQDN_LEN); + pair->oldPort = pDnodeEp->ep.port; } } } From fce58a1273530ef725bf120ceae58acf836f1e99 Mon Sep 17 00:00:00 2001 From: xinsheng Ren <285808407@qq.com> Date: Tue, 17 Jan 2023 11:12:57 +0800 Subject: [PATCH 122/139] Fix/xsren/td 21762/sem mem leak (#19580) * TD-21762 sem_init cause mem leak on windows * fix/memleak Co-authored-by: facetosea <25808407@qq.com> --- source/client/src/clientEnv.c | 4 ++++ source/client/src/clientImpl.c | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 28a55156aa..ab51a64686 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -365,6 +365,7 @@ void doDestroyRequest(void *p) { taosMemoryFreeClear(pRequest->pDb); doFreeReqResultInfo(&pRequest->body.resInfo); + tsem_destroy(&pRequest->body.rspSem); taosArrayDestroy(pRequest->tableList); taosArrayDestroy(pRequest->dbList); @@ -379,6 +380,9 @@ void doDestroyRequest(void *p) { } if (pRequest->syncQuery) { + if (pRequest->body.param){ + tsem_destroy(&((SSyncQueryParam*)pRequest->body.param)->sem); + } taosMemoryFree(pRequest->body.param); } diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index aeb73784f2..a119408a08 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -159,6 +159,12 @@ STscObj* taos_connect_internal(const char* ip, const char* user, const char* pas return taosConnectImpl(user, &secretEncrypt[0], localDb, NULL, NULL, *pInst, connType); } +void freeQueryParam(SSyncQueryParam* param) { + if (param == NULL) return; + tsem_destroy(¶m->sem); + taosMemoryFree(param); +} + int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, bool validateSql, SRequestObj** pRequest, int64_t reqid) { *pRequest = createRequest(connId, TSDB_SQL_SELECT, reqid); @@ -180,17 +186,18 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, (*pRequest)->sqlLen = sqlLen; (*pRequest)->validateOnly = validateSql; + SSyncQueryParam* newpParam; if (param == NULL) { - SSyncQueryParam* pParam = taosMemoryCalloc(1, sizeof(SSyncQueryParam)); - if (pParam == NULL) { + newpParam = taosMemoryCalloc(1, sizeof(SSyncQueryParam)); + if (newpParam == NULL) { destroyRequest(*pRequest); *pRequest = NULL; return TSDB_CODE_OUT_OF_MEMORY; } - tsem_init(&pParam->sem, 0, 0); - pParam->pRequest = (*pRequest); - param = pParam; + tsem_init(&newpParam->sem, 0, 0); + newpParam->pRequest = (*pRequest); + param = newpParam; } (*pRequest)->body.param = param; @@ -201,8 +208,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, if (err) { tscError("%" PRId64 " failed to add to request container, reqId:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql); - - taosMemoryFree(param); + freeQueryParam(newpParam); destroyRequest(*pRequest); *pRequest = NULL; return TSDB_CODE_OUT_OF_MEMORY; @@ -214,6 +220,7 @@ int32_t buildRequest(uint64_t connId, const char* sql, int sqlLen, void* param, nodesCreateAllocator((*pRequest)->requestId, tsQueryNodeChunkSize, &((*pRequest)->allocatorRefId))) { tscError("%" PRId64 " failed to create node allocator, reqId:0x%" PRIx64 ", conn:%" PRId64 ", %s", (*pRequest)->self, (*pRequest)->requestId, pTscObj->id, sql); + freeQueryParam(newpParam); destroyRequest(*pRequest); *pRequest = NULL; return TSDB_CODE_OUT_OF_MEMORY; From 830086e75601fe600b947e9abeff69c09cd7dfee Mon Sep 17 00:00:00 2001 From: xiaolei li <85657333+xleili@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:07:01 +0800 Subject: [PATCH 123/139] [WIP]docs(driver):update C# webscoket to import dll from nupkg (#17485) * docs(driver):update C# webscoket to import dll from nupkg * docs(driver):update description about C# using WebSocket dll from nuget package * docs(driver):update C# webscoket to import dll from nupkg 2nd * fix: typos Co-authored-by: Shuduo Sang --- .../14-reference/03-connector/09-csharp.mdx | 43 ++++++++++------ .../csharp/asyncQuery/asyncquery.csproj | 2 +- docs/examples/csharp/connect/connect.csproj | 2 +- .../csharp/influxdbLine/influxdbline.csproj | 2 +- docs/examples/csharp/optsJSON/optsJSON.csproj | 2 +- .../csharp/optsTelnet/optstelnet.csproj | 2 +- docs/examples/csharp/query/query.csproj | 2 +- .../csharp/sqlInsert/sqlinsert.csproj | 2 +- .../csharp/stmtInsert/stmtinsert.csproj | 2 +- .../csharp/subscribe/subscribe.csproj | 2 +- .../csharp/wsConnect/wsConnect.csproj | 9 +++- docs/examples/csharp/wsInsert/wsInsert.csproj | 10 ++-- docs/examples/csharp/wsQuery/wsQuery.csproj | 8 ++- docs/examples/csharp/wsStmt/wsStmt.csproj | 8 ++- docs/zh/08-connector/40-csharp.mdx | 50 ++++++++++++------- 15 files changed, 98 insertions(+), 48 deletions(-) diff --git a/docs/en/14-reference/03-connector/09-csharp.mdx b/docs/en/14-reference/03-connector/09-csharp.mdx index b73e1c2627..756e948bd2 100644 --- a/docs/en/14-reference/03-connector/09-csharp.mdx +++ b/docs/en/14-reference/03-connector/09-csharp.mdx @@ -17,7 +17,7 @@ import CSAsyncQuery from "../../07-develop/04-query-data/_cs_async.mdx" `TDengine.Connector` is a C# language connector provided by TDengine that allows C# developers to develop C# applications that access TDengine cluster data. -The `TDengine.Connector` connector supports connect to TDengine instances via the TDengine client driver (taosc), providing data writing, querying, subscription, schemaless writing, bind interface, etc.The `TDengine.Connector` also supports WebSocket and developers can build connection through DSN, which supports data writing, querying, and parameter binding, etc. +The `TDengine.Connector` connector supports connect to TDengine instances via the TDengine client driver (taosc), providing data writing, querying, subscription, schemaless writing, bind interface, etc.The `TDengine.Connector` also supports WebSocket from v3.0.1 and developers can build connection through DSN, which supports data writing, querying, and parameter binding, etc. This article describes how to install `TDengine.Connector` in a Linux or Windows environment and connect to TDengine clusters via `TDengine.Connector` to perform basic operations such as data writing and querying. @@ -66,31 +66,43 @@ Please refer to [version support list](/reference/connector#version-support) * [Nuget Client](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) (optional installation) * Install TDengine client driver, please refer to [Install client driver](/reference/connector/#install-client-driver) for details -### Install via dotnet CLI +### Install `TDengine.Connector` - + -You can reference the `TDengine.Connector` published in Nuget to the current project via the `dotnet` command under the path of the existing .NET project. +You can reference the `TDengine.Connector` published in Nuget to the current project via the `dotnet` CLI under the path of the existing .NET project. ``` bash dotnet add package TDengine.Connector ``` - - +You may also modify the current.NET project file. You can include the following 'ItemGroup' in your project file (.csproj). -You can [download the source code](https://github.com/taosdata/taos-connector-dotnet/tree/3.0) and directly reference the latest version of the TDengine.Connector library. - -```bash -git clone -b 3.0 https://github.com/taosdata/taos-connector-dotnet.git -cd taos-connector-dotnet -cp -r src/ myProject - -cd myProject -dotnet add exmaple.csproj reference src/TDengine.csproj +``` XML + + + ``` + + + +In this scenario, modifying your project file is required in order to copy the WebSocket dependency dynamic library from the nuget package into your project. +```XML + + + + + + + + + +``` + +Notice: `TDengine.Connector` only version>= 3.0.2 includes the dynamic library for WebSocket. + @@ -265,6 +277,7 @@ ws://localhost:6041/test | TDengine.Connector | Description | |--------------------|--------------------------------| +| 3.0.2 | Support .NET Framework 4.5 and above. Support .Net standard 2.0. Nuget package includes dynamic library for WebSocket.| | 3.0.1 | Support WebSocket and Cloud,With function query, insert, and parameter binding| | 3.0.0 | Supports TDengine 3.0.0.0. TDengine 2.x is not supported. Added `TDengine.Impl.GetData()` interface to deserialize query results. | | 1.0.7 | Fixed TDengine.Query() memory leak. | diff --git a/docs/examples/csharp/asyncQuery/asyncquery.csproj b/docs/examples/csharp/asyncQuery/asyncquery.csproj index 23e590cd25..7c5b693f28 100644 --- a/docs/examples/csharp/asyncQuery/asyncquery.csproj +++ b/docs/examples/csharp/asyncQuery/asyncquery.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/connect/connect.csproj b/docs/examples/csharp/connect/connect.csproj index 3a912f8987..a08e86d4b4 100644 --- a/docs/examples/csharp/connect/connect.csproj +++ b/docs/examples/csharp/connect/connect.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/influxdbLine/influxdbline.csproj b/docs/examples/csharp/influxdbLine/influxdbline.csproj index 58bca48508..4889f8fde9 100644 --- a/docs/examples/csharp/influxdbLine/influxdbline.csproj +++ b/docs/examples/csharp/influxdbLine/influxdbline.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/optsJSON/optsJSON.csproj b/docs/examples/csharp/optsJSON/optsJSON.csproj index da16025dcd..208f04c82d 100644 --- a/docs/examples/csharp/optsJSON/optsJSON.csproj +++ b/docs/examples/csharp/optsJSON/optsJSON.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/optsTelnet/optstelnet.csproj b/docs/examples/csharp/optsTelnet/optstelnet.csproj index 194de21bcc..32c76ec418 100644 --- a/docs/examples/csharp/optsTelnet/optstelnet.csproj +++ b/docs/examples/csharp/optsTelnet/optstelnet.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/query/query.csproj b/docs/examples/csharp/query/query.csproj index c97dbd3051..360d73b2c0 100644 --- a/docs/examples/csharp/query/query.csproj +++ b/docs/examples/csharp/query/query.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/sqlInsert/sqlinsert.csproj b/docs/examples/csharp/sqlInsert/sqlinsert.csproj index ab0e5e717a..1b6f745c82 100644 --- a/docs/examples/csharp/sqlInsert/sqlinsert.csproj +++ b/docs/examples/csharp/sqlInsert/sqlinsert.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/stmtInsert/stmtinsert.csproj b/docs/examples/csharp/stmtInsert/stmtinsert.csproj index 3d459fbeda..f5b2b67397 100644 --- a/docs/examples/csharp/stmtInsert/stmtinsert.csproj +++ b/docs/examples/csharp/stmtInsert/stmtinsert.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/subscribe/subscribe.csproj b/docs/examples/csharp/subscribe/subscribe.csproj index 8ae1cf6bc6..191b3f9e9b 100644 --- a/docs/examples/csharp/subscribe/subscribe.csproj +++ b/docs/examples/csharp/subscribe/subscribe.csproj @@ -9,7 +9,7 @@ - + diff --git a/docs/examples/csharp/wsConnect/wsConnect.csproj b/docs/examples/csharp/wsConnect/wsConnect.csproj index 34951dc761..6d78be6e7a 100644 --- a/docs/examples/csharp/wsConnect/wsConnect.csproj +++ b/docs/examples/csharp/wsConnect/wsConnect.csproj @@ -3,11 +3,16 @@ Exe net5.0 - enable - + + + + + + + diff --git a/docs/examples/csharp/wsInsert/wsInsert.csproj b/docs/examples/csharp/wsInsert/wsInsert.csproj index 34951dc761..95bfbdea3d 100644 --- a/docs/examples/csharp/wsInsert/wsInsert.csproj +++ b/docs/examples/csharp/wsInsert/wsInsert.csproj @@ -5,9 +5,13 @@ net5.0 enable - - + - + + + + + + diff --git a/docs/examples/csharp/wsQuery/wsQuery.csproj b/docs/examples/csharp/wsQuery/wsQuery.csproj index 34951dc761..e5c2cf767c 100644 --- a/docs/examples/csharp/wsQuery/wsQuery.csproj +++ b/docs/examples/csharp/wsQuery/wsQuery.csproj @@ -7,7 +7,13 @@ - + + + + + + + diff --git a/docs/examples/csharp/wsStmt/wsStmt.csproj b/docs/examples/csharp/wsStmt/wsStmt.csproj index 34951dc761..e5c2cf767c 100644 --- a/docs/examples/csharp/wsStmt/wsStmt.csproj +++ b/docs/examples/csharp/wsStmt/wsStmt.csproj @@ -7,7 +7,13 @@ - + + + + + + + diff --git a/docs/zh/08-connector/40-csharp.mdx b/docs/zh/08-connector/40-csharp.mdx index c70a8a633e..80a831bab9 100644 --- a/docs/zh/08-connector/40-csharp.mdx +++ b/docs/zh/08-connector/40-csharp.mdx @@ -17,7 +17,7 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx" `TDengine.Connector` 是 TDengine 提供的 C# 语言连接器。C# 开发人员可以通过它开发存取 TDengine 集群数据的 C# 应用软件。 -`TDengine.Connector` 连接器支持通过 TDengine 客户端驱动(taosc)建立与 TDengine 运行实例的连接,提供数据写入、查询、数据订阅、schemaless 数据写入、参数绑定接口数据写入等功能。 `TDengine.Connector` 还支持 WebSocket,通过 DSN 建立 WebSocket 连接,提供数据写入、查询、参数绑定接口数据写入等功能。 +`TDengine.Connector` 连接器支持通过 TDengine 客户端驱动(taosc)建立与 TDengine 运行实例的连接,提供数据写入、查询、数据订阅、schemaless 数据写入、参数绑定接口数据写入等功能。 `TDengine.Connector` 自 v3.0.1 起还支持 WebSocket,通过 DSN 建立 WebSocket 连接,提供数据写入、查询、参数绑定接口数据写入等功能。 本文介绍如何在 Linux 或 Windows 环境中安装 `TDengine.Connector`,并通过 `TDengine.Connector` 连接 TDengine 集群,进行数据写入、查询等基本操作。 @@ -67,30 +67,45 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx" * [Nuget 客户端](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) (可选安装) * 安装 TDengine 客户端驱动,具体步骤请参考[安装客户端驱动](../#安装客户端驱动) -### 使用 dotnet CLI 安装 +### 安装 TDengine.Connector - + -可以在当前 .NET 项目的路径下,通过 dotnet 命令引用 Nuget 中发布的 `TDengine.Connector` 到当前项目。 +可以在当前 .NET 项目的路径下,通过 dotnet CLI 添加 Nuget package `TDengine.Connector` 到当前项目。 ``` bash dotnet add package TDengine.Connector ``` - - +也可以修改当前项目的 `.csproj` 文件,添加如下 ItemGroup。 -也可以[下载源码](https://github.com/taosdata/taos-connector-dotnet/tree/3.0),直接引用 TDengine.Connector 库 - -```bash -git clone -b 3.0 https://github.com/taosdata/taos-connector-dotnet.git -cd taos-connector-dotnet -cp -r src/ myProject - -cd myProject -dotnet add exmaple.csproj reference src/TDengine.csproj +``` XML + + + ``` + + + + + +需要修改目标项目的 `.csproj` 项目文件,将 `.nupkg` 中的 `runtimes` 目录中的动态库复制到当前项目的 `$(OutDir)` 目录下。 + +```XML + + + + + + + + + +``` + +注意:`TDengine.Connector` 自 version>= 3.0.2 的 nuget package 中才会有动态库( taosws.dll,libtaows.so )。 + @@ -148,9 +163,9 @@ namespace TDengineExample 各部分意义见下表: -* **protocol**: 显示指定以何种方式建立连接,例如:`ws://localhost:6041` 指定以 Websocket 方式建立连接(支持http/ws)。 +* **protocol**: 显示指定以何种方式建立连接,例如:`ws://localhost:6041` 指定以 Websocket 方式建立连接(支持 http/ws )。 -* **username/password**: 用于创建连接的用户名及密码(默认`root/taosdata`)。 +* **username/password**: 用于创建连接的用户名及密码(默认 `root/taosdata` )。 * **host/port**: 指定创建连接的服务器及端口,WebSocket 连接默认为 `localhost:6041` 。 @@ -266,6 +281,7 @@ namespace TDengineExample | TDengine.Connector | 说明 | |--------------------|--------------------------------| +| 3.0.2 | 支持 .NET Framework 4.5 及以上,支持 .NET standard 2.0。Nuget Package 包含 WebSocket 动态库。 | | 3.0.1 | 支持 WebSocket 和 Cloud,查询,插入,参数绑定。 | | 3.0.0 | 支持 TDengine 3.0.0.0,不兼容 2.x。新增接口TDengine.Impl.GetData(),解析查询结果。 | | 1.0.7 | 修复 TDengine.Query()内存泄露。 | From f2ce2e94b0b62005db5ac2f11582e1b24d36f68f Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Tue, 17 Jan 2023 12:07:38 +0800 Subject: [PATCH 124/139] fix: make example code to be tested in ci (#19594) * fix: make example code to be tested in ci * fix: ../docs/examples/go/go.mod --- docs/examples/go/go.mod | 2 +- tests/parallel_test/cases.task | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/go/go.mod b/docs/examples/go/go.mod index 6696852312..716a0ef5dc 100644 --- a/docs/examples/go/go.mod +++ b/docs/examples/go/go.mod @@ -2,5 +2,5 @@ module goexample go 1.17 -require github.com/taosdata/driver-go/v3 3.1.0 +require github.com/taosdata/driver-go/v3 v3.1.0 diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index d77f6f1703..13cc3bce28 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -1077,4 +1077,4 @@ ,,n,docs-examples-test,bash node.sh ,,n,docs-examples-test,bash csharp.sh ,,n,docs-examples-test,bash jdbc.sh -#,,n,docs-examples-test,bash go.sh +,,n,docs-examples-test,bash go.sh From 172559a2af943e877789f73f02ca7f118bb17033 Mon Sep 17 00:00:00 2001 From: xinsheng Ren <285808407@qq.com> Date: Tue, 17 Jan 2023 15:21:02 +0800 Subject: [PATCH 125/139] fix stackflow on mac (#19590) Co-authored-by: facetosea <25808407@qq.com> --- source/os/src/osSysinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 35e76f0e67..30415f2a56 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -18,6 +18,7 @@ #include "taoserror.h" #define PROCESS_ITEM 12 +#define uuidLen37 37 typedef struct { uint64_t user; @@ -834,7 +835,8 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { return 0; #elif defined(_TD_DARWIN_64) uuid_t uuid = {0}; - char buf[37] = {0}; + char buf[uuidLen37]; + memset(buf, 0, uuidLen37); uuid_generate(uuid); // it's caller's responsibility to make enough space for `uid`, that's 36-char + 1-null uuid_unparse_lower(uuid, buf); From dff16ad4bf89298873a1457f6f75f58914158528 Mon Sep 17 00:00:00 2001 From: sunpeng Date: Tue, 17 Jan 2023 15:53:14 +0800 Subject: [PATCH 126/139] doc: update python tmq document (#19604) * doc: update python tmq document * doc: update en document Co-authored-by: Shuduo Sang --- docs/en/07-develop/07-tmq.mdx | 77 ++++++++++++++---------- docs/examples/python/tmq_example.py | 92 +++++++++++++---------------- docs/zh/07-develop/07-tmq.mdx | 78 +++++++++++++----------- 3 files changed, 129 insertions(+), 118 deletions(-) diff --git a/docs/en/07-develop/07-tmq.mdx b/docs/en/07-develop/07-tmq.mdx index 94a9dbffbd..92db7d4cbf 100644 --- a/docs/en/07-develop/07-tmq.mdx +++ b/docs/en/07-develop/07-tmq.mdx @@ -94,22 +94,21 @@ void close() throws SQLException; ```python -class TaosConsumer(): - def __init__(self, *topics, **configs) +class Consumer: + def subscribe(self, topics): + pass - def __iter__(self) + def unsubscribe(self): + pass - def __next__(self) + def poll(self, timeout: float = 1.0): + pass - def sync_next(self) - - def subscription(self) + def close(self): + pass - def unsubscribe(self) - - def close(self) - - def __del__(self) + def commit(self, message): + pass ``` @@ -395,23 +394,31 @@ let mut consumer = tmq.build()?; +```python +from taos.tmq import Consumer + +# Syntax: `consumer = Consumer(configs)` +# +# Example: +consumer = Consumer({"group.id": "local", "td.connect.ip": "127.0.0.1"}) +``` + Python programs use the following parameters: -| Parameter | Type | Description | Remarks | -| :----------------------------: | :----: | -------------------------------------------------------- | ------------------------------------------- | -| `td_connect_ip` | string | Used in establishing a connection; same as `taos_connect` | | -| `td_connect_user` | string | Used in establishing a connection; same as `taos_connect` | | -| `td_connect_pass` | string | Used in establishing a connection; same as `taos_connect` | | -| `td_connect_port` | string | Used in establishing a connection; same as `taos_connect` | | -| `group_id` | string | Consumer group ID; consumers with the same ID are in the same group | **Required**. Maximum length: 192. | -| `client_id` | string | Client ID | Maximum length: 192. | -| `auto_offset_reset` | string | Initial offset for the consumer group | Specify `earliest`, `latest`, or `none`(default) | -| `enable_auto_commit` | string | Commit automatically | Specify `true` or `false`. | -| `auto_commit_interval_ms` | string | Interval for automatic commits, in milliseconds | -| `enable_heartbeat_background` | string | Backend heartbeat; if enabled, the consumer does not go offline even if it has not polled for a long time | Specify `true` or `false`. | -| `experimental_snapshot_enable` | string | Specify whether to consume messages from the WAL or from TSBS | Specify `true` or `false`. | -| `msg_with_table_name` | string | Specify whether to deserialize table names from messages | Specify `true` or `false`. -| `timeout` | int | Consumer pull timeout | | +| Parameter | Type | Description | Remarks | +|:---------:|:----:|:-----------:|:-------:| +| `td.connect.ip` | string | Used in establishing a connection|| +| `td.connect.user` | string | Used in establishing a connection|| +| `td.connect.pass` | string | Used in establishing a connection|| +| `td.connect.port` | string | Used in establishing a connection|| +| `group.id` | string | Consumer group ID; consumers with the same ID are in the same group | **Required**. Maximum length: 192 | +| `client.id` | string | Client ID | Maximum length: 192 | +| `msg.with.table.name` | string | Specify whether to deserialize table names from messages | pecify `true` or `false` | +| `enable.auto.commit` | string | Commit automatically | pecify `true` or `false` | +| `auto.commit.interval.ms` | string | Interval for automatic commits, in milliseconds | | +| `auto.offset.reset` | string | Initial offset for the consumer group | Specify `earliest`, `latest`, or `none`(default) | +| `experimental.snapshot.enable` | string | Specify whether to consume messages from the WAL or from TSDB | Specify `true` or `false` | +| `enable.heartbeat.background` | string | Backend heartbeat; if enabled, the consumer does not go offline even if it has not polled for a long time | Specify `true` or `false` | @@ -514,7 +521,7 @@ consumer.subscribe(["tmq_meters"]).await?; ```python -consumer = TaosConsumer('topic_ctb_column', group_id='vg2') +consumer.subscribe(['topic1', 'topic2']) ``` @@ -633,9 +640,17 @@ for { ```python -for msg in consumer: - for row in msg: - print(row) +while True: + res = consumer.poll(100) + if not res: + continue + err = res.error() + if err is not None: + raise err + val = res.value() + + for block in val: + print(block.fetchall()) ``` diff --git a/docs/examples/python/tmq_example.py b/docs/examples/python/tmq_example.py index a4625ca11a..fafa81e8b5 100644 --- a/docs/examples/python/tmq_example.py +++ b/docs/examples/python/tmq_example.py @@ -1,58 +1,48 @@ +from taos.tmq import Consumer import taos -from taos.tmq import * - -conn = taos.connect() - -print("init") -conn.execute("drop topic if exists topic_ctb_column") -conn.execute("drop database if exists py_tmq") -conn.execute("create database if not exists py_tmq vgroups 2") -conn.select_db("py_tmq") -conn.execute( - "create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 binary(10)) tags(t1 int)" -) -conn.execute("create table if not exists tb1 using stb1 tags(1)") -conn.execute("create table if not exists tb2 using stb1 tags(2)") -conn.execute("create table if not exists tb3 using stb1 tags(3)") - -print("create topic") -conn.execute( - "create topic if not exists topic_ctb_column as select ts, c1, c2, c3 from stb1" -) - -print("build consumer") -conf = TaosTmqConf() -conf.set("group.id", "tg2") -conf.set("td.connect.user", "root") -conf.set("td.connect.pass", "taosdata") -conf.set("enable.auto.commit", "true") -def tmq_commit_cb_print(tmq, resp, offset, param=None): - print(f"commit: {resp}, tmq: {tmq}, offset: {offset}, param: {param}") +def init_tmq_env(db, topic): + conn = taos.connect() + conn.execute("drop topic if exists {}".format(topic)) + conn.execute("drop database if exists {}".format(db)) + conn.execute("create database if not exists {}".format(db)) + conn.select_db(db) + conn.execute( + "create stable if not exists stb1 (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))") + conn.execute("create table if not exists tb1 using stb1 tags(1, 't1')") + conn.execute("create table if not exists tb2 using stb1 tags(2, 't2')") + conn.execute("create table if not exists tb3 using stb1 tags(3, 't3')") + conn.execute("create topic if not exists {} as select ts, c1, c2, c3 from stb1".format(topic)) + conn.execute("insert into tb1 values (now, 1, 1.0, 'tmq test')") + conn.execute("insert into tb2 values (now, 2, 2.0, 'tmq test')") + conn.execute("insert into tb3 values (now, 3, 3.0, 'tmq test')") -conf.set_auto_commit_cb(tmq_commit_cb_print, None) -tmq = conf.new_consumer() +if __name__ == '__main__': + init_tmq_env("tmq_test", "tmq_test_topic") # init env + consumer = Consumer( + { + "group.id": "tg2", + "td.connect.user": "root", + "td.connect.pass": "taosdata", + "enable.auto.commit": "true", + } + ) + consumer.subscribe(["tmq_test_topic"]) -print("build topic list") + try: + while True: + res = consumer.poll(100) + if not res: + continue + err = res.error() + if err is not None: + raise err + val = res.value() -topic_list = TaosTmqList() -topic_list.append("topic_ctb_column") - -print("basic consume loop") -tmq.subscribe(topic_list) - -sub_list = tmq.subscription() - -print("subscribed topics: ", sub_list) - -while 1: - res = tmq.poll(1000) - if res: - topic = res.get_topic_name() - vg = res.get_vgroup_id() - db = res.get_db_name() - print(f"topic: {topic}\nvgroup id: {vg}\ndb: {db}") - for row in res: - print(row) + for block in val: + print(block.fetchall()) + finally: + consumer.unsubscribe() + consumer.close() diff --git a/docs/zh/07-develop/07-tmq.mdx b/docs/zh/07-develop/07-tmq.mdx index 039e9eb635..fb171042d9 100644 --- a/docs/zh/07-develop/07-tmq.mdx +++ b/docs/zh/07-develop/07-tmq.mdx @@ -92,22 +92,21 @@ void close() throws SQLException; ```python -class TaosConsumer(): - def __init__(self, *topics, **configs) +class Consumer: + def subscribe(self, topics): + pass - def __iter__(self) + def unsubscribe(self): + pass - def __next__(self) + def poll(self, timeout: float = 1.0): + pass - def sync_next(self) - - def subscription(self) + def close(self): + pass - def unsubscribe(self) - - def close(self) - - def __del__(self) + def commit(self, message): + pass ``` @@ -393,34 +392,33 @@ let mut consumer = tmq.build()?; -Python 语言下引入 `taos` 库的 `TaosConsumer` 类,创建一个 Consumer 示例: +Python 语言下引入 `taos` 库的 `Consumer` 类,创建一个 Consumer 示例: ```python -from taos.tmq import TaosConsumer +from taos.tmq import Consumer -# Syntax: `consumer = TaosConsumer(*topics, **args)` +# Syntax: `consumer = Consumer(configs)` # # Example: -consumer = TaosConsumer('topic1', 'topic2', td_connect_ip = "127.0.0.1", group_id = "local") +consumer = Consumer({"group.id": "local", "td.connect.ip": "127.0.0.1"}) ``` -其中,元组类型参数被视为 *Topics*,字典类型参数用于以下订阅配置设置: +其中,`configs` 为 dict 类型,传递创建 Consumer 的参数。可以配置的参数有: -| 参数名称 | 类型 | 参数说明 | 备注 | -| :----------------------------: | :----: | -------------------------------------------------------- | ------------------------------------------- | -| `td_connect_ip` | string | 用于创建连接,同 `taos_connect` | | -| `td_connect_user` | string | 用于创建连接,同 `taos_connect` | | -| `td_connect_pass` | string | 用于创建连接,同 `taos_connect` | | -| `td_connect_port` | string | 用于创建连接,同 `taos_connect` | | -| `group_id` | string | 消费组 ID,同一消费组共享消费进度 | **必填项**。最大长度:192。 | -| `client_id` | string | 客户端 ID | 最大长度:192。 | -| `auto_offset_reset` | string | 消费组订阅的初始位置 | 可选:`earliest`(default), `latest`, `none` | -| `enable_auto_commit` | string | 启用自动提交 | 合法值:`true`, `false`,默认为 true | -| `auto_commit_interval_ms` | string | 以毫秒为单位的自动提交时间间隔 | 默认值:5000 ms | -| `enable_heartbeat_background` | string | 启用后台心跳,启用后即使长时间不 poll 消息也不会造成离线 | 合法值:`true`, `false` | -| `experimental_snapshot_enable` | string | 是否允许从 TSDB 消费数据 | 合法值:`true`, `false` | -| `msg_with_table_name` | string | 是否允许从消息中解析表名,不适用于列订阅 | 合法值:`true`, `false` | -| `timeout` | int | 消费者拉取数据的超时时间 | | +| 参数名称 | 类型 | 参数说明 | 备注 | +|:------:|:----:|:-------:|:---:| +| `td.connect.ip` | string | 用于创建连接|| +| `td.connect.user` | string | 用于创建连接|| +| `td.connect.pass` | string | 用于创建连接|| +| `td.connect.port` | string | 用于创建连接|| +| `group.id` | string | 消费组 ID,同一消费组共享消费进度 | **必填项**。最大长度:192 | +| `client.id` | string | 客户端 ID | 最大长度:192 | +| `msg.with.table.name` | string | 是否允许从消息中解析表名,不适用于列订阅 | 合法值:`true`, `false` | +| `enable.auto.commit` | string | 启用自动提交 | 合法值:`true`, `false` | +| `auto.commit.interval.ms` | string | 以毫秒为单位的自动提交时间间隔 | 默认值:5000 ms | +| `auto.offset.reset` | string | 消费组订阅的初始位置 | 可选:`earliest`(default), `latest`, `none` | +| `experimental.snapshot.enable` | string | 是否允许从 TSDB 消费数据 | 合法值:`true`, `false` | +| `enable.heartbeat.background` | string | 启用后台心跳,启用后即使长时间不 poll 消息也不会造成离线 | 合法值:`true`, `false` | @@ -523,7 +521,7 @@ consumer.subscribe(["tmq_meters"]).await?; ```python -consumer = TaosConsumer('topic_ctb_column', group_id='vg2') +consumer.subscribe(['topic1', 'topic2']) ``` @@ -642,9 +640,17 @@ for { ```python -for msg in consumer: - for row in msg: - print(row) +while True: + res = consumer.poll(100) + if not res: + continue + err = res.error() + if err is not None: + raise err + val = res.value() + + for block in val: + print(block.fetchall()) ``` From ca43c0ab55e7c56934f197f2ae6e8738f02c3ae4 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 17 Jan 2023 16:47:43 +0800 Subject: [PATCH 127/139] feat: support writing streams to existing tables --- include/common/tmsg.h | 6 + include/libs/qcom/query.h | 6 - source/libs/parser/inc/sql.y | 8 +- source/libs/parser/src/parTranslater.c | 198 +- source/libs/parser/src/sql.c | 4316 ++++++++++--------- source/libs/parser/test/parInitialCTest.cpp | 9 +- source/libs/parser/test/parTestMain.cpp | 4 + source/libs/parser/test/parTestUtil.cpp | 25 +- source/libs/parser/test/parTestUtil.h | 7 +- 9 files changed, 2409 insertions(+), 2170 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index cf57165e54..9f00d29f6f 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1755,6 +1755,12 @@ typedef struct { #define STREAM_CREATE_STABLE_TRUE 1 #define STREAM_CREATE_STABLE_FALSE 0 +typedef struct SColLocation { + int16_t slotId; + col_id_t colId; + int8_t type; +} SColLocation; + typedef struct { char name[TSDB_STREAM_FNAME_LEN]; char sourceDB[TSDB_DB_FNAME_LEN]; diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index 57ddeb657c..bbf332c4d4 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -207,12 +207,6 @@ typedef struct SQueryNodeStat { int32_t tableNum; // vg table number, unit is TSDB_TABLE_NUM_UNIT } SQueryNodeStat; -typedef struct SColLocation { - int16_t slotId; - col_id_t colId; - int8_t type; -} SColLocation; - int32_t initTaskQueue(); int32_t cleanupTaskQueue(); diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index abb34e7e80..ba17488470 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -547,7 +547,7 @@ bufsize_opt(A) ::= BUFSIZE NK_INTEGER(B). /************************************************ create/drop stream **************************************************/ cmd ::= CREATE STREAM not_exists_opt(E) stream_name(A) stream_options(B) INTO - full_table_name(C) col_list_opt(H) tags_def_opt(F) subtable_opt(G) + full_table_name(C) col_list_opt(H) tag_def_or_ref_opt(F) subtable_opt(G) AS query_or_subquery(D). { pCxt->pRootNode = createCreateStreamStmt(pCxt, E, &A, C, B, F, G, D, H); } cmd ::= DROP STREAM exists_opt(A) stream_name(B). { pCxt->pRootNode = createDropStreamStmt(pCxt, A, &B); } @@ -556,6 +556,12 @@ cmd ::= DROP STREAM exists_opt(A) stream_name(B). col_list_opt(A) ::= . { A = NULL; } col_list_opt(A) ::= NK_LP col_name_list(B) NK_RP. { A = B; } +%type tag_def_or_ref_opt { SNodeList* } +%destructor tag_def_or_ref_opt { nodesDestroyList($$); } +tag_def_or_ref_opt(A) ::= . { A = NULL; } +tag_def_or_ref_opt(A) ::= tags_def(B). { A = B; } +tag_def_or_ref_opt(A) ::= TAGS NK_LP col_name_list(B) NK_RP. { A = B; } + stream_options(A) ::= . { A = createStreamOptions(pCxt); } stream_options(A) ::= stream_options(B) TRIGGER AT_ONCE. { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_AT_ONCE; A = B; } stream_options(A) ::= stream_options(B) TRIGGER WINDOW_CLOSE. { ((SStreamOptions*)B)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; A = B; } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index df04d92599..7cd58b592b 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4991,7 +4991,7 @@ static const SSchema* getColSchema(const STableMeta* pTableMeta, const char* pCo return NULL; } -static SSchema* getTagSchema(STableMeta* pTableMeta, const char* pTagName) { +static SSchema* getTagSchema(const STableMeta* pTableMeta, const char* pTagName) { int32_t numOfTags = getNumOfTags(pTableMeta); SSchema* pTagsSchema = getTableTagSchema(pTableMeta); for (int32_t i = 0; i < numOfTags; ++i) { @@ -5626,6 +5626,13 @@ static int32_t addWstartTsToCreateStreamQuery(STranslateContext* pCxt, SNode* pS return code; } +static const char* getTagNameForCreateStreamTag(SNode* pTag) { + if (QUERY_NODE_COLUMN_DEF == nodeType(pTag)) { + return ((SColumnDefNode*)pTag)->colName; + } + return ((SColumnNode*)pTag)->colName; +} + static int32_t addTagsToCreateStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStmt, SSelectStmt* pSelect) { if (NULL == pStmt->pTags) { return TSDB_CODE_SUCCESS; @@ -5636,7 +5643,7 @@ static int32_t addTagsToCreateStreamQuery(STranslateContext* pCxt, SCreateStream bool found = false; SNode* pPart = NULL; FOREACH(pPart, pSelect->pPartitionByList) { - if (0 == strcmp(((SColumnDefNode*)pTag)->colName, ((SExprNode*)pPart)->userAlias)) { + if (0 == strcmp(getTagNameForCreateStreamTag(pTag), ((SExprNode*)pPart)->userAlias)) { if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pSelect->pTags, nodesCloneNode(pPart))) { return TSDB_CODE_OUT_OF_MEMORY; } @@ -5645,7 +5652,7 @@ static int32_t addTagsToCreateStreamQuery(STranslateContext* pCxt, SCreateStream } } if (!found) { - return generateDealNodeErrMsg(pCxt, TSDB_CODE_PAR_INVALID_COLUMN, ((SColumnDefNode*)pTag)->colName); + return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COLUMN, ((SColumnDefNode*)pTag)->colName); } } return TSDB_CODE_SUCCESS; @@ -5789,8 +5796,30 @@ static int32_t addProjToProjColPos(STranslateContext* pCxt, const SSchema* pSche return code; } -static int32_t adjustOrderOfProjection(STranslateContext* pCxt, SNodeList* pCols, const STableMeta* pMeta, - SNodeList** pProjections) { +static int32_t setFillNullCols(SArray* pProjColPos, const STableMeta* pMeta, SCMCreateStreamReq* pReq) { + int32_t numOfBoundCols = taosArrayGetSize(pProjColPos); + pReq->fillNullCols = taosArrayInit(pMeta->tableInfo.numOfColumns - numOfBoundCols, sizeof(SColLocation)); + if (NULL == pReq->fillNullCols) { + return TSDB_CODE_OUT_OF_MEMORY; + } + int32_t indexOfSchema = 0; + const SSchema* pSchemas = getTableColumnSchema(pMeta); + for (int32_t i = 0; i < numOfBoundCols; ++i) { + SProjColPos* pPos = taosArrayGet(pProjColPos, i); + while (indexOfSchema < pMeta->tableInfo.numOfColumns) { + const SSchema* pSchema = pSchemas + indexOfSchema++; + if (pSchema->colId == pPos->colId) { + break; + } + SColLocation colLoc = {.colId = pSchema->colId, .slotId = indexOfSchema - 1, .type = pSchema->type}; + taosArrayPush(pReq->fillNullCols, &colLoc); + } + } + return TSDB_CODE_SUCCESS; +} + +static int32_t adjustOrderOfProjections(STranslateContext* pCxt, SNodeList* pCols, const STableMeta* pMeta, + SNodeList** pProjections, SCMCreateStreamReq* pReq) { if (LIST_LENGTH(pCols) != LIST_LENGTH(*pProjections)) { return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COLUMNS_NUM, "Illegal number of columns"); } @@ -5805,7 +5834,12 @@ static int32_t adjustOrderOfProjection(STranslateContext* pCxt, SNodeList* pCols SNode* pProj = NULL; FORBOTH(pCol, pCols, pProj, *pProjections) { const SSchema* pSchema = getColSchema(pMeta, ((SColumnNode*)pCol)->colName); - code = addProjToProjColPos(pCxt, pSchema, pProj, pProjColPos); + if (NULL == pSchema) { + code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COLUMN, ((SColumnNode*)pCol)->colName); + } + if (TSDB_CODE_SUCCESS == code) { + code = addProjToProjColPos(pCxt, pSchema, pProj, pProjColPos); + } if (TSDB_CODE_SUCCESS != code) { break; } @@ -5826,6 +5860,10 @@ static int32_t adjustOrderOfProjection(STranslateContext* pCxt, SNodeList* pCols } } + if (TSDB_CODE_SUCCESS == code && pMeta->tableInfo.numOfColumns > LIST_LENGTH(pCols)) { + code = setFillNullCols(pProjColPos, pMeta, pReq); + } + if (TSDB_CODE_SUCCESS == code) { taosArrayDestroy(pProjColPos); nodesDestroyList(*pProjections); @@ -5838,19 +5876,127 @@ static int32_t adjustOrderOfProjection(STranslateContext* pCxt, SNodeList* pCols return code; } -static int32_t adjustStreamQueryForExistTableImpl(STranslateContext* pCxt, SCreateStreamStmt* pStmt, - const STableMeta* pMeta) { +static int32_t adjustProjectionsForExistTable(STranslateContext* pCxt, SCreateStreamStmt* pStmt, + const STableMeta* pMeta, SCMCreateStreamReq* pReq) { SSelectStmt* pSelect = (SSelectStmt*)pStmt->pQuery; if (NULL == pStmt->pCols) { return adjustDataTypeOfProjections(pCxt, pMeta, pSelect->pProjectionList); } - return adjustOrderOfProjection(pCxt, pStmt->pCols, pMeta, &pSelect->pProjectionList); + return adjustOrderOfProjections(pCxt, pStmt->pCols, pMeta, &pSelect->pProjectionList, pReq); } -static int32_t adjustStreamQueryForExistTable(STranslateContext* pCxt, SCreateStreamStmt* pStmt, - SCMCreateStreamReq* pReq) { - STableMeta* pMeta = NULL; - int32_t code = getTableMeta(pCxt, pStmt->targetDbName, pStmt->targetTabName, &pMeta); +static int32_t adjustDataTypeOfTags(STranslateContext* pCxt, const STableMeta* pMeta, SNodeList* pTags) { + if (getNumOfTags(pMeta) != LIST_LENGTH(pTags)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COLUMNS_NUM, "Illegal number of tags"); + } + + SSchema* pSchemas = getTableTagSchema(pMeta); + int32_t index = 0; + SNode* pTag = NULL; + FOREACH(pTag, pTags) { + SSchema* pSchema = pSchemas + index++; + SDataType dt = {.type = pSchema->type, .bytes = pSchema->bytes}; + if (!dataTypeEqual(&dt, &((SExprNode*)pTag)->resType)) { + SNode* pFunc = NULL; + int32_t code = createCastFunc(pCxt, pTag, dt, &pFunc); + if (TSDB_CODE_SUCCESS != code) { + return code; + } + REPLACE_NODE(pFunc); + } + } + + return TSDB_CODE_SUCCESS; +} + +static SNode* createNullValue() { + SValueNode* pValue = (SValueNode*)nodesMakeNode(QUERY_NODE_VALUE); + if (NULL == pValue) { + return NULL; + } + pValue->isNull = true; + pValue->node.resType.type = TSDB_DATA_TYPE_NULL; + pValue->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_NULL].bytes; + return (SNode*)pValue; +} + +static int32_t adjustOrderOfTags(STranslateContext* pCxt, SNodeList* pTags, const STableMeta* pMeta, + SNodeList** pTagExprs, SCMCreateStreamReq* pReq) { + if (LIST_LENGTH(pTags) != LIST_LENGTH(*pTagExprs)) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_COLUMNS_NUM, "Illegal number of tags"); + } + + SArray* pTagPos = taosArrayInit(LIST_LENGTH(pTags), sizeof(SProjColPos)); + if (NULL == pTagPos) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + int32_t code = TSDB_CODE_SUCCESS; + SNode* pTag = NULL; + SNode* pTagExpr = NULL; + FORBOTH(pTag, pTags, pTagExpr, *pTagExprs) { + const SSchema* pSchema = getTagSchema(pMeta, ((SColumnNode*)pTag)->colName); + if (NULL == pSchema) { + code = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_TAG_NAME, ((SColumnNode*)pTag)->colName); + } + if (TSDB_CODE_SUCCESS == code) { + code = addProjToProjColPos(pCxt, pSchema, pTagExpr, pTagPos); + } + if (TSDB_CODE_SUCCESS != code) { + break; + } + } + + SNodeList* pNewTagExprs = NULL; + if (TSDB_CODE_SUCCESS == code) { + taosArraySort(pTagPos, projColPosCompar); + int32_t indexOfBoundTags = 0; + int32_t numOfBoundTags = taosArrayGetSize(pTagPos); + int32_t numOfTags = getNumOfTags(pMeta); + const SSchema* pTagsSchema = getTableTagSchema(pMeta); + pNewTagExprs = nodesMakeList(); + if (NULL == pNewTagExprs) { + code = TSDB_CODE_OUT_OF_MEMORY; + } + for (int32_t i = 0; TSDB_CODE_SUCCESS == code && i < numOfTags; ++i) { + const SSchema* pTagSchema = pTagsSchema + i; + if (indexOfBoundTags < numOfBoundTags) { + SProjColPos* pPos = taosArrayGet(pTagPos, indexOfBoundTags); + if (pPos->colId == pTagSchema->colId) { + ++indexOfBoundTags; + code = nodesListStrictAppend(pNewTagExprs, pPos->pProj); + pPos->pProj = NULL; + continue; + } + } + code = nodesListStrictAppend(pNewTagExprs, createNullValue()); + } + } + + if (TSDB_CODE_SUCCESS == code) { + taosArrayDestroy(pTagPos); + nodesDestroyList(*pTagExprs); + *pTagExprs = pNewTagExprs; + } else { + taosArrayDestroyEx(pTagPos, projColPosDelete); + nodesDestroyList(pNewTagExprs); + } + + return code; +} + +static int32_t adjustTagsForExistTable(STranslateContext* pCxt, SCreateStreamStmt* pStmt, const STableMeta* pMeta, + SCMCreateStreamReq* pReq) { + SSelectStmt* pSelect = (SSelectStmt*)pStmt->pQuery; + if (NULL == pStmt->pTags) { + return adjustDataTypeOfTags(pCxt, pMeta, pSelect->pTags); + } + return adjustOrderOfTags(pCxt, pStmt->pTags, pMeta, &pSelect->pTags, pReq); +} + +static int32_t translateStreamTargetTable(STranslateContext* pCxt, SCreateStreamStmt* pStmt, SCMCreateStreamReq* pReq, + STableMeta** pMeta) { + int32_t code = getTableMeta(pCxt, pStmt->targetDbName, pStmt->targetTabName, pMeta); if (TSDB_CODE_PAR_TABLE_NOT_EXIST == code) { if (NULL != pStmt->pCols) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_TABLE_NOT_EXIST, pStmt->targetTabName); @@ -5860,18 +6006,18 @@ static int32_t adjustStreamQueryForExistTable(STranslateContext* pCxt, SCreateSt return TSDB_CODE_SUCCESS; } else { pReq->createStb = STREAM_CREATE_STABLE_FALSE; - pReq->targetStbUid = pMeta->suid; + pReq->targetStbUid = (*pMeta)->suid; } - if (TSDB_CODE_SUCCESS == code) { - code = adjustStreamQueryForExistTableImpl(pCxt, pStmt, pMeta); - } - taosMemoryFree(pMeta); return code; } static int32_t buildCreateStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStmt, SCMCreateStreamReq* pReq) { pCxt->createStream = true; - int32_t code = addSubtableInfoToCreateStreamQuery(pCxt, pStmt); + STableMeta* pMeta = NULL; + int32_t code = translateStreamTargetTable(pCxt, pStmt, pReq, &pMeta); + if (TSDB_CODE_SUCCESS == code) { + code = addSubtableInfoToCreateStreamQuery(pCxt, pStmt); + } if (TSDB_CODE_SUCCESS == code) { code = translateQuery(pCxt, pStmt->pQuery); } @@ -5881,13 +6027,17 @@ static int32_t buildCreateStreamQuery(STranslateContext* pCxt, SCreateStreamStmt if (TSDB_CODE_SUCCESS == code) { code = checkStreamQuery(pCxt, pStmt); } - if (TSDB_CODE_SUCCESS == code) { - code = adjustStreamQueryForExistTable(pCxt, pStmt, pReq); + if (TSDB_CODE_SUCCESS == code && NULL != pMeta) { + code = adjustProjectionsForExistTable(pCxt, pStmt, pMeta, pReq); + } + if (TSDB_CODE_SUCCESS == code && NULL != pMeta) { + code = adjustTagsForExistTable(pCxt, pStmt, pMeta, pReq); } if (TSDB_CODE_SUCCESS == code) { getSourceDatabase(pStmt->pQuery, pCxt->pParseCxt->acctId, pReq->sourceDB); code = nodesNodeToString(pStmt->pQuery, false, &pReq->ast, NULL); } + taosMemoryFree(pMeta); return code; } @@ -5918,8 +6068,10 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt* pReq->watermark = (NULL != pStmt->pOptions->pWatermark ? ((SValueNode*)pStmt->pOptions->pWatermark)->datum.i : 0); pReq->fillHistory = pStmt->pOptions->fillHistory; pReq->igExpired = pStmt->pOptions->ignoreExpired; - columnDefNodeToField(pStmt->pTags, &pReq->pTags); - pReq->numOfTags = LIST_LENGTH(pStmt->pTags); + if (pReq->createStb) { + columnDefNodeToField(pStmt->pTags, &pReq->pTags); + pReq->numOfTags = LIST_LENGTH(pStmt->pTags); + } } return code; diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 7460664de2..03cd8093f9 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -104,26 +104,26 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 465 +#define YYNOCODE 466 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SToken typedef union { int yyinit; ParseTOKENTYPE yy0; - EJoinType yy42; - int8_t yy113; - int64_t yy159; - SToken yy179; - EOperatorType yy290; - EFillMode yy324; - SDataType yy394; - ENullOrder yy487; - SNode* yy602; - bool yy767; - int32_t yy820; - SAlterOption yy845; - SNodeList* yy874; - EOrder yy878; + int8_t yy27; + ENullOrder yy89; + int64_t yy129; + SToken yy233; + SAlterOption yy257; + bool yy397; + EJoinType yy428; + EFillMode yy646; + SNodeList* yy776; + int32_t yy832; + SDataType yy852; + EOperatorType yy856; + EOrder yy870; + SNode* yy924; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 730 -#define YYNRULE 553 +#define YYNSTATE 734 +#define YYNRULE 556 #define YYNTOKEN 326 -#define YY_MAX_SHIFT 729 -#define YY_MIN_SHIFTREDUCE 1081 -#define YY_MAX_SHIFTREDUCE 1633 -#define YY_ERROR_ACTION 1634 -#define YY_ACCEPT_ACTION 1635 -#define YY_NO_ACTION 1636 -#define YY_MIN_REDUCE 1637 -#define YY_MAX_REDUCE 2189 +#define YY_MAX_SHIFT 733 +#define YY_MIN_SHIFTREDUCE 1087 +#define YY_MAX_SHIFTREDUCE 1642 +#define YY_ERROR_ACTION 1643 +#define YY_ACCEPT_ACTION 1644 +#define YY_NO_ACTION 1645 +#define YY_MIN_REDUCE 1646 +#define YY_MAX_REDUCE 2201 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -216,740 +216,793 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (2706) +#define YY_ACTTAB_COUNT (2952) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1909, 471, 376, 472, 1673, 1836, 1838, 480, 1989, 472, - /* 10 */ 1673, 1909, 45, 43, 1563, 1907, 606, 173, 1650, 1985, - /* 20 */ 371, 1989, 1412, 362, 1843, 1781, 1906, 606, 2003, 35, - /* 30 */ 283, 339, 1985, 1493, 1660, 1410, 1985, 618, 342, 1892, - /* 40 */ 1841, 470, 38, 37, 475, 1679, 44, 42, 41, 40, - /* 50 */ 39, 1981, 1987, 353, 416, 594, 604, 582, 1488, 2021, - /* 60 */ 618, 2160, 629, 18, 1981, 1987, 366, 597, 1981, 1987, - /* 70 */ 1418, 619, 1971, 1635, 635, 629, 581, 179, 1971, 629, - /* 80 */ 1843, 2161, 583, 45, 43, 130, 138, 351, 1437, 1114, - /* 90 */ 618, 371, 510, 1412, 325, 14, 1841, 335, 1437, 582, - /* 100 */ 1843, 2002, 1790, 2160, 1493, 2038, 1410, 359, 107, 2004, - /* 110 */ 639, 2006, 2007, 634, 64, 629, 1841, 726, 581, 179, - /* 120 */ 176, 265, 2091, 2161, 583, 191, 365, 2087, 1116, 1488, - /* 130 */ 1119, 1120, 1495, 1496, 18, 48, 1990, 577, 1522, 386, - /* 140 */ 181, 1418, 44, 42, 41, 40, 39, 1985, 2117, 262, - /* 150 */ 2099, 593, 479, 131, 592, 475, 1679, 2160, 60, 2021, - /* 160 */ 90, 81, 1468, 1478, 80, 48, 14, 576, 1494, 1497, - /* 170 */ 274, 275, 581, 179, 163, 273, 1649, 2161, 583, 1981, - /* 180 */ 1987, 477, 558, 1413, 8, 1411, 2160, 473, 726, 346, - /* 190 */ 629, 233, 38, 37, 1820, 1523, 44, 42, 41, 40, - /* 200 */ 39, 2166, 179, 1495, 1496, 60, 2161, 583, 1416, 1417, - /* 210 */ 575, 1467, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, - /* 220 */ 631, 627, 1486, 1487, 1489, 1490, 1491, 1492, 2, 572, - /* 230 */ 1338, 1339, 1439, 1468, 1478, 60, 489, 84, 120, 1494, - /* 240 */ 1497, 119, 118, 117, 116, 115, 114, 113, 112, 111, - /* 250 */ 347, 134, 345, 344, 1413, 512, 1411, 38, 37, 514, - /* 260 */ 1785, 44, 42, 41, 40, 39, 673, 34, 369, 1517, - /* 270 */ 1518, 1519, 1520, 1521, 1525, 1526, 1527, 1528, 173, 1416, - /* 280 */ 1417, 513, 1467, 1470, 1471, 1472, 1473, 1474, 1475, 1476, - /* 290 */ 1477, 631, 627, 1486, 1487, 1489, 1490, 1491, 1492, 2, - /* 300 */ 1893, 11, 45, 43, 1706, 605, 1133, 1659, 1132, 182, - /* 310 */ 371, 1658, 1412, 578, 573, 567, 182, 11, 2003, 9, - /* 320 */ 60, 216, 409, 1493, 408, 1410, 1240, 661, 660, 659, - /* 330 */ 1244, 658, 1246, 1247, 657, 1249, 654, 1134, 1255, 651, - /* 340 */ 1257, 1258, 648, 645, 1567, 1600, 405, 2164, 1488, 2021, - /* 350 */ 1437, 1971, 487, 18, 1902, 1971, 182, 636, 619, 1630, - /* 360 */ 1418, 1133, 1971, 1132, 635, 1436, 1437, 407, 403, 525, - /* 370 */ 524, 523, 130, 45, 43, 1498, 264, 135, 519, 515, - /* 380 */ 2106, 371, 518, 1412, 1992, 14, 182, 517, 522, 1790, - /* 390 */ 1556, 2002, 1134, 516, 1493, 2038, 1410, 605, 107, 2004, - /* 400 */ 639, 2006, 2007, 634, 2003, 629, 2103, 726, 141, 2165, - /* 410 */ 147, 2062, 2091, 2160, 31, 217, 365, 2087, 1524, 1488, - /* 420 */ 38, 37, 1495, 1496, 44, 42, 41, 40, 39, 2164, - /* 430 */ 168, 1418, 1994, 2161, 2163, 2021, 506, 502, 498, 494, - /* 440 */ 214, 60, 1418, 636, 603, 1503, 1902, 2165, 1971, 619, - /* 450 */ 635, 1437, 1468, 1478, 1629, 1438, 46, 539, 1494, 1497, - /* 460 */ 104, 38, 37, 54, 1439, 44, 42, 41, 40, 39, - /* 470 */ 537, 182, 535, 1413, 139, 1411, 85, 2002, 726, 212, - /* 480 */ 1790, 2038, 1782, 454, 165, 2004, 639, 2006, 2007, 634, - /* 490 */ 32, 629, 1469, 1495, 1496, 1657, 664, 27, 1416, 1417, - /* 500 */ 1529, 1467, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, - /* 510 */ 631, 627, 1486, 1487, 1489, 1490, 1491, 1492, 2, 525, - /* 520 */ 524, 523, 84, 1468, 1478, 559, 2128, 135, 519, 1494, - /* 530 */ 1497, 164, 518, 11, 49, 619, 1744, 517, 522, 1971, - /* 540 */ 1623, 195, 194, 516, 1413, 1786, 1411, 211, 205, 184, - /* 550 */ 1656, 685, 210, 38, 37, 485, 1779, 44, 42, 41, - /* 560 */ 40, 39, 1438, 605, 453, 1440, 1790, 1355, 1356, 1416, - /* 570 */ 1417, 203, 1467, 1470, 1471, 1472, 1473, 1474, 1475, 1476, - /* 580 */ 1477, 631, 627, 1486, 1487, 1489, 1490, 1491, 1492, 2, - /* 590 */ 45, 43, 182, 1469, 1971, 671, 1837, 1838, 371, 1638, - /* 600 */ 1412, 521, 520, 1354, 1357, 1590, 2003, 1873, 264, 585, - /* 610 */ 614, 1493, 1902, 1410, 152, 151, 668, 667, 666, 149, - /* 620 */ 120, 1775, 594, 119, 118, 117, 116, 115, 114, 113, - /* 630 */ 112, 111, 13, 12, 38, 37, 1488, 2021, 44, 42, - /* 640 */ 41, 40, 39, 2165, 1768, 597, 619, 2160, 1418, 1777, - /* 650 */ 1971, 175, 635, 138, 569, 1588, 1589, 1591, 1592, 1888, - /* 660 */ 414, 45, 43, 2164, 1830, 1843, 231, 2161, 2162, 371, - /* 670 */ 187, 1412, 364, 46, 1283, 1284, 232, 1790, 621, 2002, - /* 680 */ 2063, 1841, 1493, 2038, 1410, 182, 107, 2004, 639, 2006, - /* 690 */ 2007, 634, 2003, 629, 619, 726, 1843, 1766, 176, 623, - /* 700 */ 2091, 2063, 1200, 375, 365, 2087, 489, 1488, 415, 242, - /* 710 */ 1495, 1496, 1841, 1655, 1773, 596, 177, 2099, 2100, 1418, - /* 720 */ 136, 2104, 1579, 2021, 1637, 1790, 2118, 1536, 237, 87, - /* 730 */ 330, 636, 1412, 543, 1654, 541, 1971, 1202, 635, 1653, - /* 740 */ 1468, 1478, 1389, 1390, 14, 1410, 1494, 1497, 129, 128, - /* 750 */ 127, 126, 125, 124, 123, 122, 121, 1971, 434, 673, - /* 760 */ 630, 1413, 686, 1411, 1760, 2002, 726, 433, 663, 2038, - /* 770 */ 697, 695, 165, 2004, 639, 2006, 2007, 634, 1971, 629, - /* 780 */ 1418, 1495, 1496, 1971, 2106, 1652, 1416, 1417, 410, 1467, - /* 790 */ 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 631, 627, - /* 800 */ 1486, 1487, 1489, 1490, 1491, 1492, 2, 619, 1888, 1888, - /* 810 */ 2102, 1468, 1478, 328, 2129, 1435, 619, 1494, 1497, 189, - /* 820 */ 193, 424, 447, 619, 98, 461, 2106, 726, 460, 1971, - /* 830 */ 439, 558, 1413, 1843, 1411, 2160, 363, 440, 1790, 553, - /* 840 */ 41, 40, 39, 430, 161, 462, 1783, 1790, 432, 1842, - /* 850 */ 2166, 179, 2101, 1792, 1790, 2161, 583, 1416, 1417, 1958, - /* 860 */ 1467, 1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 631, - /* 870 */ 627, 1486, 1487, 1489, 1490, 1491, 1492, 2, 1767, 374, - /* 880 */ 1119, 1120, 161, 162, 1651, 619, 619, 161, 303, 343, - /* 890 */ 1703, 1793, 514, 1413, 1765, 1411, 1792, 1437, 33, 488, - /* 900 */ 1787, 420, 301, 70, 38, 37, 69, 393, 44, 42, - /* 910 */ 41, 40, 39, 377, 513, 1745, 1790, 1790, 1416, 1417, - /* 920 */ 140, 161, 259, 2062, 199, 467, 465, 2131, 1971, 665, - /* 930 */ 1792, 458, 1834, 1560, 452, 451, 450, 449, 446, 445, - /* 940 */ 444, 443, 442, 438, 437, 436, 435, 327, 427, 426, - /* 950 */ 425, 570, 422, 421, 341, 703, 702, 701, 700, 381, - /* 960 */ 60, 699, 698, 142, 693, 692, 691, 690, 689, 688, - /* 970 */ 687, 154, 683, 682, 681, 380, 379, 678, 677, 676, - /* 980 */ 675, 674, 1648, 530, 1440, 671, 38, 37, 594, 417, - /* 990 */ 44, 42, 41, 40, 39, 1632, 1633, 1440, 540, 106, - /* 1000 */ 619, 671, 418, 619, 152, 151, 668, 667, 666, 149, - /* 1010 */ 2111, 1556, 230, 1647, 234, 619, 2003, 284, 586, 138, - /* 1020 */ 152, 151, 668, 667, 666, 149, 1971, 533, 594, 554, - /* 1030 */ 619, 1790, 527, 1646, 1790, 1645, 619, 229, 150, 1469, - /* 1040 */ 78, 77, 413, 253, 598, 186, 1790, 2021, 1644, 669, - /* 1050 */ 602, 670, 1834, 297, 1834, 636, 1820, 1971, 1693, 138, - /* 1060 */ 1971, 1790, 635, 326, 619, 1643, 401, 1790, 399, 395, - /* 1070 */ 391, 388, 385, 67, 2003, 589, 66, 1971, 278, 1971, - /* 1080 */ 526, 1421, 178, 2099, 2100, 1642, 136, 2104, 619, 2002, - /* 1090 */ 53, 215, 1971, 2038, 71, 1790, 107, 2004, 639, 2006, - /* 1100 */ 2007, 634, 616, 629, 2003, 2021, 13, 12, 2180, 1971, - /* 1110 */ 2091, 182, 150, 636, 365, 2087, 382, 2022, 1971, 1790, - /* 1120 */ 635, 2003, 180, 2099, 2100, 2125, 136, 2104, 188, 1971, - /* 1130 */ 1641, 619, 38, 37, 1674, 2021, 44, 42, 41, 40, - /* 1140 */ 39, 241, 160, 636, 79, 617, 1640, 2002, 1971, 619, - /* 1150 */ 635, 2038, 2021, 1686, 107, 2004, 639, 2006, 2007, 634, - /* 1160 */ 636, 629, 1790, 378, 1387, 1971, 2180, 635, 2091, 50, - /* 1170 */ 1684, 3, 365, 2087, 1971, 528, 1559, 2002, 2003, 240, - /* 1180 */ 1790, 2038, 600, 2138, 313, 2004, 639, 2006, 2007, 634, - /* 1190 */ 1971, 629, 531, 144, 2002, 132, 222, 224, 2038, 220, - /* 1200 */ 223, 107, 2004, 639, 2006, 2007, 634, 1420, 629, 2021, - /* 1210 */ 1897, 226, 1831, 2180, 225, 2091, 52, 636, 88, 365, - /* 1220 */ 2087, 384, 1971, 557, 635, 558, 62, 626, 579, 2160, - /* 1230 */ 565, 1424, 228, 368, 367, 227, 2003, 2121, 246, 595, - /* 1240 */ 150, 587, 47, 1426, 2166, 179, 1, 271, 258, 2161, - /* 1250 */ 583, 2002, 47, 1680, 1493, 2038, 1419, 4, 107, 2004, - /* 1260 */ 639, 2006, 2007, 634, 558, 629, 2003, 2021, 2160, 261, - /* 1270 */ 2180, 1162, 2091, 68, 148, 636, 365, 2087, 1587, 1488, - /* 1280 */ 1971, 150, 635, 2166, 179, 103, 679, 2154, 2161, 583, - /* 1290 */ 248, 1418, 601, 387, 1352, 100, 392, 2021, 2003, 276, - /* 1300 */ 590, 340, 721, 62, 1479, 636, 1163, 47, 1181, 2002, - /* 1310 */ 1971, 643, 635, 2038, 291, 148, 107, 2004, 639, 2006, - /* 1320 */ 2007, 634, 150, 629, 133, 611, 280, 1374, 2180, 2021, - /* 1330 */ 2091, 192, 680, 1233, 365, 2087, 148, 636, 625, 2002, - /* 1340 */ 1440, 419, 1971, 2038, 635, 2110, 107, 2004, 639, 2006, - /* 1350 */ 2007, 634, 383, 629, 1179, 1530, 1898, 1423, 2066, 296, - /* 1360 */ 2091, 423, 456, 1261, 365, 2087, 1435, 1265, 428, 441, - /* 1370 */ 455, 2002, 1514, 1890, 1272, 2038, 1270, 2003, 107, 2004, - /* 1380 */ 639, 2006, 2007, 634, 448, 629, 457, 463, 153, 464, - /* 1390 */ 2064, 196, 2091, 466, 468, 558, 365, 2087, 1441, 2160, - /* 1400 */ 469, 478, 1443, 481, 1427, 202, 1422, 1438, 2021, 482, - /* 1410 */ 204, 1442, 483, 1444, 2166, 179, 636, 484, 207, 2161, - /* 1420 */ 583, 1971, 486, 635, 209, 546, 82, 490, 83, 1430, - /* 1430 */ 1432, 213, 1136, 507, 508, 2003, 511, 1780, 509, 219, - /* 1440 */ 1776, 110, 627, 1486, 1487, 1489, 1490, 1491, 1492, 221, - /* 1450 */ 2002, 155, 156, 329, 2038, 2003, 1778, 107, 2004, 639, - /* 1460 */ 2006, 2007, 634, 1774, 629, 545, 2021, 547, 558, 622, - /* 1470 */ 157, 2091, 2160, 158, 636, 365, 2087, 235, 86, 1971, - /* 1480 */ 292, 635, 1948, 548, 1947, 238, 2021, 2166, 179, 552, - /* 1490 */ 571, 555, 2161, 583, 636, 146, 549, 609, 2122, 1971, - /* 1500 */ 2132, 635, 562, 568, 2137, 2136, 244, 247, 2002, 7, - /* 1510 */ 354, 574, 2038, 2003, 580, 108, 2004, 639, 2006, 2007, - /* 1520 */ 634, 2113, 629, 560, 563, 252, 355, 561, 2002, 2091, - /* 1530 */ 255, 169, 2038, 2090, 2087, 108, 2004, 639, 2006, 2007, - /* 1540 */ 634, 588, 629, 2003, 2021, 254, 257, 591, 1556, 2091, - /* 1550 */ 256, 137, 636, 624, 2087, 1439, 2107, 1971, 358, 635, - /* 1560 */ 2003, 599, 1445, 266, 2183, 1903, 93, 612, 293, 294, - /* 1570 */ 607, 613, 608, 260, 2021, 1917, 95, 1916, 2159, 1915, - /* 1580 */ 361, 97, 633, 295, 1791, 59, 637, 1971, 2072, 635, - /* 1590 */ 2038, 2021, 99, 108, 2004, 639, 2006, 2007, 634, 636, - /* 1600 */ 629, 1835, 641, 298, 1971, 722, 635, 2091, 1761, 723, - /* 1610 */ 287, 334, 2087, 725, 51, 331, 2002, 2003, 300, 307, - /* 1620 */ 2038, 332, 322, 319, 2004, 639, 2006, 2007, 634, 632, - /* 1630 */ 629, 620, 2056, 2002, 302, 321, 1965, 2038, 311, 1964, - /* 1640 */ 166, 2004, 639, 2006, 2007, 634, 75, 629, 2021, 1963, - /* 1650 */ 1962, 76, 1959, 389, 390, 1404, 636, 1405, 185, 394, - /* 1660 */ 1957, 1971, 396, 635, 2003, 397, 398, 1956, 400, 1955, - /* 1670 */ 402, 1954, 1953, 404, 1377, 406, 1376, 1928, 1927, 411, - /* 1680 */ 412, 2003, 1926, 1925, 1329, 1881, 1880, 1878, 1877, 143, - /* 1690 */ 2002, 1876, 584, 2181, 2038, 2021, 1879, 108, 2004, 639, - /* 1700 */ 2006, 2007, 634, 636, 629, 1875, 1874, 1872, 1971, 190, - /* 1710 */ 635, 2091, 2021, 1871, 1870, 429, 2088, 360, 1869, 431, - /* 1720 */ 636, 1883, 1868, 1867, 1866, 1971, 1865, 635, 1864, 1863, - /* 1730 */ 1862, 1861, 1860, 1859, 1858, 1857, 2003, 2002, 1856, 1855, - /* 1740 */ 1854, 2038, 145, 1853, 166, 2004, 639, 2006, 2007, 634, - /* 1750 */ 1852, 629, 1851, 1882, 2002, 1850, 1849, 1848, 2038, 2003, - /* 1760 */ 1847, 320, 2004, 639, 2006, 2007, 634, 2021, 629, 1331, - /* 1770 */ 1846, 1845, 1844, 459, 1708, 633, 1208, 197, 1707, 1705, - /* 1780 */ 1971, 1669, 635, 198, 200, 73, 1668, 1122, 174, 1121, - /* 1790 */ 2021, 2003, 1991, 1941, 1935, 370, 474, 2182, 636, 201, - /* 1800 */ 74, 476, 1924, 1971, 206, 635, 208, 1923, 1901, 2002, - /* 1810 */ 1769, 1704, 1155, 2038, 1702, 491, 319, 2004, 639, 2006, - /* 1820 */ 2007, 634, 2021, 629, 492, 2057, 493, 372, 1700, 497, - /* 1830 */ 636, 495, 2002, 496, 1698, 1971, 2038, 635, 2003, 320, - /* 1840 */ 2004, 639, 2006, 2007, 634, 500, 629, 499, 501, 1696, - /* 1850 */ 503, 504, 729, 1683, 1682, 505, 1665, 1771, 1277, 1276, - /* 1860 */ 218, 1770, 2003, 694, 2002, 1199, 290, 61, 2038, 2021, - /* 1870 */ 1198, 320, 2004, 639, 2006, 2007, 634, 636, 629, 1197, - /* 1880 */ 1196, 172, 1971, 696, 635, 1193, 1192, 719, 715, 711, - /* 1890 */ 707, 288, 1191, 2021, 1190, 1694, 348, 1687, 349, 1685, - /* 1900 */ 350, 636, 529, 532, 1664, 1663, 1971, 534, 635, 1662, - /* 1910 */ 536, 544, 538, 109, 1394, 2038, 1393, 1396, 315, 2004, - /* 1920 */ 639, 2006, 2007, 634, 26, 629, 1940, 105, 2003, 1383, - /* 1930 */ 281, 542, 55, 1934, 550, 2002, 1922, 159, 1920, 2038, - /* 1940 */ 2165, 551, 304, 2004, 639, 2006, 2007, 634, 239, 629, - /* 1950 */ 2003, 19, 352, 16, 1602, 556, 564, 28, 566, 2021, - /* 1960 */ 243, 58, 5, 615, 63, 245, 6, 636, 250, 1586, - /* 1970 */ 251, 30, 1971, 1578, 635, 2003, 1992, 167, 249, 29, - /* 1980 */ 89, 2021, 1622, 1623, 21, 1617, 1616, 356, 1621, 636, - /* 1990 */ 1620, 357, 1553, 263, 1971, 170, 635, 1552, 268, 92, - /* 2000 */ 1899, 2002, 57, 267, 1921, 2038, 2021, 1919, 305, 2004, - /* 2010 */ 639, 2006, 2007, 634, 636, 629, 20, 1918, 1900, 1971, - /* 2020 */ 1381, 635, 236, 2002, 269, 91, 22, 2038, 56, 272, - /* 2030 */ 306, 2004, 639, 2006, 2007, 634, 277, 629, 2003, 17, - /* 2040 */ 270, 1584, 65, 282, 94, 23, 1505, 610, 2002, 96, - /* 2050 */ 12, 10, 2038, 1504, 279, 312, 2004, 639, 2006, 2007, - /* 2060 */ 634, 1428, 629, 1515, 100, 2041, 2003, 1483, 628, 2021, - /* 2070 */ 1481, 36, 171, 183, 1480, 15, 24, 636, 640, 1452, - /* 2080 */ 1460, 638, 1971, 25, 635, 1262, 642, 373, 644, 646, - /* 2090 */ 1259, 1256, 647, 650, 649, 652, 2003, 2021, 1250, 1248, - /* 2100 */ 655, 653, 1239, 656, 1254, 636, 1253, 101, 285, 1252, - /* 2110 */ 1971, 2002, 635, 1267, 102, 2038, 662, 1271, 316, 2004, - /* 2120 */ 639, 2006, 2007, 634, 72, 629, 1153, 2021, 2003, 1251, - /* 2130 */ 672, 1187, 1186, 1185, 1184, 636, 1183, 1182, 1180, 2002, - /* 2140 */ 1971, 1178, 635, 2038, 1177, 1176, 308, 2004, 639, 2006, - /* 2150 */ 2007, 634, 286, 629, 1206, 684, 1174, 1173, 1172, 2021, - /* 2160 */ 2003, 1171, 1170, 1169, 1168, 1203, 1201, 636, 1165, 2002, - /* 2170 */ 1164, 1161, 1971, 2038, 635, 1160, 317, 2004, 639, 2006, - /* 2180 */ 2007, 634, 1159, 629, 1158, 1701, 704, 706, 1699, 705, - /* 2190 */ 708, 2021, 2003, 709, 1697, 710, 712, 714, 713, 636, - /* 2200 */ 1695, 2002, 716, 718, 1971, 2038, 635, 717, 309, 2004, - /* 2210 */ 639, 2006, 2007, 634, 1681, 629, 720, 2003, 1111, 1661, - /* 2220 */ 289, 1414, 724, 2021, 299, 727, 728, 1636, 1636, 1636, - /* 2230 */ 1636, 636, 1636, 2002, 1636, 1636, 1971, 2038, 635, 1636, - /* 2240 */ 318, 2004, 639, 2006, 2007, 634, 1636, 629, 2021, 2003, - /* 2250 */ 1636, 1636, 1636, 1636, 1636, 1636, 636, 1636, 1636, 1636, - /* 2260 */ 1636, 1971, 1636, 635, 1636, 2002, 1636, 1636, 1636, 2038, - /* 2270 */ 1636, 1636, 310, 2004, 639, 2006, 2007, 634, 1636, 629, - /* 2280 */ 2021, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 636, 1636, - /* 2290 */ 2002, 1636, 1636, 1971, 2038, 635, 1636, 323, 2004, 639, - /* 2300 */ 2006, 2007, 634, 1636, 629, 1636, 1636, 1636, 1636, 1636, - /* 2310 */ 1636, 2003, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, - /* 2320 */ 1636, 1636, 2002, 1636, 1636, 1636, 2038, 1636, 2003, 324, - /* 2330 */ 2004, 639, 2006, 2007, 634, 1636, 629, 1636, 1636, 1636, - /* 2340 */ 1636, 1636, 2021, 1636, 1636, 1636, 1636, 1636, 1636, 1636, - /* 2350 */ 636, 1636, 1636, 1636, 1636, 1971, 1636, 635, 1636, 2021, - /* 2360 */ 1636, 1636, 1636, 1636, 1636, 1636, 1636, 636, 1636, 1636, - /* 2370 */ 1636, 1636, 1971, 1636, 635, 1636, 1636, 1636, 1636, 1636, - /* 2380 */ 1636, 1636, 1636, 1636, 2002, 2003, 1636, 1636, 2038, 1636, - /* 2390 */ 1636, 2015, 2004, 639, 2006, 2007, 634, 1636, 629, 1636, - /* 2400 */ 1636, 2002, 1636, 1636, 1636, 2038, 1636, 2003, 2014, 2004, - /* 2410 */ 639, 2006, 2007, 634, 1636, 629, 2021, 1636, 1636, 1636, - /* 2420 */ 1636, 1636, 1636, 1636, 636, 1636, 1636, 1636, 1636, 1971, - /* 2430 */ 1636, 635, 1636, 1636, 1636, 1636, 1636, 1636, 2021, 1636, - /* 2440 */ 1636, 1636, 1636, 1636, 1636, 1636, 636, 1636, 1636, 1636, - /* 2450 */ 1636, 1971, 1636, 635, 1636, 1636, 1636, 1636, 2002, 1636, - /* 2460 */ 1636, 1636, 2038, 1636, 1636, 2013, 2004, 639, 2006, 2007, - /* 2470 */ 634, 1636, 629, 2003, 1636, 1636, 1636, 1636, 1636, 1636, - /* 2480 */ 2002, 1636, 1636, 1636, 2038, 1636, 1636, 336, 2004, 639, - /* 2490 */ 2006, 2007, 634, 1636, 629, 1636, 1636, 2003, 1636, 1636, - /* 2500 */ 1636, 1636, 1636, 1636, 2021, 1636, 1636, 1636, 1636, 1636, - /* 2510 */ 1636, 1636, 636, 1636, 1636, 1636, 1636, 1971, 1636, 635, - /* 2520 */ 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 2021, 1636, - /* 2530 */ 1636, 1636, 1636, 1636, 1636, 1636, 636, 1636, 1636, 1636, - /* 2540 */ 1636, 1971, 1636, 635, 1636, 1636, 2002, 1636, 1636, 1636, - /* 2550 */ 2038, 1636, 1636, 337, 2004, 639, 2006, 2007, 634, 1636, - /* 2560 */ 629, 2003, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, - /* 2570 */ 2002, 1636, 1636, 1636, 2038, 1636, 1636, 333, 2004, 639, - /* 2580 */ 2006, 2007, 634, 1636, 629, 1636, 2003, 1636, 1636, 1636, - /* 2590 */ 1636, 1636, 2021, 1636, 1636, 1636, 1636, 1636, 1636, 1636, - /* 2600 */ 636, 1636, 1636, 1636, 1636, 1971, 1636, 635, 1636, 1636, - /* 2610 */ 1636, 1636, 1636, 1636, 1636, 1636, 1636, 2021, 2003, 1636, - /* 2620 */ 1636, 1636, 1636, 1636, 1636, 636, 1636, 1636, 1636, 1636, - /* 2630 */ 1971, 1636, 635, 1636, 2002, 1636, 1636, 1636, 2038, 1636, - /* 2640 */ 1636, 338, 2004, 639, 2006, 2007, 634, 1636, 629, 2021, - /* 2650 */ 1636, 1636, 1636, 1636, 1636, 1636, 1636, 636, 1636, 637, - /* 2660 */ 1636, 1636, 1971, 2038, 635, 1636, 315, 2004, 639, 2006, - /* 2670 */ 2007, 634, 1636, 629, 1636, 1636, 1636, 1636, 1636, 1636, - /* 2680 */ 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, 1636, - /* 2690 */ 1636, 2002, 1636, 1636, 1636, 2038, 1636, 1636, 314, 2004, - /* 2700 */ 639, 2006, 2007, 634, 1636, 629, + /* 0 */ 1918, 2177, 366, 623, 1788, 2172, 474, 2001, 475, 1682, + /* 10 */ 163, 557, 45, 43, 1572, 1916, 610, 54, 1997, 1801, + /* 20 */ 374, 2176, 1421, 38, 37, 2173, 2175, 44, 42, 41, + /* 30 */ 40, 39, 419, 1502, 1799, 1419, 1715, 44, 42, 41, + /* 40 */ 40, 39, 38, 37, 2001, 175, 44, 42, 41, 40, + /* 50 */ 39, 1993, 1999, 356, 219, 1997, 377, 377, 1497, 163, + /* 60 */ 348, 2015, 633, 18, 160, 163, 344, 1901, 1802, 170, + /* 70 */ 1427, 354, 327, 1801, 1801, 509, 505, 501, 497, 216, + /* 80 */ 1850, 598, 379, 45, 43, 1845, 1847, 1448, 1993, 1999, + /* 90 */ 369, 374, 2033, 1421, 1446, 14, 2177, 337, 104, 633, + /* 100 */ 601, 528, 527, 526, 1502, 1983, 1419, 639, 101, 136, + /* 110 */ 522, 1609, 139, 1448, 521, 86, 480, 730, 214, 520, + /* 120 */ 525, 349, 476, 347, 346, 519, 515, 60, 1446, 1497, + /* 130 */ 517, 1120, 1504, 1505, 18, 2014, 623, 105, 1531, 2050, + /* 140 */ 177, 1427, 108, 2016, 643, 2018, 2019, 638, 1852, 633, + /* 150 */ 131, 140, 516, 1839, 178, 353, 2103, 513, 1421, 1791, + /* 160 */ 368, 2099, 1477, 1487, 1850, 1430, 14, 1799, 1503, 1506, + /* 170 */ 1122, 1419, 1125, 1126, 183, 600, 179, 2111, 2112, 85, + /* 180 */ 137, 2116, 2129, 1422, 234, 1420, 213, 207, 730, 1632, + /* 190 */ 64, 212, 38, 37, 488, 1532, 44, 42, 41, 40, + /* 200 */ 39, 1447, 1795, 1504, 1505, 165, 1427, 1658, 1425, 1426, + /* 210 */ 205, 1476, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, + /* 220 */ 635, 631, 1495, 1496, 1498, 1499, 1500, 1501, 2, 60, + /* 230 */ 1139, 266, 1138, 1477, 1487, 492, 1344, 1345, 121, 1503, + /* 240 */ 1506, 120, 119, 118, 117, 116, 115, 114, 113, 112, + /* 250 */ 1398, 1399, 2033, 730, 1422, 622, 1420, 266, 38, 37, + /* 260 */ 580, 1140, 44, 42, 41, 40, 39, 34, 372, 1526, + /* 270 */ 1527, 1528, 1529, 1530, 1534, 1535, 1536, 1537, 184, 1425, + /* 280 */ 1426, 60, 1476, 1479, 1480, 1481, 1482, 1483, 1484, 1485, + /* 290 */ 1486, 635, 631, 1495, 1496, 1498, 1499, 1500, 1501, 2, + /* 300 */ 175, 11, 45, 43, 579, 483, 598, 475, 1682, 457, + /* 310 */ 374, 420, 1421, 1361, 1362, 1433, 412, 622, 411, 1422, + /* 320 */ 49, 1420, 1902, 1502, 421, 1419, 1246, 665, 664, 663, + /* 330 */ 1250, 662, 1252, 1253, 661, 1255, 658, 139, 1261, 655, + /* 340 */ 1263, 1264, 652, 649, 1425, 1426, 1588, 608, 1497, 1360, + /* 350 */ 1363, 31, 267, 18, 41, 40, 39, 38, 37, 1639, + /* 360 */ 1427, 44, 42, 41, 40, 39, 598, 197, 196, 528, + /* 370 */ 527, 526, 2118, 45, 43, 1507, 1882, 136, 522, 593, + /* 380 */ 184, 374, 521, 1421, 1599, 14, 1646, 520, 525, 60, + /* 390 */ 456, 91, 48, 519, 1502, 622, 1419, 139, 2115, 408, + /* 400 */ 1533, 264, 2111, 597, 1669, 132, 596, 730, 1447, 2172, + /* 410 */ 130, 129, 128, 127, 126, 125, 124, 123, 122, 1497, + /* 420 */ 410, 406, 1504, 1505, 585, 181, 1918, 35, 285, 2173, + /* 430 */ 587, 1427, 184, 573, 1597, 1598, 1600, 1601, 365, 38, + /* 440 */ 37, 1915, 610, 44, 42, 41, 40, 39, 1983, 581, + /* 450 */ 166, 1449, 1477, 1487, 1638, 1753, 46, 52, 1503, 1506, + /* 460 */ 1647, 180, 2111, 2112, 561, 137, 2116, 1852, 233, 1445, + /* 470 */ 48, 184, 32, 1422, 341, 1420, 473, 1777, 730, 478, + /* 480 */ 1688, 121, 1538, 1850, 120, 119, 118, 117, 116, 115, + /* 490 */ 114, 113, 112, 1504, 1505, 276, 277, 413, 1425, 1426, + /* 500 */ 275, 1476, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, + /* 510 */ 635, 631, 1495, 1496, 1498, 1499, 1500, 1501, 2, 733, + /* 520 */ 1289, 1290, 482, 1477, 1487, 478, 1688, 437, 623, 1503, + /* 530 */ 1506, 88, 332, 292, 1446, 546, 436, 544, 542, 492, + /* 540 */ 184, 562, 186, 586, 1422, 2172, 1420, 2172, 174, 1776, + /* 550 */ 677, 540, 609, 538, 723, 719, 715, 711, 290, 1799, + /* 560 */ 2178, 181, 585, 181, 551, 2173, 587, 2173, 587, 1425, + /* 570 */ 1426, 604, 1476, 1479, 1480, 1481, 1482, 1483, 1484, 1485, + /* 580 */ 1486, 635, 631, 1495, 1496, 1498, 1499, 1500, 1501, 2, + /* 590 */ 45, 43, 2118, 533, 106, 244, 1954, 283, 374, 490, + /* 600 */ 1421, 1911, 1644, 609, 594, 675, 576, 1852, 543, 60, + /* 610 */ 1775, 1502, 2118, 1419, 362, 562, 1846, 1847, 2114, 2172, + /* 620 */ 2015, 184, 232, 1850, 153, 152, 672, 671, 670, 150, + /* 630 */ 619, 11, 623, 9, 2178, 181, 1497, 536, 2113, 2173, + /* 640 */ 587, 235, 530, 1139, 1668, 1138, 131, 231, 1427, 1667, + /* 650 */ 607, 2033, 1911, 518, 13, 12, 675, 11, 218, 640, + /* 660 */ 193, 45, 43, 1799, 1983, 270, 639, 1446, 389, 374, + /* 670 */ 269, 1421, 677, 46, 1140, 153, 152, 672, 671, 670, + /* 680 */ 150, 1427, 1502, 68, 1419, 1206, 67, 1387, 1983, 238, + /* 690 */ 582, 577, 571, 1983, 2014, 730, 82, 141, 2050, 81, + /* 700 */ 2074, 167, 2016, 643, 2018, 2019, 638, 1497, 633, 586, + /* 710 */ 1504, 1505, 562, 2172, 524, 523, 2172, 38, 37, 1427, + /* 720 */ 1208, 44, 42, 41, 40, 39, 609, 299, 585, 181, + /* 730 */ 1829, 2178, 181, 2173, 587, 1689, 2173, 587, 701, 699, + /* 740 */ 1477, 1487, 563, 2140, 14, 33, 1503, 1506, 623, 1545, + /* 750 */ 668, 38, 37, 27, 598, 44, 42, 41, 40, 39, + /* 760 */ 184, 1422, 417, 1420, 38, 37, 730, 1852, 44, 42, + /* 770 */ 41, 40, 39, 618, 367, 1911, 1666, 689, 625, 1799, + /* 780 */ 2075, 1504, 1505, 1850, 725, 139, 1425, 1426, 1774, 1476, + /* 790 */ 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 635, 631, + /* 800 */ 1495, 1496, 1498, 1499, 1500, 1501, 2, 85, 627, 1478, + /* 810 */ 2075, 1477, 1487, 330, 1784, 1444, 1897, 1503, 1506, 1852, + /* 820 */ 1983, 135, 450, 380, 623, 464, 378, 189, 463, 2176, + /* 830 */ 1794, 163, 1422, 1786, 1420, 1850, 387, 99, 418, 669, + /* 840 */ 1801, 1790, 1843, 433, 50, 465, 3, 1665, 435, 182, + /* 850 */ 2111, 2112, 1997, 137, 2116, 1799, 1782, 1425, 1426, 1792, + /* 860 */ 1476, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 635, + /* 870 */ 631, 1495, 1496, 1498, 1499, 1500, 1501, 2, 623, 623, + /* 880 */ 562, 1576, 1569, 164, 2172, 1993, 1999, 1446, 305, 345, + /* 890 */ 1712, 1983, 427, 442, 667, 675, 633, 623, 623, 2178, + /* 900 */ 181, 423, 303, 71, 2173, 587, 70, 1852, 8, 1799, + /* 910 */ 1799, 443, 491, 1449, 153, 152, 672, 671, 670, 150, + /* 920 */ 162, 1897, 1897, 1851, 201, 470, 468, 673, 1799, 1799, + /* 930 */ 1843, 461, 191, 195, 455, 454, 453, 452, 449, 448, + /* 940 */ 447, 446, 445, 441, 440, 439, 438, 329, 430, 429, + /* 950 */ 428, 1664, 425, 424, 343, 707, 706, 705, 704, 384, + /* 960 */ 60, 703, 702, 143, 697, 696, 695, 694, 693, 692, + /* 970 */ 691, 155, 687, 686, 685, 383, 382, 682, 681, 680, + /* 980 */ 679, 678, 674, 386, 690, 1843, 1769, 590, 1663, 623, + /* 990 */ 1512, 549, 371, 370, 2177, 1983, 1446, 623, 2172, 107, + /* 1000 */ 38, 37, 1435, 1796, 44, 42, 41, 40, 39, 1125, + /* 1010 */ 1126, 236, 623, 1502, 2176, 1428, 1641, 1642, 2173, 2174, + /* 1020 */ 1799, 1662, 623, 1449, 2123, 1565, 558, 562, 1799, 1478, + /* 1030 */ 623, 2172, 1983, 1661, 1660, 562, 602, 151, 1497, 2172, + /* 1040 */ 79, 78, 416, 1799, 606, 188, 2178, 181, 623, 2015, + /* 1050 */ 1427, 2173, 587, 1799, 2178, 181, 1970, 190, 1657, 2173, + /* 1060 */ 587, 1799, 280, 328, 2002, 1983, 404, 623, 402, 398, + /* 1070 */ 394, 391, 388, 239, 72, 1997, 2015, 1983, 1983, 1799, + /* 1080 */ 2033, 620, 623, 1702, 1656, 623, 623, 151, 640, 53, + /* 1090 */ 1659, 589, 1655, 1983, 630, 639, 621, 629, 1799, 286, + /* 1100 */ 381, 1654, 1983, 1653, 396, 529, 1429, 2033, 1993, 1999, + /* 1110 */ 1754, 184, 1652, 1799, 1565, 601, 1799, 1799, 224, 633, + /* 1120 */ 1983, 222, 639, 2014, 80, 1568, 1651, 2050, 1983, 1650, + /* 1130 */ 108, 2016, 643, 2018, 2019, 638, 1983, 633, 1478, 1393, + /* 1140 */ 142, 2015, 148, 2074, 2103, 1983, 517, 1983, 368, 2099, + /* 1150 */ 2014, 1649, 226, 634, 2050, 225, 1983, 108, 2016, 643, + /* 1160 */ 2018, 2019, 638, 1436, 633, 1431, 151, 243, 516, 178, + /* 1170 */ 1983, 2103, 2033, 1983, 1695, 368, 2099, 145, 228, 133, + /* 1180 */ 640, 227, 242, 62, 2143, 1983, 1693, 639, 1439, 1441, + /* 1190 */ 248, 230, 151, 1168, 229, 1983, 531, 2130, 2004, 2015, + /* 1200 */ 47, 631, 1495, 1496, 1498, 1499, 1500, 1501, 534, 273, + /* 1210 */ 591, 683, 69, 149, 151, 2014, 13, 12, 1396, 2050, + /* 1220 */ 62, 89, 108, 2016, 643, 2018, 2019, 638, 1169, 633, + /* 1230 */ 2033, 261, 2015, 1187, 2192, 1596, 2103, 47, 640, 1523, + /* 1240 */ 368, 2099, 250, 1983, 605, 639, 2006, 684, 47, 647, + /* 1250 */ 149, 2137, 1358, 151, 217, 134, 1432, 574, 255, 2034, + /* 1260 */ 149, 278, 385, 2033, 615, 282, 1239, 1683, 1906, 1185, + /* 1270 */ 1840, 640, 1539, 2014, 2133, 599, 1983, 2050, 639, 260, + /* 1280 */ 108, 2016, 643, 2018, 2019, 638, 263, 633, 1, 1488, + /* 1290 */ 2015, 390, 2192, 4, 2103, 395, 342, 1380, 368, 2099, + /* 1300 */ 298, 1267, 1271, 293, 194, 1278, 2014, 1276, 422, 2150, + /* 1310 */ 2050, 1449, 154, 108, 2016, 643, 2018, 2019, 638, 1907, + /* 1320 */ 633, 2033, 426, 459, 431, 2192, 1444, 2103, 444, 640, + /* 1330 */ 451, 368, 2099, 1899, 1983, 458, 639, 460, 466, 467, + /* 1340 */ 1450, 198, 569, 469, 471, 472, 481, 1452, 204, 484, + /* 1350 */ 1447, 206, 485, 1451, 486, 1453, 487, 1142, 489, 512, + /* 1360 */ 209, 211, 493, 1960, 2014, 83, 84, 215, 2050, 510, + /* 1370 */ 2015, 108, 2016, 643, 2018, 2019, 638, 511, 633, 331, + /* 1380 */ 548, 514, 1959, 2192, 111, 2103, 1789, 221, 550, 368, + /* 1390 */ 2099, 87, 1785, 2015, 223, 156, 157, 147, 1787, 294, + /* 1400 */ 2166, 2033, 1783, 237, 158, 552, 159, 553, 556, 640, + /* 1410 */ 240, 559, 2149, 2134, 1983, 575, 639, 2148, 613, 7, + /* 1420 */ 584, 2125, 566, 2144, 2033, 572, 254, 171, 357, 256, + /* 1430 */ 578, 567, 640, 257, 565, 358, 564, 1983, 246, 639, + /* 1440 */ 2195, 258, 249, 595, 2014, 592, 2171, 1565, 2050, 138, + /* 1450 */ 1448, 108, 2016, 643, 2018, 2019, 638, 262, 633, 361, + /* 1460 */ 2015, 268, 603, 2192, 259, 2103, 1454, 2014, 94, 368, + /* 1470 */ 2099, 2050, 2119, 1912, 108, 2016, 643, 2018, 2019, 638, + /* 1480 */ 2122, 633, 295, 611, 2015, 612, 2078, 1926, 2103, 296, + /* 1490 */ 1925, 2033, 368, 2099, 616, 96, 1924, 297, 617, 640, + /* 1500 */ 1800, 364, 98, 59, 1983, 2084, 639, 100, 645, 1844, + /* 1510 */ 1770, 729, 726, 289, 300, 2033, 727, 324, 333, 334, + /* 1520 */ 309, 51, 304, 640, 302, 1977, 1976, 323, 1983, 76, + /* 1530 */ 639, 1975, 2015, 77, 2014, 313, 1974, 1971, 2050, 392, + /* 1540 */ 393, 108, 2016, 643, 2018, 2019, 638, 1413, 633, 1414, + /* 1550 */ 187, 397, 1969, 2076, 399, 2103, 2015, 400, 2014, 368, + /* 1560 */ 2099, 401, 2050, 2033, 1968, 108, 2016, 643, 2018, 2019, + /* 1570 */ 638, 640, 633, 403, 1967, 405, 1983, 626, 639, 2103, + /* 1580 */ 1966, 407, 1965, 368, 2099, 409, 1383, 2033, 1382, 1937, + /* 1590 */ 1936, 1935, 414, 415, 1934, 640, 1335, 1890, 1889, 1887, + /* 1600 */ 1983, 1886, 639, 144, 1885, 1888, 2014, 1884, 1883, 1881, + /* 1610 */ 2050, 1880, 1879, 109, 2016, 643, 2018, 2019, 638, 192, + /* 1620 */ 633, 432, 2015, 1878, 434, 1892, 1877, 2103, 1876, 1875, + /* 1630 */ 2014, 2102, 2099, 1874, 2050, 1873, 1872, 109, 2016, 643, + /* 1640 */ 2018, 2019, 638, 1871, 633, 2015, 1870, 1869, 1868, 1867, + /* 1650 */ 1866, 2103, 1865, 2033, 1864, 628, 2099, 1863, 146, 1862, + /* 1660 */ 1861, 640, 1860, 1891, 1859, 1858, 1983, 1337, 639, 1857, + /* 1670 */ 1856, 1855, 1854, 462, 1853, 1214, 2033, 1717, 199, 1716, + /* 1680 */ 200, 1714, 1678, 202, 637, 2003, 176, 1128, 1677, 1983, + /* 1690 */ 74, 639, 1127, 203, 1950, 1944, 641, 75, 1933, 1932, + /* 1700 */ 2050, 210, 477, 109, 2016, 643, 2018, 2019, 638, 1910, + /* 1710 */ 633, 1778, 1713, 2015, 479, 208, 1711, 2103, 494, 2014, + /* 1720 */ 1709, 336, 2099, 2050, 496, 1161, 321, 2016, 643, 2018, + /* 1730 */ 2019, 638, 636, 633, 624, 2068, 498, 495, 499, 2015, + /* 1740 */ 1707, 500, 502, 504, 2033, 503, 1705, 508, 506, 1692, + /* 1750 */ 1691, 507, 640, 1674, 1780, 1282, 1283, 1983, 1779, 639, + /* 1760 */ 1205, 1204, 1203, 1202, 1199, 1198, 698, 700, 220, 1197, + /* 1770 */ 2033, 1196, 61, 1703, 350, 1696, 1694, 351, 640, 352, + /* 1780 */ 535, 532, 1673, 1983, 1672, 639, 537, 2014, 1671, 541, + /* 1790 */ 110, 2050, 1405, 1949, 168, 2016, 643, 2018, 2019, 638, + /* 1800 */ 539, 633, 1943, 1403, 2015, 545, 1402, 1389, 55, 26, + /* 1810 */ 65, 554, 1931, 2014, 2177, 16, 161, 2050, 1929, 28, + /* 1820 */ 109, 2016, 643, 2018, 2019, 638, 570, 633, 1611, 2015, + /* 1830 */ 19, 568, 245, 169, 2103, 2033, 58, 247, 1595, 2100, + /* 1840 */ 1587, 241, 252, 640, 555, 30, 588, 2193, 1983, 63, + /* 1850 */ 639, 355, 253, 2004, 251, 29, 560, 5, 90, 21, + /* 1860 */ 2033, 1626, 2015, 6, 20, 1631, 1625, 17, 640, 359, + /* 1870 */ 1632, 1630, 1629, 1983, 360, 639, 1562, 1561, 2014, 265, + /* 1880 */ 172, 56, 2050, 1930, 57, 167, 2016, 643, 2018, 2019, + /* 1890 */ 638, 1928, 633, 2033, 1927, 2015, 1909, 93, 92, 271, + /* 1900 */ 272, 640, 22, 2014, 1593, 274, 1983, 2050, 639, 1908, + /* 1910 */ 315, 2016, 643, 2018, 2019, 638, 279, 633, 66, 95, + /* 1920 */ 97, 101, 284, 614, 10, 23, 2033, 2141, 12, 281, + /* 1930 */ 1437, 363, 173, 2053, 640, 1514, 2014, 1492, 632, 1983, + /* 1940 */ 2050, 639, 36, 168, 2016, 643, 2018, 2019, 638, 1490, + /* 1950 */ 633, 1524, 1489, 185, 583, 15, 24, 1469, 1461, 25, + /* 1960 */ 2015, 644, 1268, 1513, 646, 376, 648, 650, 1265, 2014, + /* 1970 */ 1260, 642, 651, 2050, 1262, 653, 322, 2016, 643, 2018, + /* 1980 */ 2019, 638, 654, 633, 1256, 2015, 656, 657, 659, 1254, + /* 1990 */ 660, 2033, 1259, 1245, 102, 1258, 2194, 103, 1257, 637, + /* 2000 */ 287, 1277, 1273, 1159, 1983, 666, 639, 73, 676, 1193, + /* 2010 */ 1192, 1191, 1190, 1189, 1188, 688, 2033, 1186, 1184, 1183, + /* 2020 */ 1182, 373, 1212, 1180, 640, 288, 1179, 1178, 1177, 1983, + /* 2030 */ 1176, 639, 1175, 1174, 2014, 1209, 1207, 1171, 2050, 1170, + /* 2040 */ 1167, 321, 2016, 643, 2018, 2019, 638, 2015, 633, 1166, + /* 2050 */ 2069, 1165, 1164, 1710, 708, 709, 1708, 710, 712, 2014, + /* 2060 */ 713, 714, 1706, 2050, 2015, 716, 322, 2016, 643, 2018, + /* 2070 */ 2019, 638, 717, 633, 718, 1704, 720, 722, 2033, 721, + /* 2080 */ 1690, 724, 1117, 375, 1670, 291, 640, 728, 1645, 1423, + /* 2090 */ 301, 1983, 731, 639, 732, 2033, 1645, 1645, 1645, 1645, + /* 2100 */ 1645, 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, 1645, + /* 2110 */ 639, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, + /* 2120 */ 1645, 2014, 1645, 1645, 2015, 2050, 1645, 1645, 322, 2016, + /* 2130 */ 643, 2018, 2019, 638, 1645, 633, 1645, 1645, 547, 1645, + /* 2140 */ 1645, 1645, 2050, 2015, 1645, 317, 2016, 643, 2018, 2019, + /* 2150 */ 638, 1645, 633, 1645, 1645, 2033, 1645, 1645, 1645, 1645, + /* 2160 */ 1645, 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, 1645, + /* 2170 */ 639, 1645, 1645, 1645, 2033, 1645, 1645, 1645, 1645, 1645, + /* 2180 */ 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, 1645, 639, + /* 2190 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2014, 1645, + /* 2200 */ 1645, 1645, 2050, 2015, 1645, 306, 2016, 643, 2018, 2019, + /* 2210 */ 638, 1645, 633, 1645, 1645, 1645, 1645, 2014, 1645, 2015, + /* 2220 */ 1645, 2050, 1645, 1645, 307, 2016, 643, 2018, 2019, 638, + /* 2230 */ 1645, 633, 1645, 1645, 2033, 1645, 2015, 1645, 1645, 1645, + /* 2240 */ 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, 1645, 639, + /* 2250 */ 2033, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 640, 1645, + /* 2260 */ 1645, 1645, 1645, 1983, 1645, 639, 1645, 2033, 1645, 1645, + /* 2270 */ 1645, 1645, 1645, 1645, 1645, 640, 1645, 2014, 1645, 1645, + /* 2280 */ 1983, 2050, 639, 1645, 308, 2016, 643, 2018, 2019, 638, + /* 2290 */ 1645, 633, 1645, 2014, 1645, 1645, 1645, 2050, 1645, 2015, + /* 2300 */ 314, 2016, 643, 2018, 2019, 638, 1645, 633, 1645, 1645, + /* 2310 */ 2014, 1645, 1645, 1645, 2050, 2015, 1645, 318, 2016, 643, + /* 2320 */ 2018, 2019, 638, 1645, 633, 1645, 1645, 1645, 1645, 1645, + /* 2330 */ 2033, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 640, 1645, + /* 2340 */ 1645, 1645, 1645, 1983, 1645, 639, 2033, 1645, 1645, 1645, + /* 2350 */ 1645, 1645, 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, + /* 2360 */ 1645, 639, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, + /* 2370 */ 1645, 2015, 1645, 2014, 1645, 1645, 1645, 2050, 1645, 1645, + /* 2380 */ 310, 2016, 643, 2018, 2019, 638, 1645, 633, 1645, 2014, + /* 2390 */ 1645, 1645, 1645, 2050, 2015, 1645, 319, 2016, 643, 2018, + /* 2400 */ 2019, 638, 2033, 633, 1645, 1645, 1645, 1645, 1645, 1645, + /* 2410 */ 640, 1645, 1645, 1645, 1645, 1983, 1645, 639, 1645, 1645, + /* 2420 */ 1645, 1645, 1645, 1645, 1645, 2033, 1645, 1645, 1645, 1645, + /* 2430 */ 1645, 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, 1645, + /* 2440 */ 639, 1645, 1645, 1645, 1645, 2014, 1645, 1645, 1645, 2050, + /* 2450 */ 1645, 1645, 311, 2016, 643, 2018, 2019, 638, 2015, 633, + /* 2460 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2014, 1645, + /* 2470 */ 1645, 1645, 2050, 1645, 1645, 320, 2016, 643, 2018, 2019, + /* 2480 */ 638, 1645, 633, 1645, 1645, 2015, 1645, 1645, 1645, 2033, + /* 2490 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 640, 1645, 1645, + /* 2500 */ 1645, 1645, 1983, 1645, 639, 1645, 1645, 1645, 1645, 1645, + /* 2510 */ 1645, 1645, 1645, 1645, 1645, 1645, 2033, 1645, 1645, 1645, + /* 2520 */ 1645, 1645, 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, + /* 2530 */ 1645, 639, 2014, 2015, 1645, 1645, 2050, 1645, 1645, 312, + /* 2540 */ 2016, 643, 2018, 2019, 638, 1645, 633, 1645, 1645, 2015, + /* 2550 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2014, + /* 2560 */ 1645, 1645, 1645, 2050, 2033, 1645, 325, 2016, 643, 2018, + /* 2570 */ 2019, 638, 640, 633, 1645, 1645, 1645, 1983, 1645, 639, + /* 2580 */ 2033, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 640, 1645, + /* 2590 */ 1645, 1645, 1645, 1983, 1645, 639, 1645, 2015, 1645, 1645, + /* 2600 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2014, 1645, 1645, + /* 2610 */ 1645, 2050, 1645, 1645, 326, 2016, 643, 2018, 2019, 638, + /* 2620 */ 1645, 633, 1645, 2014, 1645, 1645, 1645, 2050, 2033, 1645, + /* 2630 */ 2027, 2016, 643, 2018, 2019, 638, 640, 633, 1645, 1645, + /* 2640 */ 1645, 1983, 1645, 639, 1645, 2015, 1645, 1645, 1645, 1645, + /* 2650 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, + /* 2660 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2015, 1645, + /* 2670 */ 1645, 2014, 1645, 1645, 1645, 2050, 2033, 1645, 2026, 2016, + /* 2680 */ 643, 2018, 2019, 638, 640, 633, 1645, 1645, 1645, 1983, + /* 2690 */ 1645, 639, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2033, + /* 2700 */ 1645, 2015, 1645, 1645, 1645, 1645, 1645, 640, 1645, 1645, + /* 2710 */ 1645, 1645, 1983, 1645, 639, 1645, 1645, 1645, 1645, 2014, + /* 2720 */ 1645, 1645, 1645, 2050, 2015, 1645, 2025, 2016, 643, 2018, + /* 2730 */ 2019, 638, 2033, 633, 1645, 1645, 1645, 1645, 1645, 1645, + /* 2740 */ 640, 1645, 2014, 1645, 1645, 1983, 2050, 639, 1645, 338, + /* 2750 */ 2016, 643, 2018, 2019, 638, 2033, 633, 1645, 1645, 1645, + /* 2760 */ 1645, 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, 1645, + /* 2770 */ 639, 1645, 1645, 1645, 1645, 2014, 1645, 1645, 1645, 2050, + /* 2780 */ 1645, 1645, 339, 2016, 643, 2018, 2019, 638, 2015, 633, + /* 2790 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2014, 1645, + /* 2800 */ 1645, 1645, 2050, 1645, 1645, 335, 2016, 643, 2018, 2019, + /* 2810 */ 638, 1645, 633, 1645, 1645, 2015, 1645, 1645, 1645, 2033, + /* 2820 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 640, 1645, 1645, + /* 2830 */ 1645, 1645, 1983, 1645, 639, 1645, 1645, 1645, 1645, 1645, + /* 2840 */ 1645, 1645, 1645, 1645, 1645, 1645, 2033, 1645, 1645, 1645, + /* 2850 */ 1645, 1645, 1645, 1645, 640, 1645, 1645, 1645, 1645, 1983, + /* 2860 */ 1645, 639, 2014, 2015, 1645, 1645, 2050, 1645, 1645, 340, + /* 2870 */ 2016, 643, 2018, 2019, 638, 1645, 633, 1645, 1645, 1645, + /* 2880 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 641, + /* 2890 */ 1645, 1645, 1645, 2050, 2033, 1645, 317, 2016, 643, 2018, + /* 2900 */ 2019, 638, 640, 633, 1645, 1645, 1645, 1983, 1645, 639, + /* 2910 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, + /* 2920 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645, + /* 2930 */ 1645, 1645, 1645, 1645, 1645, 1645, 1645, 2014, 1645, 1645, + /* 2940 */ 1645, 2050, 1645, 1645, 316, 2016, 643, 2018, 2019, 638, + /* 2950 */ 1645, 633, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 375, 333, 371, 335, 336, 374, 375, 333, 362, 335, - /* 10 */ 336, 375, 12, 13, 14, 390, 391, 360, 330, 373, - /* 20 */ 20, 362, 22, 387, 360, 362, 390, 391, 329, 424, - /* 30 */ 425, 367, 373, 33, 329, 35, 373, 20, 381, 382, - /* 40 */ 376, 334, 8, 9, 337, 338, 12, 13, 14, 15, - /* 50 */ 16, 405, 406, 407, 337, 337, 20, 435, 58, 360, - /* 60 */ 20, 439, 416, 63, 405, 406, 407, 368, 405, 406, - /* 70 */ 70, 337, 373, 326, 375, 416, 454, 455, 373, 416, - /* 80 */ 360, 459, 460, 12, 13, 351, 368, 367, 20, 4, - /* 90 */ 20, 20, 358, 22, 377, 95, 376, 63, 20, 435, - /* 100 */ 360, 402, 368, 439, 33, 406, 35, 367, 409, 410, - /* 110 */ 411, 412, 413, 414, 4, 416, 376, 117, 454, 455, - /* 120 */ 421, 58, 423, 459, 460, 58, 427, 428, 43, 58, - /* 130 */ 45, 46, 132, 133, 63, 95, 362, 20, 104, 392, - /* 140 */ 441, 70, 12, 13, 14, 15, 16, 373, 449, 431, - /* 150 */ 432, 433, 334, 435, 436, 337, 338, 439, 95, 360, - /* 160 */ 97, 94, 162, 163, 97, 95, 95, 368, 168, 169, - /* 170 */ 126, 127, 454, 455, 328, 131, 330, 459, 460, 405, - /* 180 */ 406, 14, 435, 183, 39, 185, 439, 20, 117, 37, - /* 190 */ 416, 353, 8, 9, 356, 161, 12, 13, 14, 15, - /* 200 */ 16, 454, 455, 132, 133, 95, 459, 460, 208, 209, - /* 210 */ 411, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 167, - /* 230 */ 162, 163, 20, 162, 163, 95, 62, 343, 21, 168, + /* 0 */ 375, 436, 352, 337, 361, 440, 333, 362, 335, 336, + /* 10 */ 360, 396, 12, 13, 14, 390, 391, 351, 373, 369, + /* 20 */ 20, 456, 22, 8, 9, 460, 461, 12, 13, 14, + /* 30 */ 15, 16, 337, 33, 368, 35, 0, 12, 13, 14, + /* 40 */ 15, 16, 8, 9, 362, 360, 12, 13, 14, 15, + /* 50 */ 16, 406, 407, 408, 33, 373, 352, 352, 58, 360, + /* 60 */ 37, 329, 417, 63, 360, 360, 381, 382, 369, 48, + /* 70 */ 70, 367, 377, 369, 369, 54, 55, 56, 57, 58, + /* 80 */ 376, 337, 371, 12, 13, 374, 375, 20, 406, 407, + /* 90 */ 408, 20, 360, 22, 20, 95, 3, 63, 95, 417, + /* 100 */ 368, 65, 66, 67, 33, 373, 35, 375, 105, 73, + /* 110 */ 74, 96, 368, 20, 78, 94, 14, 117, 97, 83, + /* 120 */ 84, 98, 20, 100, 101, 89, 103, 95, 20, 58, + /* 130 */ 107, 4, 132, 133, 63, 403, 337, 341, 104, 407, + /* 140 */ 359, 70, 410, 411, 412, 413, 414, 415, 360, 417, + /* 150 */ 351, 355, 129, 372, 422, 367, 424, 358, 22, 363, + /* 160 */ 428, 429, 162, 163, 376, 35, 95, 368, 168, 169, + /* 170 */ 43, 35, 45, 46, 442, 431, 432, 433, 434, 343, + /* 180 */ 436, 437, 450, 183, 126, 185, 165, 166, 117, 96, + /* 190 */ 4, 170, 8, 9, 173, 161, 12, 13, 14, 15, + /* 200 */ 16, 20, 366, 132, 133, 328, 70, 330, 208, 209, + /* 210 */ 189, 211, 212, 213, 214, 215, 216, 217, 218, 219, + /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 95, + /* 230 */ 20, 164, 22, 162, 163, 62, 162, 163, 21, 168, /* 240 */ 169, 24, 25, 26, 27, 28, 29, 30, 31, 32, - /* 250 */ 98, 357, 100, 101, 183, 103, 185, 8, 9, 107, - /* 260 */ 366, 12, 13, 14, 15, 16, 62, 233, 234, 235, - /* 270 */ 236, 237, 238, 239, 240, 241, 242, 243, 360, 208, - /* 280 */ 209, 129, 211, 212, 213, 214, 215, 216, 217, 218, + /* 250 */ 192, 193, 360, 117, 183, 20, 185, 164, 8, 9, + /* 260 */ 368, 51, 12, 13, 14, 15, 16, 233, 234, 235, + /* 270 */ 236, 237, 238, 239, 240, 241, 242, 243, 246, 208, + /* 280 */ 209, 95, 211, 212, 213, 214, 215, 216, 217, 218, /* 290 */ 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - /* 300 */ 382, 230, 12, 13, 0, 337, 20, 329, 22, 246, - /* 310 */ 20, 329, 22, 251, 252, 253, 246, 230, 329, 232, - /* 320 */ 95, 35, 182, 33, 184, 35, 108, 109, 110, 111, - /* 330 */ 112, 113, 114, 115, 116, 117, 118, 51, 120, 121, - /* 340 */ 122, 123, 124, 125, 14, 96, 178, 3, 58, 360, - /* 350 */ 20, 373, 384, 63, 386, 373, 246, 368, 337, 175, - /* 360 */ 70, 20, 373, 22, 375, 20, 20, 199, 200, 65, - /* 370 */ 66, 67, 351, 12, 13, 14, 164, 73, 74, 358, - /* 380 */ 408, 20, 78, 22, 47, 95, 246, 83, 84, 368, - /* 390 */ 245, 402, 51, 89, 33, 406, 35, 337, 409, 410, - /* 400 */ 411, 412, 413, 414, 329, 416, 434, 117, 419, 435, - /* 410 */ 421, 422, 423, 439, 2, 33, 427, 428, 161, 58, - /* 420 */ 8, 9, 132, 133, 12, 13, 14, 15, 16, 455, - /* 430 */ 48, 70, 95, 459, 460, 360, 54, 55, 56, 57, - /* 440 */ 58, 95, 70, 368, 384, 14, 386, 3, 373, 337, - /* 450 */ 375, 20, 162, 163, 270, 20, 95, 21, 168, 169, - /* 460 */ 341, 8, 9, 351, 20, 12, 13, 14, 15, 16, - /* 470 */ 34, 246, 36, 183, 355, 185, 94, 402, 117, 97, - /* 480 */ 368, 406, 363, 79, 409, 410, 411, 412, 413, 414, - /* 490 */ 233, 416, 162, 132, 133, 329, 106, 44, 208, 209, - /* 500 */ 243, 211, 212, 213, 214, 215, 216, 217, 218, 219, - /* 510 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 65, - /* 520 */ 66, 67, 343, 162, 163, 450, 451, 73, 74, 168, - /* 530 */ 169, 344, 78, 230, 95, 337, 349, 83, 84, 373, - /* 540 */ 96, 137, 138, 89, 183, 366, 185, 165, 166, 351, - /* 550 */ 329, 70, 170, 8, 9, 173, 361, 12, 13, 14, - /* 560 */ 15, 16, 20, 337, 160, 20, 368, 132, 133, 208, - /* 570 */ 209, 189, 211, 212, 213, 214, 215, 216, 217, 218, + /* 300 */ 360, 230, 12, 13, 412, 333, 337, 335, 336, 79, + /* 310 */ 20, 22, 22, 132, 133, 185, 182, 20, 184, 183, + /* 320 */ 95, 185, 382, 33, 35, 35, 108, 109, 110, 111, + /* 330 */ 112, 113, 114, 115, 116, 117, 118, 368, 120, 121, + /* 340 */ 122, 123, 124, 125, 208, 209, 96, 20, 58, 168, + /* 350 */ 169, 2, 58, 63, 14, 15, 16, 8, 9, 175, + /* 360 */ 70, 12, 13, 14, 15, 16, 337, 137, 138, 65, + /* 370 */ 66, 67, 409, 12, 13, 14, 0, 73, 74, 44, + /* 380 */ 246, 20, 78, 22, 208, 95, 0, 83, 84, 95, + /* 390 */ 160, 97, 95, 89, 33, 20, 35, 368, 435, 178, + /* 400 */ 161, 432, 433, 434, 329, 436, 437, 117, 20, 440, + /* 410 */ 24, 25, 26, 27, 28, 29, 30, 31, 32, 58, + /* 420 */ 199, 200, 132, 133, 455, 456, 375, 425, 426, 460, + /* 430 */ 461, 70, 246, 257, 258, 259, 260, 261, 387, 8, + /* 440 */ 9, 390, 391, 12, 13, 14, 15, 16, 373, 20, + /* 450 */ 344, 20, 162, 163, 270, 349, 95, 164, 168, 169, + /* 460 */ 0, 432, 433, 434, 171, 436, 437, 360, 127, 20, + /* 470 */ 95, 246, 233, 183, 367, 185, 334, 0, 117, 337, + /* 480 */ 338, 21, 243, 376, 24, 25, 26, 27, 28, 29, + /* 490 */ 30, 31, 32, 132, 133, 126, 127, 392, 208, 209, + /* 500 */ 131, 211, 212, 213, 214, 215, 216, 217, 218, 219, + /* 510 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 19, + /* 520 */ 132, 133, 334, 162, 163, 337, 338, 151, 337, 168, + /* 530 */ 169, 190, 191, 33, 20, 194, 160, 196, 21, 62, + /* 540 */ 246, 436, 351, 436, 183, 440, 185, 440, 48, 0, + /* 550 */ 62, 34, 337, 36, 54, 55, 56, 57, 58, 368, + /* 560 */ 455, 456, 455, 456, 106, 460, 461, 460, 461, 208, + /* 570 */ 209, 392, 211, 212, 213, 214, 215, 216, 217, 218, /* 580 */ 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - /* 590 */ 12, 13, 246, 162, 373, 107, 374, 375, 20, 0, - /* 600 */ 22, 346, 347, 168, 169, 208, 329, 0, 164, 265, - /* 610 */ 384, 33, 386, 35, 126, 127, 128, 129, 130, 131, - /* 620 */ 21, 361, 337, 24, 25, 26, 27, 28, 29, 30, - /* 630 */ 31, 32, 1, 2, 8, 9, 58, 360, 12, 13, - /* 640 */ 14, 15, 16, 435, 0, 368, 337, 439, 70, 361, - /* 650 */ 373, 359, 375, 368, 257, 258, 259, 260, 261, 368, - /* 660 */ 351, 12, 13, 455, 372, 360, 127, 459, 460, 20, - /* 670 */ 379, 22, 367, 95, 132, 133, 126, 368, 420, 402, - /* 680 */ 422, 376, 33, 406, 35, 246, 409, 410, 411, 412, - /* 690 */ 413, 414, 329, 416, 337, 117, 360, 0, 421, 420, - /* 700 */ 423, 422, 35, 367, 427, 428, 62, 58, 351, 164, - /* 710 */ 132, 133, 376, 329, 361, 430, 431, 432, 433, 70, - /* 720 */ 435, 436, 96, 360, 0, 368, 449, 96, 361, 190, - /* 730 */ 191, 368, 22, 194, 329, 196, 373, 70, 375, 329, - /* 740 */ 162, 163, 192, 193, 95, 35, 168, 169, 24, 25, - /* 750 */ 26, 27, 28, 29, 30, 31, 32, 373, 151, 62, - /* 760 */ 361, 183, 348, 185, 350, 402, 117, 160, 361, 406, - /* 770 */ 346, 347, 409, 410, 411, 412, 413, 414, 373, 416, - /* 780 */ 70, 132, 133, 373, 408, 329, 208, 209, 392, 211, + /* 590 */ 12, 13, 409, 4, 94, 164, 356, 97, 20, 384, + /* 600 */ 22, 386, 326, 337, 269, 107, 167, 360, 19, 95, + /* 610 */ 0, 33, 409, 35, 367, 436, 374, 375, 435, 440, + /* 620 */ 329, 246, 33, 376, 126, 127, 128, 129, 130, 131, + /* 630 */ 130, 230, 337, 232, 455, 456, 58, 48, 435, 460, + /* 640 */ 461, 401, 53, 20, 329, 22, 351, 58, 70, 329, + /* 650 */ 384, 360, 386, 358, 1, 2, 107, 230, 35, 368, + /* 660 */ 58, 12, 13, 368, 373, 165, 375, 20, 392, 20, + /* 670 */ 170, 22, 62, 95, 51, 126, 127, 128, 129, 130, + /* 680 */ 131, 70, 33, 94, 35, 35, 97, 187, 373, 189, + /* 690 */ 251, 252, 253, 373, 403, 117, 94, 420, 407, 97, + /* 700 */ 423, 410, 411, 412, 413, 414, 415, 58, 417, 436, + /* 710 */ 132, 133, 436, 440, 346, 347, 440, 8, 9, 70, + /* 720 */ 70, 12, 13, 14, 15, 16, 337, 353, 455, 456, + /* 730 */ 356, 455, 456, 460, 461, 0, 460, 461, 346, 347, + /* 740 */ 162, 163, 451, 452, 95, 2, 168, 169, 337, 96, + /* 750 */ 106, 8, 9, 44, 337, 12, 13, 14, 15, 16, + /* 760 */ 246, 183, 351, 185, 8, 9, 117, 360, 12, 13, + /* 770 */ 14, 15, 16, 384, 367, 386, 329, 70, 421, 368, + /* 780 */ 423, 132, 133, 376, 49, 368, 208, 209, 0, 211, /* 790 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 800 */ 222, 223, 224, 225, 226, 227, 228, 337, 368, 368, - /* 810 */ 434, 162, 163, 18, 451, 20, 337, 168, 169, 379, - /* 820 */ 379, 351, 27, 337, 341, 30, 408, 117, 33, 373, - /* 830 */ 351, 435, 183, 360, 185, 439, 352, 351, 368, 396, - /* 840 */ 14, 15, 16, 48, 360, 50, 363, 368, 53, 376, - /* 850 */ 454, 455, 434, 369, 368, 459, 460, 208, 209, 0, + /* 800 */ 222, 223, 224, 225, 226, 227, 228, 343, 421, 162, + /* 810 */ 423, 162, 163, 18, 361, 20, 368, 168, 169, 360, + /* 820 */ 373, 357, 27, 352, 337, 30, 367, 379, 33, 3, + /* 830 */ 366, 360, 183, 361, 185, 376, 392, 341, 351, 370, + /* 840 */ 369, 362, 373, 48, 42, 50, 44, 329, 53, 432, + /* 850 */ 433, 434, 373, 436, 437, 368, 361, 208, 209, 363, /* 860 */ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - /* 870 */ 221, 222, 223, 224, 225, 226, 227, 228, 0, 352, - /* 880 */ 45, 46, 360, 18, 329, 337, 337, 360, 23, 94, - /* 890 */ 0, 369, 107, 183, 0, 185, 369, 20, 2, 351, - /* 900 */ 351, 106, 37, 38, 8, 9, 41, 48, 12, 13, - /* 910 */ 14, 15, 16, 352, 129, 349, 368, 368, 208, 209, - /* 920 */ 419, 360, 463, 422, 59, 60, 61, 383, 373, 370, - /* 930 */ 369, 136, 373, 4, 139, 140, 141, 142, 143, 144, + /* 870 */ 221, 222, 223, 224, 225, 226, 227, 228, 337, 337, + /* 880 */ 436, 14, 4, 18, 440, 406, 407, 20, 23, 94, + /* 890 */ 0, 373, 351, 351, 361, 107, 417, 337, 337, 455, + /* 900 */ 456, 106, 37, 38, 460, 461, 41, 360, 39, 368, + /* 910 */ 368, 351, 351, 20, 126, 127, 128, 129, 130, 131, + /* 920 */ 164, 368, 368, 376, 59, 60, 61, 370, 368, 368, + /* 930 */ 373, 136, 379, 379, 139, 140, 141, 142, 143, 144, /* 940 */ 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - /* 950 */ 155, 452, 157, 158, 159, 65, 66, 67, 68, 69, + /* 950 */ 155, 329, 157, 158, 159, 65, 66, 67, 68, 69, /* 960 */ 95, 71, 72, 73, 74, 75, 76, 77, 78, 79, /* 970 */ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - /* 980 */ 90, 91, 329, 4, 20, 107, 8, 9, 337, 22, - /* 990 */ 12, 13, 14, 15, 16, 132, 133, 20, 19, 134, - /* 1000 */ 337, 107, 35, 337, 126, 127, 128, 129, 130, 131, - /* 1010 */ 244, 245, 33, 329, 351, 337, 329, 351, 44, 368, - /* 1020 */ 126, 127, 128, 129, 130, 131, 373, 48, 337, 351, - /* 1030 */ 337, 368, 53, 329, 368, 329, 337, 58, 44, 162, - /* 1040 */ 175, 176, 177, 446, 351, 180, 368, 360, 329, 370, - /* 1050 */ 351, 370, 373, 353, 373, 368, 356, 373, 0, 368, - /* 1060 */ 373, 368, 375, 198, 337, 329, 201, 368, 203, 204, - /* 1070 */ 205, 206, 207, 94, 329, 44, 97, 373, 351, 373, - /* 1080 */ 22, 35, 431, 432, 433, 329, 435, 436, 337, 402, - /* 1090 */ 96, 339, 373, 406, 106, 368, 409, 410, 411, 412, - /* 1100 */ 413, 414, 351, 416, 329, 360, 1, 2, 421, 373, - /* 1110 */ 423, 246, 44, 368, 427, 428, 339, 360, 373, 368, - /* 1120 */ 375, 329, 431, 432, 433, 438, 435, 436, 164, 373, - /* 1130 */ 329, 337, 8, 9, 336, 360, 12, 13, 14, 15, - /* 1140 */ 16, 164, 164, 368, 156, 351, 329, 402, 373, 337, - /* 1150 */ 375, 406, 360, 0, 409, 410, 411, 412, 413, 414, - /* 1160 */ 368, 416, 368, 351, 96, 373, 421, 375, 423, 42, - /* 1170 */ 0, 44, 427, 428, 373, 22, 247, 402, 329, 58, - /* 1180 */ 368, 406, 392, 438, 409, 410, 411, 412, 413, 414, - /* 1190 */ 373, 416, 22, 42, 402, 44, 99, 99, 406, 102, - /* 1200 */ 102, 409, 410, 411, 412, 413, 414, 35, 416, 360, - /* 1210 */ 383, 99, 372, 421, 102, 423, 164, 368, 97, 427, - /* 1220 */ 428, 392, 373, 171, 375, 435, 44, 63, 453, 439, - /* 1230 */ 438, 185, 99, 12, 13, 102, 329, 383, 44, 437, - /* 1240 */ 44, 267, 44, 22, 454, 455, 440, 44, 429, 459, - /* 1250 */ 460, 402, 44, 0, 33, 406, 35, 248, 409, 410, - /* 1260 */ 411, 412, 413, 414, 435, 416, 329, 360, 439, 456, - /* 1270 */ 421, 35, 423, 44, 44, 368, 427, 428, 96, 58, - /* 1280 */ 373, 44, 375, 454, 455, 95, 13, 438, 459, 460, - /* 1290 */ 96, 70, 96, 404, 96, 105, 48, 360, 329, 96, - /* 1300 */ 269, 403, 49, 44, 96, 368, 70, 44, 35, 402, - /* 1310 */ 373, 44, 375, 406, 394, 44, 409, 410, 411, 412, - /* 1320 */ 413, 414, 44, 416, 44, 96, 96, 181, 421, 360, - /* 1330 */ 423, 42, 13, 96, 427, 428, 44, 368, 117, 402, - /* 1340 */ 20, 380, 373, 406, 375, 438, 409, 410, 411, 412, - /* 1350 */ 413, 414, 392, 416, 35, 96, 383, 185, 421, 96, - /* 1360 */ 423, 380, 161, 96, 427, 428, 20, 96, 378, 337, - /* 1370 */ 378, 402, 208, 337, 96, 406, 96, 329, 409, 410, - /* 1380 */ 411, 412, 413, 414, 380, 416, 378, 93, 96, 345, - /* 1390 */ 421, 337, 423, 337, 337, 435, 427, 428, 20, 439, - /* 1400 */ 331, 331, 20, 398, 183, 343, 185, 20, 360, 375, - /* 1410 */ 343, 20, 338, 20, 454, 455, 368, 393, 343, 459, - /* 1420 */ 460, 373, 338, 375, 343, 392, 343, 337, 343, 208, - /* 1430 */ 209, 343, 52, 340, 340, 329, 360, 360, 331, 360, - /* 1440 */ 360, 337, 221, 222, 223, 224, 225, 226, 227, 360, - /* 1450 */ 402, 360, 360, 331, 406, 329, 360, 409, 410, 411, - /* 1460 */ 412, 413, 414, 360, 416, 197, 360, 401, 435, 421, - /* 1470 */ 360, 423, 439, 360, 368, 427, 428, 341, 95, 373, - /* 1480 */ 398, 375, 373, 188, 373, 341, 360, 454, 455, 375, - /* 1490 */ 256, 337, 459, 460, 368, 400, 397, 255, 383, 373, - /* 1500 */ 383, 375, 373, 373, 445, 445, 388, 388, 402, 262, - /* 1510 */ 373, 373, 406, 329, 174, 409, 410, 411, 412, 413, - /* 1520 */ 414, 448, 416, 249, 264, 447, 271, 263, 402, 423, - /* 1530 */ 443, 445, 406, 427, 428, 409, 410, 411, 412, 413, - /* 1540 */ 414, 266, 416, 329, 360, 444, 404, 268, 245, 423, - /* 1550 */ 442, 368, 368, 427, 428, 20, 408, 373, 338, 375, - /* 1560 */ 329, 337, 20, 341, 464, 386, 341, 166, 388, 388, - /* 1570 */ 373, 385, 373, 457, 360, 373, 341, 373, 458, 373, - /* 1580 */ 373, 341, 368, 356, 368, 95, 402, 373, 426, 375, - /* 1590 */ 406, 360, 95, 409, 410, 411, 412, 413, 414, 368, - /* 1600 */ 416, 373, 364, 337, 373, 36, 375, 423, 350, 332, - /* 1610 */ 341, 427, 428, 331, 395, 389, 402, 329, 342, 354, - /* 1620 */ 406, 389, 399, 409, 410, 411, 412, 413, 414, 415, - /* 1630 */ 416, 417, 418, 402, 327, 354, 0, 406, 354, 0, - /* 1640 */ 409, 410, 411, 412, 413, 414, 190, 416, 360, 0, - /* 1650 */ 0, 42, 0, 35, 202, 35, 368, 35, 35, 202, - /* 1660 */ 0, 373, 35, 375, 329, 35, 202, 0, 202, 0, - /* 1670 */ 35, 0, 0, 22, 185, 35, 183, 0, 0, 179, - /* 1680 */ 178, 329, 0, 0, 47, 0, 0, 0, 0, 42, - /* 1690 */ 402, 0, 461, 462, 406, 360, 0, 409, 410, 411, - /* 1700 */ 412, 413, 414, 368, 416, 0, 0, 0, 373, 151, - /* 1710 */ 375, 423, 360, 0, 0, 35, 428, 365, 0, 151, - /* 1720 */ 368, 0, 0, 0, 0, 373, 0, 375, 0, 0, - /* 1730 */ 0, 0, 0, 0, 0, 0, 329, 402, 0, 0, - /* 1740 */ 0, 406, 42, 0, 409, 410, 411, 412, 413, 414, - /* 1750 */ 0, 416, 0, 0, 402, 0, 0, 0, 406, 329, - /* 1760 */ 0, 409, 410, 411, 412, 413, 414, 360, 416, 22, - /* 1770 */ 0, 0, 0, 135, 0, 368, 35, 58, 0, 0, - /* 1780 */ 373, 0, 375, 58, 42, 39, 0, 14, 44, 14, - /* 1790 */ 360, 329, 47, 0, 0, 365, 47, 462, 368, 40, - /* 1800 */ 39, 47, 0, 373, 39, 375, 174, 0, 0, 402, - /* 1810 */ 0, 0, 64, 406, 0, 35, 409, 410, 411, 412, - /* 1820 */ 413, 414, 360, 416, 48, 418, 39, 365, 0, 39, - /* 1830 */ 368, 35, 402, 48, 0, 373, 406, 375, 329, 409, - /* 1840 */ 410, 411, 412, 413, 414, 48, 416, 35, 39, 0, - /* 1850 */ 35, 48, 19, 0, 0, 39, 0, 0, 35, 22, - /* 1860 */ 102, 0, 329, 44, 402, 35, 33, 104, 406, 360, - /* 1870 */ 35, 409, 410, 411, 412, 413, 414, 368, 416, 35, - /* 1880 */ 35, 48, 373, 44, 375, 35, 35, 54, 55, 56, - /* 1890 */ 57, 58, 22, 360, 35, 0, 22, 0, 22, 0, - /* 1900 */ 22, 368, 50, 35, 0, 0, 373, 35, 375, 0, - /* 1910 */ 35, 402, 22, 20, 35, 406, 35, 96, 409, 410, - /* 1920 */ 411, 412, 413, 414, 95, 416, 0, 94, 329, 35, - /* 1930 */ 97, 195, 164, 0, 22, 402, 0, 186, 0, 406, - /* 1940 */ 3, 164, 409, 410, 411, 412, 413, 414, 166, 416, - /* 1950 */ 329, 44, 164, 250, 96, 172, 229, 95, 254, 360, - /* 1960 */ 95, 44, 171, 130, 3, 96, 171, 368, 44, 96, - /* 1970 */ 47, 44, 373, 96, 375, 329, 47, 95, 95, 95, - /* 1980 */ 95, 360, 96, 96, 44, 35, 35, 35, 35, 368, - /* 1990 */ 35, 35, 96, 47, 373, 47, 375, 96, 165, 39, - /* 2000 */ 0, 402, 44, 170, 0, 406, 360, 0, 409, 410, - /* 2010 */ 411, 412, 413, 414, 368, 416, 250, 0, 0, 373, - /* 2020 */ 187, 375, 189, 402, 47, 95, 95, 406, 244, 95, - /* 2030 */ 409, 410, 411, 412, 413, 414, 95, 416, 329, 250, - /* 2040 */ 96, 96, 95, 47, 39, 44, 229, 167, 402, 95, - /* 2050 */ 2, 231, 406, 229, 165, 409, 410, 411, 412, 413, - /* 2060 */ 414, 22, 416, 208, 105, 95, 329, 96, 95, 360, - /* 2070 */ 96, 95, 47, 47, 96, 95, 95, 368, 106, 96, - /* 2080 */ 22, 210, 373, 95, 375, 96, 35, 35, 95, 35, - /* 2090 */ 96, 96, 95, 95, 35, 35, 329, 360, 96, 96, - /* 2100 */ 35, 95, 22, 95, 119, 368, 119, 95, 44, 119, - /* 2110 */ 373, 402, 375, 22, 95, 406, 107, 35, 409, 410, - /* 2120 */ 411, 412, 413, 414, 95, 416, 64, 360, 329, 119, - /* 2130 */ 63, 35, 35, 35, 35, 368, 35, 35, 35, 402, - /* 2140 */ 373, 35, 375, 406, 35, 35, 409, 410, 411, 412, - /* 2150 */ 413, 414, 44, 416, 70, 92, 35, 35, 35, 360, - /* 2160 */ 329, 22, 35, 35, 35, 70, 35, 368, 35, 402, - /* 2170 */ 35, 35, 373, 406, 375, 35, 409, 410, 411, 412, - /* 2180 */ 413, 414, 22, 416, 35, 0, 35, 39, 0, 48, - /* 2190 */ 35, 360, 329, 48, 0, 39, 35, 39, 48, 368, - /* 2200 */ 0, 402, 35, 39, 373, 406, 375, 48, 409, 410, - /* 2210 */ 411, 412, 413, 414, 0, 416, 35, 329, 35, 0, - /* 2220 */ 22, 22, 21, 360, 22, 21, 20, 465, 465, 465, - /* 2230 */ 465, 368, 465, 402, 465, 465, 373, 406, 375, 465, - /* 2240 */ 409, 410, 411, 412, 413, 414, 465, 416, 360, 329, - /* 2250 */ 465, 465, 465, 465, 465, 465, 368, 465, 465, 465, - /* 2260 */ 465, 373, 465, 375, 465, 402, 465, 465, 465, 406, - /* 2270 */ 465, 465, 409, 410, 411, 412, 413, 414, 465, 416, - /* 2280 */ 360, 465, 465, 465, 465, 465, 465, 465, 368, 465, - /* 2290 */ 402, 465, 465, 373, 406, 375, 465, 409, 410, 411, - /* 2300 */ 412, 413, 414, 465, 416, 465, 465, 465, 465, 465, - /* 2310 */ 465, 329, 465, 465, 465, 465, 465, 465, 465, 465, - /* 2320 */ 465, 465, 402, 465, 465, 465, 406, 465, 329, 409, - /* 2330 */ 410, 411, 412, 413, 414, 465, 416, 465, 465, 465, - /* 2340 */ 465, 465, 360, 465, 465, 465, 465, 465, 465, 465, - /* 2350 */ 368, 465, 465, 465, 465, 373, 465, 375, 465, 360, - /* 2360 */ 465, 465, 465, 465, 465, 465, 465, 368, 465, 465, - /* 2370 */ 465, 465, 373, 465, 375, 465, 465, 465, 465, 465, - /* 2380 */ 465, 465, 465, 465, 402, 329, 465, 465, 406, 465, - /* 2390 */ 465, 409, 410, 411, 412, 413, 414, 465, 416, 465, - /* 2400 */ 465, 402, 465, 465, 465, 406, 465, 329, 409, 410, - /* 2410 */ 411, 412, 413, 414, 465, 416, 360, 465, 465, 465, - /* 2420 */ 465, 465, 465, 465, 368, 465, 465, 465, 465, 373, - /* 2430 */ 465, 375, 465, 465, 465, 465, 465, 465, 360, 465, - /* 2440 */ 465, 465, 465, 465, 465, 465, 368, 465, 465, 465, - /* 2450 */ 465, 373, 465, 375, 465, 465, 465, 465, 402, 465, - /* 2460 */ 465, 465, 406, 465, 465, 409, 410, 411, 412, 413, - /* 2470 */ 414, 465, 416, 329, 465, 465, 465, 465, 465, 465, - /* 2480 */ 402, 465, 465, 465, 406, 465, 465, 409, 410, 411, - /* 2490 */ 412, 413, 414, 465, 416, 465, 465, 329, 465, 465, - /* 2500 */ 465, 465, 465, 465, 360, 465, 465, 465, 465, 465, - /* 2510 */ 465, 465, 368, 465, 465, 465, 465, 373, 465, 375, - /* 2520 */ 465, 465, 465, 465, 465, 465, 465, 465, 360, 465, - /* 2530 */ 465, 465, 465, 465, 465, 465, 368, 465, 465, 465, - /* 2540 */ 465, 373, 465, 375, 465, 465, 402, 465, 465, 465, - /* 2550 */ 406, 465, 465, 409, 410, 411, 412, 413, 414, 465, - /* 2560 */ 416, 329, 465, 465, 465, 465, 465, 465, 465, 465, - /* 2570 */ 402, 465, 465, 465, 406, 465, 465, 409, 410, 411, - /* 2580 */ 412, 413, 414, 465, 416, 465, 329, 465, 465, 465, - /* 2590 */ 465, 465, 360, 465, 465, 465, 465, 465, 465, 465, - /* 2600 */ 368, 465, 465, 465, 465, 373, 465, 375, 465, 465, - /* 2610 */ 465, 465, 465, 465, 465, 465, 465, 360, 329, 465, - /* 2620 */ 465, 465, 465, 465, 465, 368, 465, 465, 465, 465, - /* 2630 */ 373, 465, 375, 465, 402, 465, 465, 465, 406, 465, - /* 2640 */ 465, 409, 410, 411, 412, 413, 414, 465, 416, 360, - /* 2650 */ 465, 465, 465, 465, 465, 465, 465, 368, 465, 402, - /* 2660 */ 465, 465, 373, 406, 375, 465, 409, 410, 411, 412, - /* 2670 */ 413, 414, 465, 416, 465, 465, 465, 465, 465, 465, - /* 2680 */ 465, 465, 465, 465, 465, 465, 465, 465, 465, 465, - /* 2690 */ 465, 402, 465, 465, 465, 406, 465, 465, 409, 410, - /* 2700 */ 411, 412, 413, 414, 465, 416, + /* 980 */ 90, 91, 370, 392, 348, 373, 350, 44, 329, 337, + /* 990 */ 14, 392, 12, 13, 436, 373, 20, 337, 440, 134, + /* 1000 */ 8, 9, 22, 351, 12, 13, 14, 15, 16, 45, + /* 1010 */ 46, 351, 337, 33, 456, 35, 132, 133, 460, 461, + /* 1020 */ 368, 329, 337, 20, 244, 245, 351, 436, 368, 162, + /* 1030 */ 337, 440, 373, 329, 329, 436, 351, 44, 58, 440, + /* 1040 */ 175, 176, 177, 368, 351, 180, 455, 456, 337, 329, + /* 1050 */ 70, 460, 461, 368, 455, 456, 0, 164, 329, 460, + /* 1060 */ 461, 368, 351, 198, 362, 373, 201, 337, 203, 204, + /* 1070 */ 205, 206, 207, 361, 106, 373, 329, 373, 373, 368, + /* 1080 */ 360, 351, 337, 0, 329, 337, 337, 44, 368, 96, + /* 1090 */ 330, 265, 329, 373, 63, 375, 351, 117, 368, 351, + /* 1100 */ 351, 329, 373, 329, 48, 22, 35, 360, 406, 407, + /* 1110 */ 349, 246, 329, 368, 245, 368, 368, 368, 99, 417, + /* 1120 */ 373, 102, 375, 403, 156, 247, 329, 407, 373, 329, + /* 1130 */ 410, 411, 412, 413, 414, 415, 373, 417, 162, 96, + /* 1140 */ 420, 329, 422, 423, 424, 373, 107, 373, 428, 429, + /* 1150 */ 403, 329, 99, 361, 407, 102, 373, 410, 411, 412, + /* 1160 */ 413, 414, 415, 183, 417, 185, 44, 164, 129, 422, + /* 1170 */ 373, 424, 360, 373, 0, 428, 429, 42, 99, 44, + /* 1180 */ 368, 102, 58, 44, 383, 373, 0, 375, 208, 209, + /* 1190 */ 44, 99, 44, 35, 102, 373, 22, 450, 47, 329, + /* 1200 */ 44, 221, 222, 223, 224, 225, 226, 227, 22, 44, + /* 1210 */ 267, 13, 44, 44, 44, 403, 1, 2, 96, 407, + /* 1220 */ 44, 97, 410, 411, 412, 413, 414, 415, 70, 417, + /* 1230 */ 360, 464, 329, 35, 422, 96, 424, 44, 368, 208, + /* 1240 */ 428, 429, 96, 373, 96, 375, 95, 13, 44, 44, + /* 1250 */ 44, 439, 96, 44, 339, 44, 185, 453, 447, 360, + /* 1260 */ 44, 96, 339, 360, 96, 96, 96, 336, 383, 35, + /* 1270 */ 372, 368, 96, 403, 383, 438, 373, 407, 375, 430, + /* 1280 */ 410, 411, 412, 413, 414, 415, 457, 417, 441, 96, + /* 1290 */ 329, 405, 422, 248, 424, 48, 404, 181, 428, 429, + /* 1300 */ 96, 96, 96, 394, 42, 96, 403, 96, 380, 439, + /* 1310 */ 407, 20, 96, 410, 411, 412, 413, 414, 415, 383, + /* 1320 */ 417, 360, 380, 161, 378, 422, 20, 424, 337, 368, + /* 1330 */ 380, 428, 429, 337, 373, 378, 375, 378, 93, 345, + /* 1340 */ 20, 337, 439, 337, 337, 331, 331, 20, 343, 398, + /* 1350 */ 20, 343, 375, 20, 338, 20, 393, 52, 338, 331, + /* 1360 */ 343, 343, 337, 373, 403, 343, 343, 343, 407, 340, + /* 1370 */ 329, 410, 411, 412, 413, 414, 415, 340, 417, 331, + /* 1380 */ 197, 360, 373, 422, 337, 424, 360, 360, 402, 428, + /* 1390 */ 429, 95, 360, 329, 360, 360, 360, 400, 360, 398, + /* 1400 */ 439, 360, 360, 341, 360, 188, 360, 397, 375, 368, + /* 1410 */ 341, 337, 446, 383, 373, 256, 375, 446, 255, 262, + /* 1420 */ 174, 449, 373, 383, 360, 373, 448, 446, 373, 445, + /* 1430 */ 373, 264, 368, 444, 263, 271, 249, 373, 388, 375, + /* 1440 */ 465, 443, 388, 268, 403, 266, 459, 245, 407, 368, + /* 1450 */ 20, 410, 411, 412, 413, 414, 415, 458, 417, 338, + /* 1460 */ 329, 341, 337, 422, 405, 424, 20, 403, 341, 428, + /* 1470 */ 429, 407, 409, 386, 410, 411, 412, 413, 414, 415, + /* 1480 */ 439, 417, 388, 373, 329, 373, 422, 373, 424, 388, + /* 1490 */ 373, 360, 428, 429, 166, 341, 373, 356, 385, 368, + /* 1500 */ 368, 373, 341, 95, 373, 427, 375, 95, 364, 373, + /* 1510 */ 350, 331, 36, 341, 337, 360, 332, 399, 389, 389, + /* 1520 */ 354, 395, 327, 368, 342, 0, 0, 354, 373, 190, + /* 1530 */ 375, 0, 329, 42, 403, 354, 0, 0, 407, 35, + /* 1540 */ 202, 410, 411, 412, 413, 414, 415, 35, 417, 35, + /* 1550 */ 35, 202, 0, 422, 35, 424, 329, 35, 403, 428, + /* 1560 */ 429, 202, 407, 360, 0, 410, 411, 412, 413, 414, + /* 1570 */ 415, 368, 417, 202, 0, 35, 373, 422, 375, 424, + /* 1580 */ 0, 22, 0, 428, 429, 35, 185, 360, 183, 0, + /* 1590 */ 0, 0, 179, 178, 0, 368, 47, 0, 0, 0, + /* 1600 */ 373, 0, 375, 42, 0, 0, 403, 0, 0, 0, + /* 1610 */ 407, 0, 0, 410, 411, 412, 413, 414, 415, 151, + /* 1620 */ 417, 35, 329, 0, 151, 0, 0, 424, 0, 0, + /* 1630 */ 403, 428, 429, 0, 407, 0, 0, 410, 411, 412, + /* 1640 */ 413, 414, 415, 0, 417, 329, 0, 0, 0, 0, + /* 1650 */ 0, 424, 0, 360, 0, 428, 429, 0, 42, 0, + /* 1660 */ 0, 368, 0, 0, 0, 0, 373, 22, 375, 0, + /* 1670 */ 0, 0, 0, 135, 0, 35, 360, 0, 58, 0, + /* 1680 */ 58, 0, 0, 42, 368, 47, 44, 14, 0, 373, + /* 1690 */ 39, 375, 14, 40, 0, 0, 403, 39, 0, 0, + /* 1700 */ 407, 174, 47, 410, 411, 412, 413, 414, 415, 0, + /* 1710 */ 417, 0, 0, 329, 47, 39, 0, 424, 35, 403, + /* 1720 */ 0, 428, 429, 407, 39, 64, 410, 411, 412, 413, + /* 1730 */ 414, 415, 416, 417, 418, 419, 35, 48, 48, 329, + /* 1740 */ 0, 39, 35, 39, 360, 48, 0, 39, 35, 0, + /* 1750 */ 0, 48, 368, 0, 0, 22, 35, 373, 0, 375, + /* 1760 */ 35, 35, 35, 35, 35, 35, 44, 44, 102, 22, + /* 1770 */ 360, 35, 104, 0, 22, 0, 0, 22, 368, 22, + /* 1780 */ 35, 50, 0, 373, 0, 375, 35, 403, 0, 22, + /* 1790 */ 20, 407, 96, 0, 410, 411, 412, 413, 414, 415, + /* 1800 */ 35, 417, 0, 35, 329, 195, 35, 35, 164, 95, + /* 1810 */ 95, 22, 0, 403, 3, 250, 186, 407, 0, 95, + /* 1820 */ 410, 411, 412, 413, 414, 415, 254, 417, 96, 329, + /* 1830 */ 44, 229, 95, 95, 424, 360, 44, 96, 96, 429, + /* 1840 */ 96, 166, 44, 368, 164, 44, 462, 463, 373, 3, + /* 1850 */ 375, 164, 47, 47, 95, 95, 172, 171, 95, 44, + /* 1860 */ 360, 35, 329, 171, 250, 96, 35, 250, 368, 35, + /* 1870 */ 96, 35, 35, 373, 35, 375, 96, 96, 403, 47, + /* 1880 */ 47, 244, 407, 0, 44, 410, 411, 412, 413, 414, + /* 1890 */ 415, 0, 417, 360, 0, 329, 0, 39, 95, 47, + /* 1900 */ 96, 368, 95, 403, 96, 95, 373, 407, 375, 0, + /* 1910 */ 410, 411, 412, 413, 414, 415, 95, 417, 95, 39, + /* 1920 */ 95, 105, 47, 167, 231, 44, 360, 452, 2, 165, + /* 1930 */ 22, 365, 47, 95, 368, 229, 403, 96, 95, 373, + /* 1940 */ 407, 375, 95, 410, 411, 412, 413, 414, 415, 96, + /* 1950 */ 417, 208, 96, 47, 454, 95, 95, 22, 96, 95, + /* 1960 */ 329, 106, 96, 229, 35, 35, 95, 35, 96, 403, + /* 1970 */ 119, 210, 95, 407, 96, 35, 410, 411, 412, 413, + /* 1980 */ 414, 415, 95, 417, 96, 329, 35, 95, 35, 96, + /* 1990 */ 95, 360, 119, 22, 95, 119, 463, 95, 119, 368, + /* 2000 */ 44, 35, 22, 64, 373, 107, 375, 95, 63, 35, + /* 2010 */ 35, 35, 35, 35, 35, 92, 360, 35, 35, 35, + /* 2020 */ 35, 365, 70, 35, 368, 44, 35, 35, 22, 373, + /* 2030 */ 35, 375, 35, 35, 403, 70, 35, 35, 407, 35, + /* 2040 */ 35, 410, 411, 412, 413, 414, 415, 329, 417, 35, + /* 2050 */ 419, 22, 35, 0, 35, 48, 0, 39, 35, 403, + /* 2060 */ 48, 39, 0, 407, 329, 35, 410, 411, 412, 413, + /* 2070 */ 414, 415, 48, 417, 39, 0, 35, 39, 360, 48, + /* 2080 */ 0, 35, 35, 365, 0, 22, 368, 21, 466, 22, + /* 2090 */ 22, 373, 21, 375, 20, 360, 466, 466, 466, 466, + /* 2100 */ 466, 466, 466, 368, 466, 466, 466, 466, 373, 466, + /* 2110 */ 375, 466, 466, 466, 466, 466, 466, 466, 466, 466, + /* 2120 */ 466, 403, 466, 466, 329, 407, 466, 466, 410, 411, + /* 2130 */ 412, 413, 414, 415, 466, 417, 466, 466, 403, 466, + /* 2140 */ 466, 466, 407, 329, 466, 410, 411, 412, 413, 414, + /* 2150 */ 415, 466, 417, 466, 466, 360, 466, 466, 466, 466, + /* 2160 */ 466, 466, 466, 368, 466, 466, 466, 466, 373, 466, + /* 2170 */ 375, 466, 466, 466, 360, 466, 466, 466, 466, 466, + /* 2180 */ 466, 466, 368, 466, 466, 466, 466, 373, 466, 375, + /* 2190 */ 466, 466, 466, 466, 466, 466, 466, 466, 403, 466, + /* 2200 */ 466, 466, 407, 329, 466, 410, 411, 412, 413, 414, + /* 2210 */ 415, 466, 417, 466, 466, 466, 466, 403, 466, 329, + /* 2220 */ 466, 407, 466, 466, 410, 411, 412, 413, 414, 415, + /* 2230 */ 466, 417, 466, 466, 360, 466, 329, 466, 466, 466, + /* 2240 */ 466, 466, 368, 466, 466, 466, 466, 373, 466, 375, + /* 2250 */ 360, 466, 466, 466, 466, 466, 466, 466, 368, 466, + /* 2260 */ 466, 466, 466, 373, 466, 375, 466, 360, 466, 466, + /* 2270 */ 466, 466, 466, 466, 466, 368, 466, 403, 466, 466, + /* 2280 */ 373, 407, 375, 466, 410, 411, 412, 413, 414, 415, + /* 2290 */ 466, 417, 466, 403, 466, 466, 466, 407, 466, 329, + /* 2300 */ 410, 411, 412, 413, 414, 415, 466, 417, 466, 466, + /* 2310 */ 403, 466, 466, 466, 407, 329, 466, 410, 411, 412, + /* 2320 */ 413, 414, 415, 466, 417, 466, 466, 466, 466, 466, + /* 2330 */ 360, 466, 466, 466, 466, 466, 466, 466, 368, 466, + /* 2340 */ 466, 466, 466, 373, 466, 375, 360, 466, 466, 466, + /* 2350 */ 466, 466, 466, 466, 368, 466, 466, 466, 466, 373, + /* 2360 */ 466, 375, 466, 466, 466, 466, 466, 466, 466, 466, + /* 2370 */ 466, 329, 466, 403, 466, 466, 466, 407, 466, 466, + /* 2380 */ 410, 411, 412, 413, 414, 415, 466, 417, 466, 403, + /* 2390 */ 466, 466, 466, 407, 329, 466, 410, 411, 412, 413, + /* 2400 */ 414, 415, 360, 417, 466, 466, 466, 466, 466, 466, + /* 2410 */ 368, 466, 466, 466, 466, 373, 466, 375, 466, 466, + /* 2420 */ 466, 466, 466, 466, 466, 360, 466, 466, 466, 466, + /* 2430 */ 466, 466, 466, 368, 466, 466, 466, 466, 373, 466, + /* 2440 */ 375, 466, 466, 466, 466, 403, 466, 466, 466, 407, + /* 2450 */ 466, 466, 410, 411, 412, 413, 414, 415, 329, 417, + /* 2460 */ 466, 466, 466, 466, 466, 466, 466, 466, 403, 466, + /* 2470 */ 466, 466, 407, 466, 466, 410, 411, 412, 413, 414, + /* 2480 */ 415, 466, 417, 466, 466, 329, 466, 466, 466, 360, + /* 2490 */ 466, 466, 466, 466, 466, 466, 466, 368, 466, 466, + /* 2500 */ 466, 466, 373, 466, 375, 466, 466, 466, 466, 466, + /* 2510 */ 466, 466, 466, 466, 466, 466, 360, 466, 466, 466, + /* 2520 */ 466, 466, 466, 466, 368, 466, 466, 466, 466, 373, + /* 2530 */ 466, 375, 403, 329, 466, 466, 407, 466, 466, 410, + /* 2540 */ 411, 412, 413, 414, 415, 466, 417, 466, 466, 329, + /* 2550 */ 466, 466, 466, 466, 466, 466, 466, 466, 466, 403, + /* 2560 */ 466, 466, 466, 407, 360, 466, 410, 411, 412, 413, + /* 2570 */ 414, 415, 368, 417, 466, 466, 466, 373, 466, 375, + /* 2580 */ 360, 466, 466, 466, 466, 466, 466, 466, 368, 466, + /* 2590 */ 466, 466, 466, 373, 466, 375, 466, 329, 466, 466, + /* 2600 */ 466, 466, 466, 466, 466, 466, 466, 403, 466, 466, + /* 2610 */ 466, 407, 466, 466, 410, 411, 412, 413, 414, 415, + /* 2620 */ 466, 417, 466, 403, 466, 466, 466, 407, 360, 466, + /* 2630 */ 410, 411, 412, 413, 414, 415, 368, 417, 466, 466, + /* 2640 */ 466, 373, 466, 375, 466, 329, 466, 466, 466, 466, + /* 2650 */ 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, + /* 2660 */ 466, 466, 466, 466, 466, 466, 466, 466, 329, 466, + /* 2670 */ 466, 403, 466, 466, 466, 407, 360, 466, 410, 411, + /* 2680 */ 412, 413, 414, 415, 368, 417, 466, 466, 466, 373, + /* 2690 */ 466, 375, 466, 466, 466, 466, 466, 466, 466, 360, + /* 2700 */ 466, 329, 466, 466, 466, 466, 466, 368, 466, 466, + /* 2710 */ 466, 466, 373, 466, 375, 466, 466, 466, 466, 403, + /* 2720 */ 466, 466, 466, 407, 329, 466, 410, 411, 412, 413, + /* 2730 */ 414, 415, 360, 417, 466, 466, 466, 466, 466, 466, + /* 2740 */ 368, 466, 403, 466, 466, 373, 407, 375, 466, 410, + /* 2750 */ 411, 412, 413, 414, 415, 360, 417, 466, 466, 466, + /* 2760 */ 466, 466, 466, 368, 466, 466, 466, 466, 373, 466, + /* 2770 */ 375, 466, 466, 466, 466, 403, 466, 466, 466, 407, + /* 2780 */ 466, 466, 410, 411, 412, 413, 414, 415, 329, 417, + /* 2790 */ 466, 466, 466, 466, 466, 466, 466, 466, 403, 466, + /* 2800 */ 466, 466, 407, 466, 466, 410, 411, 412, 413, 414, + /* 2810 */ 415, 466, 417, 466, 466, 329, 466, 466, 466, 360, + /* 2820 */ 466, 466, 466, 466, 466, 466, 466, 368, 466, 466, + /* 2830 */ 466, 466, 373, 466, 375, 466, 466, 466, 466, 466, + /* 2840 */ 466, 466, 466, 466, 466, 466, 360, 466, 466, 466, + /* 2850 */ 466, 466, 466, 466, 368, 466, 466, 466, 466, 373, + /* 2860 */ 466, 375, 403, 329, 466, 466, 407, 466, 466, 410, + /* 2870 */ 411, 412, 413, 414, 415, 466, 417, 466, 466, 466, + /* 2880 */ 466, 466, 466, 466, 466, 466, 466, 466, 466, 403, + /* 2890 */ 466, 466, 466, 407, 360, 466, 410, 411, 412, 413, + /* 2900 */ 414, 415, 368, 417, 466, 466, 466, 373, 466, 375, + /* 2910 */ 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, + /* 2920 */ 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, + /* 2930 */ 466, 466, 466, 466, 466, 466, 466, 403, 466, 466, + /* 2940 */ 466, 407, 466, 466, 410, 411, 412, 413, 414, 415, + /* 2950 */ 466, 417, }; -#define YY_SHIFT_COUNT (729) +#define YY_SHIFT_COUNT (733) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2219) +#define YY_SHIFT_MAX (2084) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 865, 0, 71, 0, 290, 290, 290, 290, 290, 290, /* 10 */ 290, 290, 290, 290, 290, 361, 578, 578, 649, 578, /* 20 */ 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, /* 30 */ 578, 578, 578, 578, 578, 578, 578, 578, 578, 578, - /* 40 */ 578, 578, 578, 578, 578, 578, 578, 578, 70, 346, - /* 50 */ 40, 140, 63, 225, 439, 225, 40, 40, 1221, 1221, - /* 60 */ 225, 1221, 1221, 110, 225, 435, 17, 17, 435, 85, - /* 70 */ 85, 68, 542, 167, 167, 17, 17, 17, 17, 17, - /* 80 */ 17, 17, 36, 17, 17, 174, 78, 17, 17, 117, - /* 90 */ 17, 78, 17, 36, 17, 36, 78, 17, 17, 78, - /* 100 */ 17, 78, 78, 78, 17, 204, 795, 34, 34, 217, - /* 110 */ 454, 710, 710, 710, 710, 710, 710, 710, 710, 710, - /* 120 */ 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, - /* 130 */ 152, 444, 68, 542, 644, 667, 212, 212, 212, 697, - /* 140 */ 87, 87, 667, 345, 345, 345, 390, 303, 78, 372, - /* 150 */ 78, 372, 372, 390, 481, 218, 218, 218, 218, 218, - /* 160 */ 218, 218, 1833, 599, 304, 545, 184, 397, 286, 62, - /* 170 */ 330, 431, 341, 964, 835, 785, 977, 766, 145, 344, - /* 180 */ 766, 1127, 929, 877, 1009, 1248, 1146, 1289, 1320, 1289, - /* 190 */ 1201, 1346, 1346, 1289, 1201, 1201, 1294, 1346, 1346, 1346, - /* 200 */ 1378, 1378, 1382, 174, 1387, 174, 1391, 1393, 174, 1391, - /* 210 */ 174, 174, 174, 1346, 174, 1380, 1380, 1378, 78, 78, - /* 220 */ 78, 78, 78, 78, 78, 78, 78, 78, 78, 1346, - /* 230 */ 1378, 372, 372, 1268, 1383, 1382, 204, 1295, 1387, 204, - /* 240 */ 1346, 1320, 1320, 372, 1234, 1242, 372, 1234, 1242, 372, - /* 250 */ 372, 78, 1247, 1340, 1234, 1260, 1264, 1274, 1009, 1255, - /* 260 */ 1279, 1275, 1303, 345, 1535, 1346, 1391, 204, 204, 1542, - /* 270 */ 1242, 372, 372, 372, 372, 372, 1242, 372, 1401, 204, - /* 280 */ 390, 204, 345, 1490, 1497, 372, 481, 1346, 204, 1569, - /* 290 */ 1378, 2706, 2706, 2706, 2706, 2706, 2706, 2706, 2706, 2706, - /* 300 */ 890, 382, 724, 979, 249, 453, 626, 878, 412, 896, - /* 310 */ 978, 894, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, - /* 320 */ 1124, 488, 539, 130, 130, 404, 168, 607, 67, 436, - /* 330 */ 550, 44, 44, 826, 631, 257, 826, 826, 826, 994, - /* 340 */ 859, 967, 1151, 988, 1097, 1098, 1112, 1133, 1058, 1153, - /* 350 */ 1170, 1068, 1121, 1182, 1194, 863, 974, 1031, 1052, 1196, - /* 360 */ 1198, 1203, 1229, 1230, 1237, 1105, 1259, 1046, 1172, 1164, - /* 370 */ 1208, 337, 1263, 1267, 1271, 1278, 1280, 1292, 1190, 1273, - /* 380 */ 1319, 1236, 1253, 1636, 1639, 1456, 1649, 1650, 1609, 1652, - /* 390 */ 1618, 1452, 1620, 1622, 1623, 1457, 1660, 1627, 1630, 1464, - /* 400 */ 1667, 1466, 1669, 1635, 1671, 1651, 1672, 1640, 1489, 1493, - /* 410 */ 1677, 1678, 1500, 1502, 1682, 1683, 1637, 1685, 1686, 1687, - /* 420 */ 1647, 1688, 1691, 1696, 1705, 1706, 1707, 1713, 1714, 1558, - /* 430 */ 1680, 1718, 1568, 1721, 1722, 1723, 1724, 1726, 1728, 1729, - /* 440 */ 1730, 1731, 1732, 1733, 1734, 1735, 1738, 1739, 1740, 1700, - /* 450 */ 1743, 1750, 1752, 1753, 1755, 1756, 1747, 1757, 1760, 1770, - /* 460 */ 1638, 1771, 1772, 1741, 1774, 1719, 1778, 1725, 1779, 1781, - /* 470 */ 1742, 1746, 1744, 1745, 1773, 1749, 1775, 1754, 1786, 1759, - /* 480 */ 1761, 1793, 1794, 1802, 1765, 1632, 1807, 1808, 1810, 1748, - /* 490 */ 1811, 1814, 1780, 1776, 1787, 1828, 1796, 1785, 1790, 1834, - /* 500 */ 1812, 1797, 1809, 1849, 1815, 1803, 1816, 1853, 1854, 1856, - /* 510 */ 1857, 1763, 1758, 1823, 1837, 1861, 1830, 1835, 1844, 1845, - /* 520 */ 1819, 1839, 1850, 1851, 1870, 1859, 1895, 1874, 1897, 1876, - /* 530 */ 1852, 1899, 1878, 1868, 1904, 1872, 1905, 1875, 1909, 1890, - /* 540 */ 1893, 1879, 1881, 1736, 1821, 1829, 1926, 1768, 1894, 1933, - /* 550 */ 1751, 1912, 1777, 1782, 1936, 1938, 1788, 1783, 1937, 1907, - /* 560 */ 1703, 1862, 1858, 1865, 1791, 1727, 1795, 1704, 1869, 1917, - /* 570 */ 1873, 1882, 1883, 1884, 1877, 1924, 1923, 1929, 1885, 1927, - /* 580 */ 1766, 1886, 1887, 1961, 1940, 1789, 1950, 1951, 1952, 1953, - /* 590 */ 1955, 1956, 1896, 1901, 1946, 1784, 1958, 1948, 2004, 2007, - /* 600 */ 2017, 2018, 1930, 1960, 1745, 1977, 1931, 1944, 1945, 1934, - /* 610 */ 1941, 1880, 1947, 2000, 2005, 1889, 1954, 1959, 1745, 1996, - /* 620 */ 2001, 1817, 1820, 1824, 2048, 2039, 1855, 1970, 1971, 1973, - /* 630 */ 1974, 1976, 1978, 2025, 1980, 1981, 2026, 1983, 2058, 1871, - /* 640 */ 1988, 1972, 1989, 2051, 2052, 1993, 1994, 2054, 1997, 1995, - /* 650 */ 2059, 1998, 2002, 2060, 2006, 2003, 2065, 2008, 1985, 1987, - /* 660 */ 1990, 2010, 2080, 2009, 2012, 2064, 2019, 2082, 2029, 2064, - /* 670 */ 2064, 2091, 2062, 2067, 2096, 2097, 2098, 2099, 2101, 2102, - /* 680 */ 2103, 2106, 2109, 2110, 2084, 2063, 2108, 2121, 2122, 2123, - /* 690 */ 2139, 2127, 2128, 2129, 2095, 1819, 2131, 1839, 2133, 2135, - /* 700 */ 2136, 2140, 2160, 2149, 2185, 2151, 2141, 2148, 2188, 2155, - /* 710 */ 2145, 2156, 2194, 2161, 2150, 2158, 2200, 2167, 2159, 2164, - /* 720 */ 2214, 2181, 2183, 2219, 2198, 2201, 2199, 2202, 2204, 2206, + /* 40 */ 578, 578, 578, 578, 578, 578, 578, 578, 375, 514, + /* 50 */ 297, 134, 294, 32, 225, 32, 297, 297, 980, 980, + /* 60 */ 32, 980, 980, 186, 32, 108, 181, 235, 235, 181, + /* 70 */ 127, 127, 74, 388, 102, 102, 235, 235, 235, 235, + /* 80 */ 235, 235, 235, 327, 235, 235, 173, 108, 235, 235, + /* 90 */ 429, 235, 108, 235, 327, 235, 327, 108, 235, 235, + /* 100 */ 108, 235, 108, 108, 108, 235, 488, 795, 34, 34, + /* 110 */ 217, 304, 136, 136, 136, 136, 136, 136, 136, 136, + /* 120 */ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + /* 130 */ 136, 23, 93, 74, 388, 477, 650, 67, 67, 67, + /* 140 */ 610, 401, 401, 650, 449, 449, 449, 458, 427, 108, + /* 150 */ 611, 108, 611, 611, 644, 707, 218, 218, 218, 218, + /* 160 */ 218, 218, 218, 218, 500, 460, 36, 431, 184, 176, + /* 170 */ 623, 439, 867, 976, 210, 893, 964, 1039, 1003, 780, + /* 180 */ 869, 826, 780, 802, 878, 647, 1045, 1247, 1116, 1262, + /* 190 */ 1291, 1262, 1162, 1306, 1306, 1262, 1162, 1162, 1245, 1306, + /* 200 */ 1306, 1306, 1320, 1320, 1327, 173, 1330, 173, 1333, 1335, + /* 210 */ 173, 1333, 173, 173, 173, 1306, 173, 1305, 1305, 1320, + /* 220 */ 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + /* 230 */ 108, 1306, 1320, 611, 611, 1183, 1296, 1327, 488, 1217, + /* 240 */ 1330, 488, 1306, 1291, 1291, 611, 1159, 1163, 611, 1159, + /* 250 */ 1163, 611, 611, 108, 1157, 1246, 1159, 1167, 1171, 1187, + /* 260 */ 1045, 1164, 1175, 1179, 1202, 449, 1430, 1306, 1333, 488, + /* 270 */ 488, 1446, 1163, 611, 611, 611, 611, 611, 1163, 611, + /* 280 */ 1328, 488, 644, 488, 449, 1408, 1412, 611, 707, 1306, + /* 290 */ 488, 1476, 1320, 2952, 2952, 2952, 2952, 2952, 2952, 2952, + /* 300 */ 2952, 2952, 890, 21, 386, 589, 15, 709, 250, 549, + /* 310 */ 349, 743, 756, 788, 992, 992, 992, 992, 992, 992, + /* 320 */ 992, 992, 992, 498, 341, 25, 25, 230, 221, 376, + /* 330 */ 602, 517, 58, 369, 369, 340, 653, 239, 340, 340, + /* 340 */ 340, 993, 1056, 289, 1135, 968, 1019, 1053, 1079, 1092, + /* 350 */ 1083, 1174, 1186, 1043, 1122, 1124, 1139, 1146, 884, 943, + /* 360 */ 335, 293, 1148, 1156, 1165, 1168, 1169, 1170, 1215, 1176, + /* 370 */ 130, 1071, 1031, 1193, 1151, 1204, 1205, 1206, 1209, 1211, + /* 380 */ 1216, 3, 1198, 1234, 1158, 735, 1525, 1526, 1339, 1531, + /* 390 */ 1536, 1491, 1537, 1504, 1338, 1512, 1514, 1515, 1349, 1552, + /* 400 */ 1519, 1522, 1359, 1564, 1371, 1574, 1540, 1580, 1559, 1582, + /* 410 */ 1550, 1401, 1405, 1589, 1590, 1413, 1415, 1591, 1594, 1549, + /* 420 */ 1597, 1598, 1599, 1561, 1601, 1604, 1605, 1607, 1608, 1609, + /* 430 */ 1611, 1612, 1468, 1586, 1623, 1473, 1625, 1626, 1628, 1629, + /* 440 */ 1633, 1635, 1636, 1643, 1646, 1647, 1648, 1649, 1650, 1652, + /* 450 */ 1654, 1657, 1616, 1659, 1660, 1662, 1663, 1664, 1665, 1645, + /* 460 */ 1669, 1670, 1671, 1538, 1672, 1674, 1640, 1677, 1620, 1679, + /* 470 */ 1622, 1681, 1682, 1641, 1651, 1642, 1638, 1673, 1655, 1678, + /* 480 */ 1667, 1688, 1653, 1658, 1694, 1695, 1698, 1676, 1527, 1699, + /* 490 */ 1709, 1711, 1661, 1712, 1716, 1683, 1689, 1685, 1720, 1701, + /* 500 */ 1690, 1702, 1740, 1707, 1697, 1704, 1746, 1713, 1703, 1708, + /* 510 */ 1749, 1750, 1753, 1754, 1668, 1666, 1721, 1733, 1758, 1725, + /* 520 */ 1726, 1727, 1728, 1722, 1723, 1729, 1730, 1747, 1736, 1773, + /* 530 */ 1752, 1775, 1755, 1731, 1776, 1757, 1745, 1782, 1751, 1784, + /* 540 */ 1765, 1788, 1767, 1770, 1768, 1771, 1610, 1696, 1714, 1793, + /* 550 */ 1644, 1715, 1772, 1802, 1630, 1789, 1680, 1675, 1812, 1818, + /* 560 */ 1687, 1684, 1811, 1786, 1565, 1724, 1732, 1737, 1686, 1602, + /* 570 */ 1692, 1572, 1741, 1792, 1742, 1738, 1759, 1760, 1744, 1798, + /* 580 */ 1805, 1806, 1763, 1801, 1614, 1769, 1774, 1846, 1815, 1617, + /* 590 */ 1826, 1831, 1834, 1836, 1837, 1839, 1780, 1781, 1832, 1637, + /* 600 */ 1840, 1833, 1883, 1891, 1894, 1896, 1803, 1858, 1638, 1852, + /* 610 */ 1807, 1804, 1808, 1810, 1821, 1756, 1823, 1909, 1880, 1764, + /* 620 */ 1825, 1816, 1638, 1875, 1881, 1706, 1693, 1734, 1926, 1908, + /* 630 */ 1743, 1838, 1841, 1843, 1853, 1847, 1856, 1885, 1860, 1861, + /* 640 */ 1906, 1862, 1935, 1761, 1864, 1855, 1866, 1929, 1930, 1871, + /* 650 */ 1872, 1932, 1877, 1878, 1940, 1887, 1888, 1951, 1892, 1893, + /* 660 */ 1953, 1895, 1851, 1873, 1876, 1879, 1971, 1898, 1899, 1956, + /* 670 */ 1902, 1966, 1912, 1956, 1956, 1980, 1939, 1945, 1974, 1975, + /* 680 */ 1976, 1977, 1978, 1979, 1982, 1983, 1984, 1985, 1952, 1923, + /* 690 */ 1981, 1988, 1991, 1992, 2006, 1995, 1997, 1998, 1965, 1722, + /* 700 */ 2001, 1723, 2002, 2004, 2005, 2014, 2029, 2017, 2053, 2019, + /* 710 */ 2007, 2018, 2056, 2023, 2012, 2022, 2062, 2030, 2024, 2035, + /* 720 */ 2075, 2041, 2031, 2038, 2080, 2046, 2047, 2084, 2063, 2066, + /* 730 */ 2067, 2068, 2071, 2074, }; -#define YY_REDUCE_COUNT (299) -#define YY_REDUCE_MIN (-395) -#define YY_REDUCE_MAX (2289) +#define YY_REDUCE_COUNT (301) +#define YY_REDUCE_MIN (-435) +#define YY_REDUCE_MAX (2534) static const short yy_reduce_ofst[] = { - /* 0 */ -253, -301, -11, 277, 687, 745, 792, 849, 907, 937, - /* 10 */ 969, 1048, 1106, 1126, 1184, 1214, 75, 1231, 1288, 363, - /* 20 */ 775, 1335, 1352, 1407, 1430, 1462, 1509, 1533, 1599, 1621, - /* 30 */ 1646, 1709, 1737, 1767, 1799, 1831, 1863, 1888, 1920, 1982, - /* 40 */ 1999, 2056, 2078, 2144, 2168, 2232, 2257, 2289, -282, -336, - /* 50 */ 285, 396, 790, 829, 960, 1033, 651, 691, -354, -341, - /* 60 */ -378, -337, -226, -26, 208, -364, -266, 21, -375, -332, - /* 70 */ -326, -343, -369, -293, -182, 112, 198, 309, 357, 470, - /* 80 */ 479, 486, -32, 548, 549, -106, -280, 663, 678, -201, - /* 90 */ 693, -260, 699, 60, 727, 226, 484, 751, 794, 305, - /* 100 */ 666, 527, 336, 561, 812, 119, -283, -395, -395, -154, - /* 110 */ 187, -295, -22, -18, 166, 221, 384, 405, 410, 456, - /* 120 */ 555, 653, 684, 704, 706, 719, 736, 756, 801, 817, - /* 130 */ 292, -28, -82, 222, 179, 255, -28, 376, 418, 483, - /* 140 */ 258, 279, 424, 291, 440, 441, -162, 501, 522, 559, - /* 150 */ 473, 679, 681, 700, 414, 195, 260, 288, 353, 367, - /* 160 */ 399, 407, 443, -312, 566, 544, 459, 499, 752, 597, - /* 170 */ 757, 757, 777, 827, 798, 840, 854, 802, 802, 813, - /* 180 */ 802, 819, 806, 757, 889, 898, 920, 961, 973, 981, - /* 190 */ 990, 1032, 1036, 1004, 992, 1008, 1044, 1054, 1056, 1057, - /* 200 */ 1069, 1070, 1005, 1062, 1034, 1067, 1074, 1024, 1075, 1084, - /* 210 */ 1081, 1083, 1085, 1090, 1088, 1093, 1094, 1107, 1076, 1077, - /* 220 */ 1079, 1080, 1089, 1091, 1092, 1096, 1103, 1110, 1113, 1104, - /* 230 */ 1122, 1109, 1111, 1066, 1095, 1082, 1136, 1099, 1114, 1144, - /* 240 */ 1154, 1115, 1117, 1129, 1059, 1118, 1130, 1060, 1119, 1137, - /* 250 */ 1138, 757, 1073, 1078, 1086, 1101, 1087, 1108, 1142, 1100, - /* 260 */ 1120, 1116, 802, 1183, 1148, 1224, 1220, 1222, 1225, 1179, - /* 270 */ 1180, 1197, 1199, 1202, 1204, 1206, 1181, 1207, 1186, 1235, - /* 280 */ 1227, 1240, 1216, 1162, 1238, 1228, 1258, 1266, 1269, 1277, - /* 290 */ 1282, 1219, 1223, 1226, 1232, 1265, 1281, 1284, 1276, 1307, + /* 0 */ 276, -268, 720, 747, 812, 870, 903, 961, 1041, 1064, + /* 10 */ 1131, 1155, 1203, 1227, 1293, 1316, 291, 1384, 1410, 1475, + /* 20 */ 1500, 1533, 1566, 1631, 1656, 1718, 1735, 1795, 1814, 1874, + /* 30 */ 1890, 1907, 1970, 1986, 2042, 2065, 2129, 2156, 2204, 2220, + /* 40 */ 2268, 2316, 2339, 2372, 2395, 2459, 2486, 2534, -31, 107, + /* 50 */ -256, 105, 179, 444, 591, 599, 29, 417, -355, -318, + /* 60 */ 273, 479, 702, -435, 558, -296, 51, -201, 295, -375, + /* 70 */ -327, -28, -315, -289, 142, 188, -334, 191, 411, 487, + /* 80 */ 541, 542, 560, 215, 561, 652, 464, -212, 660, 675, + /* 90 */ -108, 685, 247, 693, 266, 711, 389, -350, 730, 745, + /* 100 */ 407, 748, -295, 459, 471, 749, -204, -305, 2, 2, + /* 110 */ -123, 106, 75, 315, 320, 447, 518, 622, 659, 692, + /* 120 */ 704, 705, 729, 755, 763, 772, 774, 783, 797, 800, + /* 130 */ 822, -219, -37, -60, 242, -164, 368, -37, 183, 203, + /* 140 */ 496, 357, 387, 392, 448, 553, 554, 240, 277, -301, + /* 150 */ 469, 547, 557, 612, 374, 636, -357, 453, 472, 495, + /* 160 */ 533, 712, 792, 533, -385, 760, 761, 801, 767, 804, + /* 170 */ 915, 811, 899, 899, 923, 885, 931, 898, 891, 837, + /* 180 */ 837, 829, 837, 849, 847, 899, 886, 892, 909, 928, + /* 190 */ 936, 942, 946, 991, 996, 950, 957, 959, 994, 1004, + /* 200 */ 1006, 1007, 1014, 1015, 951, 1005, 977, 1008, 1016, 963, + /* 210 */ 1017, 1020, 1018, 1022, 1023, 1025, 1024, 1029, 1037, 1028, + /* 220 */ 1021, 1026, 1027, 1032, 1034, 1035, 1036, 1038, 1042, 1044, + /* 230 */ 1046, 1047, 1048, 990, 1009, 986, 997, 1001, 1062, 1010, + /* 240 */ 1033, 1069, 1074, 1030, 1040, 1049, 966, 1050, 1052, 971, + /* 250 */ 1054, 1055, 1057, 899, 972, 978, 981, 984, 989, 998, + /* 260 */ 1059, 975, 987, 999, 837, 1081, 1063, 1125, 1121, 1120, + /* 270 */ 1127, 1087, 1094, 1110, 1112, 1114, 1117, 1123, 1101, 1128, + /* 280 */ 1113, 1154, 1141, 1161, 1132, 1078, 1144, 1136, 1160, 1177, + /* 290 */ 1172, 1184, 1180, 1126, 1118, 1129, 1130, 1166, 1173, 1181, + /* 300 */ 1182, 1195, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 10 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 20 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 30 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 40 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 50 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 60 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 70 */ 1634, 1891, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 80 */ 1634, 1634, 1634, 1634, 1634, 1712, 1634, 1634, 1634, 1634, - /* 90 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 100 */ 1634, 1634, 1634, 1634, 1634, 1710, 1884, 2093, 1634, 1634, - /* 110 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 120 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 130 */ 1634, 2105, 1634, 1634, 1712, 1634, 2105, 2105, 2105, 1710, - /* 140 */ 2065, 2065, 1634, 1634, 1634, 1634, 1819, 1634, 1634, 1634, - /* 150 */ 1634, 1634, 1634, 1819, 1634, 1634, 1634, 1634, 1634, 1634, - /* 160 */ 1634, 1634, 1936, 1634, 1634, 2130, 2184, 1634, 1634, 2133, - /* 170 */ 1634, 1634, 1634, 1896, 1634, 1772, 2120, 2097, 2111, 2168, - /* 180 */ 2098, 2095, 2114, 1634, 2124, 1634, 1929, 1889, 1634, 1889, - /* 190 */ 1886, 1634, 1634, 1889, 1886, 1886, 1763, 1634, 1634, 1634, - /* 200 */ 1634, 1634, 1634, 1712, 1634, 1712, 1634, 1634, 1712, 1634, - /* 210 */ 1712, 1712, 1712, 1634, 1712, 1691, 1691, 1634, 1634, 1634, - /* 220 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 230 */ 1634, 1634, 1634, 1951, 1942, 1634, 1710, 1938, 1634, 1710, - /* 240 */ 1634, 1634, 1634, 1634, 2141, 2139, 1634, 2141, 2139, 1634, - /* 250 */ 1634, 1634, 2153, 2149, 2141, 2157, 2155, 2126, 2124, 2187, - /* 260 */ 2174, 2170, 2111, 1634, 1634, 1634, 1634, 1710, 1710, 1634, - /* 270 */ 2139, 1634, 1634, 1634, 1634, 1634, 2139, 1634, 1634, 1710, - /* 280 */ 1634, 1710, 1634, 1634, 1788, 1634, 1634, 1634, 1710, 1666, - /* 290 */ 1634, 1931, 1944, 1914, 1914, 1822, 1822, 1822, 1713, 1639, - /* 300 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 310 */ 1634, 1634, 2152, 2151, 2020, 1634, 2069, 2068, 2067, 2058, - /* 320 */ 2019, 1784, 1634, 2018, 2017, 1634, 1634, 1634, 1634, 1634, - /* 330 */ 1634, 1905, 1904, 2011, 1634, 1634, 2012, 2010, 2009, 1634, - /* 340 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 350 */ 1634, 1634, 1634, 1634, 1634, 1634, 2171, 2175, 1634, 1634, - /* 360 */ 1634, 1634, 1634, 1634, 1634, 2094, 1634, 1634, 1634, 1634, - /* 370 */ 1634, 1993, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 380 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 390 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 400 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 410 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 420 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 430 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 440 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 450 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 460 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 470 */ 1634, 1634, 1671, 1998, 1634, 1634, 1634, 1634, 1634, 1634, - /* 480 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 490 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 500 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 510 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 520 */ 1751, 1750, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 530 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 540 */ 1634, 1634, 1634, 1634, 2002, 1634, 1634, 1634, 1634, 1634, - /* 550 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 2167, 2127, - /* 560 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 570 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1993, 1634, 2150, - /* 580 */ 1634, 1634, 2165, 1634, 2169, 1634, 1634, 1634, 1634, 1634, - /* 590 */ 1634, 1634, 2104, 2100, 1634, 1634, 2096, 1634, 1634, 1634, - /* 600 */ 1634, 1634, 1634, 1634, 2001, 1634, 1634, 1634, 1634, 1634, - /* 610 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1992, 1634, - /* 620 */ 2055, 1634, 1634, 1634, 2089, 1634, 1634, 2040, 1634, 1634, - /* 630 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 2002, 1634, 2005, - /* 640 */ 1634, 1634, 1634, 1634, 1634, 1816, 1634, 1634, 1634, 1634, - /* 650 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1801, 1799, - /* 660 */ 1798, 1797, 1634, 1794, 1634, 1829, 1634, 1634, 1634, 1825, - /* 670 */ 1824, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 680 */ 1634, 1634, 1634, 1634, 1634, 1634, 1731, 1634, 1634, 1634, - /* 690 */ 1634, 1634, 1634, 1634, 1634, 1723, 1634, 1722, 1634, 1634, - /* 700 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 710 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, - /* 720 */ 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, 1634, + /* 0 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 10 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 20 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 30 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 40 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 50 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 60 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 70 */ 1643, 1643, 1900, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 80 */ 1643, 1643, 1643, 1643, 1643, 1643, 1721, 1643, 1643, 1643, + /* 90 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 100 */ 1643, 1643, 1643, 1643, 1643, 1643, 1719, 1893, 2105, 1643, + /* 110 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 120 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 130 */ 1643, 1643, 2117, 1643, 1643, 1721, 1643, 2117, 2117, 2117, + /* 140 */ 1719, 2077, 2077, 1643, 1643, 1643, 1643, 1953, 1643, 1643, + /* 150 */ 1643, 1643, 1643, 1643, 1828, 1643, 1643, 1643, 1643, 1643, + /* 160 */ 1852, 1643, 1643, 1643, 1945, 1643, 1643, 2142, 2196, 1643, + /* 170 */ 1643, 2145, 1643, 1643, 1643, 1905, 1643, 1781, 2132, 2109, + /* 180 */ 2123, 2180, 2110, 2107, 2126, 1643, 2136, 1643, 1938, 1898, + /* 190 */ 1643, 1898, 1895, 1643, 1643, 1898, 1895, 1895, 1772, 1643, + /* 200 */ 1643, 1643, 1643, 1643, 1643, 1721, 1643, 1721, 1643, 1643, + /* 210 */ 1721, 1643, 1721, 1721, 1721, 1643, 1721, 1700, 1700, 1643, + /* 220 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 230 */ 1643, 1643, 1643, 1643, 1643, 1963, 1951, 1643, 1719, 1947, + /* 240 */ 1643, 1719, 1643, 1643, 1643, 1643, 2153, 2151, 1643, 2153, + /* 250 */ 2151, 1643, 1643, 1643, 2165, 2161, 2153, 2169, 2167, 2138, + /* 260 */ 2136, 2199, 2186, 2182, 2123, 1643, 1643, 1643, 1643, 1719, + /* 270 */ 1719, 1643, 2151, 1643, 1643, 1643, 1643, 1643, 2151, 1643, + /* 280 */ 1643, 1719, 1643, 1719, 1643, 1643, 1797, 1643, 1643, 1643, + /* 290 */ 1719, 1675, 1643, 1940, 1956, 1923, 1923, 1831, 1831, 1831, + /* 300 */ 1722, 1648, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 310 */ 1643, 1643, 1643, 1643, 2164, 2163, 2032, 1643, 2081, 2080, + /* 320 */ 2079, 2070, 2031, 1793, 1643, 2030, 2029, 1643, 1643, 1643, + /* 330 */ 1643, 1643, 1643, 1914, 1913, 2023, 1643, 1643, 2024, 2022, + /* 340 */ 2021, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 350 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 2183, + /* 360 */ 2187, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 2106, 1643, + /* 370 */ 1643, 1643, 1643, 1643, 2005, 1643, 1643, 1643, 1643, 1643, + /* 380 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 390 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 400 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 410 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 420 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 430 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 440 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 450 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 460 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 470 */ 1643, 1643, 1643, 1643, 1643, 1680, 2010, 1643, 1643, 1643, + /* 480 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 490 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 500 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 510 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 520 */ 1643, 1643, 1643, 1760, 1759, 1643, 1643, 1643, 1643, 1643, + /* 530 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 540 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 2014, 1643, 1643, + /* 550 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 560 */ 1643, 1643, 2179, 2139, 1643, 1643, 1643, 1643, 1643, 1643, + /* 570 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 580 */ 1643, 2005, 1643, 2162, 1643, 1643, 2177, 1643, 2181, 1643, + /* 590 */ 1643, 1643, 1643, 1643, 1643, 1643, 2116, 2112, 1643, 1643, + /* 600 */ 2108, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 2013, 1643, + /* 610 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 620 */ 1643, 1643, 2004, 1643, 2067, 1643, 1643, 1643, 2101, 1643, + /* 630 */ 1643, 2052, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 640 */ 1643, 2014, 1643, 2017, 1643, 1643, 1643, 1643, 1643, 1825, + /* 650 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 660 */ 1643, 1643, 1810, 1808, 1807, 1806, 1643, 1803, 1643, 1838, + /* 670 */ 1643, 1643, 1643, 1834, 1833, 1643, 1643, 1643, 1643, 1643, + /* 680 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 690 */ 1740, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1732, + /* 700 */ 1643, 1731, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 710 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 720 */ 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + /* 730 */ 1643, 1643, 1643, 1643, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1783,70 +1836,71 @@ static const char *const yyTokenName[] = { /* 398 */ "stream_name", /* 399 */ "stream_options", /* 400 */ "col_list_opt", - /* 401 */ "subtable_opt", - /* 402 */ "expression", - /* 403 */ "dnode_list", - /* 404 */ "where_clause_opt", - /* 405 */ "signed", - /* 406 */ "literal_func", - /* 407 */ "literal_list", - /* 408 */ "table_alias", - /* 409 */ "expr_or_subquery", - /* 410 */ "pseudo_column", - /* 411 */ "column_reference", - /* 412 */ "function_expression", - /* 413 */ "case_when_expression", - /* 414 */ "star_func", - /* 415 */ "star_func_para_list", - /* 416 */ "noarg_func", - /* 417 */ "other_para_list", - /* 418 */ "star_func_para", - /* 419 */ "when_then_list", - /* 420 */ "case_when_else_opt", - /* 421 */ "common_expression", - /* 422 */ "when_then_expr", - /* 423 */ "predicate", - /* 424 */ "compare_op", - /* 425 */ "in_op", - /* 426 */ "in_predicate_value", - /* 427 */ "boolean_value_expression", - /* 428 */ "boolean_primary", - /* 429 */ "from_clause_opt", - /* 430 */ "table_reference_list", - /* 431 */ "table_reference", - /* 432 */ "table_primary", - /* 433 */ "joined_table", - /* 434 */ "alias_opt", - /* 435 */ "subquery", - /* 436 */ "parenthesized_joined_table", - /* 437 */ "join_type", - /* 438 */ "search_condition", - /* 439 */ "query_specification", - /* 440 */ "set_quantifier_opt", - /* 441 */ "select_list", - /* 442 */ "partition_by_clause_opt", - /* 443 */ "range_opt", - /* 444 */ "every_opt", - /* 445 */ "fill_opt", - /* 446 */ "twindow_clause_opt", - /* 447 */ "group_by_clause_opt", - /* 448 */ "having_clause_opt", - /* 449 */ "select_item", - /* 450 */ "partition_list", - /* 451 */ "partition_item", - /* 452 */ "fill_mode", - /* 453 */ "group_by_list", - /* 454 */ "query_expression", - /* 455 */ "query_simple", - /* 456 */ "order_by_clause_opt", - /* 457 */ "slimit_clause_opt", - /* 458 */ "limit_clause_opt", - /* 459 */ "union_query_expression", - /* 460 */ "query_simple_or_subquery", - /* 461 */ "sort_specification_list", - /* 462 */ "sort_specification", - /* 463 */ "ordering_specification_opt", - /* 464 */ "null_ordering_opt", + /* 401 */ "tag_def_or_ref_opt", + /* 402 */ "subtable_opt", + /* 403 */ "expression", + /* 404 */ "dnode_list", + /* 405 */ "where_clause_opt", + /* 406 */ "signed", + /* 407 */ "literal_func", + /* 408 */ "literal_list", + /* 409 */ "table_alias", + /* 410 */ "expr_or_subquery", + /* 411 */ "pseudo_column", + /* 412 */ "column_reference", + /* 413 */ "function_expression", + /* 414 */ "case_when_expression", + /* 415 */ "star_func", + /* 416 */ "star_func_para_list", + /* 417 */ "noarg_func", + /* 418 */ "other_para_list", + /* 419 */ "star_func_para", + /* 420 */ "when_then_list", + /* 421 */ "case_when_else_opt", + /* 422 */ "common_expression", + /* 423 */ "when_then_expr", + /* 424 */ "predicate", + /* 425 */ "compare_op", + /* 426 */ "in_op", + /* 427 */ "in_predicate_value", + /* 428 */ "boolean_value_expression", + /* 429 */ "boolean_primary", + /* 430 */ "from_clause_opt", + /* 431 */ "table_reference_list", + /* 432 */ "table_reference", + /* 433 */ "table_primary", + /* 434 */ "joined_table", + /* 435 */ "alias_opt", + /* 436 */ "subquery", + /* 437 */ "parenthesized_joined_table", + /* 438 */ "join_type", + /* 439 */ "search_condition", + /* 440 */ "query_specification", + /* 441 */ "set_quantifier_opt", + /* 442 */ "select_list", + /* 443 */ "partition_by_clause_opt", + /* 444 */ "range_opt", + /* 445 */ "every_opt", + /* 446 */ "fill_opt", + /* 447 */ "twindow_clause_opt", + /* 448 */ "group_by_clause_opt", + /* 449 */ "having_clause_opt", + /* 450 */ "select_item", + /* 451 */ "partition_list", + /* 452 */ "partition_item", + /* 453 */ "fill_mode", + /* 454 */ "group_by_list", + /* 455 */ "query_expression", + /* 456 */ "query_simple", + /* 457 */ "order_by_clause_opt", + /* 458 */ "slimit_clause_opt", + /* 459 */ "limit_clause_opt", + /* 460 */ "union_query_expression", + /* 461 */ "query_simple_or_subquery", + /* 462 */ "sort_specification_list", + /* 463 */ "sort_specification", + /* 464 */ "ordering_specification_opt", + /* 465 */ "null_ordering_opt", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -2157,256 +2211,259 @@ static const char *const yyRuleName[] = { /* 300 */ "agg_func_opt ::= AGGREGATE", /* 301 */ "bufsize_opt ::=", /* 302 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 303 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tags_def_opt subtable_opt AS query_or_subquery", + /* 303 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery", /* 304 */ "cmd ::= DROP STREAM exists_opt stream_name", /* 305 */ "col_list_opt ::=", /* 306 */ "col_list_opt ::= NK_LP col_name_list NK_RP", - /* 307 */ "stream_options ::=", - /* 308 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 309 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 310 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 311 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 312 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 313 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", - /* 314 */ "subtable_opt ::=", - /* 315 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 316 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 317 */ "cmd ::= KILL QUERY NK_STRING", - /* 318 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 319 */ "cmd ::= BALANCE VGROUP", - /* 320 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 321 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 322 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 323 */ "dnode_list ::= DNODE NK_INTEGER", - /* 324 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 325 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 326 */ "cmd ::= query_or_subquery", - /* 327 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 328 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 329 */ "literal ::= NK_INTEGER", - /* 330 */ "literal ::= NK_FLOAT", - /* 331 */ "literal ::= NK_STRING", - /* 332 */ "literal ::= NK_BOOL", - /* 333 */ "literal ::= TIMESTAMP NK_STRING", - /* 334 */ "literal ::= duration_literal", - /* 335 */ "literal ::= NULL", - /* 336 */ "literal ::= NK_QUESTION", - /* 337 */ "duration_literal ::= NK_VARIABLE", - /* 338 */ "signed ::= NK_INTEGER", - /* 339 */ "signed ::= NK_PLUS NK_INTEGER", - /* 340 */ "signed ::= NK_MINUS NK_INTEGER", - /* 341 */ "signed ::= NK_FLOAT", - /* 342 */ "signed ::= NK_PLUS NK_FLOAT", - /* 343 */ "signed ::= NK_MINUS NK_FLOAT", - /* 344 */ "signed_literal ::= signed", - /* 345 */ "signed_literal ::= NK_STRING", - /* 346 */ "signed_literal ::= NK_BOOL", - /* 347 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 348 */ "signed_literal ::= duration_literal", - /* 349 */ "signed_literal ::= NULL", - /* 350 */ "signed_literal ::= literal_func", - /* 351 */ "signed_literal ::= NK_QUESTION", - /* 352 */ "literal_list ::= signed_literal", - /* 353 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 354 */ "db_name ::= NK_ID", - /* 355 */ "table_name ::= NK_ID", - /* 356 */ "column_name ::= NK_ID", - /* 357 */ "function_name ::= NK_ID", - /* 358 */ "table_alias ::= NK_ID", - /* 359 */ "column_alias ::= NK_ID", - /* 360 */ "user_name ::= NK_ID", - /* 361 */ "topic_name ::= NK_ID", - /* 362 */ "stream_name ::= NK_ID", - /* 363 */ "cgroup_name ::= NK_ID", - /* 364 */ "index_name ::= NK_ID", - /* 365 */ "expr_or_subquery ::= expression", - /* 366 */ "expression ::= literal", - /* 367 */ "expression ::= pseudo_column", - /* 368 */ "expression ::= column_reference", - /* 369 */ "expression ::= function_expression", - /* 370 */ "expression ::= case_when_expression", - /* 371 */ "expression ::= NK_LP expression NK_RP", - /* 372 */ "expression ::= NK_PLUS expr_or_subquery", - /* 373 */ "expression ::= NK_MINUS expr_or_subquery", - /* 374 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 375 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 376 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 377 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 378 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 379 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 380 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 381 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 382 */ "expression_list ::= expr_or_subquery", - /* 383 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 384 */ "column_reference ::= column_name", - /* 385 */ "column_reference ::= table_name NK_DOT column_name", - /* 386 */ "pseudo_column ::= ROWTS", - /* 387 */ "pseudo_column ::= TBNAME", - /* 388 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 389 */ "pseudo_column ::= QSTART", - /* 390 */ "pseudo_column ::= QEND", - /* 391 */ "pseudo_column ::= QDURATION", - /* 392 */ "pseudo_column ::= WSTART", - /* 393 */ "pseudo_column ::= WEND", - /* 394 */ "pseudo_column ::= WDURATION", - /* 395 */ "pseudo_column ::= IROWTS", - /* 396 */ "pseudo_column ::= ISFILLED", - /* 397 */ "pseudo_column ::= QTAGS", - /* 398 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 399 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 400 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 401 */ "function_expression ::= literal_func", - /* 402 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 403 */ "literal_func ::= NOW", - /* 404 */ "noarg_func ::= NOW", - /* 405 */ "noarg_func ::= TODAY", - /* 406 */ "noarg_func ::= TIMEZONE", - /* 407 */ "noarg_func ::= DATABASE", - /* 408 */ "noarg_func ::= CLIENT_VERSION", - /* 409 */ "noarg_func ::= SERVER_VERSION", - /* 410 */ "noarg_func ::= SERVER_STATUS", - /* 411 */ "noarg_func ::= CURRENT_USER", - /* 412 */ "noarg_func ::= USER", - /* 413 */ "star_func ::= COUNT", - /* 414 */ "star_func ::= FIRST", - /* 415 */ "star_func ::= LAST", - /* 416 */ "star_func ::= LAST_ROW", - /* 417 */ "star_func_para_list ::= NK_STAR", - /* 418 */ "star_func_para_list ::= other_para_list", - /* 419 */ "other_para_list ::= star_func_para", - /* 420 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 421 */ "star_func_para ::= expr_or_subquery", - /* 422 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 423 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 424 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 425 */ "when_then_list ::= when_then_expr", - /* 426 */ "when_then_list ::= when_then_list when_then_expr", - /* 427 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 428 */ "case_when_else_opt ::=", - /* 429 */ "case_when_else_opt ::= ELSE common_expression", - /* 430 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 431 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 432 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 433 */ "predicate ::= expr_or_subquery IS NULL", - /* 434 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 435 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 436 */ "compare_op ::= NK_LT", - /* 437 */ "compare_op ::= NK_GT", - /* 438 */ "compare_op ::= NK_LE", - /* 439 */ "compare_op ::= NK_GE", - /* 440 */ "compare_op ::= NK_NE", - /* 441 */ "compare_op ::= NK_EQ", - /* 442 */ "compare_op ::= LIKE", - /* 443 */ "compare_op ::= NOT LIKE", - /* 444 */ "compare_op ::= MATCH", - /* 445 */ "compare_op ::= NMATCH", - /* 446 */ "compare_op ::= CONTAINS", - /* 447 */ "in_op ::= IN", - /* 448 */ "in_op ::= NOT IN", - /* 449 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 450 */ "boolean_value_expression ::= boolean_primary", - /* 451 */ "boolean_value_expression ::= NOT boolean_primary", - /* 452 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 453 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 454 */ "boolean_primary ::= predicate", - /* 455 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 456 */ "common_expression ::= expr_or_subquery", - /* 457 */ "common_expression ::= boolean_value_expression", - /* 458 */ "from_clause_opt ::=", - /* 459 */ "from_clause_opt ::= FROM table_reference_list", - /* 460 */ "table_reference_list ::= table_reference", - /* 461 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 462 */ "table_reference ::= table_primary", - /* 463 */ "table_reference ::= joined_table", - /* 464 */ "table_primary ::= table_name alias_opt", - /* 465 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 466 */ "table_primary ::= subquery alias_opt", - /* 467 */ "table_primary ::= parenthesized_joined_table", - /* 468 */ "alias_opt ::=", - /* 469 */ "alias_opt ::= table_alias", - /* 470 */ "alias_opt ::= AS table_alias", - /* 471 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 472 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 473 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 474 */ "join_type ::=", - /* 475 */ "join_type ::= INNER", - /* 476 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 477 */ "set_quantifier_opt ::=", - /* 478 */ "set_quantifier_opt ::= DISTINCT", - /* 479 */ "set_quantifier_opt ::= ALL", - /* 480 */ "select_list ::= select_item", - /* 481 */ "select_list ::= select_list NK_COMMA select_item", - /* 482 */ "select_item ::= NK_STAR", - /* 483 */ "select_item ::= common_expression", - /* 484 */ "select_item ::= common_expression column_alias", - /* 485 */ "select_item ::= common_expression AS column_alias", - /* 486 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 487 */ "where_clause_opt ::=", - /* 488 */ "where_clause_opt ::= WHERE search_condition", - /* 489 */ "partition_by_clause_opt ::=", - /* 490 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 491 */ "partition_list ::= partition_item", - /* 492 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 493 */ "partition_item ::= expr_or_subquery", - /* 494 */ "partition_item ::= expr_or_subquery column_alias", - /* 495 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 496 */ "twindow_clause_opt ::=", - /* 497 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 498 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 499 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 500 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 501 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", - /* 502 */ "sliding_opt ::=", - /* 503 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 504 */ "fill_opt ::=", - /* 505 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 506 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 507 */ "fill_mode ::= NONE", - /* 508 */ "fill_mode ::= PREV", - /* 509 */ "fill_mode ::= NULL", - /* 510 */ "fill_mode ::= LINEAR", - /* 511 */ "fill_mode ::= NEXT", - /* 512 */ "group_by_clause_opt ::=", - /* 513 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 514 */ "group_by_list ::= expr_or_subquery", - /* 515 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 516 */ "having_clause_opt ::=", - /* 517 */ "having_clause_opt ::= HAVING search_condition", - /* 518 */ "range_opt ::=", - /* 519 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 520 */ "every_opt ::=", - /* 521 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 522 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 523 */ "query_simple ::= query_specification", - /* 524 */ "query_simple ::= union_query_expression", - /* 525 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 526 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 527 */ "query_simple_or_subquery ::= query_simple", - /* 528 */ "query_simple_or_subquery ::= subquery", - /* 529 */ "query_or_subquery ::= query_expression", - /* 530 */ "query_or_subquery ::= subquery", - /* 531 */ "order_by_clause_opt ::=", - /* 532 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 533 */ "slimit_clause_opt ::=", - /* 534 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 535 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 536 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 537 */ "limit_clause_opt ::=", - /* 538 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 539 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 540 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 541 */ "subquery ::= NK_LP query_expression NK_RP", - /* 542 */ "subquery ::= NK_LP subquery NK_RP", - /* 543 */ "search_condition ::= common_expression", - /* 544 */ "sort_specification_list ::= sort_specification", - /* 545 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 546 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 547 */ "ordering_specification_opt ::=", - /* 548 */ "ordering_specification_opt ::= ASC", - /* 549 */ "ordering_specification_opt ::= DESC", - /* 550 */ "null_ordering_opt ::=", - /* 551 */ "null_ordering_opt ::= NULLS FIRST", - /* 552 */ "null_ordering_opt ::= NULLS LAST", + /* 307 */ "tag_def_or_ref_opt ::=", + /* 308 */ "tag_def_or_ref_opt ::= tags_def", + /* 309 */ "tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP", + /* 310 */ "stream_options ::=", + /* 311 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 312 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 313 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 314 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 315 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 316 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER", + /* 317 */ "subtable_opt ::=", + /* 318 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 319 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 320 */ "cmd ::= KILL QUERY NK_STRING", + /* 321 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 322 */ "cmd ::= BALANCE VGROUP", + /* 323 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 324 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 325 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 326 */ "dnode_list ::= DNODE NK_INTEGER", + /* 327 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 328 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 329 */ "cmd ::= query_or_subquery", + /* 330 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 331 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 332 */ "literal ::= NK_INTEGER", + /* 333 */ "literal ::= NK_FLOAT", + /* 334 */ "literal ::= NK_STRING", + /* 335 */ "literal ::= NK_BOOL", + /* 336 */ "literal ::= TIMESTAMP NK_STRING", + /* 337 */ "literal ::= duration_literal", + /* 338 */ "literal ::= NULL", + /* 339 */ "literal ::= NK_QUESTION", + /* 340 */ "duration_literal ::= NK_VARIABLE", + /* 341 */ "signed ::= NK_INTEGER", + /* 342 */ "signed ::= NK_PLUS NK_INTEGER", + /* 343 */ "signed ::= NK_MINUS NK_INTEGER", + /* 344 */ "signed ::= NK_FLOAT", + /* 345 */ "signed ::= NK_PLUS NK_FLOAT", + /* 346 */ "signed ::= NK_MINUS NK_FLOAT", + /* 347 */ "signed_literal ::= signed", + /* 348 */ "signed_literal ::= NK_STRING", + /* 349 */ "signed_literal ::= NK_BOOL", + /* 350 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 351 */ "signed_literal ::= duration_literal", + /* 352 */ "signed_literal ::= NULL", + /* 353 */ "signed_literal ::= literal_func", + /* 354 */ "signed_literal ::= NK_QUESTION", + /* 355 */ "literal_list ::= signed_literal", + /* 356 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 357 */ "db_name ::= NK_ID", + /* 358 */ "table_name ::= NK_ID", + /* 359 */ "column_name ::= NK_ID", + /* 360 */ "function_name ::= NK_ID", + /* 361 */ "table_alias ::= NK_ID", + /* 362 */ "column_alias ::= NK_ID", + /* 363 */ "user_name ::= NK_ID", + /* 364 */ "topic_name ::= NK_ID", + /* 365 */ "stream_name ::= NK_ID", + /* 366 */ "cgroup_name ::= NK_ID", + /* 367 */ "index_name ::= NK_ID", + /* 368 */ "expr_or_subquery ::= expression", + /* 369 */ "expression ::= literal", + /* 370 */ "expression ::= pseudo_column", + /* 371 */ "expression ::= column_reference", + /* 372 */ "expression ::= function_expression", + /* 373 */ "expression ::= case_when_expression", + /* 374 */ "expression ::= NK_LP expression NK_RP", + /* 375 */ "expression ::= NK_PLUS expr_or_subquery", + /* 376 */ "expression ::= NK_MINUS expr_or_subquery", + /* 377 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 378 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 379 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 380 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 381 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 382 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 383 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 384 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 385 */ "expression_list ::= expr_or_subquery", + /* 386 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 387 */ "column_reference ::= column_name", + /* 388 */ "column_reference ::= table_name NK_DOT column_name", + /* 389 */ "pseudo_column ::= ROWTS", + /* 390 */ "pseudo_column ::= TBNAME", + /* 391 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 392 */ "pseudo_column ::= QSTART", + /* 393 */ "pseudo_column ::= QEND", + /* 394 */ "pseudo_column ::= QDURATION", + /* 395 */ "pseudo_column ::= WSTART", + /* 396 */ "pseudo_column ::= WEND", + /* 397 */ "pseudo_column ::= WDURATION", + /* 398 */ "pseudo_column ::= IROWTS", + /* 399 */ "pseudo_column ::= ISFILLED", + /* 400 */ "pseudo_column ::= QTAGS", + /* 401 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 402 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 403 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 404 */ "function_expression ::= literal_func", + /* 405 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 406 */ "literal_func ::= NOW", + /* 407 */ "noarg_func ::= NOW", + /* 408 */ "noarg_func ::= TODAY", + /* 409 */ "noarg_func ::= TIMEZONE", + /* 410 */ "noarg_func ::= DATABASE", + /* 411 */ "noarg_func ::= CLIENT_VERSION", + /* 412 */ "noarg_func ::= SERVER_VERSION", + /* 413 */ "noarg_func ::= SERVER_STATUS", + /* 414 */ "noarg_func ::= CURRENT_USER", + /* 415 */ "noarg_func ::= USER", + /* 416 */ "star_func ::= COUNT", + /* 417 */ "star_func ::= FIRST", + /* 418 */ "star_func ::= LAST", + /* 419 */ "star_func ::= LAST_ROW", + /* 420 */ "star_func_para_list ::= NK_STAR", + /* 421 */ "star_func_para_list ::= other_para_list", + /* 422 */ "other_para_list ::= star_func_para", + /* 423 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 424 */ "star_func_para ::= expr_or_subquery", + /* 425 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 426 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 427 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 428 */ "when_then_list ::= when_then_expr", + /* 429 */ "when_then_list ::= when_then_list when_then_expr", + /* 430 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 431 */ "case_when_else_opt ::=", + /* 432 */ "case_when_else_opt ::= ELSE common_expression", + /* 433 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 434 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 435 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 436 */ "predicate ::= expr_or_subquery IS NULL", + /* 437 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 438 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 439 */ "compare_op ::= NK_LT", + /* 440 */ "compare_op ::= NK_GT", + /* 441 */ "compare_op ::= NK_LE", + /* 442 */ "compare_op ::= NK_GE", + /* 443 */ "compare_op ::= NK_NE", + /* 444 */ "compare_op ::= NK_EQ", + /* 445 */ "compare_op ::= LIKE", + /* 446 */ "compare_op ::= NOT LIKE", + /* 447 */ "compare_op ::= MATCH", + /* 448 */ "compare_op ::= NMATCH", + /* 449 */ "compare_op ::= CONTAINS", + /* 450 */ "in_op ::= IN", + /* 451 */ "in_op ::= NOT IN", + /* 452 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 453 */ "boolean_value_expression ::= boolean_primary", + /* 454 */ "boolean_value_expression ::= NOT boolean_primary", + /* 455 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 456 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 457 */ "boolean_primary ::= predicate", + /* 458 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 459 */ "common_expression ::= expr_or_subquery", + /* 460 */ "common_expression ::= boolean_value_expression", + /* 461 */ "from_clause_opt ::=", + /* 462 */ "from_clause_opt ::= FROM table_reference_list", + /* 463 */ "table_reference_list ::= table_reference", + /* 464 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 465 */ "table_reference ::= table_primary", + /* 466 */ "table_reference ::= joined_table", + /* 467 */ "table_primary ::= table_name alias_opt", + /* 468 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 469 */ "table_primary ::= subquery alias_opt", + /* 470 */ "table_primary ::= parenthesized_joined_table", + /* 471 */ "alias_opt ::=", + /* 472 */ "alias_opt ::= table_alias", + /* 473 */ "alias_opt ::= AS table_alias", + /* 474 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 475 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 476 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 477 */ "join_type ::=", + /* 478 */ "join_type ::= INNER", + /* 479 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 480 */ "set_quantifier_opt ::=", + /* 481 */ "set_quantifier_opt ::= DISTINCT", + /* 482 */ "set_quantifier_opt ::= ALL", + /* 483 */ "select_list ::= select_item", + /* 484 */ "select_list ::= select_list NK_COMMA select_item", + /* 485 */ "select_item ::= NK_STAR", + /* 486 */ "select_item ::= common_expression", + /* 487 */ "select_item ::= common_expression column_alias", + /* 488 */ "select_item ::= common_expression AS column_alias", + /* 489 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 490 */ "where_clause_opt ::=", + /* 491 */ "where_clause_opt ::= WHERE search_condition", + /* 492 */ "partition_by_clause_opt ::=", + /* 493 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 494 */ "partition_list ::= partition_item", + /* 495 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 496 */ "partition_item ::= expr_or_subquery", + /* 497 */ "partition_item ::= expr_or_subquery column_alias", + /* 498 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 499 */ "twindow_clause_opt ::=", + /* 500 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 501 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 502 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 503 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 504 */ "twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition", + /* 505 */ "sliding_opt ::=", + /* 506 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 507 */ "fill_opt ::=", + /* 508 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 509 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 510 */ "fill_mode ::= NONE", + /* 511 */ "fill_mode ::= PREV", + /* 512 */ "fill_mode ::= NULL", + /* 513 */ "fill_mode ::= LINEAR", + /* 514 */ "fill_mode ::= NEXT", + /* 515 */ "group_by_clause_opt ::=", + /* 516 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 517 */ "group_by_list ::= expr_or_subquery", + /* 518 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 519 */ "having_clause_opt ::=", + /* 520 */ "having_clause_opt ::= HAVING search_condition", + /* 521 */ "range_opt ::=", + /* 522 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 523 */ "every_opt ::=", + /* 524 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 525 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 526 */ "query_simple ::= query_specification", + /* 527 */ "query_simple ::= union_query_expression", + /* 528 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 529 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 530 */ "query_simple_or_subquery ::= query_simple", + /* 531 */ "query_simple_or_subquery ::= subquery", + /* 532 */ "query_or_subquery ::= query_expression", + /* 533 */ "query_or_subquery ::= subquery", + /* 534 */ "order_by_clause_opt ::=", + /* 535 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 536 */ "slimit_clause_opt ::=", + /* 537 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 538 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 539 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 540 */ "limit_clause_opt ::=", + /* 541 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 542 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 543 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 544 */ "subquery ::= NK_LP query_expression NK_RP", + /* 545 */ "subquery ::= NK_LP subquery NK_RP", + /* 546 */ "search_condition ::= common_expression", + /* 547 */ "sort_specification_list ::= sort_specification", + /* 548 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 549 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 550 */ "ordering_specification_opt ::=", + /* 551 */ "ordering_specification_opt ::= ASC", + /* 552 */ "ordering_specification_opt ::= DESC", + /* 553 */ "null_ordering_opt ::=", + /* 554 */ "null_ordering_opt ::= NULLS FIRST", + /* 555 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -2562,49 +2619,49 @@ static void yy_destructor( case 392: /* query_or_subquery */ case 395: /* explain_options */ case 399: /* stream_options */ - case 401: /* subtable_opt */ - case 402: /* expression */ - case 404: /* where_clause_opt */ - case 405: /* signed */ - case 406: /* literal_func */ - case 409: /* expr_or_subquery */ - case 410: /* pseudo_column */ - case 411: /* column_reference */ - case 412: /* function_expression */ - case 413: /* case_when_expression */ - case 418: /* star_func_para */ - case 420: /* case_when_else_opt */ - case 421: /* common_expression */ - case 422: /* when_then_expr */ - case 423: /* predicate */ - case 426: /* in_predicate_value */ - case 427: /* boolean_value_expression */ - case 428: /* boolean_primary */ - case 429: /* from_clause_opt */ - case 430: /* table_reference_list */ - case 431: /* table_reference */ - case 432: /* table_primary */ - case 433: /* joined_table */ - case 435: /* subquery */ - case 436: /* parenthesized_joined_table */ - case 438: /* search_condition */ - case 439: /* query_specification */ - case 443: /* range_opt */ - case 444: /* every_opt */ - case 445: /* fill_opt */ - case 446: /* twindow_clause_opt */ - case 448: /* having_clause_opt */ - case 449: /* select_item */ - case 451: /* partition_item */ - case 454: /* query_expression */ - case 455: /* query_simple */ - case 457: /* slimit_clause_opt */ - case 458: /* limit_clause_opt */ - case 459: /* union_query_expression */ - case 460: /* query_simple_or_subquery */ - case 462: /* sort_specification */ + case 402: /* subtable_opt */ + case 403: /* expression */ + case 405: /* where_clause_opt */ + case 406: /* signed */ + case 407: /* literal_func */ + case 410: /* expr_or_subquery */ + case 411: /* pseudo_column */ + case 412: /* column_reference */ + case 413: /* function_expression */ + case 414: /* case_when_expression */ + case 419: /* star_func_para */ + case 421: /* case_when_else_opt */ + case 422: /* common_expression */ + case 423: /* when_then_expr */ + case 424: /* predicate */ + case 427: /* in_predicate_value */ + case 428: /* boolean_value_expression */ + case 429: /* boolean_primary */ + case 430: /* from_clause_opt */ + case 431: /* table_reference_list */ + case 432: /* table_reference */ + case 433: /* table_primary */ + case 434: /* joined_table */ + case 436: /* subquery */ + case 437: /* parenthesized_joined_table */ + case 439: /* search_condition */ + case 440: /* query_specification */ + case 444: /* range_opt */ + case 445: /* every_opt */ + case 446: /* fill_opt */ + case 447: /* twindow_clause_opt */ + case 449: /* having_clause_opt */ + case 450: /* select_item */ + case 452: /* partition_item */ + case 455: /* query_expression */ + case 456: /* query_simple */ + case 458: /* slimit_clause_opt */ + case 459: /* limit_clause_opt */ + case 460: /* union_query_expression */ + case 461: /* query_simple_or_subquery */ + case 463: /* sort_specification */ { - nodesDestroyNode((yypminor->yy602)); + nodesDestroyNode((yypminor->yy924)); } break; case 327: /* account_options */ @@ -2629,10 +2686,10 @@ static void yy_destructor( case 391: /* sma_func_name */ case 393: /* cgroup_name */ case 398: /* stream_name */ - case 408: /* table_alias */ - case 414: /* star_func */ - case 416: /* noarg_func */ - case 434: /* alias_opt */ + case 409: /* table_alias */ + case 415: /* star_func */ + case 417: /* noarg_func */ + case 435: /* alias_opt */ { } @@ -2654,7 +2711,7 @@ static void yy_destructor( case 343: /* exists_opt */ case 394: /* analyze_opt */ case 396: /* agg_func_opt */ - case 440: /* set_quantifier_opt */ + case 441: /* set_quantifier_opt */ { } @@ -2675,20 +2732,21 @@ static void yy_destructor( case 381: /* tag_list_opt */ case 387: /* func_list */ case 400: /* col_list_opt */ - case 403: /* dnode_list */ - case 407: /* literal_list */ - case 415: /* star_func_para_list */ - case 417: /* other_para_list */ - case 419: /* when_then_list */ - case 441: /* select_list */ - case 442: /* partition_by_clause_opt */ - case 447: /* group_by_clause_opt */ - case 450: /* partition_list */ - case 453: /* group_by_list */ - case 456: /* order_by_clause_opt */ - case 461: /* sort_specification_list */ + case 401: /* tag_def_or_ref_opt */ + case 404: /* dnode_list */ + case 408: /* literal_list */ + case 416: /* star_func_para_list */ + case 418: /* other_para_list */ + case 420: /* when_then_list */ + case 442: /* select_list */ + case 443: /* partition_by_clause_opt */ + case 448: /* group_by_clause_opt */ + case 451: /* partition_list */ + case 454: /* group_by_list */ + case 457: /* order_by_clause_opt */ + case 462: /* sort_specification_list */ { - nodesDestroyList((yypminor->yy874)); + nodesDestroyList((yypminor->yy776)); } break; case 349: /* alter_db_option */ @@ -2702,28 +2760,28 @@ static void yy_destructor( } break; - case 424: /* compare_op */ - case 425: /* in_op */ + case 425: /* compare_op */ + case 426: /* in_op */ { } break; - case 437: /* join_type */ + case 438: /* join_type */ { } break; - case 452: /* fill_mode */ + case 453: /* fill_mode */ { } break; - case 463: /* ordering_specification_opt */ + case 464: /* ordering_specification_opt */ { } break; - case 464: /* null_ordering_opt */ + case 465: /* null_ordering_opt */ { } @@ -3325,256 +3383,259 @@ static const struct { { 396, -1 }, /* (300) agg_func_opt ::= AGGREGATE */ { 397, 0 }, /* (301) bufsize_opt ::= */ { 397, -2 }, /* (302) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 326, -12 }, /* (303) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tags_def_opt subtable_opt AS query_or_subquery */ + { 326, -12 }, /* (303) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ { 326, -4 }, /* (304) cmd ::= DROP STREAM exists_opt stream_name */ { 400, 0 }, /* (305) col_list_opt ::= */ { 400, -3 }, /* (306) col_list_opt ::= NK_LP col_name_list NK_RP */ - { 399, 0 }, /* (307) stream_options ::= */ - { 399, -3 }, /* (308) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 399, -3 }, /* (309) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 399, -4 }, /* (310) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 399, -3 }, /* (311) stream_options ::= stream_options WATERMARK duration_literal */ - { 399, -4 }, /* (312) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 399, -3 }, /* (313) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ - { 401, 0 }, /* (314) subtable_opt ::= */ - { 401, -4 }, /* (315) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 326, -3 }, /* (316) cmd ::= KILL CONNECTION NK_INTEGER */ - { 326, -3 }, /* (317) cmd ::= KILL QUERY NK_STRING */ - { 326, -3 }, /* (318) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 326, -2 }, /* (319) cmd ::= BALANCE VGROUP */ - { 326, -4 }, /* (320) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 326, -4 }, /* (321) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 326, -3 }, /* (322) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 403, -2 }, /* (323) dnode_list ::= DNODE NK_INTEGER */ - { 403, -3 }, /* (324) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 326, -4 }, /* (325) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 326, -1 }, /* (326) cmd ::= query_or_subquery */ - { 326, -7 }, /* (327) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 326, -4 }, /* (328) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 329, -1 }, /* (329) literal ::= NK_INTEGER */ - { 329, -1 }, /* (330) literal ::= NK_FLOAT */ - { 329, -1 }, /* (331) literal ::= NK_STRING */ - { 329, -1 }, /* (332) literal ::= NK_BOOL */ - { 329, -2 }, /* (333) literal ::= TIMESTAMP NK_STRING */ - { 329, -1 }, /* (334) literal ::= duration_literal */ - { 329, -1 }, /* (335) literal ::= NULL */ - { 329, -1 }, /* (336) literal ::= NK_QUESTION */ - { 373, -1 }, /* (337) duration_literal ::= NK_VARIABLE */ - { 405, -1 }, /* (338) signed ::= NK_INTEGER */ - { 405, -2 }, /* (339) signed ::= NK_PLUS NK_INTEGER */ - { 405, -2 }, /* (340) signed ::= NK_MINUS NK_INTEGER */ - { 405, -1 }, /* (341) signed ::= NK_FLOAT */ - { 405, -2 }, /* (342) signed ::= NK_PLUS NK_FLOAT */ - { 405, -2 }, /* (343) signed ::= NK_MINUS NK_FLOAT */ - { 362, -1 }, /* (344) signed_literal ::= signed */ - { 362, -1 }, /* (345) signed_literal ::= NK_STRING */ - { 362, -1 }, /* (346) signed_literal ::= NK_BOOL */ - { 362, -2 }, /* (347) signed_literal ::= TIMESTAMP NK_STRING */ - { 362, -1 }, /* (348) signed_literal ::= duration_literal */ - { 362, -1 }, /* (349) signed_literal ::= NULL */ - { 362, -1 }, /* (350) signed_literal ::= literal_func */ - { 362, -1 }, /* (351) signed_literal ::= NK_QUESTION */ - { 407, -1 }, /* (352) literal_list ::= signed_literal */ - { 407, -3 }, /* (353) literal_list ::= literal_list NK_COMMA signed_literal */ - { 337, -1 }, /* (354) db_name ::= NK_ID */ - { 368, -1 }, /* (355) table_name ::= NK_ID */ - { 360, -1 }, /* (356) column_name ::= NK_ID */ - { 375, -1 }, /* (357) function_name ::= NK_ID */ - { 408, -1 }, /* (358) table_alias ::= NK_ID */ - { 383, -1 }, /* (359) column_alias ::= NK_ID */ - { 331, -1 }, /* (360) user_name ::= NK_ID */ - { 338, -1 }, /* (361) topic_name ::= NK_ID */ - { 398, -1 }, /* (362) stream_name ::= NK_ID */ - { 393, -1 }, /* (363) cgroup_name ::= NK_ID */ - { 386, -1 }, /* (364) index_name ::= NK_ID */ - { 409, -1 }, /* (365) expr_or_subquery ::= expression */ - { 402, -1 }, /* (366) expression ::= literal */ - { 402, -1 }, /* (367) expression ::= pseudo_column */ - { 402, -1 }, /* (368) expression ::= column_reference */ - { 402, -1 }, /* (369) expression ::= function_expression */ - { 402, -1 }, /* (370) expression ::= case_when_expression */ - { 402, -3 }, /* (371) expression ::= NK_LP expression NK_RP */ - { 402, -2 }, /* (372) expression ::= NK_PLUS expr_or_subquery */ - { 402, -2 }, /* (373) expression ::= NK_MINUS expr_or_subquery */ - { 402, -3 }, /* (374) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 402, -3 }, /* (375) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 402, -3 }, /* (376) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 402, -3 }, /* (377) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 402, -3 }, /* (378) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 402, -3 }, /* (379) expression ::= column_reference NK_ARROW NK_STRING */ - { 402, -3 }, /* (380) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 402, -3 }, /* (381) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 365, -1 }, /* (382) expression_list ::= expr_or_subquery */ - { 365, -3 }, /* (383) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 411, -1 }, /* (384) column_reference ::= column_name */ - { 411, -3 }, /* (385) column_reference ::= table_name NK_DOT column_name */ - { 410, -1 }, /* (386) pseudo_column ::= ROWTS */ - { 410, -1 }, /* (387) pseudo_column ::= TBNAME */ - { 410, -3 }, /* (388) pseudo_column ::= table_name NK_DOT TBNAME */ - { 410, -1 }, /* (389) pseudo_column ::= QSTART */ - { 410, -1 }, /* (390) pseudo_column ::= QEND */ - { 410, -1 }, /* (391) pseudo_column ::= QDURATION */ - { 410, -1 }, /* (392) pseudo_column ::= WSTART */ - { 410, -1 }, /* (393) pseudo_column ::= WEND */ - { 410, -1 }, /* (394) pseudo_column ::= WDURATION */ - { 410, -1 }, /* (395) pseudo_column ::= IROWTS */ - { 410, -1 }, /* (396) pseudo_column ::= ISFILLED */ - { 410, -1 }, /* (397) pseudo_column ::= QTAGS */ - { 412, -4 }, /* (398) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 412, -4 }, /* (399) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 412, -6 }, /* (400) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 412, -1 }, /* (401) function_expression ::= literal_func */ - { 406, -3 }, /* (402) literal_func ::= noarg_func NK_LP NK_RP */ - { 406, -1 }, /* (403) literal_func ::= NOW */ - { 416, -1 }, /* (404) noarg_func ::= NOW */ - { 416, -1 }, /* (405) noarg_func ::= TODAY */ - { 416, -1 }, /* (406) noarg_func ::= TIMEZONE */ - { 416, -1 }, /* (407) noarg_func ::= DATABASE */ - { 416, -1 }, /* (408) noarg_func ::= CLIENT_VERSION */ - { 416, -1 }, /* (409) noarg_func ::= SERVER_VERSION */ - { 416, -1 }, /* (410) noarg_func ::= SERVER_STATUS */ - { 416, -1 }, /* (411) noarg_func ::= CURRENT_USER */ - { 416, -1 }, /* (412) noarg_func ::= USER */ - { 414, -1 }, /* (413) star_func ::= COUNT */ - { 414, -1 }, /* (414) star_func ::= FIRST */ - { 414, -1 }, /* (415) star_func ::= LAST */ - { 414, -1 }, /* (416) star_func ::= LAST_ROW */ - { 415, -1 }, /* (417) star_func_para_list ::= NK_STAR */ - { 415, -1 }, /* (418) star_func_para_list ::= other_para_list */ - { 417, -1 }, /* (419) other_para_list ::= star_func_para */ - { 417, -3 }, /* (420) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 418, -1 }, /* (421) star_func_para ::= expr_or_subquery */ - { 418, -3 }, /* (422) star_func_para ::= table_name NK_DOT NK_STAR */ - { 413, -4 }, /* (423) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 413, -5 }, /* (424) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 419, -1 }, /* (425) when_then_list ::= when_then_expr */ - { 419, -2 }, /* (426) when_then_list ::= when_then_list when_then_expr */ - { 422, -4 }, /* (427) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 420, 0 }, /* (428) case_when_else_opt ::= */ - { 420, -2 }, /* (429) case_when_else_opt ::= ELSE common_expression */ - { 423, -3 }, /* (430) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 423, -5 }, /* (431) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 423, -6 }, /* (432) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 423, -3 }, /* (433) predicate ::= expr_or_subquery IS NULL */ - { 423, -4 }, /* (434) predicate ::= expr_or_subquery IS NOT NULL */ - { 423, -3 }, /* (435) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 424, -1 }, /* (436) compare_op ::= NK_LT */ - { 424, -1 }, /* (437) compare_op ::= NK_GT */ - { 424, -1 }, /* (438) compare_op ::= NK_LE */ - { 424, -1 }, /* (439) compare_op ::= NK_GE */ - { 424, -1 }, /* (440) compare_op ::= NK_NE */ - { 424, -1 }, /* (441) compare_op ::= NK_EQ */ - { 424, -1 }, /* (442) compare_op ::= LIKE */ - { 424, -2 }, /* (443) compare_op ::= NOT LIKE */ - { 424, -1 }, /* (444) compare_op ::= MATCH */ - { 424, -1 }, /* (445) compare_op ::= NMATCH */ - { 424, -1 }, /* (446) compare_op ::= CONTAINS */ - { 425, -1 }, /* (447) in_op ::= IN */ - { 425, -2 }, /* (448) in_op ::= NOT IN */ - { 426, -3 }, /* (449) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 427, -1 }, /* (450) boolean_value_expression ::= boolean_primary */ - { 427, -2 }, /* (451) boolean_value_expression ::= NOT boolean_primary */ - { 427, -3 }, /* (452) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 427, -3 }, /* (453) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 428, -1 }, /* (454) boolean_primary ::= predicate */ - { 428, -3 }, /* (455) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 421, -1 }, /* (456) common_expression ::= expr_or_subquery */ - { 421, -1 }, /* (457) common_expression ::= boolean_value_expression */ - { 429, 0 }, /* (458) from_clause_opt ::= */ - { 429, -2 }, /* (459) from_clause_opt ::= FROM table_reference_list */ - { 430, -1 }, /* (460) table_reference_list ::= table_reference */ - { 430, -3 }, /* (461) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 431, -1 }, /* (462) table_reference ::= table_primary */ - { 431, -1 }, /* (463) table_reference ::= joined_table */ - { 432, -2 }, /* (464) table_primary ::= table_name alias_opt */ - { 432, -4 }, /* (465) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 432, -2 }, /* (466) table_primary ::= subquery alias_opt */ - { 432, -1 }, /* (467) table_primary ::= parenthesized_joined_table */ - { 434, 0 }, /* (468) alias_opt ::= */ - { 434, -1 }, /* (469) alias_opt ::= table_alias */ - { 434, -2 }, /* (470) alias_opt ::= AS table_alias */ - { 436, -3 }, /* (471) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 436, -3 }, /* (472) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 433, -6 }, /* (473) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 437, 0 }, /* (474) join_type ::= */ - { 437, -1 }, /* (475) join_type ::= INNER */ - { 439, -12 }, /* (476) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 440, 0 }, /* (477) set_quantifier_opt ::= */ - { 440, -1 }, /* (478) set_quantifier_opt ::= DISTINCT */ - { 440, -1 }, /* (479) set_quantifier_opt ::= ALL */ - { 441, -1 }, /* (480) select_list ::= select_item */ - { 441, -3 }, /* (481) select_list ::= select_list NK_COMMA select_item */ - { 449, -1 }, /* (482) select_item ::= NK_STAR */ - { 449, -1 }, /* (483) select_item ::= common_expression */ - { 449, -2 }, /* (484) select_item ::= common_expression column_alias */ - { 449, -3 }, /* (485) select_item ::= common_expression AS column_alias */ - { 449, -3 }, /* (486) select_item ::= table_name NK_DOT NK_STAR */ - { 404, 0 }, /* (487) where_clause_opt ::= */ - { 404, -2 }, /* (488) where_clause_opt ::= WHERE search_condition */ - { 442, 0 }, /* (489) partition_by_clause_opt ::= */ - { 442, -3 }, /* (490) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 450, -1 }, /* (491) partition_list ::= partition_item */ - { 450, -3 }, /* (492) partition_list ::= partition_list NK_COMMA partition_item */ - { 451, -1 }, /* (493) partition_item ::= expr_or_subquery */ - { 451, -2 }, /* (494) partition_item ::= expr_or_subquery column_alias */ - { 451, -3 }, /* (495) partition_item ::= expr_or_subquery AS column_alias */ - { 446, 0 }, /* (496) twindow_clause_opt ::= */ - { 446, -6 }, /* (497) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 446, -4 }, /* (498) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 446, -6 }, /* (499) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 446, -8 }, /* (500) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 446, -7 }, /* (501) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ - { 388, 0 }, /* (502) sliding_opt ::= */ - { 388, -4 }, /* (503) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 445, 0 }, /* (504) fill_opt ::= */ - { 445, -4 }, /* (505) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 445, -6 }, /* (506) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 452, -1 }, /* (507) fill_mode ::= NONE */ - { 452, -1 }, /* (508) fill_mode ::= PREV */ - { 452, -1 }, /* (509) fill_mode ::= NULL */ - { 452, -1 }, /* (510) fill_mode ::= LINEAR */ - { 452, -1 }, /* (511) fill_mode ::= NEXT */ - { 447, 0 }, /* (512) group_by_clause_opt ::= */ - { 447, -3 }, /* (513) group_by_clause_opt ::= GROUP BY group_by_list */ - { 453, -1 }, /* (514) group_by_list ::= expr_or_subquery */ - { 453, -3 }, /* (515) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 448, 0 }, /* (516) having_clause_opt ::= */ - { 448, -2 }, /* (517) having_clause_opt ::= HAVING search_condition */ - { 443, 0 }, /* (518) range_opt ::= */ - { 443, -6 }, /* (519) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 444, 0 }, /* (520) every_opt ::= */ - { 444, -4 }, /* (521) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 454, -4 }, /* (522) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 455, -1 }, /* (523) query_simple ::= query_specification */ - { 455, -1 }, /* (524) query_simple ::= union_query_expression */ - { 459, -4 }, /* (525) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 459, -3 }, /* (526) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 460, -1 }, /* (527) query_simple_or_subquery ::= query_simple */ - { 460, -1 }, /* (528) query_simple_or_subquery ::= subquery */ - { 392, -1 }, /* (529) query_or_subquery ::= query_expression */ - { 392, -1 }, /* (530) query_or_subquery ::= subquery */ - { 456, 0 }, /* (531) order_by_clause_opt ::= */ - { 456, -3 }, /* (532) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 457, 0 }, /* (533) slimit_clause_opt ::= */ - { 457, -2 }, /* (534) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 457, -4 }, /* (535) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 457, -4 }, /* (536) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 458, 0 }, /* (537) limit_clause_opt ::= */ - { 458, -2 }, /* (538) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 458, -4 }, /* (539) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 458, -4 }, /* (540) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 435, -3 }, /* (541) subquery ::= NK_LP query_expression NK_RP */ - { 435, -3 }, /* (542) subquery ::= NK_LP subquery NK_RP */ - { 438, -1 }, /* (543) search_condition ::= common_expression */ - { 461, -1 }, /* (544) sort_specification_list ::= sort_specification */ - { 461, -3 }, /* (545) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 462, -3 }, /* (546) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 463, 0 }, /* (547) ordering_specification_opt ::= */ - { 463, -1 }, /* (548) ordering_specification_opt ::= ASC */ - { 463, -1 }, /* (549) ordering_specification_opt ::= DESC */ - { 464, 0 }, /* (550) null_ordering_opt ::= */ - { 464, -2 }, /* (551) null_ordering_opt ::= NULLS FIRST */ - { 464, -2 }, /* (552) null_ordering_opt ::= NULLS LAST */ + { 401, 0 }, /* (307) tag_def_or_ref_opt ::= */ + { 401, -1 }, /* (308) tag_def_or_ref_opt ::= tags_def */ + { 401, -4 }, /* (309) tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ + { 399, 0 }, /* (310) stream_options ::= */ + { 399, -3 }, /* (311) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 399, -3 }, /* (312) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 399, -4 }, /* (313) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 399, -3 }, /* (314) stream_options ::= stream_options WATERMARK duration_literal */ + { 399, -4 }, /* (315) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 399, -3 }, /* (316) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ + { 402, 0 }, /* (317) subtable_opt ::= */ + { 402, -4 }, /* (318) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 326, -3 }, /* (319) cmd ::= KILL CONNECTION NK_INTEGER */ + { 326, -3 }, /* (320) cmd ::= KILL QUERY NK_STRING */ + { 326, -3 }, /* (321) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 326, -2 }, /* (322) cmd ::= BALANCE VGROUP */ + { 326, -4 }, /* (323) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 326, -4 }, /* (324) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 326, -3 }, /* (325) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 404, -2 }, /* (326) dnode_list ::= DNODE NK_INTEGER */ + { 404, -3 }, /* (327) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 326, -4 }, /* (328) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 326, -1 }, /* (329) cmd ::= query_or_subquery */ + { 326, -7 }, /* (330) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 326, -4 }, /* (331) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 329, -1 }, /* (332) literal ::= NK_INTEGER */ + { 329, -1 }, /* (333) literal ::= NK_FLOAT */ + { 329, -1 }, /* (334) literal ::= NK_STRING */ + { 329, -1 }, /* (335) literal ::= NK_BOOL */ + { 329, -2 }, /* (336) literal ::= TIMESTAMP NK_STRING */ + { 329, -1 }, /* (337) literal ::= duration_literal */ + { 329, -1 }, /* (338) literal ::= NULL */ + { 329, -1 }, /* (339) literal ::= NK_QUESTION */ + { 373, -1 }, /* (340) duration_literal ::= NK_VARIABLE */ + { 406, -1 }, /* (341) signed ::= NK_INTEGER */ + { 406, -2 }, /* (342) signed ::= NK_PLUS NK_INTEGER */ + { 406, -2 }, /* (343) signed ::= NK_MINUS NK_INTEGER */ + { 406, -1 }, /* (344) signed ::= NK_FLOAT */ + { 406, -2 }, /* (345) signed ::= NK_PLUS NK_FLOAT */ + { 406, -2 }, /* (346) signed ::= NK_MINUS NK_FLOAT */ + { 362, -1 }, /* (347) signed_literal ::= signed */ + { 362, -1 }, /* (348) signed_literal ::= NK_STRING */ + { 362, -1 }, /* (349) signed_literal ::= NK_BOOL */ + { 362, -2 }, /* (350) signed_literal ::= TIMESTAMP NK_STRING */ + { 362, -1 }, /* (351) signed_literal ::= duration_literal */ + { 362, -1 }, /* (352) signed_literal ::= NULL */ + { 362, -1 }, /* (353) signed_literal ::= literal_func */ + { 362, -1 }, /* (354) signed_literal ::= NK_QUESTION */ + { 408, -1 }, /* (355) literal_list ::= signed_literal */ + { 408, -3 }, /* (356) literal_list ::= literal_list NK_COMMA signed_literal */ + { 337, -1 }, /* (357) db_name ::= NK_ID */ + { 368, -1 }, /* (358) table_name ::= NK_ID */ + { 360, -1 }, /* (359) column_name ::= NK_ID */ + { 375, -1 }, /* (360) function_name ::= NK_ID */ + { 409, -1 }, /* (361) table_alias ::= NK_ID */ + { 383, -1 }, /* (362) column_alias ::= NK_ID */ + { 331, -1 }, /* (363) user_name ::= NK_ID */ + { 338, -1 }, /* (364) topic_name ::= NK_ID */ + { 398, -1 }, /* (365) stream_name ::= NK_ID */ + { 393, -1 }, /* (366) cgroup_name ::= NK_ID */ + { 386, -1 }, /* (367) index_name ::= NK_ID */ + { 410, -1 }, /* (368) expr_or_subquery ::= expression */ + { 403, -1 }, /* (369) expression ::= literal */ + { 403, -1 }, /* (370) expression ::= pseudo_column */ + { 403, -1 }, /* (371) expression ::= column_reference */ + { 403, -1 }, /* (372) expression ::= function_expression */ + { 403, -1 }, /* (373) expression ::= case_when_expression */ + { 403, -3 }, /* (374) expression ::= NK_LP expression NK_RP */ + { 403, -2 }, /* (375) expression ::= NK_PLUS expr_or_subquery */ + { 403, -2 }, /* (376) expression ::= NK_MINUS expr_or_subquery */ + { 403, -3 }, /* (377) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 403, -3 }, /* (378) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 403, -3 }, /* (379) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 403, -3 }, /* (380) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 403, -3 }, /* (381) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 403, -3 }, /* (382) expression ::= column_reference NK_ARROW NK_STRING */ + { 403, -3 }, /* (383) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 403, -3 }, /* (384) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 365, -1 }, /* (385) expression_list ::= expr_or_subquery */ + { 365, -3 }, /* (386) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 412, -1 }, /* (387) column_reference ::= column_name */ + { 412, -3 }, /* (388) column_reference ::= table_name NK_DOT column_name */ + { 411, -1 }, /* (389) pseudo_column ::= ROWTS */ + { 411, -1 }, /* (390) pseudo_column ::= TBNAME */ + { 411, -3 }, /* (391) pseudo_column ::= table_name NK_DOT TBNAME */ + { 411, -1 }, /* (392) pseudo_column ::= QSTART */ + { 411, -1 }, /* (393) pseudo_column ::= QEND */ + { 411, -1 }, /* (394) pseudo_column ::= QDURATION */ + { 411, -1 }, /* (395) pseudo_column ::= WSTART */ + { 411, -1 }, /* (396) pseudo_column ::= WEND */ + { 411, -1 }, /* (397) pseudo_column ::= WDURATION */ + { 411, -1 }, /* (398) pseudo_column ::= IROWTS */ + { 411, -1 }, /* (399) pseudo_column ::= ISFILLED */ + { 411, -1 }, /* (400) pseudo_column ::= QTAGS */ + { 413, -4 }, /* (401) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 413, -4 }, /* (402) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 413, -6 }, /* (403) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 413, -1 }, /* (404) function_expression ::= literal_func */ + { 407, -3 }, /* (405) literal_func ::= noarg_func NK_LP NK_RP */ + { 407, -1 }, /* (406) literal_func ::= NOW */ + { 417, -1 }, /* (407) noarg_func ::= NOW */ + { 417, -1 }, /* (408) noarg_func ::= TODAY */ + { 417, -1 }, /* (409) noarg_func ::= TIMEZONE */ + { 417, -1 }, /* (410) noarg_func ::= DATABASE */ + { 417, -1 }, /* (411) noarg_func ::= CLIENT_VERSION */ + { 417, -1 }, /* (412) noarg_func ::= SERVER_VERSION */ + { 417, -1 }, /* (413) noarg_func ::= SERVER_STATUS */ + { 417, -1 }, /* (414) noarg_func ::= CURRENT_USER */ + { 417, -1 }, /* (415) noarg_func ::= USER */ + { 415, -1 }, /* (416) star_func ::= COUNT */ + { 415, -1 }, /* (417) star_func ::= FIRST */ + { 415, -1 }, /* (418) star_func ::= LAST */ + { 415, -1 }, /* (419) star_func ::= LAST_ROW */ + { 416, -1 }, /* (420) star_func_para_list ::= NK_STAR */ + { 416, -1 }, /* (421) star_func_para_list ::= other_para_list */ + { 418, -1 }, /* (422) other_para_list ::= star_func_para */ + { 418, -3 }, /* (423) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 419, -1 }, /* (424) star_func_para ::= expr_or_subquery */ + { 419, -3 }, /* (425) star_func_para ::= table_name NK_DOT NK_STAR */ + { 414, -4 }, /* (426) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 414, -5 }, /* (427) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 420, -1 }, /* (428) when_then_list ::= when_then_expr */ + { 420, -2 }, /* (429) when_then_list ::= when_then_list when_then_expr */ + { 423, -4 }, /* (430) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 421, 0 }, /* (431) case_when_else_opt ::= */ + { 421, -2 }, /* (432) case_when_else_opt ::= ELSE common_expression */ + { 424, -3 }, /* (433) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 424, -5 }, /* (434) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 424, -6 }, /* (435) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 424, -3 }, /* (436) predicate ::= expr_or_subquery IS NULL */ + { 424, -4 }, /* (437) predicate ::= expr_or_subquery IS NOT NULL */ + { 424, -3 }, /* (438) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 425, -1 }, /* (439) compare_op ::= NK_LT */ + { 425, -1 }, /* (440) compare_op ::= NK_GT */ + { 425, -1 }, /* (441) compare_op ::= NK_LE */ + { 425, -1 }, /* (442) compare_op ::= NK_GE */ + { 425, -1 }, /* (443) compare_op ::= NK_NE */ + { 425, -1 }, /* (444) compare_op ::= NK_EQ */ + { 425, -1 }, /* (445) compare_op ::= LIKE */ + { 425, -2 }, /* (446) compare_op ::= NOT LIKE */ + { 425, -1 }, /* (447) compare_op ::= MATCH */ + { 425, -1 }, /* (448) compare_op ::= NMATCH */ + { 425, -1 }, /* (449) compare_op ::= CONTAINS */ + { 426, -1 }, /* (450) in_op ::= IN */ + { 426, -2 }, /* (451) in_op ::= NOT IN */ + { 427, -3 }, /* (452) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 428, -1 }, /* (453) boolean_value_expression ::= boolean_primary */ + { 428, -2 }, /* (454) boolean_value_expression ::= NOT boolean_primary */ + { 428, -3 }, /* (455) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 428, -3 }, /* (456) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 429, -1 }, /* (457) boolean_primary ::= predicate */ + { 429, -3 }, /* (458) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 422, -1 }, /* (459) common_expression ::= expr_or_subquery */ + { 422, -1 }, /* (460) common_expression ::= boolean_value_expression */ + { 430, 0 }, /* (461) from_clause_opt ::= */ + { 430, -2 }, /* (462) from_clause_opt ::= FROM table_reference_list */ + { 431, -1 }, /* (463) table_reference_list ::= table_reference */ + { 431, -3 }, /* (464) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 432, -1 }, /* (465) table_reference ::= table_primary */ + { 432, -1 }, /* (466) table_reference ::= joined_table */ + { 433, -2 }, /* (467) table_primary ::= table_name alias_opt */ + { 433, -4 }, /* (468) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 433, -2 }, /* (469) table_primary ::= subquery alias_opt */ + { 433, -1 }, /* (470) table_primary ::= parenthesized_joined_table */ + { 435, 0 }, /* (471) alias_opt ::= */ + { 435, -1 }, /* (472) alias_opt ::= table_alias */ + { 435, -2 }, /* (473) alias_opt ::= AS table_alias */ + { 437, -3 }, /* (474) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 437, -3 }, /* (475) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 434, -6 }, /* (476) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 438, 0 }, /* (477) join_type ::= */ + { 438, -1 }, /* (478) join_type ::= INNER */ + { 440, -12 }, /* (479) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 441, 0 }, /* (480) set_quantifier_opt ::= */ + { 441, -1 }, /* (481) set_quantifier_opt ::= DISTINCT */ + { 441, -1 }, /* (482) set_quantifier_opt ::= ALL */ + { 442, -1 }, /* (483) select_list ::= select_item */ + { 442, -3 }, /* (484) select_list ::= select_list NK_COMMA select_item */ + { 450, -1 }, /* (485) select_item ::= NK_STAR */ + { 450, -1 }, /* (486) select_item ::= common_expression */ + { 450, -2 }, /* (487) select_item ::= common_expression column_alias */ + { 450, -3 }, /* (488) select_item ::= common_expression AS column_alias */ + { 450, -3 }, /* (489) select_item ::= table_name NK_DOT NK_STAR */ + { 405, 0 }, /* (490) where_clause_opt ::= */ + { 405, -2 }, /* (491) where_clause_opt ::= WHERE search_condition */ + { 443, 0 }, /* (492) partition_by_clause_opt ::= */ + { 443, -3 }, /* (493) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 451, -1 }, /* (494) partition_list ::= partition_item */ + { 451, -3 }, /* (495) partition_list ::= partition_list NK_COMMA partition_item */ + { 452, -1 }, /* (496) partition_item ::= expr_or_subquery */ + { 452, -2 }, /* (497) partition_item ::= expr_or_subquery column_alias */ + { 452, -3 }, /* (498) partition_item ::= expr_or_subquery AS column_alias */ + { 447, 0 }, /* (499) twindow_clause_opt ::= */ + { 447, -6 }, /* (500) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 447, -4 }, /* (501) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 447, -6 }, /* (502) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 447, -8 }, /* (503) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 447, -7 }, /* (504) twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ + { 388, 0 }, /* (505) sliding_opt ::= */ + { 388, -4 }, /* (506) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 446, 0 }, /* (507) fill_opt ::= */ + { 446, -4 }, /* (508) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 446, -6 }, /* (509) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 453, -1 }, /* (510) fill_mode ::= NONE */ + { 453, -1 }, /* (511) fill_mode ::= PREV */ + { 453, -1 }, /* (512) fill_mode ::= NULL */ + { 453, -1 }, /* (513) fill_mode ::= LINEAR */ + { 453, -1 }, /* (514) fill_mode ::= NEXT */ + { 448, 0 }, /* (515) group_by_clause_opt ::= */ + { 448, -3 }, /* (516) group_by_clause_opt ::= GROUP BY group_by_list */ + { 454, -1 }, /* (517) group_by_list ::= expr_or_subquery */ + { 454, -3 }, /* (518) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 449, 0 }, /* (519) having_clause_opt ::= */ + { 449, -2 }, /* (520) having_clause_opt ::= HAVING search_condition */ + { 444, 0 }, /* (521) range_opt ::= */ + { 444, -6 }, /* (522) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 445, 0 }, /* (523) every_opt ::= */ + { 445, -4 }, /* (524) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 455, -4 }, /* (525) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 456, -1 }, /* (526) query_simple ::= query_specification */ + { 456, -1 }, /* (527) query_simple ::= union_query_expression */ + { 460, -4 }, /* (528) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 460, -3 }, /* (529) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 461, -1 }, /* (530) query_simple_or_subquery ::= query_simple */ + { 461, -1 }, /* (531) query_simple_or_subquery ::= subquery */ + { 392, -1 }, /* (532) query_or_subquery ::= query_expression */ + { 392, -1 }, /* (533) query_or_subquery ::= subquery */ + { 457, 0 }, /* (534) order_by_clause_opt ::= */ + { 457, -3 }, /* (535) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 458, 0 }, /* (536) slimit_clause_opt ::= */ + { 458, -2 }, /* (537) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 458, -4 }, /* (538) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 458, -4 }, /* (539) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 459, 0 }, /* (540) limit_clause_opt ::= */ + { 459, -2 }, /* (541) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 459, -4 }, /* (542) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 459, -4 }, /* (543) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 436, -3 }, /* (544) subquery ::= NK_LP query_expression NK_RP */ + { 436, -3 }, /* (545) subquery ::= NK_LP subquery NK_RP */ + { 439, -1 }, /* (546) search_condition ::= common_expression */ + { 462, -1 }, /* (547) sort_specification_list ::= sort_specification */ + { 462, -3 }, /* (548) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 463, -3 }, /* (549) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 464, 0 }, /* (550) ordering_specification_opt ::= */ + { 464, -1 }, /* (551) ordering_specification_opt ::= ASC */ + { 464, -1 }, /* (552) ordering_specification_opt ::= DESC */ + { 465, 0 }, /* (553) null_ordering_opt ::= */ + { 465, -2 }, /* (554) null_ordering_opt ::= NULLS FIRST */ + { 465, -2 }, /* (555) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3711,78 +3772,78 @@ static YYACTIONTYPE yy_reduce( yy_destructor(yypParser,329,&yymsp[0].minor); break; case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */ -{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy179, &yymsp[-1].minor.yy0, yymsp[0].minor.yy113); } +{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy233, &yymsp[-1].minor.yy0, yymsp[0].minor.yy27); } break; case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy179, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy233, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); } break; case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy179, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy233, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); } break; case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */ -{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy179, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy233, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); } break; case 28: /* cmd ::= DROP USER user_name */ -{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy233); } break; case 29: /* sysinfo_opt ::= */ -{ yymsp[1].minor.yy113 = 1; } +{ yymsp[1].minor.yy27 = 1; } break; case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */ -{ yymsp[-1].minor.yy113 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy27 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); } break; case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */ -{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy159, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy129, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy233); } break; case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */ -{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy159, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy129, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy233); } break; case 33: /* privileges ::= ALL */ -{ yymsp[0].minor.yy159 = PRIVILEGE_TYPE_ALL; } +{ yymsp[0].minor.yy129 = PRIVILEGE_TYPE_ALL; } break; case 34: /* privileges ::= priv_type_list */ case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36); -{ yylhsminor.yy159 = yymsp[0].minor.yy159; } - yymsp[0].minor.yy159 = yylhsminor.yy159; +{ yylhsminor.yy129 = yymsp[0].minor.yy129; } + yymsp[0].minor.yy129 = yylhsminor.yy129; break; case 35: /* privileges ::= SUBSCRIBE */ -{ yymsp[0].minor.yy159 = PRIVILEGE_TYPE_SUBSCRIBE; } +{ yymsp[0].minor.yy129 = PRIVILEGE_TYPE_SUBSCRIBE; } break; case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */ -{ yylhsminor.yy159 = yymsp[-2].minor.yy159 | yymsp[0].minor.yy159; } - yymsp[-2].minor.yy159 = yylhsminor.yy159; +{ yylhsminor.yy129 = yymsp[-2].minor.yy129 | yymsp[0].minor.yy129; } + yymsp[-2].minor.yy129 = yylhsminor.yy129; break; case 38: /* priv_type ::= READ */ -{ yymsp[0].minor.yy159 = PRIVILEGE_TYPE_READ; } +{ yymsp[0].minor.yy129 = PRIVILEGE_TYPE_READ; } break; case 39: /* priv_type ::= WRITE */ -{ yymsp[0].minor.yy159 = PRIVILEGE_TYPE_WRITE; } +{ yymsp[0].minor.yy129 = PRIVILEGE_TYPE_WRITE; } break; case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */ -{ yylhsminor.yy179 = yymsp[-2].minor.yy0; } - yymsp[-2].minor.yy179 = yylhsminor.yy179; +{ yylhsminor.yy233 = yymsp[-2].minor.yy0; } + yymsp[-2].minor.yy233 = yylhsminor.yy233; break; case 41: /* priv_level ::= db_name NK_DOT NK_STAR */ -{ yylhsminor.yy179 = yymsp[-2].minor.yy179; } - yymsp[-2].minor.yy179 = yylhsminor.yy179; +{ yylhsminor.yy233 = yymsp[-2].minor.yy233; } + yymsp[-2].minor.yy233 = yylhsminor.yy233; break; case 42: /* priv_level ::= topic_name */ case 272: /* sma_func_name ::= function_name */ yytestcase(yyruleno==272); - case 469: /* alias_opt ::= table_alias */ yytestcase(yyruleno==469); -{ yylhsminor.yy179 = yymsp[0].minor.yy179; } - yymsp[0].minor.yy179 = yylhsminor.yy179; + case 472: /* alias_opt ::= table_alias */ yytestcase(yyruleno==472); +{ yylhsminor.yy233 = yymsp[0].minor.yy233; } + yymsp[0].minor.yy233 = yylhsminor.yy233; break; case 43: /* cmd ::= CREATE DNODE dnode_endpoint */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy179, NULL); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy233, NULL); } break; case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */ -{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy0); } +{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy0); } break; case 45: /* cmd ::= DROP DNODE NK_INTEGER force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy767); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy397); } break; case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */ -{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy179, yymsp[0].minor.yy767); } +{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy233, yymsp[0].minor.yy397); } break; case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */ { pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); } @@ -3803,46 +3864,46 @@ static YYACTIONTYPE yy_reduce( case 274: /* sma_func_name ::= FIRST */ yytestcase(yyruleno==274); case 275: /* sma_func_name ::= LAST */ yytestcase(yyruleno==275); case 276: /* sma_func_name ::= LAST_ROW */ yytestcase(yyruleno==276); - case 354: /* db_name ::= NK_ID */ yytestcase(yyruleno==354); - case 355: /* table_name ::= NK_ID */ yytestcase(yyruleno==355); - case 356: /* column_name ::= NK_ID */ yytestcase(yyruleno==356); - case 357: /* function_name ::= NK_ID */ yytestcase(yyruleno==357); - case 358: /* table_alias ::= NK_ID */ yytestcase(yyruleno==358); - case 359: /* column_alias ::= NK_ID */ yytestcase(yyruleno==359); - case 360: /* user_name ::= NK_ID */ yytestcase(yyruleno==360); - case 361: /* topic_name ::= NK_ID */ yytestcase(yyruleno==361); - case 362: /* stream_name ::= NK_ID */ yytestcase(yyruleno==362); - case 363: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==363); - case 364: /* index_name ::= NK_ID */ yytestcase(yyruleno==364); - case 404: /* noarg_func ::= NOW */ yytestcase(yyruleno==404); - case 405: /* noarg_func ::= TODAY */ yytestcase(yyruleno==405); - case 406: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==406); - case 407: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==407); - case 408: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==408); - case 409: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==409); - case 410: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==410); - case 411: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==411); - case 412: /* noarg_func ::= USER */ yytestcase(yyruleno==412); - case 413: /* star_func ::= COUNT */ yytestcase(yyruleno==413); - case 414: /* star_func ::= FIRST */ yytestcase(yyruleno==414); - case 415: /* star_func ::= LAST */ yytestcase(yyruleno==415); - case 416: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==416); -{ yylhsminor.yy179 = yymsp[0].minor.yy0; } - yymsp[0].minor.yy179 = yylhsminor.yy179; + case 357: /* db_name ::= NK_ID */ yytestcase(yyruleno==357); + case 358: /* table_name ::= NK_ID */ yytestcase(yyruleno==358); + case 359: /* column_name ::= NK_ID */ yytestcase(yyruleno==359); + case 360: /* function_name ::= NK_ID */ yytestcase(yyruleno==360); + case 361: /* table_alias ::= NK_ID */ yytestcase(yyruleno==361); + case 362: /* column_alias ::= NK_ID */ yytestcase(yyruleno==362); + case 363: /* user_name ::= NK_ID */ yytestcase(yyruleno==363); + case 364: /* topic_name ::= NK_ID */ yytestcase(yyruleno==364); + case 365: /* stream_name ::= NK_ID */ yytestcase(yyruleno==365); + case 366: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==366); + case 367: /* index_name ::= NK_ID */ yytestcase(yyruleno==367); + case 407: /* noarg_func ::= NOW */ yytestcase(yyruleno==407); + case 408: /* noarg_func ::= TODAY */ yytestcase(yyruleno==408); + case 409: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==409); + case 410: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==410); + case 411: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==411); + case 412: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==412); + case 413: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==413); + case 414: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==414); + case 415: /* noarg_func ::= USER */ yytestcase(yyruleno==415); + case 416: /* star_func ::= COUNT */ yytestcase(yyruleno==416); + case 417: /* star_func ::= FIRST */ yytestcase(yyruleno==417); + case 418: /* star_func ::= LAST */ yytestcase(yyruleno==418); + case 419: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==419); +{ yylhsminor.yy233 = yymsp[0].minor.yy0; } + yymsp[0].minor.yy233 = yylhsminor.yy233; break; case 54: /* force_opt ::= */ case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73); case 75: /* exists_opt ::= */ yytestcase(yyruleno==75); case 292: /* analyze_opt ::= */ yytestcase(yyruleno==292); case 299: /* agg_func_opt ::= */ yytestcase(yyruleno==299); - case 477: /* set_quantifier_opt ::= */ yytestcase(yyruleno==477); -{ yymsp[1].minor.yy767 = false; } + case 480: /* set_quantifier_opt ::= */ yytestcase(yyruleno==480); +{ yymsp[1].minor.yy397 = false; } break; case 55: /* force_opt ::= FORCE */ case 293: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==293); case 300: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==300); - case 478: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==478); -{ yymsp[0].minor.yy767 = true; } + case 481: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==481); +{ yymsp[0].minor.yy397 = true; } break; case 56: /* cmd ::= ALTER LOCAL NK_STRING */ { pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); } @@ -3875,206 +3936,206 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); } break; case 66: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */ -{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy767, &yymsp[-1].minor.yy179, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy397, &yymsp[-1].minor.yy233, yymsp[0].minor.yy924); } break; case 67: /* cmd ::= DROP DATABASE exists_opt db_name */ -{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy767, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy233); } break; case 68: /* cmd ::= USE db_name */ -{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy233); } break; case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */ -{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy179, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy233, yymsp[0].minor.yy924); } break; case 70: /* cmd ::= FLUSH DATABASE db_name */ -{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy233); } break; case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */ -{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy179, yymsp[0].minor.yy820); } +{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy233, yymsp[0].minor.yy832); } break; case 72: /* not_exists_opt ::= IF NOT EXISTS */ -{ yymsp[-2].minor.yy767 = true; } +{ yymsp[-2].minor.yy397 = true; } break; case 74: /* exists_opt ::= IF EXISTS */ -{ yymsp[-1].minor.yy767 = true; } +{ yymsp[-1].minor.yy397 = true; } break; case 76: /* db_options ::= */ -{ yymsp[1].minor.yy602 = createDefaultDatabaseOptions(pCxt); } +{ yymsp[1].minor.yy924 = createDefaultDatabaseOptions(pCxt); } break; case 77: /* db_options ::= db_options BUFFER NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 78: /* db_options ::= db_options CACHEMODEL NK_STRING */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 79: /* db_options ::= db_options CACHESIZE NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 80: /* db_options ::= db_options COMP NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_COMP, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_COMP, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 81: /* db_options ::= db_options DURATION NK_INTEGER */ case 82: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==82); -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_DAYS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 83: /* db_options ::= db_options MAXROWS NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 84: /* db_options ::= db_options MINROWS NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 85: /* db_options ::= db_options KEEP integer_list */ case 86: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==86); -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_KEEP, yymsp[0].minor.yy874); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_KEEP, yymsp[0].minor.yy776); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 87: /* db_options ::= db_options PAGES NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_PAGES, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 88: /* db_options ::= db_options PAGESIZE NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 89: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 90: /* db_options ::= db_options PRECISION NK_STRING */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 91: /* db_options ::= db_options REPLICA NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 92: /* db_options ::= db_options VGROUPS NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 93: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 94: /* db_options ::= db_options RETENTIONS retention_list */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_RETENTIONS, yymsp[0].minor.yy874); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_RETENTIONS, yymsp[0].minor.yy776); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 95: /* db_options ::= db_options SCHEMALESS NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 96: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_WAL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_WAL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 97: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 98: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-3].minor.yy602, DB_OPTION_WAL_RETENTION_PERIOD, &t); + yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-3].minor.yy924, DB_OPTION_WAL_RETENTION_PERIOD, &t); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; case 100: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-3].minor.yy602, DB_OPTION_WAL_RETENTION_SIZE, &t); + yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-3].minor.yy924, DB_OPTION_WAL_RETENTION_SIZE, &t); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; case 102: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 103: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 104: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 105: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 106: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */ -{ yylhsminor.yy602 = setDatabaseOption(pCxt, yymsp[-2].minor.yy602, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setDatabaseOption(pCxt, yymsp[-2].minor.yy924, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 107: /* alter_db_options ::= alter_db_option */ -{ yylhsminor.yy602 = createAlterDatabaseOptions(pCxt); yylhsminor.yy602 = setAlterDatabaseOption(pCxt, yylhsminor.yy602, &yymsp[0].minor.yy845); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterDatabaseOptions(pCxt); yylhsminor.yy924 = setAlterDatabaseOption(pCxt, yylhsminor.yy924, &yymsp[0].minor.yy257); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 108: /* alter_db_options ::= alter_db_options alter_db_option */ -{ yylhsminor.yy602 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy602, &yymsp[0].minor.yy845); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy924, &yymsp[0].minor.yy257); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; case 109: /* alter_db_option ::= BUFFER NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 110: /* alter_db_option ::= CACHEMODEL NK_STRING */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 111: /* alter_db_option ::= CACHESIZE NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 112: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 113: /* alter_db_option ::= KEEP integer_list */ case 114: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==114); -{ yymsp[-1].minor.yy845.type = DB_OPTION_KEEP; yymsp[-1].minor.yy845.pList = yymsp[0].minor.yy874; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_KEEP; yymsp[-1].minor.yy257.pList = yymsp[0].minor.yy776; } break; case 115: /* alter_db_option ::= PAGES NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_PAGES; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_PAGES; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 116: /* alter_db_option ::= REPLICA NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 117: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_WAL; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_WAL; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 118: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 119: /* integer_list ::= NK_INTEGER */ -{ yylhsminor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy874 = yylhsminor.yy874; +{ yylhsminor.yy776 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy776 = yylhsminor.yy776; break; case 120: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 324: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==324); -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy874 = yylhsminor.yy874; + case 327: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==327); +{ yylhsminor.yy776 = addNodeToList(pCxt, yymsp[-2].minor.yy776, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy776 = yylhsminor.yy776; break; case 121: /* variable_list ::= NK_VARIABLE */ -{ yylhsminor.yy874 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy874 = yylhsminor.yy874; +{ yylhsminor.yy776 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy776 = yylhsminor.yy776; break; case 122: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy874 = yylhsminor.yy874; +{ yylhsminor.yy776 = addNodeToList(pCxt, yymsp[-2].minor.yy776, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy776 = yylhsminor.yy776; break; case 123: /* retention_list ::= retention */ case 145: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==145); @@ -4084,14 +4145,14 @@ static YYACTIONTYPE yy_reduce( case 204: /* col_name_list ::= col_name */ yytestcase(yyruleno==204); case 255: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==255); case 269: /* func_list ::= func */ yytestcase(yyruleno==269); - case 352: /* literal_list ::= signed_literal */ yytestcase(yyruleno==352); - case 419: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==419); - case 425: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==425); - case 480: /* select_list ::= select_item */ yytestcase(yyruleno==480); - case 491: /* partition_list ::= partition_item */ yytestcase(yyruleno==491); - case 544: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==544); -{ yylhsminor.yy874 = createNodeList(pCxt, yymsp[0].minor.yy602); } - yymsp[0].minor.yy874 = yylhsminor.yy874; + case 355: /* literal_list ::= signed_literal */ yytestcase(yyruleno==355); + case 422: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==422); + case 428: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==428); + case 483: /* select_list ::= select_item */ yytestcase(yyruleno==483); + case 494: /* partition_list ::= partition_item */ yytestcase(yyruleno==494); + case 547: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==547); +{ yylhsminor.yy776 = createNodeList(pCxt, yymsp[0].minor.yy924); } + yymsp[0].minor.yy776 = yylhsminor.yy776; break; case 124: /* retention_list ::= retention_list NK_COMMA retention */ case 156: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==156); @@ -4099,273 +4160,276 @@ static YYACTIONTYPE yy_reduce( case 205: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==205); case 256: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==256); case 270: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==270); - case 353: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==353); - case 420: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==420); - case 481: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==481); - case 492: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==492); - case 545: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==545); -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, yymsp[0].minor.yy602); } - yymsp[-2].minor.yy874 = yylhsminor.yy874; + case 356: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==356); + case 423: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==423); + case 484: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==484); + case 495: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==495); + case 548: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==548); +{ yylhsminor.yy776 = addNodeToList(pCxt, yymsp[-2].minor.yy776, yymsp[0].minor.yy924); } + yymsp[-2].minor.yy776 = yylhsminor.yy776; break; case 125: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ -{ yylhsminor.yy602 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 126: /* speed_opt ::= */ case 301: /* bufsize_opt ::= */ yytestcase(yyruleno==301); -{ yymsp[1].minor.yy820 = 0; } +{ yymsp[1].minor.yy832 = 0; } break; case 127: /* speed_opt ::= MAX_SPEED NK_INTEGER */ case 302: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==302); -{ yymsp[-1].minor.yy820 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy832 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; case 128: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ case 130: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==130); -{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy767, yymsp[-5].minor.yy602, yymsp[-3].minor.yy874, yymsp[-1].minor.yy874, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-5].minor.yy924, yymsp[-3].minor.yy776, yymsp[-1].minor.yy776, yymsp[0].minor.yy924); } break; case 129: /* cmd ::= CREATE TABLE multi_create_clause */ -{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy874); } +{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy776); } break; case 131: /* cmd ::= DROP TABLE multi_drop_clause */ -{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy874); } +{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy776); } break; case 132: /* cmd ::= DROP STABLE exists_opt full_table_name */ -{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy767, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy924); } break; case 133: /* cmd ::= ALTER TABLE alter_table_clause */ - case 326: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==326); -{ pCxt->pRootNode = yymsp[0].minor.yy602; } + case 329: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==329); +{ pCxt->pRootNode = yymsp[0].minor.yy924; } break; case 134: /* cmd ::= ALTER STABLE alter_table_clause */ -{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy602); } +{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy924); } break; case 135: /* alter_table_clause ::= full_table_name alter_table_options */ -{ yylhsminor.yy602 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy602, yymsp[0].minor.yy602); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy924, yymsp[0].minor.yy924); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; case 136: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ -{ yylhsminor.yy602 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy602, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy179, yymsp[0].minor.yy394); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy924, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy233, yymsp[0].minor.yy852); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 137: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ -{ yylhsminor.yy602 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy602, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy179); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy924, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy233); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; case 138: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ -{ yylhsminor.yy602 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy602, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy179, yymsp[0].minor.yy394); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy924, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy233, yymsp[0].minor.yy852); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 139: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ -{ yylhsminor.yy602 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy602, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy179, &yymsp[0].minor.yy179); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy924, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy233, &yymsp[0].minor.yy233); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 140: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ -{ yylhsminor.yy602 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy602, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy179, yymsp[0].minor.yy394); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy924, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy233, yymsp[0].minor.yy852); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 141: /* alter_table_clause ::= full_table_name DROP TAG column_name */ -{ yylhsminor.yy602 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy602, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy179); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy924, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy233); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; case 142: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ -{ yylhsminor.yy602 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy602, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy179, yymsp[0].minor.yy394); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy924, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy233, yymsp[0].minor.yy852); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 143: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ -{ yylhsminor.yy602 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy602, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy179, &yymsp[0].minor.yy179); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy924, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy233, &yymsp[0].minor.yy233); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 144: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ -{ yylhsminor.yy602 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy602, &yymsp[-2].minor.yy179, yymsp[0].minor.yy602); } - yymsp[-5].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy924, &yymsp[-2].minor.yy233, yymsp[0].minor.yy924); } + yymsp[-5].minor.yy924 = yylhsminor.yy924; break; case 146: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ case 149: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==149); - case 426: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==426); -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-1].minor.yy874, yymsp[0].minor.yy602); } - yymsp[-1].minor.yy874 = yylhsminor.yy874; + case 429: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==429); +{ yylhsminor.yy776 = addNodeToList(pCxt, yymsp[-1].minor.yy776, yymsp[0].minor.yy924); } + yymsp[-1].minor.yy776 = yylhsminor.yy776; break; case 147: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ -{ yylhsminor.yy602 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy767, yymsp[-8].minor.yy602, yymsp[-6].minor.yy602, yymsp[-5].minor.yy874, yymsp[-2].minor.yy874, yymsp[0].minor.yy602); } - yymsp[-9].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy397, yymsp[-8].minor.yy924, yymsp[-6].minor.yy924, yymsp[-5].minor.yy776, yymsp[-2].minor.yy776, yymsp[0].minor.yy924); } + yymsp[-9].minor.yy924 = yylhsminor.yy924; break; case 150: /* drop_table_clause ::= exists_opt full_table_name */ -{ yylhsminor.yy602 = createDropTableClause(pCxt, yymsp[-1].minor.yy767, yymsp[0].minor.yy602); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createDropTableClause(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy924); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; case 151: /* specific_cols_opt ::= */ case 182: /* tags_def_opt ::= */ yytestcase(yyruleno==182); case 254: /* tag_list_opt ::= */ yytestcase(yyruleno==254); case 305: /* col_list_opt ::= */ yytestcase(yyruleno==305); - case 489: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==489); - case 512: /* group_by_clause_opt ::= */ yytestcase(yyruleno==512); - case 531: /* order_by_clause_opt ::= */ yytestcase(yyruleno==531); -{ yymsp[1].minor.yy874 = NULL; } + case 307: /* tag_def_or_ref_opt ::= */ yytestcase(yyruleno==307); + case 492: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==492); + case 515: /* group_by_clause_opt ::= */ yytestcase(yyruleno==515); + case 534: /* order_by_clause_opt ::= */ yytestcase(yyruleno==534); +{ yymsp[1].minor.yy776 = NULL; } break; case 152: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ case 306: /* col_list_opt ::= NK_LP col_name_list NK_RP */ yytestcase(yyruleno==306); -{ yymsp[-2].minor.yy874 = yymsp[-1].minor.yy874; } +{ yymsp[-2].minor.yy776 = yymsp[-1].minor.yy776; } break; case 153: /* full_table_name ::= table_name */ -{ yylhsminor.yy602 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy179, NULL); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy233, NULL); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 154: /* full_table_name ::= db_name NK_DOT table_name */ -{ yylhsminor.yy602 = createRealTableNode(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy179, NULL); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createRealTableNode(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy233, NULL); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 157: /* column_def ::= column_name type_name */ -{ yylhsminor.yy602 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy179, yymsp[0].minor.yy394, NULL); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy233, yymsp[0].minor.yy852, NULL); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; case 158: /* column_def ::= column_name type_name COMMENT NK_STRING */ -{ yylhsminor.yy602 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy179, yymsp[-2].minor.yy394, &yymsp[0].minor.yy0); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy233, yymsp[-2].minor.yy852, &yymsp[0].minor.yy0); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; case 159: /* type_name ::= BOOL */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_BOOL); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_BOOL); } break; case 160: /* type_name ::= TINYINT */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_TINYINT); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; case 161: /* type_name ::= SMALLINT */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_SMALLINT); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; case 162: /* type_name ::= INT */ case 163: /* type_name ::= INTEGER */ yytestcase(yyruleno==163); -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_INT); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_INT); } break; case 164: /* type_name ::= BIGINT */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_BIGINT); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; case 165: /* type_name ::= FLOAT */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_FLOAT); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; case 166: /* type_name ::= DOUBLE */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_DOUBLE); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; case 167: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy394 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy852 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; case 168: /* type_name ::= TIMESTAMP */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; case 169: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy394 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy852 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; case 170: /* type_name ::= TINYINT UNSIGNED */ -{ yymsp[-1].minor.yy394 = createDataType(TSDB_DATA_TYPE_UTINYINT); } +{ yymsp[-1].minor.yy852 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; case 171: /* type_name ::= SMALLINT UNSIGNED */ -{ yymsp[-1].minor.yy394 = createDataType(TSDB_DATA_TYPE_USMALLINT); } +{ yymsp[-1].minor.yy852 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; case 172: /* type_name ::= INT UNSIGNED */ -{ yymsp[-1].minor.yy394 = createDataType(TSDB_DATA_TYPE_UINT); } +{ yymsp[-1].minor.yy852 = createDataType(TSDB_DATA_TYPE_UINT); } break; case 173: /* type_name ::= BIGINT UNSIGNED */ -{ yymsp[-1].minor.yy394 = createDataType(TSDB_DATA_TYPE_UBIGINT); } +{ yymsp[-1].minor.yy852 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; case 174: /* type_name ::= JSON */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_JSON); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_JSON); } break; case 175: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy394 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy852 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; case 176: /* type_name ::= MEDIUMBLOB */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; case 177: /* type_name ::= BLOB */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_BLOB); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_BLOB); } break; case 178: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy394 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } +{ yymsp[-3].minor.yy852 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; case 179: /* type_name ::= DECIMAL */ -{ yymsp[0].minor.yy394 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[0].minor.yy852 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 180: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ -{ yymsp[-3].minor.yy394 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-3].minor.yy852 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ -{ yymsp[-5].minor.yy394 = createDataType(TSDB_DATA_TYPE_DECIMAL); } +{ yymsp[-5].minor.yy852 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; case 183: /* tags_def_opt ::= tags_def */ - case 418: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==418); -{ yylhsminor.yy874 = yymsp[0].minor.yy874; } - yymsp[0].minor.yy874 = yylhsminor.yy874; + case 308: /* tag_def_or_ref_opt ::= tags_def */ yytestcase(yyruleno==308); + case 421: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==421); +{ yylhsminor.yy776 = yymsp[0].minor.yy776; } + yymsp[0].minor.yy776 = yylhsminor.yy776; break; case 184: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ -{ yymsp[-3].minor.yy874 = yymsp[-1].minor.yy874; } + case 309: /* tag_def_or_ref_opt ::= TAGS NK_LP col_name_list NK_RP */ yytestcase(yyruleno==309); +{ yymsp[-3].minor.yy776 = yymsp[-1].minor.yy776; } break; case 185: /* table_options ::= */ -{ yymsp[1].minor.yy602 = createDefaultTableOptions(pCxt); } +{ yymsp[1].minor.yy924 = createDefaultTableOptions(pCxt); } break; case 186: /* table_options ::= table_options COMMENT NK_STRING */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-2].minor.yy602, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-2].minor.yy924, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 187: /* table_options ::= table_options MAX_DELAY duration_list */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-2].minor.yy602, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy874); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-2].minor.yy924, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy776); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 188: /* table_options ::= table_options WATERMARK duration_list */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-2].minor.yy602, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy874); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-2].minor.yy924, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy776); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 189: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-4].minor.yy602, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy874); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-4].minor.yy924, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy776); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 190: /* table_options ::= table_options TTL NK_INTEGER */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-2].minor.yy602, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-2].minor.yy924, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 191: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-4].minor.yy602, TABLE_OPTION_SMA, yymsp[-1].minor.yy874); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-4].minor.yy924, TABLE_OPTION_SMA, yymsp[-1].minor.yy776); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; case 192: /* table_options ::= table_options DELETE_MARK duration_list */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-2].minor.yy602, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy874); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-2].minor.yy924, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy776); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 193: /* alter_table_options ::= alter_table_option */ -{ yylhsminor.yy602 = createAlterTableOptions(pCxt); yylhsminor.yy602 = setTableOption(pCxt, yylhsminor.yy602, yymsp[0].minor.yy845.type, &yymsp[0].minor.yy845.val); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createAlterTableOptions(pCxt); yylhsminor.yy924 = setTableOption(pCxt, yylhsminor.yy924, yymsp[0].minor.yy257.type, &yymsp[0].minor.yy257.val); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 194: /* alter_table_options ::= alter_table_options alter_table_option */ -{ yylhsminor.yy602 = setTableOption(pCxt, yymsp[-1].minor.yy602, yymsp[0].minor.yy845.type, &yymsp[0].minor.yy845.val); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setTableOption(pCxt, yymsp[-1].minor.yy924, yymsp[0].minor.yy257.type, &yymsp[0].minor.yy257.val); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; case 195: /* alter_table_option ::= COMMENT NK_STRING */ -{ yymsp[-1].minor.yy845.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 196: /* alter_table_option ::= TTL NK_INTEGER */ -{ yymsp[-1].minor.yy845.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy845.val = yymsp[0].minor.yy0; } +{ yymsp[-1].minor.yy257.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy257.val = yymsp[0].minor.yy0; } break; case 197: /* duration_list ::= duration_literal */ - case 382: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==382); -{ yylhsminor.yy874 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy602)); } - yymsp[0].minor.yy874 = yylhsminor.yy874; + case 385: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==385); +{ yylhsminor.yy776 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy924)); } + yymsp[0].minor.yy776 = yylhsminor.yy776; break; case 198: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 383: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==383); -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, releaseRawExprNode(pCxt, yymsp[0].minor.yy602)); } - yymsp[-2].minor.yy874 = yylhsminor.yy874; + case 386: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==386); +{ yylhsminor.yy776 = addNodeToList(pCxt, yymsp[-2].minor.yy776, releaseRawExprNode(pCxt, yymsp[0].minor.yy924)); } + yymsp[-2].minor.yy776 = yylhsminor.yy776; break; case 201: /* rollup_func_name ::= function_name */ -{ yylhsminor.yy602 = createFunctionNode(pCxt, &yymsp[0].minor.yy179, NULL); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createFunctionNode(pCxt, &yymsp[0].minor.yy233, NULL); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 202: /* rollup_func_name ::= FIRST */ case 203: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==203); case 258: /* tag_item ::= QTAGS */ yytestcase(yyruleno==258); -{ yylhsminor.yy602 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 206: /* col_name ::= column_name */ case 259: /* tag_item ::= column_name */ yytestcase(yyruleno==259); -{ yylhsminor.yy602 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy179); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy233); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 207: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } @@ -4380,13 +4444,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; case 211: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy602, yymsp[0].minor.yy602, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy924, yymsp[0].minor.yy924, OP_TYPE_LIKE); } break; case 212: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy602, yymsp[0].minor.yy602, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy924, yymsp[0].minor.yy924, OP_TYPE_LIKE); } break; case 213: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy602, NULL, OP_TYPE_LIKE); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy924, NULL, OP_TYPE_LIKE); } break; case 214: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } @@ -4398,7 +4462,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; case 217: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy602, yymsp[-1].minor.yy602, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy924, yymsp[-1].minor.yy924, OP_TYPE_EQUAL); } break; case 218: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } @@ -4417,13 +4481,13 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; case 224: /* cmd ::= SHOW CREATE DATABASE db_name */ -{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy233); } break; case 225: /* cmd ::= SHOW CREATE TABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy924); } break; case 226: /* cmd ::= SHOW CREATE STABLE full_table_name */ -{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy924); } break; case 227: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } @@ -4442,7 +4506,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; case 233: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */ -{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy924); } break; case 234: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } @@ -4457,7 +4521,7 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; case 238: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ -{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy924); } break; case 239: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } @@ -4466,10 +4530,10 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; case 241: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy602, yymsp[-1].minor.yy602, OP_TYPE_EQUAL); } +{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy924, yymsp[-1].minor.yy924, OP_TYPE_EQUAL); } break; case 242: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */ -{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy602, yymsp[0].minor.yy602, yymsp[-3].minor.yy874); } +{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy924, yymsp[0].minor.yy924, yymsp[-3].minor.yy776); } break; case 243: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } @@ -4478,755 +4542,755 @@ static YYACTIONTYPE yy_reduce( { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; case 245: /* cmd ::= SHOW db_name_cond_opt ALIVE */ -{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy602, QUERY_NODE_SHOW_DB_ALIVE_STMT); } +{ pCxt->pRootNode = createShowAliveStmt(pCxt, yymsp[-1].minor.yy924, QUERY_NODE_SHOW_DB_ALIVE_STMT); } break; case 246: /* cmd ::= SHOW CLUSTER ALIVE */ { pCxt->pRootNode = createShowAliveStmt(pCxt, NULL, QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT); } break; case 247: /* db_name_cond_opt ::= */ case 252: /* from_db_opt ::= */ yytestcase(yyruleno==252); -{ yymsp[1].minor.yy602 = createDefaultDatabaseCondValue(pCxt); } +{ yymsp[1].minor.yy924 = createDefaultDatabaseCondValue(pCxt); } break; case 248: /* db_name_cond_opt ::= db_name NK_DOT */ -{ yylhsminor.yy602 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy179); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy233); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; case 249: /* like_pattern_opt ::= */ - case 314: /* subtable_opt ::= */ yytestcase(yyruleno==314); - case 428: /* case_when_else_opt ::= */ yytestcase(yyruleno==428); - case 458: /* from_clause_opt ::= */ yytestcase(yyruleno==458); - case 487: /* where_clause_opt ::= */ yytestcase(yyruleno==487); - case 496: /* twindow_clause_opt ::= */ yytestcase(yyruleno==496); - case 502: /* sliding_opt ::= */ yytestcase(yyruleno==502); - case 504: /* fill_opt ::= */ yytestcase(yyruleno==504); - case 516: /* having_clause_opt ::= */ yytestcase(yyruleno==516); - case 518: /* range_opt ::= */ yytestcase(yyruleno==518); - case 520: /* every_opt ::= */ yytestcase(yyruleno==520); - case 533: /* slimit_clause_opt ::= */ yytestcase(yyruleno==533); - case 537: /* limit_clause_opt ::= */ yytestcase(yyruleno==537); -{ yymsp[1].minor.yy602 = NULL; } + case 317: /* subtable_opt ::= */ yytestcase(yyruleno==317); + case 431: /* case_when_else_opt ::= */ yytestcase(yyruleno==431); + case 461: /* from_clause_opt ::= */ yytestcase(yyruleno==461); + case 490: /* where_clause_opt ::= */ yytestcase(yyruleno==490); + case 499: /* twindow_clause_opt ::= */ yytestcase(yyruleno==499); + case 505: /* sliding_opt ::= */ yytestcase(yyruleno==505); + case 507: /* fill_opt ::= */ yytestcase(yyruleno==507); + case 519: /* having_clause_opt ::= */ yytestcase(yyruleno==519); + case 521: /* range_opt ::= */ yytestcase(yyruleno==521); + case 523: /* every_opt ::= */ yytestcase(yyruleno==523); + case 536: /* slimit_clause_opt ::= */ yytestcase(yyruleno==536); + case 540: /* limit_clause_opt ::= */ yytestcase(yyruleno==540); +{ yymsp[1].minor.yy924 = NULL; } break; case 250: /* like_pattern_opt ::= LIKE NK_STRING */ -{ yymsp[-1].minor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } +{ yymsp[-1].minor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; case 251: /* table_name_cond ::= table_name */ -{ yylhsminor.yy602 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy179); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy233); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 253: /* from_db_opt ::= FROM db_name */ -{ yymsp[-1].minor.yy602 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy179); } +{ yymsp[-1].minor.yy924 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy233); } break; case 257: /* tag_item ::= TBNAME */ -{ yylhsminor.yy602 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 260: /* tag_item ::= column_name column_alias */ -{ yylhsminor.yy602 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy179), &yymsp[0].minor.yy179); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy233), &yymsp[0].minor.yy233); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; case 261: /* tag_item ::= column_name AS column_alias */ -{ yylhsminor.yy602 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy179), &yymsp[0].minor.yy179); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy233), &yymsp[0].minor.yy233); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 262: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy767, yymsp[-3].minor.yy602, yymsp[-1].minor.yy602, NULL, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy397, yymsp[-3].minor.yy924, yymsp[-1].minor.yy924, NULL, yymsp[0].minor.yy924); } break; case 263: /* cmd ::= CREATE INDEX not_exists_opt full_index_name ON full_table_name NK_LP col_name_list NK_RP */ -{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy767, yymsp[-5].minor.yy602, yymsp[-3].minor.yy602, yymsp[-1].minor.yy874, NULL); } +{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_NORMAL, yymsp[-6].minor.yy397, yymsp[-5].minor.yy924, yymsp[-3].minor.yy924, yymsp[-1].minor.yy776, NULL); } break; case 264: /* cmd ::= DROP INDEX exists_opt full_index_name */ -{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy767, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy397, yymsp[0].minor.yy924); } break; case 265: /* full_index_name ::= index_name */ -{ yylhsminor.yy602 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy179); } - yymsp[0].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy233); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; case 266: /* full_index_name ::= db_name NK_DOT index_name */ -{ yylhsminor.yy602 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy179); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy233); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 267: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-9].minor.yy602 = createIndexOption(pCxt, yymsp[-7].minor.yy874, releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), NULL, yymsp[-1].minor.yy602, yymsp[0].minor.yy602); } +{ yymsp[-9].minor.yy924 = createIndexOption(pCxt, yymsp[-7].minor.yy776, releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), NULL, yymsp[-1].minor.yy924, yymsp[0].minor.yy924); } break; case 268: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ -{ yymsp[-11].minor.yy602 = createIndexOption(pCxt, yymsp[-9].minor.yy874, releaseRawExprNode(pCxt, yymsp[-5].minor.yy602), releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), yymsp[-1].minor.yy602, yymsp[0].minor.yy602); } +{ yymsp[-11].minor.yy924 = createIndexOption(pCxt, yymsp[-9].minor.yy776, releaseRawExprNode(pCxt, yymsp[-5].minor.yy924), releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), yymsp[-1].minor.yy924, yymsp[0].minor.yy924); } break; case 271: /* func ::= sma_func_name NK_LP expression_list NK_RP */ -{ yylhsminor.yy602 = createFunctionNode(pCxt, &yymsp[-3].minor.yy179, yymsp[-1].minor.yy874); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = createFunctionNode(pCxt, &yymsp[-3].minor.yy233, yymsp[-1].minor.yy776); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; case 277: /* sma_stream_opt ::= */ - case 307: /* stream_options ::= */ yytestcase(yyruleno==307); -{ yymsp[1].minor.yy602 = createStreamOptions(pCxt); } + case 310: /* stream_options ::= */ yytestcase(yyruleno==310); +{ yymsp[1].minor.yy924 = createStreamOptions(pCxt); } break; case 278: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */ - case 311: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==311); -{ ((SStreamOptions*)yymsp[-2].minor.yy602)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy602); yylhsminor.yy602 = yymsp[-2].minor.yy602; } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 314: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==314); +{ ((SStreamOptions*)yymsp[-2].minor.yy924)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy924); yylhsminor.yy924 = yymsp[-2].minor.yy924; } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 279: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy602)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy602); yylhsminor.yy602 = yymsp[-2].minor.yy602; } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ ((SStreamOptions*)yymsp[-2].minor.yy924)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy924); yylhsminor.yy924 = yymsp[-2].minor.yy924; } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 280: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */ -{ ((SStreamOptions*)yymsp[-2].minor.yy602)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy602); yylhsminor.yy602 = yymsp[-2].minor.yy602; } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ ((SStreamOptions*)yymsp[-2].minor.yy924)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy924); yylhsminor.yy924 = yymsp[-2].minor.yy924; } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 281: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ -{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy767, &yymsp[-2].minor.yy179, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy233, yymsp[0].minor.yy924); } break; case 282: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy767, &yymsp[-3].minor.yy179, &yymsp[0].minor.yy179, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy233, &yymsp[0].minor.yy233, false); } break; case 283: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy767, &yymsp[-5].minor.yy179, &yymsp[0].minor.yy179, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy233, &yymsp[0].minor.yy233, true); } break; case 284: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy767, &yymsp[-3].minor.yy179, yymsp[0].minor.yy602, false); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy397, &yymsp[-3].minor.yy233, yymsp[0].minor.yy924, false); } break; case 285: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ -{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy767, &yymsp[-5].minor.yy179, yymsp[0].minor.yy602, true); } +{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy397, &yymsp[-5].minor.yy233, yymsp[0].minor.yy924, true); } break; case 286: /* cmd ::= DROP TOPIC exists_opt topic_name */ -{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy767, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy233); } break; case 287: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ -{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy767, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy397, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy233); } break; case 288: /* cmd ::= DESC full_table_name */ case 289: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==289); -{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy924); } break; case 290: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; case 291: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ -{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy767, yymsp[-1].minor.yy602, yymsp[0].minor.yy602); } +{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy397, yymsp[-1].minor.yy924, yymsp[0].minor.yy924); } break; case 294: /* explain_options ::= */ -{ yymsp[1].minor.yy602 = createDefaultExplainOptions(pCxt); } +{ yymsp[1].minor.yy924 = createDefaultExplainOptions(pCxt); } break; case 295: /* explain_options ::= explain_options VERBOSE NK_BOOL */ -{ yylhsminor.yy602 = setExplainVerbose(pCxt, yymsp[-2].minor.yy602, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setExplainVerbose(pCxt, yymsp[-2].minor.yy924, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 296: /* explain_options ::= explain_options RATIO NK_FLOAT */ -{ yylhsminor.yy602 = setExplainRatio(pCxt, yymsp[-2].minor.yy602, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; +{ yylhsminor.yy924 = setExplainRatio(pCxt, yymsp[-2].minor.yy924, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; case 297: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ -{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy767, yymsp[-8].minor.yy767, &yymsp[-5].minor.yy179, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy394, yymsp[0].minor.yy820); } +{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy397, yymsp[-8].minor.yy397, &yymsp[-5].minor.yy233, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy852, yymsp[0].minor.yy832); } break; case 298: /* cmd ::= DROP FUNCTION exists_opt function_name */ -{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy767, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy233); } break; - case 303: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tags_def_opt subtable_opt AS query_or_subquery */ -{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy767, &yymsp[-8].minor.yy179, yymsp[-5].minor.yy602, yymsp[-7].minor.yy602, yymsp[-3].minor.yy874, yymsp[-2].minor.yy602, yymsp[0].minor.yy602, yymsp[-4].minor.yy874); } + case 303: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name col_list_opt tag_def_or_ref_opt subtable_opt AS query_or_subquery */ +{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-9].minor.yy397, &yymsp[-8].minor.yy233, yymsp[-5].minor.yy924, yymsp[-7].minor.yy924, yymsp[-3].minor.yy776, yymsp[-2].minor.yy924, yymsp[0].minor.yy924, yymsp[-4].minor.yy776); } break; case 304: /* cmd ::= DROP STREAM exists_opt stream_name */ -{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy767, &yymsp[0].minor.yy179); } +{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy397, &yymsp[0].minor.yy233); } break; - case 308: /* stream_options ::= stream_options TRIGGER AT_ONCE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy602)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy602 = yymsp[-2].minor.yy602; } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 311: /* stream_options ::= stream_options TRIGGER AT_ONCE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy924)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy924 = yymsp[-2].minor.yy924; } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 309: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ -{ ((SStreamOptions*)yymsp[-2].minor.yy602)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy602 = yymsp[-2].minor.yy602; } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 312: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ +{ ((SStreamOptions*)yymsp[-2].minor.yy924)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy924 = yymsp[-2].minor.yy924; } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 310: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ -{ ((SStreamOptions*)yymsp[-3].minor.yy602)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy602)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy602); yylhsminor.yy602 = yymsp[-3].minor.yy602; } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + case 313: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ +{ ((SStreamOptions*)yymsp[-3].minor.yy924)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy924)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy924); yylhsminor.yy924 = yymsp[-3].minor.yy924; } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 312: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-3].minor.yy602)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy602 = yymsp[-3].minor.yy602; } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + case 315: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-3].minor.yy924)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy924 = yymsp[-3].minor.yy924; } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 313: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ -{ ((SStreamOptions*)yymsp[-2].minor.yy602)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy602 = yymsp[-2].minor.yy602; } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 316: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */ +{ ((SStreamOptions*)yymsp[-2].minor.yy924)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy924 = yymsp[-2].minor.yy924; } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 315: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 503: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==503); - case 521: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==521); -{ yymsp[-3].minor.yy602 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy602); } + case 318: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 506: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==506); + case 524: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==524); +{ yymsp[-3].minor.yy924 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy924); } break; - case 316: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 319: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 317: /* cmd ::= KILL QUERY NK_STRING */ + case 320: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 318: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 321: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 319: /* cmd ::= BALANCE VGROUP */ + case 322: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 320: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 323: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 321: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ -{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy874); } + case 324: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ +{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy776); } break; - case 322: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 325: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 323: /* dnode_list ::= DNODE NK_INTEGER */ -{ yymsp[-1].minor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } + case 326: /* dnode_list ::= DNODE NK_INTEGER */ +{ yymsp[-1].minor.yy776 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 325: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ -{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy602, yymsp[0].minor.yy602); } + case 328: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ +{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy924, yymsp[0].minor.yy924); } break; - case 327: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy602, yymsp[-2].minor.yy874, yymsp[0].minor.yy602); } + case 330: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy924, yymsp[-2].minor.yy776, yymsp[0].minor.yy924); } break; - case 328: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ -{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy602, NULL, yymsp[0].minor.yy602); } + case 331: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ +{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy924, NULL, yymsp[0].minor.yy924); } break; - case 329: /* literal ::= NK_INTEGER */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 332: /* literal ::= NK_INTEGER */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 330: /* literal ::= NK_FLOAT */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 333: /* literal ::= NK_FLOAT */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 331: /* literal ::= NK_STRING */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 334: /* literal ::= NK_STRING */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 332: /* literal ::= NK_BOOL */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 335: /* literal ::= NK_BOOL */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 333: /* literal ::= TIMESTAMP NK_STRING */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + case 336: /* literal ::= TIMESTAMP NK_STRING */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 334: /* literal ::= duration_literal */ - case 344: /* signed_literal ::= signed */ yytestcase(yyruleno==344); - case 365: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==365); - case 366: /* expression ::= literal */ yytestcase(yyruleno==366); - case 367: /* expression ::= pseudo_column */ yytestcase(yyruleno==367); - case 368: /* expression ::= column_reference */ yytestcase(yyruleno==368); - case 369: /* expression ::= function_expression */ yytestcase(yyruleno==369); - case 370: /* expression ::= case_when_expression */ yytestcase(yyruleno==370); - case 401: /* function_expression ::= literal_func */ yytestcase(yyruleno==401); - case 450: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==450); - case 454: /* boolean_primary ::= predicate */ yytestcase(yyruleno==454); - case 456: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==456); - case 457: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==457); - case 460: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==460); - case 462: /* table_reference ::= table_primary */ yytestcase(yyruleno==462); - case 463: /* table_reference ::= joined_table */ yytestcase(yyruleno==463); - case 467: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==467); - case 523: /* query_simple ::= query_specification */ yytestcase(yyruleno==523); - case 524: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==524); - case 527: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==527); - case 529: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==529); -{ yylhsminor.yy602 = yymsp[0].minor.yy602; } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 337: /* literal ::= duration_literal */ + case 347: /* signed_literal ::= signed */ yytestcase(yyruleno==347); + case 368: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==368); + case 369: /* expression ::= literal */ yytestcase(yyruleno==369); + case 370: /* expression ::= pseudo_column */ yytestcase(yyruleno==370); + case 371: /* expression ::= column_reference */ yytestcase(yyruleno==371); + case 372: /* expression ::= function_expression */ yytestcase(yyruleno==372); + case 373: /* expression ::= case_when_expression */ yytestcase(yyruleno==373); + case 404: /* function_expression ::= literal_func */ yytestcase(yyruleno==404); + case 453: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==453); + case 457: /* boolean_primary ::= predicate */ yytestcase(yyruleno==457); + case 459: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==459); + case 460: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==460); + case 463: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==463); + case 465: /* table_reference ::= table_primary */ yytestcase(yyruleno==465); + case 466: /* table_reference ::= joined_table */ yytestcase(yyruleno==466); + case 470: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==470); + case 526: /* query_simple ::= query_specification */ yytestcase(yyruleno==526); + case 527: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==527); + case 530: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==530); + case 532: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==532); +{ yylhsminor.yy924 = yymsp[0].minor.yy924; } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 335: /* literal ::= NULL */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 338: /* literal ::= NULL */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 336: /* literal ::= NK_QUESTION */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 339: /* literal ::= NK_QUESTION */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 337: /* duration_literal ::= NK_VARIABLE */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 340: /* duration_literal ::= NK_VARIABLE */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 338: /* signed ::= NK_INTEGER */ -{ yylhsminor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 341: /* signed ::= NK_INTEGER */ +{ yylhsminor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 339: /* signed ::= NK_PLUS NK_INTEGER */ -{ yymsp[-1].minor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } + case 342: /* signed ::= NK_PLUS NK_INTEGER */ +{ yymsp[-1].minor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 340: /* signed ::= NK_MINUS NK_INTEGER */ + case 343: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); + yylhsminor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 341: /* signed ::= NK_FLOAT */ -{ yylhsminor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 344: /* signed ::= NK_FLOAT */ +{ yylhsminor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 342: /* signed ::= NK_PLUS NK_FLOAT */ -{ yymsp[-1].minor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } + case 345: /* signed ::= NK_PLUS NK_FLOAT */ +{ yymsp[-1].minor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 343: /* signed ::= NK_MINUS NK_FLOAT */ + case 346: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; - yylhsminor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); + yylhsminor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 345: /* signed_literal ::= NK_STRING */ -{ yylhsminor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 348: /* signed_literal ::= NK_STRING */ +{ yylhsminor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 346: /* signed_literal ::= NK_BOOL */ -{ yylhsminor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 349: /* signed_literal ::= NK_BOOL */ +{ yylhsminor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 347: /* signed_literal ::= TIMESTAMP NK_STRING */ -{ yymsp[-1].minor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } + case 350: /* signed_literal ::= TIMESTAMP NK_STRING */ +{ yymsp[-1].minor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 348: /* signed_literal ::= duration_literal */ - case 350: /* signed_literal ::= literal_func */ yytestcase(yyruleno==350); - case 421: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==421); - case 483: /* select_item ::= common_expression */ yytestcase(yyruleno==483); - case 493: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==493); - case 528: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==528); - case 530: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==530); - case 543: /* search_condition ::= common_expression */ yytestcase(yyruleno==543); -{ yylhsminor.yy602 = releaseRawExprNode(pCxt, yymsp[0].minor.yy602); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 351: /* signed_literal ::= duration_literal */ + case 353: /* signed_literal ::= literal_func */ yytestcase(yyruleno==353); + case 424: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==424); + case 486: /* select_item ::= common_expression */ yytestcase(yyruleno==486); + case 496: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==496); + case 531: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==531); + case 533: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==533); + case 546: /* search_condition ::= common_expression */ yytestcase(yyruleno==546); +{ yylhsminor.yy924 = releaseRawExprNode(pCxt, yymsp[0].minor.yy924); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 349: /* signed_literal ::= NULL */ -{ yylhsminor.yy602 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 352: /* signed_literal ::= NULL */ +{ yylhsminor.yy924 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 351: /* signed_literal ::= NK_QUESTION */ -{ yylhsminor.yy602 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 354: /* signed_literal ::= NK_QUESTION */ +{ yylhsminor.yy924 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 371: /* expression ::= NK_LP expression NK_RP */ - case 455: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==455); - case 542: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==542); -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy602)); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 374: /* expression ::= NK_LP expression NK_RP */ + case 458: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==458); + case 545: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==545); +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy924)); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 372: /* expression ::= NK_PLUS expr_or_subquery */ + case 375: /* expression ::= NK_PLUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy602)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy924)); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 373: /* expression ::= NK_MINUS expr_or_subquery */ + case 376: /* expression ::= NK_MINUS expr_or_subquery */ { - SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy602), NULL)); + SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy924), NULL)); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 374: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 377: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 375: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 378: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 376: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 379: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 377: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 380: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 378: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 381: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 379: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 382: /* expression ::= column_reference NK_ARROW NK_STRING */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 380: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 383: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 381: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 384: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 384: /* column_reference ::= column_name */ -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy179, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy179)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 387: /* column_reference ::= column_name */ +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy233, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy233)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 385: /* column_reference ::= table_name NK_DOT column_name */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy179, createColumnNode(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy179)); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 388: /* column_reference ::= table_name NK_DOT column_name */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy233, createColumnNode(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy233)); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 386: /* pseudo_column ::= ROWTS */ - case 387: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==387); - case 389: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==389); - case 390: /* pseudo_column ::= QEND */ yytestcase(yyruleno==390); - case 391: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==391); - case 392: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==392); - case 393: /* pseudo_column ::= WEND */ yytestcase(yyruleno==393); - case 394: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==394); - case 395: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==395); - case 396: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==396); - case 397: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==397); - case 403: /* literal_func ::= NOW */ yytestcase(yyruleno==403); -{ yylhsminor.yy602 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 389: /* pseudo_column ::= ROWTS */ + case 390: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==390); + case 392: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==392); + case 393: /* pseudo_column ::= QEND */ yytestcase(yyruleno==393); + case 394: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==394); + case 395: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==395); + case 396: /* pseudo_column ::= WEND */ yytestcase(yyruleno==396); + case 397: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==397); + case 398: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==398); + case 399: /* pseudo_column ::= ISFILLED */ yytestcase(yyruleno==399); + case 400: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==400); + case 406: /* literal_func ::= NOW */ yytestcase(yyruleno==406); +{ yylhsminor.yy924 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 388: /* pseudo_column ::= table_name NK_DOT TBNAME */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy179)))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 391: /* pseudo_column ::= table_name NK_DOT TBNAME */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy233)))); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 398: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 399: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==399); -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy179, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy179, yymsp[-1].minor.yy874)); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + case 401: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 402: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==402); +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy233, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy233, yymsp[-1].minor.yy776)); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 400: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), yymsp[-1].minor.yy394)); } - yymsp[-5].minor.yy602 = yylhsminor.yy602; + case 403: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), yymsp[-1].minor.yy852)); } + yymsp[-5].minor.yy924 = yylhsminor.yy924; break; - case 402: /* literal_func ::= noarg_func NK_LP NK_RP */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy179, NULL)); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 405: /* literal_func ::= noarg_func NK_LP NK_RP */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy233, NULL)); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 417: /* star_func_para_list ::= NK_STAR */ -{ yylhsminor.yy874 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } - yymsp[0].minor.yy874 = yylhsminor.yy874; + case 420: /* star_func_para_list ::= NK_STAR */ +{ yylhsminor.yy776 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } + yymsp[0].minor.yy776 = yylhsminor.yy776; break; - case 422: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 486: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==486); -{ yylhsminor.yy602 = createColumnNode(pCxt, &yymsp[-2].minor.yy179, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 425: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 489: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==489); +{ yylhsminor.yy924 = createColumnNode(pCxt, &yymsp[-2].minor.yy233, &yymsp[0].minor.yy0); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 423: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy874, yymsp[-1].minor.yy602)); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + case 426: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy776, yymsp[-1].minor.yy924)); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 424: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), yymsp[-2].minor.yy874, yymsp[-1].minor.yy602)); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; + case 427: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), yymsp[-2].minor.yy776, yymsp[-1].minor.yy924)); } + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; - case 427: /* when_then_expr ::= WHEN common_expression THEN common_expression */ -{ yymsp[-3].minor.yy602 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602)); } + case 430: /* when_then_expr ::= WHEN common_expression THEN common_expression */ +{ yymsp[-3].minor.yy924 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924)); } break; - case 429: /* case_when_else_opt ::= ELSE common_expression */ -{ yymsp[-1].minor.yy602 = releaseRawExprNode(pCxt, yymsp[0].minor.yy602); } + case 432: /* case_when_else_opt ::= ELSE common_expression */ +{ yymsp[-1].minor.yy924 = releaseRawExprNode(pCxt, yymsp[0].minor.yy924); } break; - case 430: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 435: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==435); + case 433: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 438: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==438); { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy290, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy856, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 431: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 434: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy602), releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy924), releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-4].minor.yy602 = yylhsminor.yy602; + yymsp[-4].minor.yy924 = yylhsminor.yy924; break; - case 432: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 435: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy602), releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy924), releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-5].minor.yy602 = yylhsminor.yy602; + yymsp[-5].minor.yy924 = yylhsminor.yy924; break; - case 433: /* predicate ::= expr_or_subquery IS NULL */ + case 436: /* predicate ::= expr_or_subquery IS NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), NULL)); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 434: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 437: /* predicate ::= expr_or_subquery IS NOT NULL */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), NULL)); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), NULL)); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 436: /* compare_op ::= NK_LT */ -{ yymsp[0].minor.yy290 = OP_TYPE_LOWER_THAN; } + case 439: /* compare_op ::= NK_LT */ +{ yymsp[0].minor.yy856 = OP_TYPE_LOWER_THAN; } break; - case 437: /* compare_op ::= NK_GT */ -{ yymsp[0].minor.yy290 = OP_TYPE_GREATER_THAN; } + case 440: /* compare_op ::= NK_GT */ +{ yymsp[0].minor.yy856 = OP_TYPE_GREATER_THAN; } break; - case 438: /* compare_op ::= NK_LE */ -{ yymsp[0].minor.yy290 = OP_TYPE_LOWER_EQUAL; } + case 441: /* compare_op ::= NK_LE */ +{ yymsp[0].minor.yy856 = OP_TYPE_LOWER_EQUAL; } break; - case 439: /* compare_op ::= NK_GE */ -{ yymsp[0].minor.yy290 = OP_TYPE_GREATER_EQUAL; } + case 442: /* compare_op ::= NK_GE */ +{ yymsp[0].minor.yy856 = OP_TYPE_GREATER_EQUAL; } break; - case 440: /* compare_op ::= NK_NE */ -{ yymsp[0].minor.yy290 = OP_TYPE_NOT_EQUAL; } + case 443: /* compare_op ::= NK_NE */ +{ yymsp[0].minor.yy856 = OP_TYPE_NOT_EQUAL; } break; - case 441: /* compare_op ::= NK_EQ */ -{ yymsp[0].minor.yy290 = OP_TYPE_EQUAL; } + case 444: /* compare_op ::= NK_EQ */ +{ yymsp[0].minor.yy856 = OP_TYPE_EQUAL; } break; - case 442: /* compare_op ::= LIKE */ -{ yymsp[0].minor.yy290 = OP_TYPE_LIKE; } + case 445: /* compare_op ::= LIKE */ +{ yymsp[0].minor.yy856 = OP_TYPE_LIKE; } break; - case 443: /* compare_op ::= NOT LIKE */ -{ yymsp[-1].minor.yy290 = OP_TYPE_NOT_LIKE; } + case 446: /* compare_op ::= NOT LIKE */ +{ yymsp[-1].minor.yy856 = OP_TYPE_NOT_LIKE; } break; - case 444: /* compare_op ::= MATCH */ -{ yymsp[0].minor.yy290 = OP_TYPE_MATCH; } + case 447: /* compare_op ::= MATCH */ +{ yymsp[0].minor.yy856 = OP_TYPE_MATCH; } break; - case 445: /* compare_op ::= NMATCH */ -{ yymsp[0].minor.yy290 = OP_TYPE_NMATCH; } + case 448: /* compare_op ::= NMATCH */ +{ yymsp[0].minor.yy856 = OP_TYPE_NMATCH; } break; - case 446: /* compare_op ::= CONTAINS */ -{ yymsp[0].minor.yy290 = OP_TYPE_JSON_CONTAINS; } + case 449: /* compare_op ::= CONTAINS */ +{ yymsp[0].minor.yy856 = OP_TYPE_JSON_CONTAINS; } break; - case 447: /* in_op ::= IN */ -{ yymsp[0].minor.yy290 = OP_TYPE_IN; } + case 450: /* in_op ::= IN */ +{ yymsp[0].minor.yy856 = OP_TYPE_IN; } break; - case 448: /* in_op ::= NOT IN */ -{ yymsp[-1].minor.yy290 = OP_TYPE_NOT_IN; } + case 451: /* in_op ::= NOT IN */ +{ yymsp[-1].minor.yy856 = OP_TYPE_NOT_IN; } break; - case 449: /* in_predicate_value ::= NK_LP literal_list NK_RP */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 452: /* in_predicate_value ::= NK_LP literal_list NK_RP */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy776)); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 451: /* boolean_value_expression ::= NOT boolean_primary */ + case 454: /* boolean_value_expression ::= NOT boolean_primary */ { - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy602), NULL)); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy924), NULL)); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 452: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 455: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 453: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 456: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { - SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy602); - SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy602); - yylhsminor.yy602 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); + SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy924); + SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy924); + yylhsminor.yy924 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 459: /* from_clause_opt ::= FROM table_reference_list */ - case 488: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==488); - case 517: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==517); -{ yymsp[-1].minor.yy602 = yymsp[0].minor.yy602; } + case 462: /* from_clause_opt ::= FROM table_reference_list */ + case 491: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==491); + case 520: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==520); +{ yymsp[-1].minor.yy924 = yymsp[0].minor.yy924; } break; - case 461: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ -{ yylhsminor.yy602 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy602, yymsp[0].minor.yy602, NULL); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 464: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ +{ yylhsminor.yy924 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy924, yymsp[0].minor.yy924, NULL); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 464: /* table_primary ::= table_name alias_opt */ -{ yylhsminor.yy602 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy179, &yymsp[0].minor.yy179); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + case 467: /* table_primary ::= table_name alias_opt */ +{ yylhsminor.yy924 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy233, &yymsp[0].minor.yy233); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 465: /* table_primary ::= db_name NK_DOT table_name alias_opt */ -{ yylhsminor.yy602 = createRealTableNode(pCxt, &yymsp[-3].minor.yy179, &yymsp[-1].minor.yy179, &yymsp[0].minor.yy179); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + case 468: /* table_primary ::= db_name NK_DOT table_name alias_opt */ +{ yylhsminor.yy924 = createRealTableNode(pCxt, &yymsp[-3].minor.yy233, &yymsp[-1].minor.yy233, &yymsp[0].minor.yy233); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 466: /* table_primary ::= subquery alias_opt */ -{ yylhsminor.yy602 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy602), &yymsp[0].minor.yy179); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + case 469: /* table_primary ::= subquery alias_opt */ +{ yylhsminor.yy924 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy924), &yymsp[0].minor.yy233); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 468: /* alias_opt ::= */ -{ yymsp[1].minor.yy179 = nil_token; } + case 471: /* alias_opt ::= */ +{ yymsp[1].minor.yy233 = nil_token; } break; - case 470: /* alias_opt ::= AS table_alias */ -{ yymsp[-1].minor.yy179 = yymsp[0].minor.yy179; } + case 473: /* alias_opt ::= AS table_alias */ +{ yymsp[-1].minor.yy233 = yymsp[0].minor.yy233; } break; - case 471: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 472: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==472); -{ yymsp[-2].minor.yy602 = yymsp[-1].minor.yy602; } + case 474: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 475: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==475); +{ yymsp[-2].minor.yy924 = yymsp[-1].minor.yy924; } break; - case 473: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ -{ yylhsminor.yy602 = createJoinTableNode(pCxt, yymsp[-4].minor.yy42, yymsp[-5].minor.yy602, yymsp[-2].minor.yy602, yymsp[0].minor.yy602); } - yymsp[-5].minor.yy602 = yylhsminor.yy602; + case 476: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ +{ yylhsminor.yy924 = createJoinTableNode(pCxt, yymsp[-4].minor.yy428, yymsp[-5].minor.yy924, yymsp[-2].minor.yy924, yymsp[0].minor.yy924); } + yymsp[-5].minor.yy924 = yylhsminor.yy924; break; - case 474: /* join_type ::= */ -{ yymsp[1].minor.yy42 = JOIN_TYPE_INNER; } + case 477: /* join_type ::= */ +{ yymsp[1].minor.yy428 = JOIN_TYPE_INNER; } break; - case 475: /* join_type ::= INNER */ -{ yymsp[0].minor.yy42 = JOIN_TYPE_INNER; } + case 478: /* join_type ::= INNER */ +{ yymsp[0].minor.yy428 = JOIN_TYPE_INNER; } break; - case 476: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 479: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { - yymsp[-11].minor.yy602 = createSelectStmt(pCxt, yymsp[-10].minor.yy767, yymsp[-9].minor.yy874, yymsp[-8].minor.yy602); - yymsp[-11].minor.yy602 = addWhereClause(pCxt, yymsp[-11].minor.yy602, yymsp[-7].minor.yy602); - yymsp[-11].minor.yy602 = addPartitionByClause(pCxt, yymsp[-11].minor.yy602, yymsp[-6].minor.yy874); - yymsp[-11].minor.yy602 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy602, yymsp[-2].minor.yy602); - yymsp[-11].minor.yy602 = addGroupByClause(pCxt, yymsp[-11].minor.yy602, yymsp[-1].minor.yy874); - yymsp[-11].minor.yy602 = addHavingClause(pCxt, yymsp[-11].minor.yy602, yymsp[0].minor.yy602); - yymsp[-11].minor.yy602 = addRangeClause(pCxt, yymsp[-11].minor.yy602, yymsp[-5].minor.yy602); - yymsp[-11].minor.yy602 = addEveryClause(pCxt, yymsp[-11].minor.yy602, yymsp[-4].minor.yy602); - yymsp[-11].minor.yy602 = addFillClause(pCxt, yymsp[-11].minor.yy602, yymsp[-3].minor.yy602); + yymsp[-11].minor.yy924 = createSelectStmt(pCxt, yymsp[-10].minor.yy397, yymsp[-9].minor.yy776, yymsp[-8].minor.yy924); + yymsp[-11].minor.yy924 = addWhereClause(pCxt, yymsp[-11].minor.yy924, yymsp[-7].minor.yy924); + yymsp[-11].minor.yy924 = addPartitionByClause(pCxt, yymsp[-11].minor.yy924, yymsp[-6].minor.yy776); + yymsp[-11].minor.yy924 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy924, yymsp[-2].minor.yy924); + yymsp[-11].minor.yy924 = addGroupByClause(pCxt, yymsp[-11].minor.yy924, yymsp[-1].minor.yy776); + yymsp[-11].minor.yy924 = addHavingClause(pCxt, yymsp[-11].minor.yy924, yymsp[0].minor.yy924); + yymsp[-11].minor.yy924 = addRangeClause(pCxt, yymsp[-11].minor.yy924, yymsp[-5].minor.yy924); + yymsp[-11].minor.yy924 = addEveryClause(pCxt, yymsp[-11].minor.yy924, yymsp[-4].minor.yy924); + yymsp[-11].minor.yy924 = addFillClause(pCxt, yymsp[-11].minor.yy924, yymsp[-3].minor.yy924); } break; - case 479: /* set_quantifier_opt ::= ALL */ -{ yymsp[0].minor.yy767 = false; } + case 482: /* set_quantifier_opt ::= ALL */ +{ yymsp[0].minor.yy397 = false; } break; - case 482: /* select_item ::= NK_STAR */ -{ yylhsminor.yy602 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy602 = yylhsminor.yy602; + case 485: /* select_item ::= NK_STAR */ +{ yylhsminor.yy924 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy924 = yylhsminor.yy924; break; - case 484: /* select_item ::= common_expression column_alias */ - case 494: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==494); -{ yylhsminor.yy602 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy602), &yymsp[0].minor.yy179); } - yymsp[-1].minor.yy602 = yylhsminor.yy602; + case 487: /* select_item ::= common_expression column_alias */ + case 497: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==497); +{ yylhsminor.yy924 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy924), &yymsp[0].minor.yy233); } + yymsp[-1].minor.yy924 = yylhsminor.yy924; break; - case 485: /* select_item ::= common_expression AS column_alias */ - case 495: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==495); -{ yylhsminor.yy602 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), &yymsp[0].minor.yy179); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 488: /* select_item ::= common_expression AS column_alias */ + case 498: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==498); +{ yylhsminor.yy924 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), &yymsp[0].minor.yy233); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 490: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 513: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==513); - case 532: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==532); -{ yymsp[-2].minor.yy874 = yymsp[0].minor.yy874; } + case 493: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 516: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==516); + case 535: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==535); +{ yymsp[-2].minor.yy776 = yymsp[0].minor.yy776; } break; - case 497: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ -{ yymsp[-5].minor.yy602 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), releaseRawExprNode(pCxt, yymsp[-1].minor.yy602)); } + case 500: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ +{ yymsp[-5].minor.yy924 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), releaseRawExprNode(pCxt, yymsp[-1].minor.yy924)); } break; - case 498: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ -{ yymsp[-3].minor.yy602 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy602)); } + case 501: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ +{ yymsp[-3].minor.yy924 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy924)); } break; - case 499: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-5].minor.yy602 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), NULL, yymsp[-1].minor.yy602, yymsp[0].minor.yy602); } + case 502: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-5].minor.yy924 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), NULL, yymsp[-1].minor.yy924, yymsp[0].minor.yy924); } break; - case 500: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ -{ yymsp[-7].minor.yy602 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy602), releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), yymsp[-1].minor.yy602, yymsp[0].minor.yy602); } + case 503: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ +{ yymsp[-7].minor.yy924 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy924), releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), yymsp[-1].minor.yy924, yymsp[0].minor.yy924); } break; - case 501: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ -{ yymsp[-6].minor.yy602 = createEventWindowNode(pCxt, yymsp[-3].minor.yy602, yymsp[0].minor.yy602); } + case 504: /* twindow_clause_opt ::= EVENT_WINDOW START WITH search_condition END WITH search_condition */ +{ yymsp[-6].minor.yy924 = createEventWindowNode(pCxt, yymsp[-3].minor.yy924, yymsp[0].minor.yy924); } break; - case 505: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ -{ yymsp[-3].minor.yy602 = createFillNode(pCxt, yymsp[-1].minor.yy324, NULL); } + case 508: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ +{ yymsp[-3].minor.yy924 = createFillNode(pCxt, yymsp[-1].minor.yy646, NULL); } break; - case 506: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ -{ yymsp[-5].minor.yy602 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); } + case 509: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ +{ yymsp[-5].minor.yy924 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy776)); } break; - case 507: /* fill_mode ::= NONE */ -{ yymsp[0].minor.yy324 = FILL_MODE_NONE; } + case 510: /* fill_mode ::= NONE */ +{ yymsp[0].minor.yy646 = FILL_MODE_NONE; } break; - case 508: /* fill_mode ::= PREV */ -{ yymsp[0].minor.yy324 = FILL_MODE_PREV; } + case 511: /* fill_mode ::= PREV */ +{ yymsp[0].minor.yy646 = FILL_MODE_PREV; } break; - case 509: /* fill_mode ::= NULL */ -{ yymsp[0].minor.yy324 = FILL_MODE_NULL; } + case 512: /* fill_mode ::= NULL */ +{ yymsp[0].minor.yy646 = FILL_MODE_NULL; } break; - case 510: /* fill_mode ::= LINEAR */ -{ yymsp[0].minor.yy324 = FILL_MODE_LINEAR; } + case 513: /* fill_mode ::= LINEAR */ +{ yymsp[0].minor.yy646 = FILL_MODE_LINEAR; } break; - case 511: /* fill_mode ::= NEXT */ -{ yymsp[0].minor.yy324 = FILL_MODE_NEXT; } + case 514: /* fill_mode ::= NEXT */ +{ yymsp[0].minor.yy646 = FILL_MODE_NEXT; } break; - case 514: /* group_by_list ::= expr_or_subquery */ -{ yylhsminor.yy874 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); } - yymsp[0].minor.yy874 = yylhsminor.yy874; + case 517: /* group_by_list ::= expr_or_subquery */ +{ yylhsminor.yy776 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } + yymsp[0].minor.yy776 = yylhsminor.yy776; break; - case 515: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ -{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy602))); } - yymsp[-2].minor.yy874 = yylhsminor.yy874; + case 518: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ +{ yylhsminor.yy776 = addNodeToList(pCxt, yymsp[-2].minor.yy776, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy924))); } + yymsp[-2].minor.yy776 = yylhsminor.yy776; break; - case 519: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ -{ yymsp[-5].minor.yy602 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy602), releaseRawExprNode(pCxt, yymsp[-1].minor.yy602)); } + case 522: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ +{ yymsp[-5].minor.yy924 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy924), releaseRawExprNode(pCxt, yymsp[-1].minor.yy924)); } break; - case 522: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 525: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { - yylhsminor.yy602 = addOrderByClause(pCxt, yymsp[-3].minor.yy602, yymsp[-2].minor.yy874); - yylhsminor.yy602 = addSlimitClause(pCxt, yylhsminor.yy602, yymsp[-1].minor.yy602); - yylhsminor.yy602 = addLimitClause(pCxt, yylhsminor.yy602, yymsp[0].minor.yy602); + yylhsminor.yy924 = addOrderByClause(pCxt, yymsp[-3].minor.yy924, yymsp[-2].minor.yy776); + yylhsminor.yy924 = addSlimitClause(pCxt, yylhsminor.yy924, yymsp[-1].minor.yy924); + yylhsminor.yy924 = addLimitClause(pCxt, yylhsminor.yy924, yymsp[0].minor.yy924); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 525: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ -{ yylhsminor.yy602 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy602, yymsp[0].minor.yy602); } - yymsp[-3].minor.yy602 = yylhsminor.yy602; + case 528: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ +{ yylhsminor.yy924 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy924, yymsp[0].minor.yy924); } + yymsp[-3].minor.yy924 = yylhsminor.yy924; break; - case 526: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ -{ yylhsminor.yy602 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy602, yymsp[0].minor.yy602); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 529: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ +{ yylhsminor.yy924 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy924, yymsp[0].minor.yy924); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 534: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 538: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==538); -{ yymsp[-1].minor.yy602 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } + case 537: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 541: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==541); +{ yymsp[-1].minor.yy924 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 535: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 539: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==539); -{ yymsp[-3].minor.yy602 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } + case 538: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 542: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==542); +{ yymsp[-3].minor.yy924 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 536: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 540: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==540); -{ yymsp[-3].minor.yy602 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } + case 539: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 543: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==543); +{ yymsp[-3].minor.yy924 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 541: /* subquery ::= NK_LP query_expression NK_RP */ -{ yylhsminor.yy602 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy602); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 544: /* subquery ::= NK_LP query_expression NK_RP */ +{ yylhsminor.yy924 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy924); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 546: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ -{ yylhsminor.yy602 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy602), yymsp[-1].minor.yy878, yymsp[0].minor.yy487); } - yymsp[-2].minor.yy602 = yylhsminor.yy602; + case 549: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ +{ yylhsminor.yy924 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy924), yymsp[-1].minor.yy870, yymsp[0].minor.yy89); } + yymsp[-2].minor.yy924 = yylhsminor.yy924; break; - case 547: /* ordering_specification_opt ::= */ -{ yymsp[1].minor.yy878 = ORDER_ASC; } + case 550: /* ordering_specification_opt ::= */ +{ yymsp[1].minor.yy870 = ORDER_ASC; } break; - case 548: /* ordering_specification_opt ::= ASC */ -{ yymsp[0].minor.yy878 = ORDER_ASC; } + case 551: /* ordering_specification_opt ::= ASC */ +{ yymsp[0].minor.yy870 = ORDER_ASC; } break; - case 549: /* ordering_specification_opt ::= DESC */ -{ yymsp[0].minor.yy878 = ORDER_DESC; } + case 552: /* ordering_specification_opt ::= DESC */ +{ yymsp[0].minor.yy870 = ORDER_DESC; } break; - case 550: /* null_ordering_opt ::= */ -{ yymsp[1].minor.yy487 = NULL_ORDER_DEFAULT; } + case 553: /* null_ordering_opt ::= */ +{ yymsp[1].minor.yy89 = NULL_ORDER_DEFAULT; } break; - case 551: /* null_ordering_opt ::= NULLS FIRST */ -{ yymsp[-1].minor.yy487 = NULL_ORDER_FIRST; } + case 554: /* null_ordering_opt ::= NULLS FIRST */ +{ yymsp[-1].minor.yy89 = NULL_ORDER_FIRST; } break; - case 552: /* null_ordering_opt ::= NULLS LAST */ -{ yymsp[-1].minor.yy487 = NULL_ORDER_LAST; } + case 555: /* null_ordering_opt ::= NULLS LAST */ +{ yymsp[-1].minor.yy89 = NULL_ORDER_LAST; } break; default: break; diff --git a/source/libs/parser/test/parInitialCTest.cpp b/source/libs/parser/test/parInitialCTest.cpp index 8286ae72e1..a7a11d8edf 100644 --- a/source/libs/parser/test/parInitialCTest.cpp +++ b/source/libs/parser/test/parInitialCTest.cpp @@ -852,9 +852,12 @@ TEST_F(ParserInitialCTest, createStream) { "AS SELECT _WSTART wstart, COUNT(*) cnt FROM st1 PARTITION BY TBNAME tname, tag1 id INTERVAL(10S)"); clearCreateStreamReq(); - setCreateStreamReq("s1", "test", "create stream s1 into st1 as select max(c1), c2 from t1 interval(10s)", "st1", - STREAM_CREATE_STABLE_FALSE); - run("CREATE STREAM s1 INTO st1 AS SELECT MAX(c1), c2 FROM t1 INTERVAL(10S)"); + // st1 already exists + setCreateStreamReq( + "s1", "test", + "create stream s1 into st1 tags(tag2) as select max(c1), c2 from t1 partition by tbname tag2 interval(10s)", + "st1", STREAM_CREATE_STABLE_FALSE); + run("CREATE STREAM s1 INTO st1 TAGS(tag2) AS SELECT MAX(c1), c2 FROM t1 PARTITION BY TBNAME tag2 INTERVAL(10S)"); clearCreateStreamReq(); } diff --git a/source/libs/parser/test/parTestMain.cpp b/source/libs/parser/test/parTestMain.cpp index de2ce55459..8d13d7cf0e 100644 --- a/source/libs/parser/test/parTestMain.cpp +++ b/source/libs/parser/test/parTestMain.cpp @@ -86,6 +86,7 @@ static void parseArg(int argc, char* argv[]) { {"dump", no_argument, NULL, 'd'}, {"async", required_argument, NULL, 'a'}, {"skipSql", required_argument, NULL, 's'}, + {"limitSql", required_argument, NULL, 'i'}, {"log", required_argument, NULL, 'l'}, {0, 0, 0, 0} }; @@ -101,6 +102,9 @@ static void parseArg(int argc, char* argv[]) { case 's': setSkipSqlNum(optarg); break; + case 'i': + setLimitSqlNum(optarg); + break; case 'l': setLogLevel(optarg); break; diff --git a/source/libs/parser/test/parTestUtil.cpp b/source/libs/parser/test/parTestUtil.cpp index dbae302e42..f18dd4f17f 100644 --- a/source/libs/parser/test/parTestUtil.cpp +++ b/source/libs/parser/test/parTestUtil.cpp @@ -49,9 +49,11 @@ bool g_dump = false; bool g_testAsyncApis = true; int32_t g_logLevel = 131; int32_t g_skipSql = 0; +int32_t g_limitSql = 0; -void setAsyncFlag(const char* pFlag) { g_testAsyncApis = stoi(pFlag) > 0 ? true : false; } -void setSkipSqlNum(const char* pNum) { g_skipSql = stoi(pNum); } +void setAsyncFlag(const char* pArg) { g_testAsyncApis = stoi(pArg) > 0 ? true : false; } +void setSkipSqlNum(const char* pArg) { g_skipSql = stoi(pArg); } +void setLimitSqlNum(const char* pArg) { g_limitSql = stoi(pArg); } struct TerminateFlag : public exception { const char* what() const throw() { return "success and terminate"; } @@ -63,22 +65,27 @@ int32_t getLogLevel() { return g_logLevel; } class ParserTestBaseImpl { public: - ParserTestBaseImpl(ParserTestBase* pBase) : pBase_(pBase), sqlNo_(0) {} + ParserTestBaseImpl(ParserTestBase* pBase) : pBase_(pBase), sqlNo_(0), sqlNum_(0) {} void login(const std::string& user) { caseEnv_.user_ = user; } void useDb(const string& acctId, const string& db) { caseEnv_.acctId_ = acctId; caseEnv_.db_ = db; - caseEnv_.nsql_ = g_skipSql; + caseEnv_.numOfSkipSql_ = g_skipSql; + caseEnv_.numOfLimitSql_ = g_limitSql; } void run(const string& sql, int32_t expect, ParserStage checkStage) { ++sqlNo_; - if (caseEnv_.nsql_ > 0) { - --(caseEnv_.nsql_); + if (caseEnv_.numOfSkipSql_ > 0) { + --(caseEnv_.numOfSkipSql_); return; } + if (caseEnv_.numOfLimitSql_ > 0 && caseEnv_.numOfLimitSql_ == sqlNum_) { + return; + } + ++sqlNum_; runInternalFuncs(sql, expect, checkStage); runApis(sql, expect, checkStage); @@ -94,9 +101,10 @@ class ParserTestBaseImpl { string acctId_; string user_; string db_; - int32_t nsql_; + int32_t numOfSkipSql_; + int32_t numOfLimitSql_; - caseEnv() : user_("wangxiaoyu"), nsql_(0) {} + caseEnv() : user_("wangxiaoyu"), numOfSkipSql_(0) {} }; struct stmtEnv { @@ -532,6 +540,7 @@ class ParserTestBaseImpl { stmtRes res_; ParserTestBase* pBase_; int32_t sqlNo_; + int32_t sqlNum_; }; ParserTestBase::ParserTestBase() : impl_(new ParserTestBaseImpl(this)) {} diff --git a/source/libs/parser/test/parTestUtil.h b/source/libs/parser/test/parTestUtil.h index 3e5fab5927..5d9680c477 100644 --- a/source/libs/parser/test/parTestUtil.h +++ b/source/libs/parser/test/parTestUtil.h @@ -65,10 +65,11 @@ class ParserDdlTest : public ParserTestBase { extern bool g_dump; -extern void setAsyncFlag(const char* pFlag); -extern void setLogLevel(const char* pLogLevel); +extern void setAsyncFlag(const char* pArg); +extern void setLogLevel(const char* pArg); extern int32_t getLogLevel(); -extern void setSkipSqlNum(const char* pNum); +extern void setSkipSqlNum(const char* pArg); +extern void setLimitSqlNum(const char* pArg); } // namespace ParserTest From 1dd177994d132eb133f3a0f6d54a8492d4812e35 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Tue, 17 Jan 2023 17:26:13 +0800 Subject: [PATCH 128/139] ci:modify stream test --- tests/script/tsim/stream/ignoreExpiredData.sim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/script/tsim/stream/ignoreExpiredData.sim b/tests/script/tsim/stream/ignoreExpiredData.sim index 03f574bc52..b143b7977f 100644 --- a/tests/script/tsim/stream/ignoreExpiredData.sim +++ b/tests/script/tsim/stream/ignoreExpiredData.sim @@ -52,6 +52,7 @@ sql insert into t1 values(1648791213000,1,2,3,1.0); sql insert into t1 values(1648791223001,1,2,3,1.1); sql insert into t1 values(1648791233002,2,2,3,2.1); sql insert into t1 values(1648791243003,2,2,3,3.1); +sleep 300 sql insert into t1 values(1648791200000,4,2,3,4.1); $loop_count = 0 @@ -115,6 +116,7 @@ sql create stream stream_t1 trigger at_once IGNORE EXPIRED 1 into streamtST1 as sql create stream stream_t2 trigger at_once IGNORE EXPIRED 1 into streamtST2 as select _wstart, count(*) c1, count(a) c2 , sum(a) c3 , max(b) c5, min(c) c6 from st session(ts, 10s) ; sql insert into ts1 values(1648791211000,1,2,3); sql insert into ts1 values(1648791222001,2,2,3); +sleep 300 sql insert into ts2 values(1648791211000,1,2,3); sql insert into ts2 values(1648791222001,2,2,3); From 06c69b4e170852a10bd2716936614a6d71bb9588 Mon Sep 17 00:00:00 2001 From: xiaolei li <85657333+xleili@users.noreply.github.com> Date: Tue, 17 Jan 2023 22:37:31 +0800 Subject: [PATCH 129/139] docs: release v3.0.2.4 (#19614) --- docs/en/28-releases/01-tdengine.md | 4 ++++ docs/en/28-releases/02-tools.md | 4 ++++ docs/zh/28-releases/01-tdengine.md | 4 ++++ docs/zh/28-releases/02-tools.md | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/docs/en/28-releases/01-tdengine.md b/docs/en/28-releases/01-tdengine.md index 4e0239eb80..83ea3eb5e6 100644 --- a/docs/en/28-releases/01-tdengine.md +++ b/docs/en/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ For TDengine 2.x installation packages by version, please visit [here](https://w import Release from "/components/ReleaseV3"; +## 3.0.2.4 + + + ## 3.0.2.3 diff --git a/docs/en/28-releases/02-tools.md b/docs/en/28-releases/02-tools.md index 2d20c26c56..97fed654f2 100644 --- a/docs/en/28-releases/02-tools.md +++ b/docs/en/28-releases/02-tools.md @@ -10,6 +10,10 @@ For other historical version installers, please visit [here](https://www.taosdat import Release from "/components/ReleaseV3"; +## 2.4.2 + + + ## 2.4.1 diff --git a/docs/zh/28-releases/01-tdengine.md b/docs/zh/28-releases/01-tdengine.md index 29403f3874..2ec1e6cc54 100644 --- a/docs/zh/28-releases/01-tdengine.md +++ b/docs/zh/28-releases/01-tdengine.md @@ -10,6 +10,10 @@ TDengine 2.x 各版本安装包请访问[这里](https://www.taosdata.com/all-do import Release from "/components/ReleaseV3"; +## 3.0.2.4 + + + ## 3.0.2.3 diff --git a/docs/zh/28-releases/02-tools.md b/docs/zh/28-releases/02-tools.md index f10d97ebb9..421cbd39e3 100644 --- a/docs/zh/28-releases/02-tools.md +++ b/docs/zh/28-releases/02-tools.md @@ -10,6 +10,10 @@ taosTools 各版本安装包下载链接如下: import Release from "/components/ReleaseV3"; +## 2.4.2 + + + ## 2.4.1 From 0f3b3644dec123bdb39702247a7a3a3487c197e1 Mon Sep 17 00:00:00 2001 From: sunpeng Date: Wed, 18 Jan 2023 00:11:45 +0800 Subject: [PATCH 130/139] docs: update python connector document (#19609) * docs: update python connector document * fix: tmq_consumer.py Co-authored-by: Shuduo Sang --- docs/examples/python/tmq_websocket_example.py | 31 +++++++++++++++++ docs/zh/08-connector/30-python.mdx | 34 ++++++++++++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 docs/examples/python/tmq_websocket_example.py diff --git a/docs/examples/python/tmq_websocket_example.py b/docs/examples/python/tmq_websocket_example.py new file mode 100644 index 0000000000..e1dcb0086a --- /dev/null +++ b/docs/examples/python/tmq_websocket_example.py @@ -0,0 +1,31 @@ +#!/usr/bin/python3 +from taosws import Consumer + +conf = { + "td.connect.websocket.scheme": "ws", + "group.id": "0", +} +consumer = Consumer(conf) + +consumer.subscribe(["test"]) + +while True: + message = consumer.poll(timeout=1.0) + if message: + id = message.vgroup() + topic = message.topic() + database = message.database() + + for block in message: + nrows = block.nrows() + ncols = block.ncols() + for row in block: + print(row) + values = block.fetchall() + print(nrows, ncols) + + # consumer.commit(message) + else: + break + +consumer.close() diff --git a/docs/zh/08-connector/30-python.mdx b/docs/zh/08-connector/30-python.mdx index 2ca11800c8..0958fc68ad 100644 --- a/docs/zh/08-connector/30-python.mdx +++ b/docs/zh/08-connector/30-python.mdx @@ -78,6 +78,14 @@ pip3 install git+https://github.com/taosdata/taos-connector-python.git +#### 安装 `taos-ws`(可选) + +taos-ws 提供了通过 websocket 连接 TDengine 的能力,可选安装 taos-ws 以获得 websocket 连接 TDengine 的能力。 + +``` +pip3 install taos-ws-py +``` + ### 安装验证 @@ -306,6 +314,30 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 +### 数据订阅 + +连接器支持数据订阅功能,数据订阅功能请参考 [数据订阅](../../develop/tmq/)。 + + + + +`Consumer` 提供了 Python 连接器订阅 TMQ 数据的 API,相关 API 定义请参考 [数据订阅文档](../../develop/tmq/#%E4%B8%BB%E8%A6%81%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E5%92%8C-api)。 + +```python +{{#include docs/examples/python/tmq_example.py}} +``` + + + + +除了原生的连接方式,Python 连接器还支持通过 websocket 订阅 TMQ 数据。 + +```python +{{#include docs/examples/python/tmq_websocket_example.py}} +``` + + + ### 其它示例程序 | 示例程序链接 | 示例程序内容 | @@ -314,7 +346,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 | [bind_row.py](https://github.com/taosdata/taos-connector-python/blob/main/examples/bind-row.py) | 参数绑定,一次绑定一行 | | [insert_lines.py](https://github.com/taosdata/taos-connector-python/blob/main/examples/insert-lines.py) | InfluxDB 行协议写入 | | [json_tag.py](https://github.com/taosdata/taos-connector-python/blob/main/examples/json-tag.py) | 使用 JSON 类型的标签 | -| [tmq.py](https://github.com/taosdata/taos-connector-python/blob/main/examples/tmq.py) | tmq 订阅 | +| [tmq_consumer.py](https://github.com/taosdata/taos-connector-python/blob/main/examples/tmq_consumer.py) | tmq 订阅 | ## 其它说明 From 554b8c641858034ebc935a8db0ca473deadaedd9 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Wed, 18 Jan 2023 04:43:04 +0800 Subject: [PATCH 131/139] enh: optimize execute plan when 'tail' function is used with 'partition by' clause --- source/libs/planner/src/planOptimizer.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index b47f0bc043..18aaabf448 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -1080,29 +1080,29 @@ static bool sortPriKeyOptMayBeOptimized(SLogicNode* pNode) { return false; } SSortLogicNode* pSort = (SSortLogicNode*)pNode; - if (pSort->groupSort || !sortPriKeyOptIsPriKeyOrderBy(pSort->pSortKeys) || 1 != LIST_LENGTH(pSort->node.pChildren)) { + if (!sortPriKeyOptIsPriKeyOrderBy(pSort->pSortKeys) || 1 != LIST_LENGTH(pSort->node.pChildren)) { return false; } return true; } -static int32_t sortPriKeyOptGetSequencingNodesImpl(SLogicNode* pNode, bool* pNotOptimize, +static int32_t sortPriKeyOptGetSequencingNodesImpl(SLogicNode* pNode, bool groupSort, bool* pNotOptimize, SNodeList** pSequencingNodes) { switch (nodeType(pNode)) { case QUERY_NODE_LOGIC_PLAN_SCAN: { SScanLogicNode* pScan = (SScanLogicNode*)pNode; - if (NULL != pScan->pGroupTags || TSDB_SYSTEM_TABLE == pScan->tableType) { + if ((!groupSort && NULL != pScan->pGroupTags) || TSDB_SYSTEM_TABLE == pScan->tableType) { *pNotOptimize = true; return TSDB_CODE_SUCCESS; } return nodesListMakeAppend(pSequencingNodes, (SNode*)pNode); } case QUERY_NODE_LOGIC_PLAN_JOIN: { - int32_t code = sortPriKeyOptGetSequencingNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 0), + int32_t code = sortPriKeyOptGetSequencingNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 0), groupSort, pNotOptimize, pSequencingNodes); if (TSDB_CODE_SUCCESS == code) { - code = sortPriKeyOptGetSequencingNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 1), pNotOptimize, - pSequencingNodes); + code = sortPriKeyOptGetSequencingNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 1), groupSort, + pNotOptimize, pSequencingNodes); } return code; } @@ -1121,13 +1121,13 @@ static int32_t sortPriKeyOptGetSequencingNodesImpl(SLogicNode* pNode, bool* pNot return TSDB_CODE_SUCCESS; } - return sortPriKeyOptGetSequencingNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 0), pNotOptimize, - pSequencingNodes); + return sortPriKeyOptGetSequencingNodesImpl((SLogicNode*)nodesListGetNode(pNode->pChildren, 0), groupSort, + pNotOptimize, pSequencingNodes); } -static int32_t sortPriKeyOptGetSequencingNodes(SLogicNode* pNode, SNodeList** pSequencingNodes) { +static int32_t sortPriKeyOptGetSequencingNodes(SLogicNode* pNode, bool groupSort, SNodeList** pSequencingNodes) { bool notOptimize = false; - int32_t code = sortPriKeyOptGetSequencingNodesImpl(pNode, ¬Optimize, pSequencingNodes); + int32_t code = sortPriKeyOptGetSequencingNodesImpl(pNode, groupSort, ¬Optimize, pSequencingNodes); if (TSDB_CODE_SUCCESS != code || notOptimize) { NODES_CLEAR_LIST(*pSequencingNodes); } @@ -1175,8 +1175,8 @@ static int32_t sortPriKeyOptApply(SOptimizeContext* pCxt, SLogicSubplan* pLogicS static int32_t sortPrimaryKeyOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan, SSortLogicNode* pSort) { SNodeList* pSequencingNodes = NULL; - int32_t code = - sortPriKeyOptGetSequencingNodes((SLogicNode*)nodesListGetNode(pSort->node.pChildren, 0), &pSequencingNodes); + int32_t code = sortPriKeyOptGetSequencingNodes((SLogicNode*)nodesListGetNode(pSort->node.pChildren, 0), + pSort->groupSort, &pSequencingNodes); if (TSDB_CODE_SUCCESS == code && NULL != pSequencingNodes) { code = sortPriKeyOptApply(pCxt, pLogicSubplan, pSort, pSequencingNodes); } From caf3de29591fee19a526686aeff5dc8fc3dc279d Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Wed, 18 Jan 2023 09:30:54 +0800 Subject: [PATCH 132/139] fix: support writing streams to existing tables --- include/common/tmsg.h | 2 +- source/common/src/tmsg.c | 28 ++++++++++++++++++++++++++ source/libs/parser/src/parTranslater.c | 25 +++++++++++++---------- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 2fcfd4ec0b..c5e9a12756 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1789,7 +1789,7 @@ typedef struct { // 3.0.2.3 int8_t createStb; uint64_t targetStbUid; - SArray* fillNullCols; + SArray* fillNullCols; // array of SColLocation } SCMCreateStreamReq; typedef struct { diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 87ad592afb..20bb265e78 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -5428,6 +5428,13 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS } if (tEncodeI8(&encoder, pReq->createStb) < 0) return -1; if (tEncodeU64(&encoder, pReq->targetStbUid) < 0) return -1; + if (tEncodeI32(&encoder, taosArrayGetSize(pReq->fillNullCols)) < 0) return -1; + for (int32_t i = 0; i < taosArrayGetSize(pReq->fillNullCols); ++i) { + SColLocation *pCol = taosArrayGet(pReq->fillNullCols, i); + if (tEncodeI16(&encoder, pCol->slotId) < 0) return -1; + if (tEncodeI16(&encoder, pCol->colId) < 0) return -1; + if (tEncodeI8(&encoder, pCol->type) < 0) return -1; + } tEndEncode(&encoder); @@ -5490,6 +5497,26 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea } if (tDecodeI8(&decoder, &pReq->createStb) < 0) return -1; if (tDecodeU64(&decoder, &pReq->targetStbUid) < 0) return -1; + int32_t numOfFillNullCols = 0; + if (tDecodeI32(&decoder, &numOfFillNullCols) < 0) return -1; + if (numOfFillNullCols > 0) { + pReq->fillNullCols = taosArrayInit(numOfFillNullCols, sizeof(SColLocation)); + if (pReq->fillNullCols == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } + + for (int32_t i = 0; i < numOfFillNullCols; ++i) { + SColLocation col = {0}; + if (tDecodeI16(&decoder, &col.slotId) < 0) return -1; + if (tDecodeI16(&decoder, &col.colId) < 0) return -1; + if (tDecodeI8(&decoder, &col.type) < 0) return -1; + if (taosArrayPush(pReq->fillNullCols, &col) == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return -1; + } + } + } tEndDecode(&decoder); @@ -5559,6 +5586,7 @@ void tFreeSCMCreateStreamReq(SCMCreateStreamReq *pReq) { taosArrayDestroy(pReq->pTags); taosMemoryFreeClear(pReq->sql); taosMemoryFreeClear(pReq->ast); + taosArrayDestroy(pReq->fillNullCols); } int32_t tEncodeSRSmaParam(SEncoder *pCoder, const SRSmaParam *pRSmaParam) { diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index f6a2b0a025..395f90d070 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -2210,7 +2210,8 @@ static int32_t dnodeToVgroupsInfo(SArray* pDnodes, SVgroupsInfo** pVgsInfo) { } static bool sysTableFromVnode(const char* pTable) { - return ((0 == strcmp(pTable, TSDB_INS_TABLE_TABLES)) || (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS)) || (0 == strcmp(pTable, TSDB_INS_TABLE_COLS))); + return ((0 == strcmp(pTable, TSDB_INS_TABLE_TABLES)) || (0 == strcmp(pTable, TSDB_INS_TABLE_TAGS)) || + (0 == strcmp(pTable, TSDB_INS_TABLE_COLS))); } static bool sysTableFromDnode(const char* pTable) { return 0 == strcmp(pTable, TSDB_INS_TABLE_DNODE_VARIABLES); } @@ -2278,8 +2279,9 @@ static int32_t setVnodeSysTableVgroupList(STranslateContext* pCxt, SName* pName, ((SSelectStmt*)pCxt->pCurrStmt)->isEmptyResult = true; } - if (TSDB_CODE_SUCCESS == code && (0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) && !hasUserDbCond) || - 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS)) { + if (TSDB_CODE_SUCCESS == code && + (0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_TABLES) && !hasUserDbCond) || + 0 == strcmp(pRealTable->table.tableName, TSDB_INS_TABLE_COLS)) { code = addMnodeToVgroupList(&pCxt->pParseCxt->mgmtEpSet, &pVgs); } @@ -5804,18 +5806,19 @@ static int32_t setFillNullCols(SArray* pProjColPos, const STableMeta* pMeta, SCM if (NULL == pReq->fillNullCols) { return TSDB_CODE_OUT_OF_MEMORY; } - int32_t indexOfSchema = 0; const SSchema* pSchemas = getTableColumnSchema(pMeta); - for (int32_t i = 0; i < numOfBoundCols; ++i) { - SProjColPos* pPos = taosArrayGet(pProjColPos, i); - while (indexOfSchema < pMeta->tableInfo.numOfColumns) { - const SSchema* pSchema = pSchemas + indexOfSchema++; + int32_t indexOfBoundCols = 0; + for (int32_t i = 0; i < pMeta->tableInfo.numOfColumns; ++i) { + const SSchema* pSchema = pSchemas + i; + if (indexOfBoundCols < numOfBoundCols) { + SProjColPos* pPos = taosArrayGet(pProjColPos, indexOfBoundCols); if (pSchema->colId == pPos->colId) { - break; + ++indexOfBoundCols; + continue; } - SColLocation colLoc = {.colId = pSchema->colId, .slotId = indexOfSchema - 1, .type = pSchema->type}; - taosArrayPush(pReq->fillNullCols, &colLoc); } + SColLocation colLoc = {.colId = pSchema->colId, .slotId = i, .type = pSchema->type}; + taosArrayPush(pReq->fillNullCols, &colLoc); } return TSDB_CODE_SUCCESS; } From 5c5e9144f27ba0342cf1ce409c42bff8ff8708be Mon Sep 17 00:00:00 2001 From: xinsheng Ren <285808407@qq.com> Date: Wed, 18 Jan 2023 10:08:44 +0800 Subject: [PATCH 133/139] ALL UPPER CASE for macro definition (#19605) Co-authored-by: facetosea <25808407@qq.com> --- source/os/src/osSysinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 30415f2a56..b915e2964f 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -18,7 +18,7 @@ #include "taoserror.h" #define PROCESS_ITEM 12 -#define uuidLen37 37 +#define UUIDLEN37 37 typedef struct { uint64_t user; @@ -835,8 +835,8 @@ int32_t taosGetSystemUUID(char *uid, int32_t uidlen) { return 0; #elif defined(_TD_DARWIN_64) uuid_t uuid = {0}; - char buf[uuidLen37]; - memset(buf, 0, uuidLen37); + char buf[UUIDLEN37]; + memset(buf, 0, UUIDLEN37); uuid_generate(uuid); // it's caller's responsibility to make enough space for `uid`, that's 36-char + 1-null uuid_unparse_lower(uuid, buf); From 19fc157790279f2c365ad88efdd5027fecde2a1d Mon Sep 17 00:00:00 2001 From: Yiqing Liu Date: Wed, 18 Jan 2023 10:26:03 +0800 Subject: [PATCH 134/139] Update 01-faq.md --- docs/en/27-train-faq/01-faq.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/en/27-train-faq/01-faq.md b/docs/en/27-train-faq/01-faq.md index 82e98b0d98..7650e97365 100644 --- a/docs/en/27-train-faq/01-faq.md +++ b/docs/en/27-train-faq/01-faq.md @@ -33,7 +33,7 @@ TDengine 3.0 is not compatible with the configuration and data files from previo 4. Install TDengine 3.0. 5. For assistance in migrating data to TDengine 3.0, contact [TDengine Support](https://tdengine.com/support). -### 4. How can I resolve the "Unable to establish connection" error? +### 2. How can I resolve the "Unable to establish connection" error? This error indicates that the client could not connect to the server. Perform the following troubleshooting steps: @@ -68,7 +68,7 @@ This error indicates that the client could not connect to the server. Perform th 11. You can also use the TDengine CLI to diagnose network issues. For more information, see [Problem Diagnostics](https://docs.tdengine.com/operation/diagnose/). -### 5. How can I resolve the "Unable to resolve FQDN" error? +### 3. How can I resolve the "Unable to resolve FQDN" error? Clients and dnodes must be able to resolve the FQDN of each required node. You can confirm your configuration as follows: @@ -79,15 +79,15 @@ Clients and dnodes must be able to resolve the FQDN of each required node. You c 5. If TDengine has been previously installed and the `hostname` was modified, open `dnode.json` in the `data` folder and verify that the endpoint configuration is correct. The default location of the dnode file is `/var/lib/taos/dnode`. Ensure that you clean up previous installations before reinstalling TDengine. 6. Confirm whether FQDNs are preconfigured in `/etc/hosts` and `/etc/hostname`. -### 6. What is the most effective way to write data to TDengine? +### 4. What is the most effective way to write data to TDengine? Writing data in batches provides higher efficiency in most situations. You can insert one or more data records into one or more tables in a single SQL statement. -### 9. Why are table names not fully displayed? +### 5. Why are table names not fully displayed? The number of columns in the TDengine CLI terminal display is limited. This can cause table names to be cut off, and if you use an incomplete name in a statement, the "Table does not exist" error will occur. You can increase the display size with the `maxBinaryDisplayWidth` parameter or the SQL statement `set max_binary_display_width`. You can also append `\G` to your SQL statement to bypass this limitation. -### 10. How can I migrate data? +### 6. How can I migrate data? In TDengine, the `hostname` uniquely identifies a machine. When you move data files to a new machine, you must configure the new machine to have the same `host name` as the original machine. @@ -97,7 +97,7 @@ The data structure of previous versions of TDengine is not compatible with versi ::: -### 11. How can I temporary change the log level from the TDengine Client? +### 7. How can I temporary change the log level from the TDengine Client? To change the log level for debugging purposes, you can use the following command: @@ -118,14 +118,14 @@ Use `resetlog` to remove all logs generated on the local client. Use the other p For each parameter, you can set the value to `131` (error and warning), `135` (error, warning, and debug), or `143` (error, warning, debug, and trace). -### Why do TDengine components written in Go fail to compile? +### 8. Why do TDengine components written in Go fail to compile? TDengine includes taosAdapter, an independent component written in Go. This component provides the REST API as well as data access for other products such as Prometheus and Telegraf. When using the develop branch, you must run `git submodule update --init --recursive` to download the taosAdapter repository and then compile it. TDengine Go components require Go version 1.14 or later. -### 13. How can I query the storage space being used by my data? +### 9. How can I query the storage space being used by my data? The TDengine data files are stored in `/var/lib/taos` by default. Log files are stored in `/var/log/taos`. @@ -133,7 +133,7 @@ To see how much space your data files occupy, run `du -sh /var/lib/taos/vnode -- If you want to see how much space is occupied by a single database, first determine which vgroup is storing the database by running `show vgroups`. Then check `/var/lib/taos/vnode` for the files associated with the vgroup ID. -### 15. How is timezone information processed for timestamps? +### 10. How is timezone information processed for timestamps? TDengine uses the timezone of the client for timestamps. The server timezone does not affect timestamps. The client converts Unix timestamps in SQL statements to UTC before sending them to the server. When you query data on the server, it provides timestamps in UTC to the client, which converts them to its local time. @@ -144,13 +144,13 @@ Timestamps are processed as follows: 3. A timezone explicitly specified when establishing a connection to TDengine through a connector takes precedence over `taos.cfg` and the system timezone. For example, the Java connector allows you to specify a timezone in the JDBC URL. 4. If you use an RFC 3339 timestamp (2013-04-12T15:52:01.123+08:00), or an ISO 8601 timestamp (2013-04-12T15:52:01.123+0800), the timezone specified in the timestamp is used instead of the timestamps configured using any other method. -### 16. Which network ports are required by TDengine? +### 11. Which network ports are required by TDengine? See [serverPort](https://docs.tdengine.com/reference/config/#serverport) in Configuration Parameters. Note that ports are specified using 6030 as the default first port. If you change this port, all other ports change as well. -### 17. Why do applications such as Grafana fail to connect to TDengine over the REST API? +### 12. Why do applications such as Grafana fail to connect to TDengine over the REST API? In TDengine, the REST API is provided by taosAdapter. Ensure that taosAdapter is running before you connect an application to TDengine over the REST API. You can run `systemctl start taosadapter` to start the service. @@ -158,7 +158,7 @@ Note that the log path for taosAdapter must be configured separately. The defaul For more information, see [taosAdapter](https://docs.tdengine.com/reference/taosadapter/). -### 18. How can I resolve out-of-memory (OOM) errors? +### 13. How can I resolve out-of-memory (OOM) errors? OOM errors are thrown by the operating system when its memory, including swap, becomes insufficient and it needs to terminate processes to remain operational. Most OOM errors in TDengine occur for one of the following reasons: free memory is less than the value of `vm.min_free_kbytes` or free memory is less than the size of the request. If TDengine occupies reserved memory, an OOM error can occur even when free memory is sufficient. From c9a1b3ba011878265d1e2f08bd4933ee8385a711 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 18 Jan 2023 16:24:29 +0800 Subject: [PATCH 135/139] fix(query): handle the multi-group limit/offset in table group merge scan/ multiway-merge executor. --- source/libs/executor/inc/executorimpl.h | 3 ++- source/libs/executor/src/exchangeoperator.c | 11 ++++++--- source/libs/executor/src/executil.c | 5 ++++ source/libs/executor/src/projectoperator.c | 12 ++++++--- source/libs/executor/src/scanoperator.c | 27 +++++++++++++++------ source/libs/executor/src/sortoperator.c | 11 +++++---- 6 files changed, 48 insertions(+), 21 deletions(-) diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index fffe687ff6..c68f7c4697 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -705,7 +705,8 @@ void doBuildResultDatablock(SOperatorInfo* pOperator, SOptrBasicInfo* pbInfo, SG bool hasLimitOffsetInfo(SLimitInfo* pLimitInfo); void initLimitInfo(const SNode* pLimit, const SNode* pSLimit, SLimitInfo* pLimitInfo); -void applyLimitOffset(SLimitInfo* pLimitInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo, SOperatorInfo* pOperator); +void resetLimitInfoForNextGroup(SLimitInfo* pLimitInfo); +bool applyLimitOffset(SLimitInfo* pLimitInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo, SOperatorInfo* pOperator); void applyAggFunctionOnPartialTuples(SExecTaskInfo* taskInfo, SqlFunctionCtx* pCtx, SColumnInfoData* pTimeWindowData, int32_t offset, int32_t forwardStep, int32_t numOfTotal, int32_t numOfOutput); diff --git a/source/libs/executor/src/exchangeoperator.c b/source/libs/executor/src/exchangeoperator.c index 0de2836f55..037b33dc9f 100644 --- a/source/libs/executor/src/exchangeoperator.c +++ b/source/libs/executor/src/exchangeoperator.c @@ -738,9 +738,7 @@ int32_t handleLimitOffset(SOperatorInfo* pOperator, SLimitInfo* pLimitInfo, SSDa } // reset the value for a new group data - pLimitInfo->numOfOutputRows = 0; - pLimitInfo->remainOffset = pLimitInfo->limit.offset; - + resetLimitInfoForNextGroup(pLimitInfo); // existing rows that belongs to previous group. if (pBlock->info.rows > 0) { return PROJECT_RETRIEVE_DONE; @@ -766,7 +764,12 @@ int32_t handleLimitOffset(SOperatorInfo* pOperator, SLimitInfo* pLimitInfo, SSDa int32_t keepRows = (int32_t)(pLimitInfo->limit.limit - pLimitInfo->numOfOutputRows); blockDataKeepFirstNRows(pBlock, keepRows); if (pLimitInfo->slimit.limit > 0 && pLimitInfo->slimit.limit <= pLimitInfo->numOfOutputGroups) { - pOperator->status = OP_EXEC_DONE; + setOperatorCompleted(pOperator); + } else { + // current group limitation is reached, and future blocks of this group need to be discarded. + if (pBlock->info.rows == 0) { + return PROJECT_RETRIEVE_CONTINUE; + } } return PROJECT_RETRIEVE_DONE; diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 36981f501e..757324a773 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -1759,6 +1759,11 @@ void initLimitInfo(const SNode* pLimit, const SNode* pSLimit, SLimitInfo* pLimit pLimitInfo->remainGroupOffset = slimit.offset; } +void resetLimitInfoForNextGroup(SLimitInfo* pLimitInfo) { + pLimitInfo->numOfOutputRows = 0; + pLimitInfo->remainOffset = pLimitInfo->limit.offset; +} + uint64_t tableListGetSize(const STableListInfo* pTableList) { ASSERT(taosArrayGetSize(pTableList->pTableList) == taosHashGetSize(pTableList->map)); return taosArrayGetSize(pTableList->pTableList); diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index 4d38f2c8e9..3e3610827b 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -175,8 +175,7 @@ static int32_t setInfoForNewGroup(SSDataBlock* pBlock, SLimitInfo* pLimitInfo, S // reset the value for a new group data // existing rows that belongs to previous group. - pLimitInfo->numOfOutputRows = 0; - pLimitInfo->remainOffset = pLimitInfo->limit.offset; + resetLimitInfoForNextGroup(pLimitInfo); } return PROJECT_RETRIEVE_DONE; @@ -200,10 +199,18 @@ static int32_t doIngroupLimitOffset(SLimitInfo* pLimitInfo, uint64_t groupId, SS if (pLimitInfo->limit.limit >= 0 && pLimitInfo->numOfOutputRows + pBlock->info.rows >= pLimitInfo->limit.limit) { int32_t keepRows = (int32_t)(pLimitInfo->limit.limit - pLimitInfo->numOfOutputRows); blockDataKeepFirstNRows(pBlock, keepRows); + // TODO: optimize it later when partition by + limit + // all retrieved requirement has been fulfilled, let's finish this if ((pLimitInfo->slimit.limit == -1 && pLimitInfo->currentGroupId == 0) || (pLimitInfo->slimit.limit > 0 && pLimitInfo->slimit.limit <= pLimitInfo->numOfOutputGroups)) { setOperatorCompleted(pOperator); + } else { + // Even current group is done, there may be many vgroups remain existed, and we need to continue to retrieve data + // from next group. So let's continue this retrieve process + if (keepRows == 0) { + return PROJECT_RETRIEVE_CONTINUE; + } } } @@ -357,7 +364,6 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { pOperator->cost.openCost = (taosGetTimestampUs() - st) / 1000.0; } - // printDataBlock1(p, "project"); return (p->info.rows > 0) ? p : NULL; } diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index eb38299938..813763fffa 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -257,7 +257,7 @@ static void doSetTagColumnData(STableScanBase* pTableScanInfo, SSDataBlock* pBlo } // todo handle the slimit info -void applyLimitOffset(SLimitInfo* pLimitInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo, SOperatorInfo* pOperator) { +bool applyLimitOffset(SLimitInfo* pLimitInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo, SOperatorInfo* pOperator) { SLimit* pLimit = &pLimitInfo->limit; const char* id = GET_TASKID(pTaskInfo); @@ -266,6 +266,7 @@ void applyLimitOffset(SLimitInfo* pLimitInfo, SSDataBlock* pBlock, SExecTaskInfo pLimitInfo->remainOffset -= pBlock->info.rows; blockDataEmpty(pBlock); qDebug("current block ignore due to offset, current:%" PRId64 ", %s", pLimitInfo->remainOffset, id); + return false; } else { blockDataTrimFirstNRows(pBlock, pLimitInfo->remainOffset); pLimitInfo->remainOffset = 0; @@ -274,13 +275,14 @@ void applyLimitOffset(SLimitInfo* pLimitInfo, SSDataBlock* pBlock, SExecTaskInfo if (pLimit->limit != -1 && pLimit->limit <= (pLimitInfo->numOfOutputRows + pBlock->info.rows)) { // limit the output rows - int32_t overflowRows = pLimitInfo->numOfOutputRows + pBlock->info.rows - pLimit->limit; - int32_t keep = pBlock->info.rows - overflowRows; + int32_t keep = (int32_t)(pLimit->limit - pLimitInfo->numOfOutputRows); blockDataKeepFirstNRows(pBlock, keep); qDebug("output limit %" PRId64 " has reached, %s", pLimit->limit, id); - pOperator->status = OP_EXEC_DONE; + return true; } + + return false; } static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableScanInfo, SSDataBlock* pBlock, @@ -391,7 +393,10 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanBase* pTableSca } } - applyLimitOffset(&pTableScanInfo->limitInfo, pBlock, pTaskInfo, pOperator); + bool limitReached = applyLimitOffset(&pTableScanInfo->limitInfo, pBlock, pTaskInfo, pOperator); + if (limitReached) { // set operator flag is done + setOperatorCompleted(pOperator); + } pCost->totalRows += pBlock->info.rows; pTableScanInfo->limitInfo.numOfOutputRows = pCost->totalRows; @@ -768,8 +773,7 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) { // reset value for the next group data output pOperator->status = OP_OPENED; - pInfo->base.limitInfo.numOfOutputRows = 0; - pInfo->base.limitInfo.remainOffset = pInfo->base.limitInfo.limit.offset; + resetLimitInfoForNextGroup(&pInfo->base.limitInfo); int32_t num = 0; STableKeyInfo* pList = NULL; @@ -2685,9 +2689,12 @@ int32_t stopGroupTableMergeScan(SOperatorInfo* pOperator) { taosArrayDestroy(pInfo->queryConds); pInfo->queryConds = NULL; + resetLimitInfoForNextGroup(&pInfo->limitInfo); return TSDB_CODE_SUCCESS; } +// all data produced by this function only belongs to one group +// slimit/soffset does not need to be concerned here, since this function only deal with data within one group. SSDataBlock* getSortedTableMergeScanBlockData(SSortHandle* pHandle, SSDataBlock* pResBlock, int32_t capacity, SOperatorInfo* pOperator) { STableMergeScanInfo* pInfo = pOperator->info; @@ -2707,10 +2714,12 @@ SSDataBlock* getSortedTableMergeScanBlockData(SSortHandle* pHandle, SSDataBlock* } } - qDebug("%s get sorted row blocks, rows:%d", GET_TASKID(pTaskInfo), pResBlock->info.rows); applyLimitOffset(&pInfo->limitInfo, pResBlock, pTaskInfo, pOperator); pInfo->limitInfo.numOfOutputRows += pResBlock->info.rows; + qDebug("%s get sorted row block, rows:%d, limit:%"PRId64, GET_TASKID(pTaskInfo), pResBlock->info.rows, + pInfo->limitInfo.numOfOutputRows); + return (pResBlock->info.rows > 0) ? pResBlock : NULL; } @@ -2749,11 +2758,13 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) { pOperator->resultInfo.totalRows += pBlock->info.rows; return pBlock; } else { + // Data of this group are all dumped, let's try the next group stopGroupTableMergeScan(pOperator); if (pInfo->tableEndIndex >= tableListSize - 1) { setOperatorCompleted(pOperator); break; } + pInfo->tableStartIndex = pInfo->tableEndIndex + 1; pInfo->groupId = tableListGetInfo(pTaskInfo->pTableInfoList, pInfo->tableStartIndex)->groupId; startGroupTableMergeScan(pOperator); diff --git a/source/libs/executor/src/sortoperator.c b/source/libs/executor/src/sortoperator.c index f5dc6cc623..97b4fd9dc4 100644 --- a/source/libs/executor/src/sortoperator.c +++ b/source/libs/executor/src/sortoperator.c @@ -680,11 +680,13 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData break; } + bool limitReached = applyLimitOffset(&pInfo->limitInfo, p, pTaskInfo, pOperator); + if (limitReached) { + resetLimitInfoForNextGroup(&pInfo->limitInfo); + } + if (p->info.rows > 0) { - applyLimitOffset(&pInfo->limitInfo, p, pTaskInfo, pOperator); - if (p->info.rows > 0) { - break; - } + break; } } @@ -698,7 +700,6 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData colDataAssign(pDst, pSrc, p->info.rows, &pDataBlock->info); } - pInfo->limitInfo.numOfOutputRows += p->info.rows; pDataBlock->info.rows = p->info.rows; pDataBlock->info.id.groupId = pInfo->groupId; pDataBlock->info.dataLoad = 1; From f71d2b9ee6d09e732dd9f6948df813a67cc5437d Mon Sep 17 00:00:00 2001 From: Huo Linhe Date: Wed, 18 Jan 2023 11:18:18 +0800 Subject: [PATCH 136/139] docs: update helm chart version to 3.0.2 --- docs/en/10-deployment/05-helm.md | 12 ++++++------ docs/zh/10-deployment/05-helm.md | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/en/10-deployment/05-helm.md b/docs/en/10-deployment/05-helm.md index a4fa681000..61fbb17e0d 100644 --- a/docs/en/10-deployment/05-helm.md +++ b/docs/en/10-deployment/05-helm.md @@ -22,7 +22,7 @@ Helm uses the kubectl and kubeconfig configurations to perform Kubernetes operat To use TDengine Chart, download it from GitHub: ```bash -wget https://github.com/taosdata/TDengine-Operator/raw/3.0/helm/tdengine-3.0.0.tgz +wget https://github.com/taosdata/TDengine-Operator/raw/3.0/helm/tdengine-3.0.2.tgz ``` @@ -38,7 +38,7 @@ With minikube, the default value is standard. Use Helm commands to install TDengine: ```bash -helm install tdengine tdengine-3.0.0.tgz \ +helm install tdengine tdengine-3.0.2.tgz \ --set storage.className= ``` @@ -46,7 +46,7 @@ helm install tdengine tdengine-3.0.0.tgz \ You can configure a small storage size in minikube to ensure that your deployment does not exceed your available disk space. ```bash -helm install tdengine tdengine-3.0.0.tgz \ +helm install tdengine tdengine-3.0.2.tgz \ --set storage.className=standard \ --set storage.dataSize=2Gi \ --set storage.logSize=10Mi @@ -83,14 +83,14 @@ You can configure custom parameters in TDengine with the `values.yaml` file. Run the `helm show values` command to see all parameters supported by TDengine Chart. ```bash -helm show values tdengine-3.0.0.tgz +helm show values tdengine-3.0.2.tgz ``` Save the output of this command as `values.yaml`. Then you can modify this file with your desired values and use it to deploy a TDengine cluster: ```bash -helm install tdengine tdengine-3.0.0.tgz -f values.yaml +helm install tdengine tdengine-3.0.2.tgz -f values.yaml ``` @@ -107,7 +107,7 @@ image: prefix: tdengine/tdengine #pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. -# tag: "3.0.0.0" +# tag: "3.0.2.0" service: # ClusterIP is the default service type, use NodeIP only if you know what you are doing. diff --git a/docs/zh/10-deployment/05-helm.md b/docs/zh/10-deployment/05-helm.md index 9a3b21f092..07d77506f7 100644 --- a/docs/zh/10-deployment/05-helm.md +++ b/docs/zh/10-deployment/05-helm.md @@ -23,7 +23,7 @@ Helm 会使用 kubectl 和 kubeconfig 的配置来操作 Kubernetes,可以参 TDengine Chart 尚未发布到 Helm 仓库,当前可以从 GitHub 直接下载: ```bash -wget https://github.com/taosdata/TDengine-Operator/raw/3.0/helm/tdengine-3.0.0.tgz +wget https://github.com/taosdata/TDengine-Operator/raw/3.0/helm/tdengine-3.0.2.tgz ``` @@ -39,7 +39,7 @@ kubectl get storageclass 之后,使用 helm 命令安装: ```bash -helm install tdengine tdengine-3.0.0.tgz \ +helm install tdengine tdengine-3.0.2.tgz \ --set storage.className= ``` @@ -47,7 +47,7 @@ helm install tdengine tdengine-3.0.0.tgz \ 在 minikube 环境下,可以设置一个较小的容量避免超出磁盘可用空间: ```bash -helm install tdengine tdengine-3.0.0.tgz \ +helm install tdengine tdengine-3.0.2.tgz \ --set storage.className=standard \ --set storage.dataSize=2Gi \ --set storage.logSize=10Mi @@ -84,14 +84,14 @@ TDengine 支持 `values.yaml` 自定义。 通过 helm show values 可以获取 TDengine Chart 支持的全部 values 列表: ```bash -helm show values tdengine-3.0.0.tgz +helm show values tdengine-3.0.2.tgz ``` 你可以将结果保存为 values.yaml,之后可以修改其中的各项参数,如 replica 数量,存储类名称,容量大小,TDengine 配置等,然后使用如下命令安装 TDengine 集群: ```bash -helm install tdengine tdengine-3.0.0.tgz -f values.yaml +helm install tdengine tdengine-3.0.2.tgz -f values.yaml ``` @@ -108,7 +108,7 @@ image: prefix: tdengine/tdengine #pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. -# tag: "3.0.0.0" +# tag: "3.0.2.0" service: # ClusterIP is the default service type, use NodeIP only if you know what you are doing. From 90e8899ea38a17e3302185078314420dd858c860 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 18 Jan 2023 11:32:51 +0800 Subject: [PATCH 137/139] fix: typos --- docs/en/10-deployment/05-helm.md | 8 ++++---- docs/zh/10-deployment/05-helm.md | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/en/10-deployment/05-helm.md b/docs/en/10-deployment/05-helm.md index 61fbb17e0d..90baa5f445 100644 --- a/docs/en/10-deployment/05-helm.md +++ b/docs/en/10-deployment/05-helm.md @@ -155,15 +155,15 @@ clusterDomainSuffix: "" # See the [Configuration Variables](../../reference/config) # # Note: -# 1. firstEp/secondEp: should not be setted here, it's auto generated at scale-up. -# 2. serverPort: should not be setted, we'll use the default 6030 in many places. -# 3. fqdn: will be auto generated in kubenetes, user should not care about it. +# 1. firstEp/secondEp: should not be set here, it's auto generated at scale-up. +# 2. serverPort: should not be set, we'll use the default 6030 in many places. +# 3. fqdn: will be auto generated in kubernetes, user should not care about it. # 4. role: currently role is not supported - every node is able to be mnode and vnode. # # Btw, keep quotes "" around the value like below, even the value will be number or not. taoscfg: # Starts as cluster or not, must be 0 or 1. - # 0: all pods will start as a seperate TDengine server + # 0: all pods will start as a separate TDengine server # 1: pods will start as TDengine server cluster. [default] CLUSTER: "1" diff --git a/docs/zh/10-deployment/05-helm.md b/docs/zh/10-deployment/05-helm.md index 07d77506f7..b2c405033f 100644 --- a/docs/zh/10-deployment/05-helm.md +++ b/docs/zh/10-deployment/05-helm.md @@ -4,7 +4,7 @@ title: 使用 Helm 部署 TDengine 集群 description: 使用 Helm 部署 TDengine 集群的详细指南 --- -Helm 是 Kubernetes 的包管理器,上一节使用 Kubernets 部署 TDengine 集群的操作已经足够简单,但 Helm 依然可以提供更强大的能力。 +Helm 是 Kubernetes 的包管理器,上一节使用 Kubernetes 部署 TDengine 集群的操作已经足够简单,但 Helm 依然可以提供更强大的能力。 ## 安装 Helm @@ -156,15 +156,15 @@ clusterDomainSuffix: "" # See the variable list at https://www.taosdata.com/cn/documentation/administrator . # # Note: -# 1. firstEp/secondEp: should not be setted here, it's auto generated at scale-up. -# 2. serverPort: should not be setted, we'll use the default 6030 in many places. -# 3. fqdn: will be auto generated in kubenetes, user should not care about it. +# 1. firstEp/secondEp: should not be set here, it's auto generated at scale-up. +# 2. serverPort: should not be set, we'll use the default 6030 in many places. +# 3. fqdn: will be auto generated in kubernetes, user should not care about it. # 4. role: currently role is not supported - every node is able to be mnode and vnode. # # Btw, keep quotes "" around the value like below, even the value will be number or not. taoscfg: # Starts as cluster or not, must be 0 or 1. - # 0: all pods will start as a seperate TDengine server + # 0: all pods will start as a separate TDengine server # 1: pods will start as TDengine server cluster. [default] CLUSTER: "1" From 3d3d91641cd14117f4059b676391dbc58f84d039 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 18 Jan 2023 11:41:11 +0800 Subject: [PATCH 138/139] chore: release script add comp for taostools (#19618) * chore: add comp postfix for taos-tools * fix: update taos-tools 5c53cc8 --- cmake/taostools_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index cddc5aee4e..1e2247eedc 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG 723f696 + GIT_TAG 5c53cc8 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From 917324eced2dcc92f16a07f8820c8765f7ce0e3c Mon Sep 17 00:00:00 2001 From: xiaolei li <85657333+xleili@users.noreply.github.com> Date: Wed, 18 Jan 2023 16:11:12 +0800 Subject: [PATCH 139/139] release: update verion to ver-3.0.2.4 (#19633) --- cmake/cmake.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/cmake.version b/cmake/cmake.version index ba85a3d99b..a4c783b6c8 100644 --- a/cmake/cmake.version +++ b/cmake/cmake.version @@ -2,7 +2,7 @@ IF (DEFINED VERNUMBER) SET(TD_VER_NUMBER ${VERNUMBER}) ELSE () - SET(TD_VER_NUMBER "3.0.2.2") + SET(TD_VER_NUMBER "3.0.2.4") ENDIF () IF (DEFINED VERCOMPATIBLE)
小 T 的二维码小 T 的二维码 TDengine 微信视频号 TDengine 微信公众号