diff --git a/cmake/cmake.options b/cmake/cmake.options index e013ff7592..2acd46694b 100644 --- a/cmake/cmake.options +++ b/cmake/cmake.options @@ -79,10 +79,16 @@ ENDIF () option( BUILD_SANITIZER - "If build addr2line" + "If build sanitizer" OFF ) +option( + TDENGINE_3 + "TDengine 3.x" + ON + ) + option( BUILD_ADDR2LINE "If build addr2line" diff --git a/include/common/tcommon.h b/include/common/tcommon.h index f672d47c92..5a7b32d20b 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -161,7 +161,6 @@ typedef struct SQueryTableDataCond { int64_t endVersion; } SQueryTableDataCond; -void* blockDataDestroy(SSDataBlock* pBlock); int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock); void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock); @@ -169,19 +168,6 @@ int32_t tEncodeDataBlocks(void** buf, const SArray* blocks); void* tDecodeDataBlocks(const void* buf, SArray** blocks); void colDataDestroy(SColumnInfoData* pColData); -static FORCE_INLINE void blockDestroyInner(SSDataBlock* pBlock) { - int32_t numOfOutput = taosArrayGetSize(pBlock->pDataBlock); - for (int32_t i = 0; i < numOfOutput; ++i) { - SColumnInfoData* pColInfoData = (SColumnInfoData*)taosArrayGet(pBlock->pDataBlock, i); - colDataDestroy(pColInfoData); - } - - taosArrayDestroy(pBlock->pDataBlock); - taosMemoryFreeClear(pBlock->pBlockAgg); -} - -static FORCE_INLINE void tDeleteSSDataBlock(SSDataBlock* pBlock) { blockDestroyInner(pBlock); } - //====================================================================================================================== // the following structure shared by parser and executor typedef struct SColumn { diff --git a/include/common/tdatablock.h b/include/common/tdatablock.h index af333f72aa..a4f5904018 100644 --- a/include/common/tdatablock.h +++ b/include/common/tdatablock.h @@ -226,8 +226,12 @@ int32_t blockDataKeepFirstNRows(SSDataBlock* pBlock, size_t n); int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src); int32_t copyDataBlock(SSDataBlock* dst, const SSDataBlock* src); -SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData); + SSDataBlock* createDataBlock(); +void* blockDataDestroy(SSDataBlock* pBlock); +void blockDataFreeRes(SSDataBlock* pBlock); +SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData); + int32_t blockDataAppendColInfo(SSDataBlock* pBlock, SColumnInfoData* pColInfoData); SColumnInfoData createColumnInfoData(int16_t type, int32_t bytes, int16_t colId); diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h index a08db7b8f8..071c539ff3 100644 --- a/include/libs/stream/tstream.h +++ b/include/libs/stream/tstream.h @@ -340,12 +340,12 @@ static FORCE_INLINE int32_t streamTaskOutput(SStreamTask* pTask, SStreamDataBloc if (pTask->sinkType == TASK_SINK__TABLE) { ASSERT(pTask->dispatchType == TASK_DISPATCH__NONE); pTask->tbSink.tbSinkFunc(pTask, pTask->tbSink.vnode, 0, pBlock->blocks); - taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes); taosFreeQitem(pBlock); } else if (pTask->sinkType == TASK_SINK__SMA) { ASSERT(pTask->dispatchType == TASK_DISPATCH__NONE); pTask->smaSink.smaSink(pTask->smaSink.vnode, pTask->smaSink.smaId, pBlock->blocks); - taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes); taosFreeQitem(pBlock); } else { ASSERT(pTask->dispatchType != TASK_DISPATCH__NONE); diff --git a/include/os/osDef.h b/include/os/osDef.h index 6f6199de7a..14f38eb7ff 100644 --- a/include/os/osDef.h +++ b/include/os/osDef.h @@ -22,7 +22,10 @@ extern "C" { #if defined(_TD_DARWIN_64) // specific +#ifndef __COMPAR_FN_T +#define __COMPAR_FN_T typedef int(*__compar_fn_t)(const void *, const void *); +#endif // for send function in tsocket.c #if defined(MSG_NOSIGNAL) @@ -41,7 +44,10 @@ extern "C" { #endif #if defined(_ALPINE) +#ifndef __COMPAR_FN_T +#define __COMPAR_FN_T typedef int(*__compar_fn_t)(const void *, const void *); +#endif void error (int, int, const char *); #ifndef PTHREAD_MUTEX_RECURSIVE_NP #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE @@ -54,7 +60,10 @@ extern "C" { char *stpncpy (char *dest, const char *src, size_t n); // specific +#ifndef __COMPAR_FN_T +#define __COMPAR_FN_T typedef int (*__compar_fn_t)(const void *, const void *); +#endif #define ssize_t int #define _SSIZE_T_ #define bzero(ptr, size) memset((ptr), 0, (size)) @@ -69,7 +78,6 @@ extern "C" { char * strsep(char **stringp, const char *delim); char * getpass(const char *prefix); char * strndup(const char *s, size_t n); - int gettimeofday(struct timeval *ptv, void *pTimeZone); // for send function in tsocket.c #define MSG_NOSIGNAL 0 diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index f51023189d..47cfa5d410 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -542,8 +542,10 @@ int32_t blockDataToBuf(char* buf, const SSDataBlock* pBlock) { } int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) { - pBlock->info.rows = *(int32_t*)buf; + int32_t numOfRows = *(int32_t*) buf; + blockDataEnsureCapacity(pBlock, numOfRows); + pBlock->info.rows = numOfRows; size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock); const char* pStart = buf + sizeof(uint32_t); @@ -589,6 +591,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) { return TSDB_CODE_SUCCESS; } +// todo remove this int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity) { pBlock->info.rows = *(int32_t*)buf; pBlock->info.groupId = *(uint64_t*)(buf + sizeof(int32_t)); @@ -1194,15 +1197,28 @@ int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows) { return TSDB_CODE_SUCCESS; } +void blockDataFreeRes(SSDataBlock* pBlock) { + int32_t numOfOutput = taosArrayGetSize(pBlock->pDataBlock); + for (int32_t i = 0; i < numOfOutput; ++i) { + SColumnInfoData* pColInfoData = (SColumnInfoData*)taosArrayGet(pBlock->pDataBlock, i); + colDataDestroy(pColInfoData); + } + + taosArrayDestroy(pBlock->pDataBlock); + taosMemoryFreeClear(pBlock->pBlockAgg); + memset(&pBlock->info, 0, sizeof(SDataBlockInfo)); +} + void* blockDataDestroy(SSDataBlock* pBlock) { if (pBlock == NULL) { return NULL; } - blockDestroyInner(pBlock); + blockDataFreeRes(pBlock); taosMemoryFreeClear(pBlock); return NULL; } + int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src) { ASSERT(src != NULL); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c index a171d2e1e4..d2b071ec61 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmWorker.c @@ -168,7 +168,12 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { memcpy(pMsg, pRpc, sizeof(SRpcMsg)); dTrace("msg:%p, is created and will put into %s queue, type:%s", pMsg, pWorker->name, TMSG_INFO(pRpc->msgType)); - return mmPutMsgToWorker(pMgmt, pWorker, pMsg); + int32_t code = mmPutMsgToWorker(pMgmt, pWorker, pMsg); + if (code != 0) { + dTrace("msg:%p, is freed", pMsg); + taosFreeQitem(pMsg); + } + return code; } int32_t mmStartWorker(SMnodeMgmt *pMgmt) { diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index 8753ecc47c..a7ad935caa 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -319,7 +319,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { return 0; FAIL: - tDeleteSSDataBlock(pBlock); + blockDataFreeRes(pBlock); return -1; } diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 4aaa80d3ae..5e30fcd5b2 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -209,10 +209,10 @@ static void resetDataBlockScanInfo(SHashObj* pTableMap) { p->iterInit = false; p->iiter.hasVal = false; if (p->iter.iter != NULL) { - tsdbTbDataIterDestroy(p->iter.iter); + p->iter.iter = tsdbTbDataIterDestroy(p->iter.iter); } - taosArrayDestroy(p->delSkyline); + p->delSkyline = taosArrayDestroy(p->delSkyline); } } @@ -224,18 +224,15 @@ static void destroyBlockScanInfo(SHashObj* pTableMap) { p->iiter.hasVal = false; if (p->iter.iter != NULL) { - tsdbTbDataIterDestroy(p->iter.iter); - p->iter.iter = NULL; + p->iter.iter = tsdbTbDataIterDestroy(p->iter.iter); } if (p->iiter.iter != NULL) { - tsdbTbDataIterDestroy(p->iiter.iter); - p->iiter.iter = NULL; + p->iiter.iter = tsdbTbDataIterDestroy(p->iiter.iter); } - taosArrayDestroy(p->delSkyline); - taosArrayDestroy(p->pBlockList); - p->delSkyline = NULL; + p->delSkyline = taosArrayDestroy(p->delSkyline); + p->pBlockList = taosArrayDestroy(p->pBlockList); } taosHashCleanup(pTableMap); diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 2469062d09..95b4fdcd6e 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -307,7 +307,6 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode, SNode* pTagIndexCond = (SNode*)pListInfo->pTagIndexCond; if (pScanNode->tableType == TSDB_SUPER_TABLE) { if (pTagIndexCond) { - ///<<<<<<< HEAD SIndexMetaArg metaArg = { .metaEx = metaHandle, .idx = tsdbGetIdx(metaHandle), .ivtIdx = tsdbGetIvtIdx(metaHandle), .suid = tableUid}; @@ -315,20 +314,9 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode, SIdxFltStatus status = SFLT_NOT_INDEX; code = doFilterTag(pTagIndexCond, &metaArg, res, &status); if (code != 0 || status == SFLT_NOT_INDEX) { - code = TSDB_CODE_INDEX_REBUILDING; - } - //======= - // SArray* res = taosArrayInit(8, sizeof(uint64_t)); - // // code = doFilterTag(pTagIndexCond, &metaArg, res); - // code = TSDB_CODE_INDEX_REBUILDING; - //>>>>>>> dvv - if (code == TSDB_CODE_INDEX_REBUILDING) { + qError("failed to get tableIds from index, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid); +// code = TSDB_CODE_INDEX_REBUILDING; code = vnodeGetAllTableList(pVnode, tableUid, pListInfo->pTableList); - } else if (code != TSDB_CODE_SUCCESS) { - qError("failed to get tableIds, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid); - taosArrayDestroy(res); - terrno = code; - return code; } else { qDebug("success to get tableIds, size:%d, suid:%" PRIu64, (int)taosArrayGetSize(res), tableUid); } @@ -347,25 +335,25 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode, terrno = code; return code; } - - if (pTagCond) { - int32_t i = 0; - while (i < taosArrayGetSize(pListInfo->pTableList)) { - STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i); - bool isOk = isTableOk(info, pTagCond, metaHandle); - if (terrno) return terrno; - if (!isOk) { - taosArrayRemove(pListInfo->pTableList, i); - continue; - } - i++; - } - } } else { // Create one table group. STableKeyInfo info = {.lastKey = 0, .uid = tableUid, .groupId = 0}; taosArrayPush(pListInfo->pTableList, &info); } + if (pTagCond) { + int32_t i = 0; + while (i < taosArrayGetSize(pListInfo->pTableList)) { + STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i); + bool isOk = isTableOk(info, pTagCond, metaHandle); + if (terrno) return terrno; + if (!isOk) { + taosArrayRemove(pListInfo->pTableList, i); + continue; + } + i++; + } + } + pListInfo->pGroupList = taosArrayInit(4, POINTER_BYTES); if (pListInfo->pGroupList == NULL) { return TSDB_CODE_OUT_OF_MEMORY; @@ -853,6 +841,9 @@ static STimeWindow doCalculateTimeWindow(int64_t ts, SInterval* pInterval) { w.ekey = taosTimeAdd(w.skey, pInterval->interval, pInterval->intervalUnit, pInterval->precision) - 1; } else { int64_t st = w.skey; + if (pInterval->offset > 0) { + st = taosTimeAdd(st, pInterval->offset, pInterval->offsetUnit, pInterval->precision); + } if (st > ts) { st -= ((st - ts + pInterval->sliding - 1) / pInterval->sliding) * pInterval->sliding; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 4df8150140..7b274e5af8 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1193,8 +1193,6 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock } } - taosArrayDestroy(pBlock->pDataBlock); - ASSERT(pInfo->pRes->pDataBlock != NULL); // currently only the tbname pseudo column @@ -1202,12 +1200,14 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock int32_t code = addTagPseudoColumnData(&pInfo->readHandle, pInfo->pPseudoExpr, pInfo->numOfPseudoExpr, pInfo->pRes, GET_TASKID(pTaskInfo)); if (code != TSDB_CODE_SUCCESS) { + blockDataFreeRes((SSDataBlock*) pBlock); longjmp(pTaskInfo->env, code); } } doFilter(pInfo->pCondition, pInfo->pRes); blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex); + blockDataFreeRes((SSDataBlock*) pBlock); return 0; } diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index c008c7c4a9..e0bdcfdc3a 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -53,8 +53,8 @@ static void setNullRow(SSDataBlock* pBlock, int64_t ts, int32_t rowIndex) { // the first are always the timestamp column, so start from the second column. for (int32_t i = 0; i < taosArrayGetSize(pBlock->pDataBlock); ++i) { SColumnInfoData* p = taosArrayGet(pBlock->pDataBlock, i); - if (p->info.type == TSDB_DATA_TYPE_TIMESTAMP) { - colDataAppend(p, rowIndex, (const char*)&ts, false); + if (p->info.type == TSDB_DATA_TYPE_TIMESTAMP) { // handle timestamp + colDataAppend(p, rowIndex, (const char*)&ts, false); } else { colDataAppendNULL(p, rowIndex); } @@ -71,66 +71,76 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* SPoint point1, point2, point; int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order); - // set the primary timestamp column value - int32_t index = pFillInfo->numOfCurrent; - SColumnInfoData* pCol0 = taosArrayGet(pBlock->pDataBlock, pFillInfo->tsSlotId); - char* val = colDataGetData(pCol0, index); - - // set the primary timestamp value - *(TSKEY*)val = pFillInfo->currentKey; +// set the primary timestamp column value + int32_t index = pFillInfo->numOfCurrent; // set the other values if (pFillInfo->type == TSDB_FILL_PREV) { SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev : pFillInfo->next; - for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) { + for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; if (TSDB_COL_IS_TAG(pCol->flag)) { continue; } - SGroupKeys* pKey = taosArrayGet(p, i); SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol)); - doSetVal(pDstColInfoData, index, pKey); + + if (pDstColInfoData->info.type == TSDB_DATA_TYPE_TIMESTAMP) { + colDataAppend(pDstColInfoData, index, (const char*)&pFillInfo->currentKey, false); + } else { + SGroupKeys* pKey = taosArrayGet(p, i); + doSetVal(pDstColInfoData, index, pKey); + } } } else if (pFillInfo->type == TSDB_FILL_NEXT) { SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next : pFillInfo->prev; // todo refactor: start from 0 not 1 - for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) { + for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; if (TSDB_COL_IS_TAG(pCol->flag)) { continue; } - SGroupKeys* pKey = taosArrayGet(p, i); SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol)); - doSetVal(pDstColInfoData, index, pKey); + + if (pDstColInfoData->info.type == TSDB_DATA_TYPE_TIMESTAMP) { + colDataAppend(pDstColInfoData, index, (const char*)&pFillInfo->currentKey, false); + } else { + SGroupKeys* pKey = taosArrayGet(p, i); + doSetVal(pDstColInfoData, index, pKey); + } } } else if (pFillInfo->type == TSDB_FILL_LINEAR) { // TODO : linear interpolation supports NULL value if (outOfBound) { setNullRow(pBlock, pFillInfo->currentKey, index); } else { - for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) { + for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; if (TSDB_COL_IS_TAG(pCol->flag)) { continue; } - int32_t srcSlotId = GET_SRC_SLOT_ID(pCol); - int32_t dstSlotId = GET_DEST_SLOT_ID(pCol); SColumnInfoData* pDstCol = taosArrayGet(pBlock->pDataBlock, dstSlotId); - int16_t type = pCol->pExpr->base.resSchema.type; + int16_t type = pDstCol->info.type; + if (type == TSDB_DATA_TYPE_TIMESTAMP) { + colDataAppend(pDstCol, index, (const char*)&pFillInfo->currentKey, false); + continue; + } + SGroupKeys* pKey = taosArrayGet(pFillInfo->prev, i); if (IS_VAR_DATA_TYPE(type) || type == TSDB_DATA_TYPE_BOOL || pKey->isNull) { colDataAppendNULL(pDstCol, index); continue; } - SGroupKeys* pKey1 = taosArrayGet(pFillInfo->prev, 0); - int64_t prevTs = *(int64_t*)pKey1->pData; + SGroupKeys* pKey1 = taosArrayGet(pFillInfo->prev, pFillInfo->tsSlotId); + + int64_t prevTs = *(int64_t*)pKey1->pData; + int32_t srcSlotId = GET_SRC_SLOT_ID(pCol); SColumnInfoData* pSrcCol = taosArrayGet(pSrcBlock->pDataBlock, srcSlotId); char* data = colDataGetData(pSrcCol, pFillInfo->index); @@ -148,7 +158,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* } else if (pFillInfo->type == TSDB_FILL_NULL) { // fill with NULL setNullRow(pBlock, pFillInfo->currentKey, index); } else { // fill with user specified value for each column - for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) { + for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) { SFillColInfo* pCol = &pFillInfo->pFillCol[i]; if (TSDB_COL_IS_TAG(pCol->flag) /* || IS_VAR_DATA_TYPE(pCol->schema.type)*/) { continue; @@ -171,6 +181,8 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock* colDataAppend(pDst, index, (char*)&v, false); } else if (pDst->info.type == TSDB_DATA_TYPE_TIMESTAMP) { colDataAppend(pDst, index, (const char*)&pFillInfo->currentKey, false); + } else { // varchar/nchar data + colDataAppendNULL(pDst, index); } } } @@ -229,8 +241,7 @@ static void copyCurrentRowIntoBuf(SFillInfo* pFillInfo, int32_t rowIndex, SArray static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t outputRows) { pFillInfo->numOfCurrent = 0; - // todo make sure the first column is always the primary timestamp column? - SColumnInfoData* pTsCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, 0); + SColumnInfoData* pTsCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, pFillInfo->tsSlotId); int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order); bool ascFill = FILL_IS_ASC_FILL(pFillInfo); @@ -264,9 +275,8 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t assert(pFillInfo->currentKey == ts); if (pFillInfo->type == TSDB_FILL_NEXT && (pFillInfo->index + 1) < pFillInfo->numOfRows) { - ++pFillInfo->index; - copyCurrentRowIntoBuf(pFillInfo, pFillInfo->index, pFillInfo->next); - --pFillInfo->index; + int32_t nextRowIndex = pFillInfo->index + 1; + copyCurrentRowIntoBuf(pFillInfo, nextRowIndex, pFillInfo->next); } // assign rows to dst buffer diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index e622c0c1af..97cb1f0ee1 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -3461,9 +3461,16 @@ void doAddIntoResult(SqlFunctionCtx* pCtx, void* pData, int32_t rowIndex, SSData } } +/* + * +------------------------------------+--------------+--------------+ + * | null bitmap | | | + * |(n columns, one bit for each column)| src column #1| src column #2| + * +------------------------------------+--------------+--------------+ + */ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pSrcBlock, STuplePos* pPos) { SFilePage* pPage = NULL; + // todo refactor: move away int32_t completeRowSize = pCtx->subsidiaries.num * sizeof(bool); for (int32_t j = 0; j < pCtx->subsidiaries.num; ++j) { SqlFunctionCtx* pc = pCtx->subsidiaries.pCtx[j]; @@ -3476,12 +3483,15 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS } else { pPage = getBufPage(pCtx->pBuf, pCtx->curBufPage); if (pPage->num + completeRowSize > getBufPageSize(pCtx->pBuf)) { + // current page is all used, let's prepare a new buffer page + releaseBufPage(pCtx->pBuf, pPage); pPage = getNewBufPage(pCtx->pBuf, 0, &pCtx->curBufPage); pPage->num = sizeof(SFilePage); } } pPos->pageId = pCtx->curBufPage; + pPos->offset = pPage->num; // keep the current row data, extract method int32_t offset = 0; @@ -3509,7 +3519,6 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS offset += pCol->info.bytes; } - pPos->offset = pPage->num; pPage->num += completeRowSize; setBufPageDirty(pPage, true); @@ -4839,7 +4848,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da if (pInfo->numSampled < pInfo->samples) { sampleAssignResult(pInfo, data, pInfo->numSampled); if (pCtx->subsidiaries.num > 0) { - saveTupleData(pCtx, index, pCtx->pSrcBlock, pInfo->tuplePos + pInfo->numSampled * sizeof(STuplePos)); + saveTupleData(pCtx, index, pCtx->pSrcBlock, &pInfo->tuplePos[pInfo->numSampled]); } pInfo->numSampled++; } else { @@ -4847,7 +4856,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da if (j < pInfo->samples) { sampleAssignResult(pInfo, data, j); if (pCtx->subsidiaries.num > 0) { - copyTupleData(pCtx, index, pCtx->pSrcBlock, pInfo->tuplePos + j * sizeof(STuplePos)); + copyTupleData(pCtx, index, pCtx->pSrcBlock, &pInfo->tuplePos[j]); } } } @@ -4885,7 +4894,7 @@ int32_t sampleFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { int32_t currentRow = pBlock->info.rows; for (int32_t i = 0; i < pInfo->numSampled; ++i) { colDataAppend(pCol, currentRow + i, pInfo->data + i * pInfo->colBytes, false); - setSelectivityValue(pCtx, pBlock, pInfo->tuplePos + i * sizeof(STuplePos), currentRow + i); + setSelectivityValue(pCtx, pBlock, &pInfo->tuplePos[i], currentRow + i); } return pInfo->numSampled; diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index a412b589a9..fd9b588d46 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -296,8 +296,8 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { switch (call->callType) { case TSDB_UDF_CALL_SCALA_PROC: { - tDeleteSSDataBlock(&call->block); - tDeleteSSDataBlock(&subRsp->resultData); + blockDataFreeRes(&call->block); + blockDataFreeRes(&subRsp->resultData); break; } case TSDB_UDF_CALL_AGG_INIT: { @@ -305,7 +305,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) { break; } case TSDB_UDF_CALL_AGG_PROC: { - tDeleteSSDataBlock(&call->block); + blockDataFreeRes(&call->block); freeUdfInterBuf(&subRsp->resultBuf); break; } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 0542b4eec7..d108e86df1 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5954,7 +5954,8 @@ static int32_t buildAddColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, S pReq->type = pStmt->dataType.type; pReq->flags = COL_SMA_ON; - pReq->bytes = pStmt->dataType.bytes; + // pReq->bytes = pStmt->dataType.bytes; + pReq->bytes = calcTypeBytes(pStmt->dataType); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/stream/src/streamData.c b/source/libs/stream/src/streamData.c index 2b3307b7f5..8e16b23e56 100644 --- a/source/libs/stream/src/streamData.c +++ b/source/libs/stream/src/streamData.c @@ -116,7 +116,7 @@ void streamFreeQitem(SStreamQueueItem* data) { blockDataDestroy(((SStreamTrigger*)data)->pBlock); taosFreeQitem(data); } else if (type == STREAM_INPUT__DATA_BLOCK || type == STREAM_INPUT__DATA_RETRIEVE) { - taosArrayDestroyEx(((SStreamDataBlock*)data)->blocks, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(((SStreamDataBlock*)data)->blocks, (FDelete)blockDataFreeRes); taosFreeQitem(data); } else if (type == STREAM_INPUT__DATA_SUBMIT) { streamDataSubmitRefDec((SStreamDataSubmit*)data); diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c index 05efce8bc2..e2faf28abe 100644 --- a/source/libs/stream/src/streamDispatch.c +++ b/source/libs/stream/src/streamDispatch.c @@ -313,7 +313,7 @@ int32_t streamDispatch(SStreamTask* pTask, SMsgCb* pMsgCb) { atomic_store_8(&pTask->outputStatus, TASK_OUTPUT_STATUS__NORMAL); return -1; } - taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes); taosFreeQitem(pBlock); tmsgSendReq(pEpSet, &dispatchMsg); diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index d0d81e3343..023c092028 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -106,7 +106,7 @@ static SArray* streamExecForQall(SStreamTask* pTask, SArray* pRes) { qDebug("stream task %d exec end", pTask->taskId); if (pTask->taskStatus == TASK_STATUS__DROPPING) { - taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); return NULL; } @@ -121,7 +121,7 @@ static SArray* streamExecForQall(SStreamTask* pTask, SArray* pRes) { qRes->blocks = pRes; if (streamTaskOutput(pTask, qRes) < 0) { /*streamQueueProcessFail(pTask->inputQueue);*/ - taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); taosFreeQitem(qRes); return NULL; } @@ -155,7 +155,7 @@ int32_t streamExec(SStreamTask* pTask, SMsgCb* pMsgCb) { pRes = streamExecForQall(pTask, pRes); if (pRes == NULL) goto FAIL; - taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); atomic_store_8(&pTask->execStatus, TASK_EXEC_STATUS__IDLE); qDebug("stream exec, return result"); return 0; @@ -163,7 +163,7 @@ int32_t streamExec(SStreamTask* pTask, SMsgCb* pMsgCb) { continue; } else if (execStatus == TASK_EXEC_STATUS__EXECUTING) { ASSERT(taosArrayGetSize(pRes) == 0); - taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock); + taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes); return 0; } else { ASSERT(0); diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c index 3d64cec8d8..d0fb9c22e1 100644 --- a/source/libs/stream/src/streamUpdate.c +++ b/source/libs/stream/src/streamUpdate.c @@ -17,7 +17,7 @@ #include "ttime.h" #define DEFAULT_FALSE_POSITIVE 0.01 -#define DEFAULT_BUCKET_SIZE 1024 +#define DEFAULT_BUCKET_SIZE 131072 #define ROWS_PER_MILLISECOND 1 #define MAX_NUM_SCALABLE_BF 100000 #define MIN_NUM_SCALABLE_BF 10 diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index a38b14a52d..96723978ae 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -382,7 +382,7 @@ class TDDnode: if self.valgrind == 0: if platform.system().lower() == 'windows': - cmd = "mintty -h never -w hide %s -c %s" % ( + cmd = "mintty -h never %s -c %s" % ( binPath, self.cfgDir) else: cmd = "nohup %s -c %s > /dev/null 2>&1 & " % ( @@ -391,7 +391,7 @@ class TDDnode: valgrindCmdline = "valgrind --log-file=\"%s/../log/valgrind.log\" --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes"%self.cfgDir if platform.system().lower() == 'windows': - cmd = "mintty -h never -w hide %s %s -c %s" % ( + cmd = "mintty -h never %s %s -c %s" % ( valgrindCmdline, binPath, self.cfgDir) else: cmd = "nohup %s %s -c %s 2>&1 & " % ( @@ -518,20 +518,20 @@ class TDDnode: if self.running != 0: if platform.system().lower() == 'windows': - os.system("wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId | xargs echo | awk '{print $2}' | xargs taskkill -f -pid"%self.index) + psCmd = "for /f %a in ('wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId ^| xargs echo ^| awk ^'{print $2}^'') do @(ps | grep %a | awk '{print $1}' | xargs kill -INT )" % (self.index) else: psCmd = "ps -ef|grep -w %s| grep dnode%d|grep -v grep | awk '{print $2}'" % (toBeKilled,self.index) + processID = subprocess.check_output( + psCmd, shell=True).decode("utf-8") + + while(processID): + killCmd = "kill -INT %s > /dev/null 2>&1" % processID + os.system(killCmd) + time.sleep(1) processID = subprocess.check_output( psCmd, shell=True).decode("utf-8") - - while(processID): - killCmd = "kill -INT %s > /dev/null 2>&1" % processID - os.system(killCmd) - time.sleep(1) - processID = subprocess.check_output( - psCmd, shell=True).decode("utf-8") - if self.valgrind: - time.sleep(2) + if self.valgrind: + time.sleep(2) self.running = 0 tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index)) diff --git a/tests/script/general/connection/connection.sim b/tests/script/general/connection/connection.sim deleted file mode 100644 index 1af6e1fda6..0000000000 --- a/tests/script/general/connection/connection.sim +++ /dev/null @@ -1,21 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c wallevel -v 0 -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============= step1 -sql close -print close1 -sql connect - -print ============= step2 -sql close -sql connect - -print ============= step3 -sql close -sql connect - -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/connection/mqtt.sim b/tests/script/general/connection/mqtt.sim deleted file mode 100644 index c2c50ef17e..0000000000 --- a/tests/script/general/connection/mqtt.sim +++ /dev/null @@ -1,19 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 100000 -system sh/cfg.sh -n dnode1 -c http -v 1 -system sh/cfg.sh -n dnode1 -c mqtt -v 1 - -system sh/exec.sh -n dnode1 -s start - -sleep 2000 -sql connect -sql create database mqttdb; -sql create table mqttdb.devices(ts timestamp, value double) tags(name binary(32), model binary(32), serial binary(16), param binary(16), unit binary(16)); - -sleep 1000 -system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/connection/sim.tar.gz b/tests/script/general/connection/sim.tar.gz deleted file mode 100644 index 10bc1a6bac..0000000000 Binary files a/tests/script/general/connection/sim.tar.gz and /dev/null differ diff --git a/tests/script/general/connection/test_old_data.sim b/tests/script/general/connection/test_old_data.sim deleted file mode 100644 index 83df850f0b..0000000000 --- a/tests/script/general/connection/test_old_data.sim +++ /dev/null @@ -1,32 +0,0 @@ -system sh/stop_dnodes.sh -system sh/mv_old_data.sh - -print ============== deploy - -system sh/exec.sh -n dnode1 -s start -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start - -print =============== step1 - -sql use test -sql select * from m1 - -print $rows points data are retrieved -if $rows != 7 then - return -1 -endi - -print =============== step 2 - -sql select * from t1 - -print $rows points data are retrieved -if $rows != 7 then - return -1 -endi - - -system sh/exec.sh -n dnode1 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/insert/testSuite.sim b/tests/script/general/insert/testSuite.sim deleted file mode 100644 index da44167be5..0000000000 --- a/tests/script/general/insert/testSuite.sim +++ /dev/null @@ -1,9 +0,0 @@ -run general/insert/basic.sim -run general/insert/insert_drop.sim -run general/insert/query_block1_memory.sim -run general/insert/query_block2_memory.sim -run general/insert/query_block1_file.sim -run general/insert/query_block2_file.sim -run general/insert/query_file_memory.sim -run general/insert/query_multi_file.sim -run general/insert/tcp.sim diff --git a/tests/script/general/rm_bak/tag/testSuite.sim b/tests/script/general/rm_bak/tag/testSuite.sim deleted file mode 100644 index 45356efac1..0000000000 --- a/tests/script/general/rm_bak/tag/testSuite.sim +++ /dev/null @@ -1,25 +0,0 @@ -run general/tag/3.sim -run general/tag/4.sim -run general/tag/5.sim -run general/tag/6.sim -run general/tag/add.sim -run general/tag/bigint.sim -run general/tag/binary_binary.sim -run general/tag/binary.sim -run general/tag/bool_binary.sim -run general/tag/bool_int.sim -run general/tag/bool.sim -run general/tag/change.sim -run general/tag/column.sim -run general/tag/commit.sim -run general/tag/create.sim -run general/tag/delete.sim -run general/tag/double.sim -run general/tag/filter.sim -run general/tag/float.sim -run general/tag/int_binary.sim -run general/tag/int_float.sim -run general/tag/int.sim -run general/tag/set.sim -run general/tag/smallint.sim -run general/tag/tinyint.sim diff --git a/tests/script/general/table/testSuite.sim b/tests/script/general/table/testSuite.sim deleted file mode 100644 index d6cc88b36a..0000000000 --- a/tests/script/general/table/testSuite.sim +++ /dev/null @@ -1,27 +0,0 @@ -run general/table/autocreate.sim -run general/table/basic1.sim -run general/table/basic2.sim -run general/table/basic3.sim -run general/table/bigint.sim -run general/table/binary.sim -run general/table/bool.sim -run general/table/column_name.sim -run general/table/column_num.sim -run general/table/column_value.sim -run general/table/column2.sim -run general/table/date.sim -run general/table/db.table.sim -run general/table/delete_reuse1.sim -run general/table/delete_reuse2.sim -run general/table/delete_writing.sim -run general/table/describe.sim -run general/table/double.sim -run general/table/fill.sim -run general/table/float.sim -run general/table/int.sim -run general/table/limit.sim -run general/table/smallint.sim -run general/table/table_len.sim -run general/table/table.sim -run general/table/tinyint.sim -run general/table/vgroup.sim diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index dad4dbbe29..4de8b3667d 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -52,13 +52,22 @@ ./test.sh -f tsim/import/replica1.sim # ---- insert +./test.sh -f tsim/insert/backquote.sim +./test.sh -f tsim/insert/basic.sim ./test.sh -f tsim/insert/basic0.sim ./test.sh -f tsim/insert/basic1.sim -./test.sh -f tsim/insert/backquote.sim -./test.sh -f tsim/insert/null.sim -./test.sh -f tsim/insert/update0.sim ./test.sh -f tsim/insert/commit-merge0.sim +./test.sh -f tsim/insert/insert_drop.sim ./test.sh -f tsim/insert/insert_select.sim +./test.sh -f tsim/insert/null.sim +./test.sh -f tsim/insert/query_block1_file.sim +./test.sh -f tsim/insert/query_block1_memory.sim +./test.sh -f tsim/insert/query_block2_file.sim +./test.sh -f tsim/insert/query_block2_memory.sim +./test.sh -f tsim/insert/query_file_memory.sim +./test.sh -f tsim/insert/query_multi_file.sim +#./test.sh -f tsim/insert/tcp.sim +./test.sh -f tsim/insert/update0.sim # ---- parser ./test.sh -f tsim/parser/groupby-basic.sim @@ -94,7 +103,33 @@ ./test.sh -f tsim/show/basic.sim # ---- table +./test.sh -f tsim/table/autocreate.sim ./test.sh -f tsim/table/basic1.sim +./test.sh -f tsim/table/basic2.sim +./test.sh -f tsim/table/basic3.sim +./test.sh -f tsim/table/bigint.sim +./test.sh -f tsim/table/binary.sim +./test.sh -f tsim/table/bool.sim +./test.sh -f tsim/table/column_name.sim +./test.sh -f tsim/table/column_num.sim +./test.sh -f tsim/table/column_value.sim +./test.sh -f tsim/table/column2.sim +./test.sh -f tsim/table/createmulti.sim +./test.sh -f tsim/table/date.sim +./test.sh -f tsim/table/db.table.sim +# ./test.sh -f tsim/table/delete_reuse1.sim +# ./test.sh -f tsim/table/delete_reuse2.sim +# ./test.sh -f tsim/table/delete_writing.sim +./test.sh -f tsim/table/describe.sim +./test.sh -f tsim/table/double.sim +./test.sh -f tsim/table/float.sim +./test.sh -f tsim/table/int.sim +./test.sh -f tsim/table/limit.sim +./test.sh -f tsim/table/smallint.sim +./test.sh -f tsim/table/table_len.sim +./test.sh -f tsim/table/table.sim +./test.sh -f tsim/table/tinyint.sim +./test.sh -f tsim/table/vgroup.sim # ---- stream ./test.sh -f tsim/stream/basic0.sim @@ -114,6 +149,7 @@ # ./test.sh -f tsim/stream/schedSnode.sim ./test.sh -f tsim/stream/windowClose.sim ./test.sh -f tsim/stream/ignoreExpiredData.sim +./test.sh -f tsim/stream/sliding.sim # ---- transaction ./test.sh -f tsim/trans/lossdata1.sim @@ -227,23 +263,23 @@ ./test.sh -f tsim/compress/uncompress.sim # ---- compute -#./test.sh -f tsim/compute/avg.sim +./test.sh -f tsim/compute/avg.sim #./test.sh -f tsim/compute/block_dist.sim -#./test.sh -f tsim/compute/bottom.sim -#./test.sh -f tsim/compute/count.sim -#./test.sh -f tsim/compute/diff.sim -#./test.sh -f tsim/compute/diff2.sim -#./test.sh -f tsim/compute/first.sim -#./test.sh -f tsim/compute/interval.sim +./test.sh -f tsim/compute/bottom.sim +./test.sh -f tsim/compute/count.sim +./test.sh -f tsim/compute/diff.sim +./test.sh -f tsim/compute/diff2.sim +./test.sh -f tsim/compute/first.sim +./test.sh -f tsim/compute/interval.sim #./test.sh -f tsim/compute/last_row.sim -#./test.sh -f tsim/compute/last.sim -#./test.sh -f tsim/compute/leastsquare.sim -#./test.sh -f tsim/compute/max.sim -#./test.sh -f tsim/compute/min.sim +./test.sh -f tsim/compute/last.sim +./test.sh -f tsim/compute/leastsquare.sim +./test.sh -f tsim/compute/max.sim +./test.sh -f tsim/compute/min.sim #./test.sh -f tsim/compute/null.sim ./test.sh -f tsim/compute/percentile.sim ./test.sh -f tsim/compute/stddev.sim -#./test.sh -f tsim/compute/sum.sim +./test.sh -f tsim/compute/sum.sim ./test.sh -f tsim/compute/top.sim # ---- field @@ -279,4 +315,32 @@ # ---- wal ./test.sh -f tsim/wal/kill.sim +# ---- tag +./test.sh -f tsim/tag/3.sim +./test.sh -f tsim/tag/4.sim +./test.sh -f tsim/tag/5.sim +#./test.sh -f tsim/tag/6.sim +#./test.sh -f tsim/tag/add.sim +./test.sh -f tsim/tag/bigint.sim +./test.sh -f tsim/tag/binary_binary.sim +./test.sh -f tsim/tag/binary.sim +./test.sh -f tsim/tag/bool_binary.sim +./test.sh -f tsim/tag/bool_int.sim +./test.sh -f tsim/tag/bool.sim +#./test.sh -f tsim/tag/change.sim +#./test.sh -f tsim/tag/column.sim +#./test.sh -f tsim/tag/commit.sim +#./test.sh -f tsim/tag/create.sim +#./test.sh -f tsim/tag/delete.sim +#./test.sh -f tsim/tag/double.sim +#./test.sh -f tsim/tag/filter.sim +#./test.sh -f tsim/tag/float.sim +./test.sh -f tsim/tag/int_binary.sim +./test.sh -f tsim/tag/int_float.sim +./test.sh -f tsim/tag/int.sim +#./test.sh -f tsim/tag/set.sim +./test.sh -f tsim/tag/smallint.sim +./test.sh -f tsim/tag/tinyint.sim + + #======================b1-end=============== diff --git a/tests/script/sh/deploy.sh b/tests/script/sh/deploy.sh index de7b8ecfbf..5f497a248f 100755 --- a/tests/script/sh/deploy.sh +++ b/tests/script/sh/deploy.sh @@ -127,8 +127,8 @@ echo "dataDir $DATA_DIR" >> $TAOS_CFG echo "logDir $LOG_DIR" >> $TAOS_CFG echo "debugFlag 0" >> $TAOS_CFG echo "tmrDebugFlag 131" >> $TAOS_CFG -echo "uDebugFlag 131" >> $TAOS_CFG -echo "rpcDebugFlag 131" >> $TAOS_CFG +echo "uDebugFlag 143" >> $TAOS_CFG +echo "rpcDebugFlag 143" >> $TAOS_CFG echo "jniDebugFlag 143" >> $TAOS_CFG echo "qDebugFlag 143" >> $TAOS_CFG echo "cDebugFlag 143" >> $TAOS_CFG diff --git a/tests/script/sh/exec.bat b/tests/script/sh/exec.bat index e4c998c25b..88dd43349e 100644 --- a/tests/script/sh/exec.bat +++ b/tests/script/sh/exec.bat @@ -77,7 +77,10 @@ goto :eof :check_offline sleep 1 for /f "tokens=2" %%C in ('wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" get processId ^| xargs echo') do ( - echo check taosd offline - goto :check_offline + for /f "tokens=1" %%D in ('ps ^| grep %%C') do ( + echo kill -INT %%D + echo check taosd offline %NODE_NAME% %%C %%D + goto :check_offline + ) ) goto :eof \ No newline at end of file diff --git a/tests/script/test-all.bat b/tests/script/test-all.bat index f771f8fcb6..056d989e6b 100644 --- a/tests/script/test-all.bat +++ b/tests/script/test-all.bat @@ -24,7 +24,7 @@ for /F "usebackq tokens=*" %%i in (!caseFile!) do ( ) ) ) -exit !exitNum! +exit /b !exitNum! :colorEcho set timeNow=%time% diff --git a/tests/script/tsim/alter/table.sim b/tests/script/tsim/alter/table.sim index cc995d171f..348bef21fe 100644 --- a/tests/script/tsim/alter/table.sim +++ b/tests/script/tsim/alter/table.sim @@ -660,8 +660,8 @@ endi print ======= over sql drop database d1 sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/cache/new_metrics.sim b/tests/script/tsim/cache/new_metrics.sim index af7db90070..82d7d43e0f 100644 --- a/tests/script/tsim/cache/new_metrics.sim +++ b/tests/script/tsim/cache/new_metrics.sim @@ -83,10 +83,6 @@ while $i < 10 $i = $i + 1 endw -print ==> sleep 1 seconds to renew cache -sql reset query cache -sleep 1000 - print =============== step5 sql select * from $tb order by ts desc print ===>rows $rows, data $data01 diff --git a/tests/script/tsim/cache/restart_metrics.sim b/tests/script/tsim/cache/restart_metrics.sim index e144a49bf7..e346357633 100644 --- a/tests/script/tsim/cache/restart_metrics.sim +++ b/tests/script/tsim/cache/restart_metrics.sim @@ -48,9 +48,7 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start print =============== step3 -print ==> sleep 1 seconds to renew cache sql reset query cache -sleep 1000 print =============== step4 sql create database $db diff --git a/tests/script/tsim/cache/restart_table.sim b/tests/script/tsim/cache/restart_table.sim index b450f6c654..d28ef51419 100644 --- a/tests/script/tsim/cache/restart_table.sim +++ b/tests/script/tsim/cache/restart_table.sim @@ -32,9 +32,7 @@ system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start print =============== step3 -print ==> sleep 1 seconds to renew cache sql reset query cache -sleep 1000 print =============== step4 sql create database $db diff --git a/tests/script/tsim/compress/commitlog.sim b/tests/script/tsim/compress/commitlog.sim index d90780bd6c..bc9c231a9e 100644 --- a/tests/script/tsim/compress/commitlog.sim +++ b/tests/script/tsim/compress/commitlog.sim @@ -57,15 +57,7 @@ $tb = $tbPrefix . $i sql create database $db sql use $db - -$x = 0 -step3: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) -x step3 +sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) $count = 0 while $count < $N diff --git a/tests/script/tsim/compute/avg.sim b/tests/script/tsim/compute/avg.sim index 2805b65fff..c366de5f4c 100644 --- a/tests/script/tsim/compute/avg.sim +++ b/tests/script/tsim/compute/avg.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -69,13 +67,13 @@ endi print =============== step5 sql select avg(tbcol) as b from $tb interval(1m) print ===> $data01 -if $data11 != 1.000000000 then +if $data10 != 1.000000000 then return -1 endi sql select avg(tbcol) as b from $tb interval(1d) print ===> $data01 -if $data01 != 9.500000000 then +if $data00 != 9.500000000 then return -1 endi @@ -84,7 +82,7 @@ $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select avg(tbcol) as b from $tb where ts <= $ms interval(1m) print ===> $data01 -if $data41 != 4.000000000 then +if $data40 != 4.000000000 then return -1 endi if $rows != 5 then @@ -123,14 +121,14 @@ endi print =============== step9 sql select avg(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1.000000000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi sql select avg(tbcol) as b from $mt interval(1d) print ===> $data01 -if $data01 != 9.500000000 then +if $data00 != 9.500000000 then return -1 endi @@ -148,9 +146,9 @@ endi print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select avg(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1.000000000 then +sql select avg(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi if $rows != 50 then diff --git a/tests/script/tsim/compute/block_dist.sim b/tests/script/tsim/compute/block_dist.sim index 201d222af7..1583e838c6 100644 --- a/tests/script/tsim/compute/block_dist.sim +++ b/tests/script/tsim/compute/block_dist.sim @@ -47,8 +47,6 @@ while $x < $rowNum $x = $x + 1 endw -sleep 100 - print =============== step2 $i = 0 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/bottom.sim b/tests/script/tsim/compute/bottom.sim index cfac02d6d5..a17584734b 100644 --- a/tests/script/tsim/compute/bottom.sim +++ b/tests/script/tsim/compute/bottom.sim @@ -38,15 +38,13 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i sql select bottom(tbcol, 1) from $tb -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi @@ -54,25 +52,25 @@ print =============== step3 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select bottom(tbcol, 1) from $tb where ts > $ms -print ===> $data01 -if $data01 != 5 then +print ===> $data00 +if $data00 != 5 then return -1 endi print =============== step4 sql select bottom(tbcol, 1) as b from $tb -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi print =============== step5 sql select bottom(tbcol, 2) as b from $tb -print ===> $data01 $data11 -if $data01 != 0 then +print ===> $data00 $data10 +if $data00 != 1 then return -1 endi -if $data11 != 1 then +if $data10 != 0 then return -1 endi @@ -80,11 +78,11 @@ print =============== step6 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select bottom(tbcol, 2) as b from $tb where ts > $ms -print ===> $data01 $data11 -if $data01 != 5 then +print ===> $data00 $data10 +if $data00 != 6 then return -1 endi -if $data11 != 6 then +if $data10 != 5 then return -1 endi diff --git a/tests/script/tsim/compute/count.sim b/tests/script/tsim/compute/count.sim index 0a6ce93077..cf2ad933bc 100644 --- a/tests/script/tsim/compute/count.sim +++ b/tests/script/tsim/compute/count.sim @@ -38,13 +38,10 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i - sql select count(*) from $tb print ===> select count(*) from $tb => $data00 if $data00 != $rowNum then @@ -81,14 +78,14 @@ endi print =============== step5 sql select count(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 1 then +print ===> $data00 +if $data00 != 1 then return -1 endi sql select count(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != $rowNum then +print ===> $data00 +if $data00 != $rowNum then return -1 endi @@ -96,8 +93,8 @@ print =============== step6 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select count(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data01 -if $data01 != 1 then +print ===> $data00 +if $data00 != 1 then return -1 endi if $rows != 5 then @@ -149,17 +146,17 @@ endi print =============== step9 sql select count(tbcol) as b from $mt interval(1m) -print ===> $data01 -if $data01 != 10 then +print ===> $data00 +if $data00 != 10 then return -1 endi -if $data11 != 10 then +if $data10 != 10 then return -1 endi sql select count(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 200 then +print ===> $data00 +if $data00 != 200 then return -1 endi @@ -177,9 +174,9 @@ endi print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select count(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol +sql select count(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) print ===> $data01 -if $data01 != 1 then +if $data00 != 1 then return -1 endi if $rows != 50 then diff --git a/tests/script/tsim/compute/diff.sim b/tests/script/tsim/compute/diff.sim index ba4b32ddbb..6043f18b27 100644 --- a/tests/script/tsim/compute/diff.sim +++ b/tests/script/tsim/compute/diff.sim @@ -37,15 +37,13 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i sql select diff(tbcol) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi @@ -53,23 +51,23 @@ print =============== step3 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select diff(tbcol) from $tb where ts > $ms -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select diff(tbcol) from $tb where ts <= $ms -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi print =============== step4 sql select diff(tbcol) as b from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi diff --git a/tests/script/tsim/compute/diff2.sim b/tests/script/tsim/compute/diff2.sim index 08b52cb37b..021fcf6e8b 100644 --- a/tests/script/tsim/compute/diff2.sim +++ b/tests/script/tsim/compute/diff2.sim @@ -1,5 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start sql connect @@ -39,91 +40,90 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i sql select diff(c1) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c2) from $tb -print ===> $data11 -if $data11 != 1.00000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi sql select diff(c3) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c4) from $tb -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c5) from $tb -print ===> $data11 -if $data11 != 0 then +print ===> $data10 +if $data10 != 0 then return -1 endi sql select diff(c6) from $tb -print ===> $data11 -if $data11 != 1.000000000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi -sql_error select diff(c7) from $tb + +sql select diff(c7) from $tb sql_error select diff(c8) from $tb sql_error select diff(c9) from $tb sql_error select diff(ts) from $tb sql_error select diff(c1), diff(c2) from $tb -#sql_error select 2+diff(c1) from $tb -sql_error select diff(c1+2) from $tb + +sql select 2+diff(c1) from $tb +sql select diff(c1+2) from $tb sql_error select diff(c1) from $tb where ts > 0 and ts < now + 100m interval(10m) -sql_error select diff(c1) from $mt +sql select diff(c1) from $mt sql_error select diff(diff(c1)) from $tb sql_error select diff(c1) from m_di_tb1 where c2 like '2%' - print =============== step3 sql select diff(c1) from $tb where c1 > 5 -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c2) from $tb where c2 > 5 -print ===> $data11 -if $data11 != 1.00000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi sql select diff(c3) from $tb where c3 > 5 -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c4) from $tb where c4 > 5 -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select diff(c5) from $tb where c5 > 5 -print ===> $data11 -if $data11 != 0 then +print ===> $data10 +if $data10 != 0 then return -1 endi sql select diff(c6) from $tb where c6 > 5 -print ===> $data11 -if $data11 != 1.000000000 then +print ===> $data10 +if $data10 != 1.000000000 then return -1 endi print =============== step4 sql select diff(c1) from $tb where c1 > 5 and c2 < $rowNum -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi @@ -131,8 +131,8 @@ sql select diff(c1) from $tb where c9 like '%9' and c1 <= 20 if $rows != 1 then return -1 endi -print ===> $data11 -if $data01 != 10 then +print ===> $data10 +if $data00 != 10 then return -1 endi diff --git a/tests/script/tsim/compute/first.sim b/tests/script/tsim/compute/first.sim index cf1160dbdb..f8efeee513 100644 --- a/tests/script/tsim/compute/first.sim +++ b/tests/script/tsim/compute/first.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -68,14 +66,14 @@ endi print =============== step5 sql select first(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi sql select first(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi @@ -83,8 +81,8 @@ print =============== step6 $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select first(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data01 -if $data41 != 4 then +print ===> $data00 +if $data40 != 4 then return -1 endi if $rows != 5 then @@ -124,14 +122,14 @@ endi print =============== step9 sql select first(tbcol) as b from $mt interval(1m) print select first(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select first(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 0 then +print ===> $data00 +if $data00 != 0 then return -1 endi @@ -149,9 +147,9 @@ endi print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select first(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then +sql select first(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1 then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/interval.sim b/tests/script/tsim/compute/interval.sim index a8539701c7..2e38990975 100644 --- a/tests/script/tsim/compute/interval.sim +++ b/tests/script/tsim/compute/interval.sim @@ -47,10 +47,10 @@ print ===> $rows if $rows < $rowNum then return -1 endi -if $data01 != 1 then +if $data00 != 1 then return -1 endi -if $data05 != 1 then +if $data04 != 1 then return -1 endi @@ -65,10 +65,10 @@ endi if $rows < 3 then return -1 endi -if $data01 != 1 then +if $data00 != 1 then return -1 endi -if $data05 != 1 then +if $data04 != 1 then return -1 endi @@ -87,10 +87,10 @@ endi if $rows > 22 then return -1 endi -if $data01 != 1 then +if $data00 != 1 then return -1 endi -if $data05 != 1 then +if $data04 != 1 then return -1 endi @@ -109,10 +109,10 @@ endi if $rows > 50 then return -1 endi -if $data21 != 1 then +if $data20 != 1 then return -1 endi -if $data25 != 1 then +if $data24 != 1 then return -1 endi @@ -125,10 +125,10 @@ endi if $rows > 22 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi @@ -143,10 +143,10 @@ endi if $rows > 7 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi @@ -165,10 +165,10 @@ endi if $rows > 22 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi @@ -186,10 +186,10 @@ endi if $rows > 50 then return -1 endi -if $data11 > 15 then +if $data10 > 15 then return -1 endi -if $data11 < 5 then +if $data10 < 5 then return -1 endi diff --git a/tests/script/tsim/compute/last.sim b/tests/script/tsim/compute/last.sim index aa9b041ca9..6080a2fa97 100644 --- a/tests/script/tsim/compute/last.sim +++ b/tests/script/tsim/compute/last.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -69,14 +67,14 @@ endi print =============== step5 sql select last(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select last(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -85,8 +83,8 @@ $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select last(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi if $rows != 5 then @@ -127,14 +125,14 @@ endi print =============== step9 sql select last(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select last(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -153,9 +151,9 @@ print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select last(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then +sql select last(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1 then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/last_row.sim b/tests/script/tsim/compute/last_row.sim index 867f64fa2e..590fada86a 100644 --- a/tests/script/tsim/compute/last_row.sim +++ b/tests/script/tsim/compute/last_row.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -53,6 +51,7 @@ endi print =============== step3 $cc = 4 * 60000 $ms = 1601481600000 + $cc +print select last_row(tbcol) from $tb where ts <= $ms sql select last_row(tbcol) from $tb where ts <= $ms print ===> $data00 if $data00 != 4 then @@ -98,8 +97,6 @@ if $data00 != 4 then return -1 endi - - print =============== step10 sql select last_row(tbcol) as b from $mt group by tgcol print ===> $data00 diff --git a/tests/script/tsim/compute/leastsquare.sim b/tests/script/tsim/compute/leastsquare.sim index aa83a4e14e..59a5213620 100644 --- a/tests/script/tsim/compute/leastsquare.sim +++ b/tests/script/tsim/compute/leastsquare.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -65,21 +63,21 @@ endi print =============== step5 sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m) -print ===> $data01 -if $data01 != @{slop:1.000000, intercept:1.000000}@ then +print ===> $data00 +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) -print ===> $data01 -if $data01 != @{slop:1.000000, intercept:1.000000}@ then +print ===> $data00 +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print =============== step6 sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m) -print ===> $data01 -if $data01 != @{slop:1.000000, intercept:1.000000}@ then +print ===> $data00 +if $data00 != @{slop:1.000000, intercept:1.000000}@ then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/max.sim b/tests/script/tsim/compute/max.sim index 1b3fac5820..7101359026 100644 --- a/tests/script/tsim/compute/max.sim +++ b/tests/script/tsim/compute/max.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i @@ -69,14 +67,14 @@ endi print =============== step5 sql select max(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select max(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -85,8 +83,8 @@ $cc = 4 * 60000 $ms = 1601481600000 + $cc sql select max(tbcol) as b from $tb where ts <= $ms interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi if $rows != 5 then @@ -127,14 +125,14 @@ endi print =============== step9 sql select max(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then +print ===> $data10 +if $data10 != 1 then return -1 endi sql select max(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 19 then +print ===> $data00 +if $data00 != 19 then return -1 endi @@ -153,9 +151,9 @@ print =============== step11 $cc = 4 * 60000 $ms = 1601481600000 + $cc -sql select max(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then +sql select max(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m) +print ===> $data10 +if $data10 != 1 then return -1 endi print ===> $rows diff --git a/tests/script/tsim/compute/min.sim b/tests/script/tsim/compute/min.sim index 33e9eb0f3e..1ffdf19ac2 100644 --- a/tests/script/tsim/compute/min.sim +++ b/tests/script/tsim/compute/min.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/null.sim b/tests/script/tsim/compute/null.sim index 30860da48b..b5647a1e34 100644 --- a/tests/script/tsim/compute/null.sim +++ b/tests/script/tsim/compute/null.sim @@ -100,9 +100,10 @@ if $rows != 1 then return -1 endi -sql_error select * from $tb where tbcol = NULL - -return +sql select * from $tb where tbcol = NULL +if $rows != 0 then + return -1 +endi print =============== step5 sql create table tt using $mt tags( NULL ) diff --git a/tests/script/tsim/compute/percentile.sim b/tests/script/tsim/compute/percentile.sim index 5cba3ad856..93b4640442 100644 --- a/tests/script/tsim/compute/percentile.sim +++ b/tests/script/tsim/compute/percentile.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/stddev.sim b/tests/script/tsim/compute/stddev.sim index 7048399112..dbdcde9a16 100644 --- a/tests/script/tsim/compute/stddev.sim +++ b/tests/script/tsim/compute/stddev.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/sum.sim b/tests/script/tsim/compute/sum.sim index c53568f98f..950b861b4c 100644 --- a/tests/script/tsim/compute/sum.sim +++ b/tests/script/tsim/compute/sum.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/compute/top.sim b/tests/script/tsim/compute/top.sim index 9899a8a9ea..d10b3803e3 100644 --- a/tests/script/tsim/compute/top.sim +++ b/tests/script/tsim/compute/top.sim @@ -38,8 +38,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/insert/backquote.sim b/tests/script/tsim/insert/backquote.sim index ba50e70afa..db2cddd2ca 100644 --- a/tests/script/tsim/insert/backquote.sim +++ b/tests/script/tsim/insert/backquote.sim @@ -1,9 +1,9 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect + print =============== create database sql create database `database` sql create database `DataBase` @@ -184,23 +184,6 @@ print =============== stop and restart taosd system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - sql show databases print rows: $rows print $data00 $data01 diff --git a/tests/script/general/insert/basic.sim b/tests/script/tsim/insert/basic.sim similarity index 93% rename from tests/script/general/insert/basic.sim rename to tests/script/tsim/insert/basic.sim index 88eb30a1ad..20b39c8f00 100644 --- a/tests/script/general/insert/basic.sim +++ b/tests/script/tsim/insert/basic.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 diff --git a/tests/script/tsim/insert/basic0.sim b/tests/script/tsim/insert/basic0.sim index 722bc0f907..1f3c93a4bf 100644 --- a/tests/script/tsim/insert/basic0.sim +++ b/tests/script/tsim/insert/basic0.sim @@ -32,7 +32,6 @@ if $rows != 3 then return -1 endi - print =============== insert data, mode1: one row one table in sql print =============== insert data, mode1: mulit rows one table in sql #print =============== insert data, mode1: one rows mulit table in sql @@ -41,9 +40,6 @@ sql insert into ct1 values(now+0s, 10, 2.0, 3.0) sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3) sql insert into ct2 values(now+0s, 10, 2.0, 3.0) sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3) -#sql insert into ct1 values(now+4s, -14, -2.4, -3.4) ct2 values(now+4s, -14, -2.4, -3.4) -#sql insert into ct1 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6) ct2 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6) - sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0) #=================================================================== @@ -67,16 +63,6 @@ endi if $data03 != 3.000000000 then return -1 endi -#if $data41 != -14 then -# return -1 -#endi -#if $data42 != -2.40000 then -# return -1 -#endi -#if $data43 != -3.400000000 then -# return -1 -#endi - print =============== select count(*) from child table sql select count(*) from ct1 @@ -107,10 +93,10 @@ if $data03 != 4 then endi #print =============== select first(*)/first(column) from child table -#sql select first(*) from ct1 -#print ====> select first(*) from ct1 -#print rows: $rows -#print $data00 $data01 $data02 $data03 +sql select first(*) from ct1 +print ====> select first(*) from ct1 +print rows: $rows +print $data00 $data01 $data02 $data03 sql select first(ts), first(c1), first(c2), first(c3) from ct1 print ====> select first(ts), first(c1), first(c2), first(c3) from ct1 @@ -217,23 +203,23 @@ if $data32 != -3.300000000 then return -1 endi #=================================================================== -#=================================================================== #print =============== query data from stb -#sql select * from stb -#if $rows != 4 then -# return -1 -#endi +sql select * from stb +print $rows +if $rows != 9 then + return -1 +endi #print =============== select count(*) from supter table -#sql select count(*) from stb -#print $data00 $data01 $data02 -#if $rows != 1 then -# return -1 -#endi -#if $data00 != 9 then -# return -1 -#endi +sql select count(*) from stb +print $data00 $data01 $data02 +if $rows != 1 then + return -1 +endi +if $data00 != 9 then + return -1 +endi print =============== select count(column) from supter table sql select ts, c1, c2, c3 from stb @@ -264,49 +250,27 @@ if $data03 != 3.000000000 then endi #print =============== select count(column) from supter table -#sql select count(ts), count(c1), count(c2), count(c3) from stb -#print rows: $rows -#print $data00 $data01 $data02 $data03 -#print $data10 $data11 $data12 $data13 -#print $data20 $data21 $data22 $data23 -#print $data30 $data31 $data32 $data33 -#if $data00 != 9 then -# return -1 -#endi -#if $data01 != 8 then -# return -1 -#endi -#if $data02 != 8 then -# return -1 -#endi -#if $data03 != 8 then -# return -1 -#endi +sql select count(ts), count(c1), count(c2), count(c3) from stb +print rows: $rows +print $data00 $data01 $data02 $data03 +if $data00 != 9 then + return -1 +endi +if $data01 != 9 then + return -1 +endi +if $data02 != 9 then + return -1 +endi +if $data03 != 9 then + return -1 +endi #=================================================================== -#=================================================================== - print =============== stop and restart taosd, then again do query above system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== query data from child table sql select * from ct1 print rows: $rows @@ -326,16 +290,6 @@ endi if $data03 != 3.000000000 then return -1 endi -#if $data41 != -14 then -# return -1 -#endi -#if $data42 != -2.40000 then -# return -1 -#endi -#if $data43 != -3.400000000 then -# return -1 -#endi - print =============== select count(*) from child table sql select count(*) from ct1 @@ -366,10 +320,10 @@ if $data03 != 4 then endi #print =============== select first(*)/first(column) from child table -#sql select first(*) from ct1 -#print ====> select first(*) from ct1 -#print rows: $rows -#print $data00 $data01 $data02 $data03 +sql select first(*) from ct1 +print ====> select first(*) from ct1 +print rows: $rows +print $data00 $data01 $data02 $data03 sql select first(ts), first(c1), first(c2), first(c3) from ct1 print ====> select first(ts), first(c1), first(c2), first(c3) from ct1 @@ -474,24 +428,23 @@ endi if $data32 != -3.300000000 then return -1 endi -#=================================================================== -#=================================================================== -#print =============== query data from stb -#sql select * from stb -#if $rows != 4 then -# return -1 -#endi +#=================================================================== +print =============== query data from stb +sql select * from stb +if $rows != 9 then + return -1 +endi -#print =============== select count(*) from supter table -#sql select count(*) from stb -#print $data00 $data01 $data02 -#if $rows != 1 then -# return -1 -#endi -#if $data00 != 9 then -# return -1 -#endi +print =============== select count(*) from supter table +sql select count(*) from stb +print $data00 $data01 $data02 +if $rows != 1 then + return -1 +endi +if $data00 != 9 then + return -1 +endi print =============== select count(column) from supter table sql select ts, c1, c2, c3 from stb @@ -521,20 +474,19 @@ if $data03 != 3.000000000 then endi #print =============== select count(column) from supter table -#sql select count(ts), count(c1), count(c2), count(c3) from stb -#print $data00 $data01 $data02 $data03 -#if $data00 != 8 then -# return -1 -#endi -#if $data01 != 8 then -# return -1 -#endi -#if $data02 != 8 then -# return -1 -#endi -#if $data03 != 8 then -# return -1 -#endi +sql select count(ts), count(c1), count(c2), count(c3) from stb +print $data00 $data01 $data02 $data03 +if $data00 != 9 then + return -1 +endi +if $data01 != 9 then + return -1 +endi +if $data02 != 9 then + return -1 +endi +if $data03 != 9 then + return -1 +endi - -system sh/exec.sh -n dnode1 -s stop -x SIGINT +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/tsim/insert/basic1.sim b/tests/script/tsim/insert/basic1.sim index d98407b380..b8458b1b51 100644 --- a/tests/script/tsim/insert/basic1.sim +++ b/tests/script/tsim/insert/basic1.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect print =============== create database @@ -17,7 +16,6 @@ sql use d1 print =============== create super table, include all type sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned) - sql create stable if not exists stb_1 (ts timestamp, i int) tags (j int) sql create table stb_2 (ts timestamp, i int) tags (j int) sql create stable stb_3 (ts timestamp, i int) tags (j int) @@ -36,11 +34,6 @@ if $rows != 2 then return -1 endi - -print =============== insert data, mode1: one row one table in sql -print =============== insert data, mode1: mulit rows one table in sql -print =============== insert data, mode1: one rows mulit table in sql -print =============== insert data, mode1: mulit rows mulit table in sql sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) @@ -69,32 +62,15 @@ if $data03 != -2 then endi print =============== query data from st, but not support select * from super table, waiting fix -#sql select * from st -#if $rows != 4 then -# return -1 -#endi +sql select * from stb +if $rows != 4 then + return -1 +endi print =============== stop and restart taosd system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== query data sql select * from c1 print rows: $rows @@ -119,9 +95,9 @@ if $data03 != -2 then endi print =============== query data from st, but not support select * from super table, waiting fix -#sql select * from st -#if $rows != 4 then -# return -1 -#endi +sql select * from stb +if $rows != 4 then + return -1 +endi system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/insert/commit-merge0.sim b/tests/script/tsim/insert/commit-merge0.sim index 56e818654f..5fe7cc57b3 100644 --- a/tests/script/tsim/insert/commit-merge0.sim +++ b/tests/script/tsim/insert/commit-merge0.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect print =============== create database @@ -64,23 +63,6 @@ reboot_and_check: system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt sql use db sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0); diff --git a/tests/script/general/insert/insert_drop.sim b/tests/script/tsim/insert/insert_drop.sim similarity index 89% rename from tests/script/general/insert/insert_drop.sim rename to tests/script/tsim/insert/insert_drop.sim index 8592637626..020fd367ae 100644 --- a/tests/script/general/insert/insert_drop.sim +++ b/tests/script/tsim/insert/insert_drop.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $tbNum = 10 @@ -19,7 +15,7 @@ $stb = stb sql drop database $db -x step1 step1: -sql create database $db ctime 30 +sql create database $db print ====== create tables sql use $db sql create table $stb (ts timestamp, c1 int) tags(t1 int) @@ -43,13 +39,9 @@ print ====== tables created print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 3000 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql reset query cache -sleep 1000 - sql use $db sql drop table tb5 $i = 0 @@ -69,13 +61,9 @@ endw print ================== restart server to commit data into disk system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 3000 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql reset query cache -sleep 1000 - sql use $db sql create table tb5 using $stb tags(5) diff --git a/tests/script/tsim/insert/null.sim b/tests/script/tsim/insert/null.sim index 98a494c960..1b7017038a 100644 --- a/tests/script/tsim/insert/null.sim +++ b/tests/script/tsim/insert/null.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 50 sql connect print =============== create database @@ -211,66 +210,48 @@ endi #=================================================================== #print =============== query data from stb -#sql select * from stb -#print ===> -#print ===> rows: $rows -#print ===> rows0: $data00 $data01 $data02 $data03 $data04 -#if $rows != 4 then -# return -1 -#endi +sql select * from stb +print ===> +print ===> rows: $rows +print ===> rows0: $data00 $data01 $data02 $data03 $data04 +if $rows != 12 then + return -1 +endi + #print =============== select count(*) from supter table -#sql select count(*) from stb -#print $data00 $data01 $data02 -#if $rows != 1 then -# return -1 -#endi -#if $data00 != 12 then -# return -1 -#endi +sql select count(*) from stb +print $data00 $data01 $data02 +if $rows != 1 then + return -1 +endi +if $data00 != 12 then + return -1 +endi #print =============== select count(column) from supter table -#sql select count(ts), count(c1), count(c2), count(c3) from stb -#print $data00 $data01 $data02 $data03 -#if $data00 != 12 then -# return -1 -#endi -#if $data01 != 8 then -# return -1 -#endi -#if $data02 != 8 then -# return -1 -#endi -#if $data03 != 8 then -# return -1 -#endi +sql select count(ts), count(c1), count(c2), count(c3) from stb +print $data00 $data01 $data02 $data03 +if $data00 != 12 then + return -1 +endi +if $data01 != 8 then + return -1 +endi +if $data02 != 8 then + return -1 +endi +if $data03 != 8 then + return -1 +endi -#=================================================================== #=================================================================== print =============== stop and restart taosd, then again do query above system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -print ===> waiting dnode ready -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi +#=================================================================== -#=================================================================== -#=================================================================== print =============== query data from child table sql select * from ct1 print ===> select * from ct1 @@ -292,15 +273,15 @@ endi if $data03 != 3.000000000 then return -1 endi -#if $data41 != -14 then -# return -1 -#endi -#if $data42 != -2.40000 then -# return -1 -#endi -#if $data43 != -3.400000000 then -# return -1 -#endi +if $data41 != 12 then + return -1 +endi +if $data42 != 2.20000 then + return -1 +endi +if $data43 != NULL then + return -1 +endi print =============== select count(*) from child table sql select count(*) from ct1 @@ -435,40 +416,39 @@ if $data92 != 3.600000000 then return -1 endi #=================================================================== -#=================================================================== -#print =============== query data from stb -#sql select * from stb -#print ===> -#print ===> rows: $rows -#print ===> rows0: $data00 $data01 $data02 $data03 $data04 -#if $rows != 4 then -# return -1 -#endi -#print =============== select count(*) from supter table -#sql select count(*) from stb -#print $data00 $data01 $data02 -#if $rows != 1 then -# return -1 -#endi -#if $data00 != 12 then -# return -1 -#endi +print =============== query data from stb +sql select * from stb +print ===> +print ===> rows: $rows +print ===> rows0: $data00 $data01 $data02 $data03 $data04 +if $rows != 12 then + return -1 +endi +print =============== select count(*) from supter table +sql select count(*) from stb +print $data00 $data01 $data02 +if $rows != 1 then + return -1 +endi +if $data00 != 12 then + return -1 +endi -#print =============== select count(column) from supter table -#sql select count(ts), count(c1), count(c2), count(c3) from stb -#print $data00 $data01 $data02 $data03 -#if $data00 != 12 then -# return -1 -#endi -#if $data01 != 8 then -# return -1 -#endi -#if $data02 != 8 then -# return -1 -#endi -#if $data03 != 8 then -# return -1 -#endi +print =============== select count(column) from supter table +sql select count(ts), count(c1), count(c2), count(c3) from stb +print $data00 $data01 $data02 $data03 +if $data00 != 12 then + return -1 +endi +if $data01 != 8 then + return -1 +endi +if $data02 != 8 then + return -1 +endi +if $data03 != 8 then + return -1 +endi system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/insert/query_block1_file.sim b/tests/script/tsim/insert/query_block1_file.sim similarity index 98% rename from tests/script/general/insert/query_block1_file.sim rename to tests/script/tsim/insert/query_block1_file.sim index 636b9530f9..e4e8928bf8 100644 --- a/tests/script/general/insert/query_block1_file.sim +++ b/tests/script/tsim/insert/query_block1_file.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -190,7 +185,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_block1_memory.sim b/tests/script/tsim/insert/query_block1_memory.sim similarity index 97% rename from tests/script/general/insert/query_block1_memory.sim rename to tests/script/tsim/insert/query_block1_memory.sim index 823e466ee9..a8e1a0439c 100644 --- a/tests/script/general/insert/query_block1_memory.sim +++ b/tests/script/tsim/insert/query_block1_memory.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -175,7 +170,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_block2_file.sim b/tests/script/tsim/insert/query_block2_file.sim similarity index 94% rename from tests/script/general/insert/query_block2_file.sim rename to tests/script/tsim/insert/query_block2_file.sim index 5b7438875e..5557621e0f 100644 --- a/tests/script/general/insert/query_block2_file.sim +++ b/tests/script/tsim/insert/query_block2_file.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -19,15 +14,7 @@ sql drop database -x step1 step1: sql create database $db sql use $db - -$x = 0 -create1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, speed int) -x create1 +sql create table $tb (ts timestamp, speed int) #commit to file will trigger if insert 82 rows $N = 82 @@ -204,7 +191,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_block2_memory.sim b/tests/script/tsim/insert/query_block2_memory.sim similarity index 97% rename from tests/script/general/insert/query_block2_memory.sim rename to tests/script/tsim/insert/query_block2_memory.sim index fb41981c89..910207d13b 100644 --- a/tests/script/general/insert/query_block2_memory.sim +++ b/tests/script/tsim/insert/query_block2_memory.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -167,7 +162,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_file_memory.sim b/tests/script/tsim/insert/query_file_memory.sim similarity index 94% rename from tests/script/general/insert/query_file_memory.sim rename to tests/script/tsim/insert/query_file_memory.sim index f920c215c0..c0aafd2686 100644 --- a/tests/script/general/insert/query_file_memory.sim +++ b/tests/script/tsim/insert/query_file_memory.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -20,14 +15,7 @@ step1: sql create database $db sql use $db -$x = 0 -create1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, speed int) -x create1 +sql create table $tb (ts timestamp, speed int) #commit to file will trigger if insert 82 rows @@ -202,7 +190,7 @@ clear: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/query_multi_file.sim b/tests/script/tsim/insert/query_multi_file.sim similarity index 76% rename from tests/script/general/insert/query_multi_file.sim rename to tests/script/tsim/insert/query_multi_file.sim index bbca53d309..f996317721 100644 --- a/tests/script/general/insert/query_multi_file.sim +++ b/tests/script/tsim/insert/query_multi_file.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -20,14 +15,7 @@ step1: sql create database $db sql use $db -$x = 0 -create1: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi -sql create table $tb (ts timestamp, speed int) -x create1 +sql create table $tb (ts timestamp, speed int) $N = 20000 @@ -49,7 +37,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/insert/tcp.sim b/tests/script/tsim/insert/tcp.sim similarity index 91% rename from tests/script/general/insert/tcp.sim rename to tests/script/tsim/insert/tcp.sim index 002d84dcae..2dc720a0d4 100644 --- a/tests/script/general/insert/tcp.sim +++ b/tests/script/tsim/insert/tcp.sim @@ -1,10 +1,7 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect sql create database d1; diff --git a/tests/script/tsim/stream/sliding.sim b/tests/script/tsim/stream/sliding.sim index 750be7cb49..44f96cbefa 100644 --- a/tests/script/tsim/stream/sliding.sim +++ b/tests/script/tsim/stream/sliding.sim @@ -17,10 +17,10 @@ sql use test sql create stable st(ts timestamp, a int, b int, c int, d double) 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 stream streams1 trigger at_once into streamt as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s); -sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s); -sql create stream stream_t1 trigger at_once into streamtST as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s); -sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s); +sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s); +sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s); +sql create stream stream_t1 trigger at_once into streamtST as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s); +sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s); sql insert into t1 values(1648791210000,1,2,3,1.0); sql insert into t1 values(1648791216000,2,2,3,1.1); diff --git a/tests/script/general/table/autocreate.sim b/tests/script/tsim/table/autocreate.sim similarity index 98% rename from tests/script/general/table/autocreate.sim rename to tests/script/tsim/table/autocreate.sim index 404c714ab4..1267e33932 100644 --- a/tests/script/general/table/autocreate.sim +++ b/tests/script/tsim/table/autocreate.sim @@ -1,13 +1,12 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 2000 sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi diff --git a/tests/script/general/table/back_insert.sim b/tests/script/tsim/table/back_insert.sim similarity index 100% rename from tests/script/general/table/back_insert.sim rename to tests/script/tsim/table/back_insert.sim diff --git a/tests/script/tsim/table/basic1.sim b/tests/script/tsim/table/basic1.sim index 913ced74aa..6cb5bc54f7 100644 --- a/tests/script/tsim/table/basic1.sim +++ b/tests/script/tsim/table/basic1.sim @@ -213,23 +213,6 @@ endi system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s start -$loop_cnt = 0 -check_dnode_ready: - $loop_cnt = $loop_cnt + 1 - sleep 200 - if $loop_cnt == 10 then - print ====> dnode not ready! - return -1 - endi -sql show dnodes -print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05 -if $data00 != 1 then - return -1 -endi -if $data04 != ready then - goto check_dnode_ready -endi - print =============== query data sql select * from c1 print rows: $rows diff --git a/tests/script/general/table/basic2.sim b/tests/script/tsim/table/basic2.sim similarity index 93% rename from tests/script/general/table/basic2.sim rename to tests/script/tsim/table/basic2.sim index 4286f9ee4a..297ae3d333 100644 --- a/tests/script/general/table/basic2.sim +++ b/tests/script/tsim/table/basic2.sim @@ -1,7 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 2000 sql connect print =============== one table @@ -21,11 +20,11 @@ endi print =============== show sql show databases -if $data02 != 2 then +if $data22 != 2 then return -1 endi -if $data03 != 1 then +if $data24 != 1 then return -1 endi @@ -34,7 +33,7 @@ if $data00 != 2 then return -1 endi -if $data01 != 2 then +if $data01 != d1 then return -1 endi diff --git a/tests/script/general/table/basic3.sim b/tests/script/tsim/table/basic3.sim similarity index 97% rename from tests/script/general/table/basic3.sim rename to tests/script/tsim/table/basic3.sim index 41c276ae98..c9335b6d1b 100644 --- a/tests/script/general/table/basic3.sim +++ b/tests/script/tsim/table/basic3.sim @@ -1,13 +1,12 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 2000 sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi diff --git a/tests/script/general/table/bigint.sim b/tests/script/tsim/table/bigint.sim similarity index 95% rename from tests/script/general/table/bigint.sim rename to tests/script/tsim/table/bigint.sim index d75f406d77..4611db112f 100644 --- a/tests/script/general/table/bigint.sim +++ b/tests/script/tsim/table/bigint.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -66,7 +63,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/binary.sim b/tests/script/tsim/table/binary.sim similarity index 93% rename from tests/script/general/table/binary.sim rename to tests/script/tsim/table/binary.sim index 47915530ef..a2cfc77796 100644 --- a/tests/script/general/table/binary.sim +++ b/tests/script/tsim/table/binary.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -56,7 +53,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/bool.sim b/tests/script/tsim/table/bool.sim similarity index 95% rename from tests/script/general/table/bool.sim rename to tests/script/tsim/table/bool.sim index e49637448f..454bf47d33 100644 --- a/tests/script/general/table/bool.sim +++ b/tests/script/tsim/table/bool.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -85,7 +82,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/column2.sim b/tests/script/tsim/table/column2.sim similarity index 87% rename from tests/script/general/table/column2.sim rename to tests/script/tsim/table/column2.sim index 441766f2d4..e540835c14 100644 --- a/tests/script/general/table/column2.sim +++ b/tests/script/tsim/table/column2.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print =============== step1 @@ -19,7 +16,7 @@ endi sql drop database db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/column_name.sim b/tests/script/tsim/table/column_name.sim similarity index 94% rename from tests/script/general/table/column_name.sim rename to tests/script/tsim/table/column_name.sim index 47fcfab5a8..bad6c95bb1 100644 --- a/tests/script/general/table/column_name.sim +++ b/tests/script/tsim/table/column_name.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -79,7 +76,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/column_num.sim b/tests/script/tsim/table/column_num.sim similarity index 96% rename from tests/script/general/table/column_num.sim rename to tests/script/tsim/table/column_num.sim index a18173bc8f..0a5d151adf 100644 --- a/tests/script/general/table/column_num.sim +++ b/tests/script/tsim/table/column_num.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -78,7 +75,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/column_value.sim b/tests/script/tsim/table/column_value.sim similarity index 95% rename from tests/script/general/table/column_value.sim rename to tests/script/tsim/table/column_value.sim index 1edf8c2992..861e2f1a8d 100644 --- a/tests/script/general/table/column_value.sim +++ b/tests/script/tsim/table/column_value.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -68,7 +65,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/createmulti.sim b/tests/script/tsim/table/createmulti.sim similarity index 97% rename from tests/script/general/table/createmulti.sim rename to tests/script/tsim/table/createmulti.sim index 0da1ce96a7..e204bd4f3d 100644 --- a/tests/script/general/table/createmulti.sim +++ b/tests/script/tsim/table/createmulti.sim @@ -1,13 +1,12 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start -sleep 3000 sql connect print =============== create database sql create database db sql show databases -if $rows != 1 then +if $rows != 3 then return -1 endi diff --git a/tests/script/general/table/date.sim b/tests/script/tsim/table/date.sim similarity index 81% rename from tests/script/general/table/date.sim rename to tests/script/tsim/table/date.sim index 23188e12e0..f2361cf4f5 100644 --- a/tests/script/general/table/date.sim +++ b/tests/script/tsim/table/date.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -27,18 +24,18 @@ if $data00 != @17-01-01 08:00:00.001@ then endi print =============== step2 -sql insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2) -#sql insert into $tb values ('2017-08-28 00:23:46cd .429', 2) +sql_error insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2) +sql_error insert into $tb values ('2017-08-28 00:23:46cd .429', 2) sql select ts from $tb -if $rows != 2 then +if $rows != 1 then return -1 endi print =============== step3 -#sql insert into $tb values ('1970-01-01 08:00:00.000', 3) -#sql insert into $tb values ('1970-01-01 08:00:00.000', 3) +sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3) +sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3) sql select ts from $tb -if $rows != 2 then +if $rows != 1 then return -1 endi @@ -57,7 +54,7 @@ print =============== step5 sql_error insert into $tb values ('9999-12-31 213:59:59.999', 13) sql select ts from $tb print $rows -if $rows != 8 then +if $rows != 7 then return -1 endi @@ -65,7 +62,7 @@ print =============== step6 sql_error insert into $tb values ('9999-12-99 23:59:59.999', 13) sql select ts from $tb -if $rows != 8 then +if $rows != 7 then return -1 endi @@ -83,7 +80,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/db.table.sim b/tests/script/tsim/table/db.table.sim similarity index 90% rename from tests/script/general/table/db.table.sim rename to tests/script/tsim/table/db.table.sim index 906396402a..b5d8294b6e 100644 --- a/tests/script/general/table/db.table.sim +++ b/tests/script/tsim/table/db.table.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -40,7 +37,7 @@ sql drop table $table sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/delete_reuse1.sim b/tests/script/tsim/table/delete_reuse1.sim similarity index 100% rename from tests/script/general/table/delete_reuse1.sim rename to tests/script/tsim/table/delete_reuse1.sim diff --git a/tests/script/general/table/delete_reuse2.sim b/tests/script/tsim/table/delete_reuse2.sim similarity index 100% rename from tests/script/general/table/delete_reuse2.sim rename to tests/script/tsim/table/delete_reuse2.sim diff --git a/tests/script/general/table/delete_writing.sim b/tests/script/tsim/table/delete_writing.sim similarity index 100% rename from tests/script/general/table/delete_writing.sim rename to tests/script/tsim/table/delete_writing.sim diff --git a/tests/script/general/table/describe.sim b/tests/script/tsim/table/describe.sim similarity index 90% rename from tests/script/general/table/describe.sim rename to tests/script/tsim/table/describe.sim index e59371e530..28690e5794 100644 --- a/tests/script/general/table/describe.sim +++ b/tests/script/tsim/table/describe.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -42,7 +39,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/double.sim b/tests/script/tsim/table/double.sim similarity index 96% rename from tests/script/general/table/double.sim rename to tests/script/tsim/table/double.sim index ab3f2428bd..08f0dc7663 100644 --- a/tests/script/general/table/double.sim +++ b/tests/script/tsim/table/double.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -91,7 +88,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/float.sim b/tests/script/tsim/table/float.sim similarity index 96% rename from tests/script/general/table/float.sim rename to tests/script/tsim/table/float.sim index 2d0ea0e5ea..c53b4bb1a4 100644 --- a/tests/script/general/table/float.sim +++ b/tests/script/tsim/table/float.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -91,7 +88,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/int.sim b/tests/script/tsim/table/int.sim similarity index 71% rename from tests/script/general/table/int.sim rename to tests/script/tsim/table/int.sim index f30b5b28f5..7e3cefc7ca 100644 --- a/tests/script/general/table/int.sim +++ b/tests/script/tsim/table/int.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -27,12 +24,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -2147483648) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -2147483648) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -40,9 +35,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 2147483647) +sql insert into $tb values (now+3m, 2147483647) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 2147483647 then @@ -50,12 +45,10 @@ if $data01 != 2147483647 then endi print =============== step4 -sql insert into $tb values (now+3m, 2147483648) -x step4 - return -1 -step4: -sql insert into $tb values (now+3m, NULL) +sql_error insert into $tb values (now+4m, 2147483648) +sql insert into $tb values (now+5m, NULL) sql select * from $tb order by ts desc -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -63,10 +56,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -74,19 +67,8 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) -sql select * from $tb order by ts desc -if $rows != 6 then - return -1 -endi -if $data01 != 2 then - return -1 -endi - -print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc if $rows != 7 then return -1 @@ -95,18 +77,19 @@ if $data01 != 2 then return -1 endi -print =============== step8 -sql insert into $tb values (now+8m, "NULL") +print =============== step7 +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) sql select * from $tb order by ts desc if $rows != 8 then return -1 endi -if $data01 != NULL then +if $data01 != 2 then return -1 endi -print =============== step9 -sql insert into $tb values (now+9m, 'NULL') +print =============== step8 +sql insert into $tb values (now+12m, "NULL") sql select * from $tb order by ts desc if $rows != 9 then return -1 @@ -115,19 +98,29 @@ if $data01 != NULL then return -1 endi -print =============== step10 -sql insert into $tb values (now+10m, -123) +print =============== step9 +sql insert into $tb values (now+13m, 'NULL') sql select * from $tb order by ts desc if $rows != 10 then return -1 endi +if $data01 != NULL then + return -1 +endi + +print =============== step10 +sql insert into $tb values (now+14m, -123) +sql select * from $tb order by ts desc +if $rows != 11 then + return -1 +endi if $data01 != -123 then return -1 endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/limit.sim b/tests/script/tsim/table/limit.sim similarity index 86% rename from tests/script/general/table/limit.sim rename to tests/script/tsim/table/limit.sim index dd38453d0c..d20938367e 100644 --- a/tests/script/general/table/limit.sim +++ b/tests/script/tsim/table/limit.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 129 -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ============================ dnode1 start @@ -17,10 +12,10 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =================== step 0 -sql create database $db +sql create database $db vgroups 8 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 8 then return -1 endi @@ -87,7 +82,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/smallint.sim b/tests/script/tsim/table/smallint.sim similarity index 71% rename from tests/script/general/table/smallint.sim rename to tests/script/tsim/table/smallint.sim index f622ce7853..87140c561a 100644 --- a/tests/script/general/table/smallint.sim +++ b/tests/script/tsim/table/smallint.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -28,12 +25,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -32768) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -32768) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -41,9 +36,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 32767) +sql insert into $tb values (now+3m, 32767) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 32767 then @@ -51,12 +46,12 @@ if $data01 != 32767 then endi print =============== step4 -sql insert into $tb values (now+3m, 32768) -x step4 +sql insert into $tb values (now+4m, 32768) -x step4 return -1 step4: -sql insert into $tb values (now+3m, NULL) +sql insert into $tb values (now+5m, NULL) sql select * from $tb order by ts desc -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -64,10 +59,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -75,19 +70,8 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) -sql select * from $tb order by ts desc -if $rows != 6 then - return -1 -endi -if $data01 != 2 then - return -1 -endi - -print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc if $rows != 7 then return -1 @@ -96,9 +80,20 @@ if $data01 != 2 then return -1 endi +print =============== step7 +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) +sql select * from $tb order by ts desc +if $rows != 8 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +return sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/table.sim b/tests/script/tsim/table/table.sim similarity index 95% rename from tests/script/general/table/table.sim rename to tests/script/tsim/table/table.sim index c9806c40c6..65774dd03c 100644 --- a/tests/script/general/table/table.sim +++ b/tests/script/tsim/table/table.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ============================ dnode1 start @@ -200,16 +197,15 @@ if $data01 != 7 then endi print =============== step10 -$i = 1 $tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val tinyint, val2 tinyint) +sql_error create table $tb (ts timestamp, val tinyint, val2 tinyint) sql show tables if $rows != 7 then return -1 endi print =============== step11 -sql create table $tb (ts timestamp, val float, val2 double) +sql_error create table $tb (ts timestamp, val float, val2 double) sql show tables if $rows != 7 then return -1 @@ -217,7 +213,7 @@ endi sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/table_len.sim b/tests/script/tsim/table/table_len.sim similarity index 96% rename from tests/script/general/table/table_len.sim rename to tests/script/tsim/table/table_len.sim index d95c9ab0aa..e48c5d419e 100644 --- a/tests/script/general/table/table_len.sim +++ b/tests/script/tsim/table/table_len.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -98,7 +95,7 @@ step8: sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/tinyint.sim b/tests/script/tsim/table/tinyint.sim similarity index 71% rename from tests/script/general/table/tinyint.sim rename to tests/script/tsim/table/tinyint.sim index afa931fc79..4764600b5b 100644 --- a/tests/script/general/table/tinyint.sim +++ b/tests/script/tsim/table/tinyint.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect $i = 0 @@ -27,12 +24,10 @@ if $data01 != NULL then endi print =============== step2 -sql insert into $tb values (now+1m, -128) -x step2 - return -1 -step2: -sql insert into $tb values (now+1m, NULL) +sql insert into $tb values (now+1m, -128) +sql insert into $tb values (now+2m, NULL) sql select * from $tb order by ts desc -if $rows != 2 then +if $rows != 3 then return -1 endi if $data01 != NULL then @@ -40,9 +35,9 @@ if $data01 != NULL then endi print =============== step3 -sql insert into $tb values (now+2m, 127) +sql insert into $tb values (now+3m, 127) sql select * from $tb order by ts desc -if $rows != 3 then +if $rows != 4 then return -1 endi if $data01 != 127 then @@ -50,12 +45,12 @@ if $data01 != 127 then endi print =============== step4 -sql insert into $tb values (now+3m, 128) -x step4 +sql insert into $tb values (now+4m, 128) -x step4 return -1 step4: -sql insert into $tb values (now+3m, NULL) +sql insert into $tb values (now+5m, NULL) sql select * from $tb -if $rows != 4 then +if $rows != 5 then return -1 endi if $data01 != NULL then @@ -63,10 +58,10 @@ if $data01 != NULL then endi print =============== step5 -sql_error insert into $tb values (now+4m, a2) -sql insert into $tb values (now+4m, 0) +sql_error insert into $tb values (now+6m, a2) +sql insert into $tb values (now+7m, 0) sql select * from $tb order by ts desc -if $rows != 5 then +if $rows != 6 then return -1 endi if $data01 != 0 then @@ -74,19 +69,8 @@ if $data01 != 0 then endi print =============== step6 -sql_error insert into $tb values (now+5m, 2a) -sql insert into $tb values (now+5m, 2) -sql select * from $tb order by ts desc -if $rows != 6 then - return -1 -endi -if $data01 != 2 then - return -1 -endi - -print =============== step7 -sql_error insert into $tb values (now+6m, 2a'1) -sql insert into $tb values (now+6m, 2) +sql_error insert into $tb values (now+8m, 2a) +sql insert into $tb values (now+9m, 2) sql select * from $tb order by ts desc if $rows != 7 then return -1 @@ -95,9 +79,20 @@ if $data01 != 2 then return -1 endi +print =============== step7 +sql_error insert into $tb values (now+10m, 2a'1) +sql insert into $tb values (now+11m, 2) +sql select * from $tb order by ts desc +if $rows != 8 then + return -1 +endi +if $data01 != 2 then + return -1 +endi + sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/table/vgroup.sim b/tests/script/tsim/table/vgroup.sim similarity index 86% rename from tests/script/general/table/vgroup.sim rename to tests/script/tsim/table/vgroup.sim index d306a4731d..2925e9de4c 100644 --- a/tests/script/general/table/vgroup.sim +++ b/tests/script/tsim/table/vgroup.sim @@ -1,12 +1,8 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4 -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect + print ============================ dnode1 start $i = 0 @@ -16,10 +12,10 @@ $db = $dbPrefix . $i $tb = $tbPrefix . $i print =================== step 1 -sql create database $db +sql create database $db vgroups 4 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 4 then return -1 endi @@ -28,7 +24,7 @@ sql create table table2 (ts timestamp, speed int) sql create table table3 (ts timestamp, speed int) sql create table table4 (ts timestamp, speed int) sql show vgroups -if $rows != 1 then +if $rows != 4 then return -1 endi @@ -37,7 +33,7 @@ sql create table table6 (ts timestamp, speed int) sql create table table7 (ts timestamp, speed int) sql create table table8 (ts timestamp, speed int) sql show vgroups -if $rows != 2 then +if $rows != 4 then return -1 endi @@ -46,7 +42,7 @@ sql create table table10 (ts timestamp, speed int) sql create table table11 (ts timestamp, speed int) sql create table table12 (ts timestamp, speed int) sql show vgroups -if $rows != 3 then +if $rows != 4 then return -1 endi @@ -58,7 +54,7 @@ endi sql drop table table13 sql show vgroups -if $rows != 3 then +if $rows != 4 then return -1 endi @@ -72,10 +68,10 @@ print =================== step 2 $i = 1 $db = $dbPrefix . $i -sql create database $db +sql create database $db vgroups 2 sql use $db sql show vgroups -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -88,13 +84,13 @@ $db = $dbPrefix . $i sql use $db sql create table table2 (ts timestamp, speed int) sql show vgroups -if $rows != 1 then +if $rows != 2 then return -1 endi sql drop table table2 sql show vgroups -if $rows != 0 then +if $rows != 2 then return -1 endi @@ -104,7 +100,7 @@ sql create table table3 (ts timestamp, speed int) sql create table table4 (ts timestamp, speed int) sql drop table table1 sql show vgroups -if $rows != 1 then +if $rows != 2 then return -1 endi @@ -133,7 +129,7 @@ sql create database $db sql use $db sql show databases -if $rows != 5 then +if $rows != 7 then return -1 endi @@ -144,7 +140,7 @@ while $i < 5 $i = $i + 1 endw sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/3.sim b/tests/script/tsim/tag/3.sim similarity index 97% rename from tests/script/general/rm_bak/tag/3.sim rename to tests/script/tsim/tag/3.sim index 20185f5f01..d816aec3e3 100644 --- a/tests/script/general/rm_bak/tag/3.sim +++ b/tests/script/tsim/tag/3.sim @@ -1,9 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -494,28 +491,28 @@ if $data00 != 25 then endi print =============== step19 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/4.sim b/tests/script/tsim/tag/4.sim similarity index 97% rename from tests/script/general/rm_bak/tag/4.sim rename to tests/script/tsim/tag/4.sim index ee3c8efa6c..fcdb146fb9 100644 --- a/tests/script/general/rm_bak/tag/4.sim +++ b/tests/script/tsim/tag/4.sim @@ -1,13 +1,7 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect -sql reset query cache print ======================== dnode1 start @@ -681,34 +675,34 @@ if $data00 != 25 then endi print =============== step24 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/5.sim b/tests/script/tsim/tag/5.sim similarity index 97% rename from tests/script/general/rm_bak/tag/5.sim rename to tests/script/tsim/tag/5.sim index 895b1a9492..92695ddfcf 100644 --- a/tests/script/general/rm_bak/tag/5.sim +++ b/tests/script/tsim/tag/5.sim @@ -1,13 +1,7 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect -sql reset query cache print ======================== dnode1 start @@ -798,40 +792,40 @@ endi print =============== step27 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 interval(1d) group by tgcol5 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 partition by tgcol5 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/6.sim b/tests/script/tsim/tag/6.sim similarity index 98% rename from tests/script/general/rm_bak/tag/6.sim rename to tests/script/tsim/tag/6.sim index 9190998bb3..4f7f5b88d1 100644 --- a/tests/script/general/rm_bak/tag/6.sim +++ b/tests/script/tsim/tag/6.sim @@ -1,13 +1,7 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect -sql reset query cache print ======================== dnode1 start @@ -947,46 +941,46 @@ if $data00 != 25 then endi print =============== step31 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 interval(1d) group by tgcol5 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 partition by tgcol5 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 interval(1d) group by tgcol6 +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 partition by tgcol6 interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/add.sim b/tests/script/tsim/tag/add.sim similarity index 99% rename from tests/script/general/rm_bak/tag/add.sim rename to tests/script/tsim/tag/add.sim index 4a3871235e..2901614889 100644 --- a/tests/script/general/rm_bak/tag/add.sim +++ b/tests/script/tsim/tag/add.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -849,7 +845,7 @@ step142: print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/bigint.sim b/tests/script/tsim/tag/bigint.sim similarity index 96% rename from tests/script/general/rm_bak/tag/bigint.sim rename to tests/script/tsim/tag/bigint.sim index 3e5d528980..565688270c 100644 --- a/tests/script/general/rm_bak/tag/bigint.sim +++ b/tests/script/tsim/tag/bigint.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -226,18 +220,17 @@ if $data00 != 25 then return -1 endi - print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/binary.sim b/tests/script/tsim/tag/binary.sim similarity index 96% rename from tests/script/general/rm_bak/tag/binary.sim rename to tests/script/tsim/tag/binary.sim index 960f45675d..f3f89d6659 100644 --- a/tests/script/general/rm_bak/tag/binary.sim +++ b/tests/script/tsim/tag/binary.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -226,18 +220,17 @@ if $data00 != 25 then return -1 endi - print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/binary_binary.sim b/tests/script/tsim/tag/binary_binary.sim similarity index 97% rename from tests/script/general/rm_bak/tag/binary_binary.sim rename to tests/script/tsim/tag/binary_binary.sim index 3a0fb56848..071b457b44 100644 --- a/tests/script/general/rm_bak/tag/binary_binary.sim +++ b/tests/script/tsim/tag/binary_binary.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -295,16 +290,16 @@ if $data00 != 25 then endi print =============== step14 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/bool.sim b/tests/script/tsim/tag/bool.sim similarity index 95% rename from tests/script/general/rm_bak/tag/bool.sim rename to tests/script/tsim/tag/bool.sim index e37cba669b..25c7b2d967 100644 --- a/tests/script/general/rm_bak/tag/bool.sim +++ b/tests/script/tsim/tag/bool.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -223,19 +217,18 @@ if $data00 != 25 then return -1 endi - print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol -print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) +print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/bool_binary.sim b/tests/script/tsim/tag/bool_binary.sim similarity index 97% rename from tests/script/general/rm_bak/tag/bool_binary.sim rename to tests/script/tsim/tag/bool_binary.sim index 9f6e4f7344..3fcb085e37 100644 --- a/tests/script/general/rm_bak/tag/bool_binary.sim +++ b/tests/script/tsim/tag/bool_binary.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -295,16 +290,16 @@ if $data00 != 25 then endi print =============== step14 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/bool_int.sim b/tests/script/tsim/tag/bool_int.sim similarity index 97% rename from tests/script/general/rm_bak/tag/bool_int.sim rename to tests/script/tsim/tag/bool_int.sim index 60345c2d68..2ff640b329 100644 --- a/tests/script/general/rm_bak/tag/bool_int.sim +++ b/tests/script/tsim/tag/bool_int.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -311,16 +306,16 @@ if $data00 != 25 then endi print =============== step14 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/change.sim b/tests/script/tsim/tag/change.sim similarity index 99% rename from tests/script/general/rm_bak/tag/change.sim rename to tests/script/tsim/tag/change.sim index 6f294c0f48..f58e387217 100644 --- a/tests/script/general/rm_bak/tag/change.sim +++ b/tests/script/tsim/tag/change.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -508,7 +504,7 @@ endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/column.sim b/tests/script/tsim/tag/column.sim similarity index 95% rename from tests/script/general/rm_bak/tag/column.sim rename to tests/script/tsim/tag/column.sim index 5a0cd169c5..c73999230f 100644 --- a/tests/script/general/rm_bak/tag/column.sim +++ b/tests/script/tsim/tag/column.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -89,7 +84,7 @@ endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/commit.sim b/tests/script/tsim/tag/commit.sim similarity index 99% rename from tests/script/general/rm_bak/tag/commit.sim rename to tests/script/tsim/tag/commit.sim index bcd9d7c618..18128fc464 100644 --- a/tests/script/general/rm_bak/tag/commit.sim +++ b/tests/script/tsim/tag/commit.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -1177,7 +1173,7 @@ endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/create.sim b/tests/script/tsim/tag/create.sim similarity index 99% rename from tests/script/general/rm_bak/tag/create.sim rename to tests/script/tsim/tag/create.sim index 95b4166543..e25f1eb71f 100644 --- a/tests/script/general/rm_bak/tag/create.sim +++ b/tests/script/tsim/tag/create.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start diff --git a/tests/script/general/rm_bak/tag/delete.sim b/tests/script/tsim/tag/delete.sim similarity index 99% rename from tests/script/general/rm_bak/tag/delete.sim rename to tests/script/tsim/tag/delete.sim index 2a0aa27bde..bcfd822dbd 100644 --- a/tests/script/general/rm_bak/tag/delete.sim +++ b/tests/script/tsim/tag/delete.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -820,7 +816,7 @@ step145: print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/double.sim b/tests/script/tsim/tag/double.sim similarity index 96% rename from tests/script/general/rm_bak/tag/double.sim rename to tests/script/tsim/tag/double.sim index f17043393f..b8292b64e8 100644 --- a/tests/script/general/rm_bak/tag/double.sim +++ b/tests/script/tsim/tag/double.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -228,16 +222,16 @@ endi print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/filter.sim b/tests/script/tsim/tag/filter.sim similarity index 99% rename from tests/script/general/rm_bak/tag/filter.sim rename to tests/script/tsim/tag/filter.sim index 7a899a7e67..b9f2df0cc6 100644 --- a/tests/script/general/rm_bak/tag/filter.sim +++ b/tests/script/tsim/tag/filter.sim @@ -1,8 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -142,7 +140,7 @@ endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/float.sim b/tests/script/tsim/tag/float.sim similarity index 96% rename from tests/script/general/rm_bak/tag/float.sim rename to tests/script/tsim/tag/float.sim index 35bf7d6090..26a09e2973 100644 --- a/tests/script/general/rm_bak/tag/float.sim +++ b/tests/script/tsim/tag/float.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -228,16 +222,16 @@ endi print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/int.sim b/tests/script/tsim/tag/int.sim similarity index 96% rename from tests/script/general/rm_bak/tag/int.sim rename to tests/script/tsim/tag/int.sim index 4eea02c9cd..13255eb2ba 100644 --- a/tests/script/general/rm_bak/tag/int.sim +++ b/tests/script/tsim/tag/int.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -226,18 +220,17 @@ if $data00 != 25 then return -1 endi - print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/int_binary.sim b/tests/script/tsim/tag/int_binary.sim similarity index 97% rename from tests/script/general/rm_bak/tag/int_binary.sim rename to tests/script/tsim/tag/int_binary.sim index 9a75697676..01d73cf0c2 100644 --- a/tests/script/general/rm_bak/tag/int_binary.sim +++ b/tests/script/tsim/tag/int_binary.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -295,16 +290,16 @@ if $data00 != 25 then endi print =============== step14 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/int_float.sim b/tests/script/tsim/tag/int_float.sim similarity index 97% rename from tests/script/general/rm_bak/tag/int_float.sim rename to tests/script/tsim/tag/int_float.sim index a03c4b7148..0b20ff3d62 100644 --- a/tests/script/general/rm_bak/tag/int_float.sim +++ b/tests/script/tsim/tag/int_float.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -311,16 +306,16 @@ if $data00 != 25 then endi print =============== step14 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/set.sim b/tests/script/tsim/tag/set.sim similarity index 99% rename from tests/script/general/rm_bak/tag/set.sim rename to tests/script/tsim/tag/set.sim index cbc964fad7..2c14313a07 100644 --- a/tests/script/general/rm_bak/tag/set.sim +++ b/tests/script/tsim/tag/set.sim @@ -1,10 +1,6 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 2 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -452,7 +448,7 @@ endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/smallint.sim b/tests/script/tsim/tag/smallint.sim similarity index 96% rename from tests/script/general/rm_bak/tag/smallint.sim rename to tests/script/tsim/tag/smallint.sim index e69eef05f2..70c5ee0771 100644 --- a/tests/script/general/rm_bak/tag/smallint.sim +++ b/tests/script/tsim/tag/smallint.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -226,18 +220,17 @@ if $data00 != 25 then return -1 endi - print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/general/rm_bak/tag/tinyint.sim b/tests/script/tsim/tag/tinyint.sim similarity index 96% rename from tests/script/general/rm_bak/tag/tinyint.sim rename to tests/script/tsim/tag/tinyint.sim index 2d70dc7d48..b7f7616cf4 100644 --- a/tests/script/general/rm_bak/tag/tinyint.sim +++ b/tests/script/tsim/tag/tinyint.sim @@ -1,11 +1,6 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 -system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start - -sleep 2000 sql connect print ======================== dnode1 start @@ -51,7 +46,6 @@ while $i < 10 endw print =============== step2 -sleep 100 sql select * from $tb if $rows != $rowNum then return -1 @@ -226,18 +220,17 @@ if $data00 != 25 then return -1 endi - print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt interval(1d) group by tgcol +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql show databases -if $rows != 0 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/valgrind/basic1.sim b/tests/script/tsim/valgrind/basic1.sim index f0430195c9..784b83d96b 100644 --- a/tests/script/tsim/valgrind/basic1.sim +++ b/tests/script/tsim/valgrind/basic1.sim @@ -1,7 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c debugflag -v 131 -system sh/exec.sh -n dnode1 -s start -v +system sh/exec.sh -n dnode1 -s start sql connect print =============== step1: create drop show dnodes @@ -23,51 +23,65 @@ if $data(1)[4] != ready then endi print =============== step2: create db -sql create database d1 vgroups 1 buffer 3 +sql create database d1 vgroups 3 buffer 3 sql show databases sql use d1 sql show vgroups -print =============== step3: create show stable -sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) +print =============== step3: create show stable, include all type +sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned) +sql create stable if not exists stb_1 (ts timestamp, c1 int) tags (j int) +sql create table stb_2 (ts timestamp, c1 int) tags (t1 int) +sql create stable stb_3 (ts timestamp, c1 int) tags (t1 int) sql show stables -if $rows != 1 then +if $rows != 4 then return -1 endi -print =============== step4: create show table -sql create table ct1 using stb tags(1000) -sql create table ct2 using stb tags(2000) -sql create table ct3 using stb tags(3000) +print =============== step4: ccreate child table +sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) +sql create table c2 using stb tags(false, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 2', 'child tbl 2', '2022-02-25 18:00:00.000', 10, 20, 30, 40) sql show tables -if $rows != 3 then +if $rows != 2 then return -1 endi print =============== step5: insert data -sql insert into ct1 values(now+0s, 10, 2.0, 3.0) -sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3) -sql insert into ct2 values(now+0s, 10, 2.0, 3.0) -sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3) -sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0) +sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) +sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) +sql insert into c2 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) +sql insert into c2 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) -print =============== step6: query data -sql select * from ct1 -sql select * from stb -sql select c1, c2, c3 from ct1 -sql select ts, c1, c2, c3 from stb +print =============== step6: alter insert +sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) +sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) -print =============== step7: count -sql select count(*) from ct1; +print =============== restart +system sh/exec.sh -n dnode1 -s stop -x SIGINT +system sh/exec.sh -n dnode1 -s start -v + +print =============== stepa: query data +sql select * from c1 +#sql select * from stb +#sql select * from stb_1 +#sql select ts, c1, c2, c3 from c1 +#sql select ts, c1, c2, c3 from stb +#sql select ts, c1 from stb_2 +#sql select ts, c1, t1 from c1 +#sql select ts, c1, t1 from stb +#sql select ts, c1, t1 from stb_2 + +print =============== stepb: count +#sql select count(*) from c1; #sql select count(*) from stb; -#sql select count(ts), count(c1), count(c2), count(c3) from ct1 +#sql select count(ts), count(c1), count(c2), count(c3) from c1 #sql select count(ts), count(c1), count(c2), count(c3) from stb -print =============== step8: func -#sql select first(ts), first(c1), first(c2), first(c3) from ct1 -#sql select min(c1), min(c2), min(c3) from ct1 -#sql select max(c1), max(c2), max(c3) from ct1 -#sql select sum(c1), sum(c2), sum(c3) from ct1 +print =============== stepc: func +#sql select first(ts), first(c1), first(c2), first(c3) from c1 +#sql select min(c2), min(c3), min(c4) from c1 +#sql select max(c2), max(c3), max(c4) from c1 +#sql select sum(c2), sum(c3), sum(c4) from c1 _OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/valgrind/checkError2.sim b/tests/script/tsim/valgrind/checkError2.sim index 3939b7c854..3a82218015 100644 --- a/tests/script/tsim/valgrind/checkError2.sim +++ b/tests/script/tsim/valgrind/checkError2.sim @@ -37,22 +37,40 @@ endi print =============== step4: create show table sql create table ct1 using stb tags(1000) +sql create table ct2 using stb tags(2000) +sql create table ct3 using stb tags(3000) sql show tables -if $rows != 1 then +if $rows != 3 then return -1 endi print =============== step5: insert data sql insert into ct1 values(now+0s, 10, 2.0, 3.0) sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3) +sql insert into ct2 values(now+0s, 10, 2.0, 3.0) +sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3) +sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0) -print =============== step6: select data +print =============== step6: query data sql select * from ct1 sql select * from stb +sql select c1, c2, c3 from ct1 +sql select ts, c1, c2, c3 from stb + +print =============== step7: count +sql select count(*) from ct1; +sql select count(*) from stb; +sql select count(ts), count(c1), count(c2), count(c3) from ct1 +sql select count(ts), count(c1), count(c2), count(c3) from stb + +print =============== step8: func +sql select first(ts), first(c1), first(c2), first(c3) from ct1 +sql select min(c1), min(c2), min(c3) from ct1 +sql select max(c1), max(c2), max(c3) from ct1 +sql select sum(c1), sum(c2), sum(c3) from ct1 _OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT - print =============== check $null= diff --git a/tests/script/tsim/valgrind/checkError3.sim b/tests/script/tsim/valgrind/checkError3.sim index d5a407f6f8..10a8f01fb3 100644 --- a/tests/script/tsim/valgrind/checkError3.sim +++ b/tests/script/tsim/valgrind/checkError3.sim @@ -68,16 +68,16 @@ sql select ts, c1, t1 from stb sql select ts, c1, t1 from stb_2 print =============== stepb: count -#sql select count(*) from c1; -#sql select count(*) from stb; -#sql select count(ts), count(c1), count(c2), count(c3) from c1 -#sql select count(ts), count(c1), count(c2), count(c3) from stb +sql select count(*) from c1; +sql select count(*) from stb; +sql select count(ts), count(c1), count(c2), count(c3) from c1 +sql select count(ts), count(c1), count(c2), count(c3) from stb print =============== stepc: func -#sql select first(ts), first(c1), first(c2), first(c3) from c1 -#sql select min(c1), min(c2), min(c3) from c1 -#sql select max(c1), max(c2), max(c3) from c1 -#sql select sum(c1), sum(c2), sum(c3) from c1 +sql select first(ts), first(c1), first(c2), first(c3) from c1 +sql select min(c2), min(c3), min(c4) from c1 +sql select max(c2), max(c3), max(c4) from c1 +sql select sum(c2), sum(c3), sum(c4) from c1 _OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/vector/metrics_field.sim b/tests/script/tsim/vector/metrics_field.sim index 4d0f9e19fc..b75ba9cffe 100644 --- a/tests/script/tsim/vector/metrics_field.sim +++ b/tests/script/tsim/vector/metrics_field.sim @@ -41,8 +41,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_mix.sim b/tests/script/tsim/vector/metrics_mix.sim index fd36a62332..fa93f0b2e3 100644 --- a/tests/script/tsim/vector/metrics_mix.sim +++ b/tests/script/tsim/vector/metrics_mix.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_query.sim b/tests/script/tsim/vector/metrics_query.sim index 8a334acef2..5d433486e8 100644 --- a/tests/script/tsim/vector/metrics_query.sim +++ b/tests/script/tsim/vector/metrics_query.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_tag.sim b/tests/script/tsim/vector/metrics_tag.sim index 0b275336f9..c8380590d5 100644 --- a/tests/script/tsim/vector/metrics_tag.sim +++ b/tests/script/tsim/vector/metrics_tag.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/metrics_time.sim b/tests/script/tsim/vector/metrics_time.sim index bcd93cb582..efa1ae4c84 100644 --- a/tests/script/tsim/vector/metrics_time.sim +++ b/tests/script/tsim/vector/metrics_time.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/multi.sim b/tests/script/tsim/vector/multi.sim index dcedbe73c9..1b592cdd0a 100644 --- a/tests/script/tsim/vector/multi.sim +++ b/tests/script/tsim/vector/multi.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/single.sim b/tests/script/tsim/vector/single.sim index c9d794456c..4da7c78110 100644 --- a/tests/script/tsim/vector/single.sim +++ b/tests/script/tsim/vector/single.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_field.sim b/tests/script/tsim/vector/table_field.sim index 5ad60b2a35..d5bdad8be2 100644 --- a/tests/script/tsim/vector/table_field.sim +++ b/tests/script/tsim/vector/table_field.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_mix.sim b/tests/script/tsim/vector/table_mix.sim index 358d6cf87f..79ecb09d81 100644 --- a/tests/script/tsim/vector/table_mix.sim +++ b/tests/script/tsim/vector/table_mix.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_query.sim b/tests/script/tsim/vector/table_query.sim index 0e4562716e..d69d16eba5 100644 --- a/tests/script/tsim/vector/table_query.sim +++ b/tests/script/tsim/vector/table_query.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/tsim/vector/table_time.sim b/tests/script/tsim/vector/table_time.sim index 1e6bdb2cde..f16c95ad4a 100644 --- a/tests/script/tsim/vector/table_time.sim +++ b/tests/script/tsim/vector/table_time.sim @@ -37,8 +37,6 @@ while $i < $tbNum $i = $i + 1 endw -sleep 100 - print =============== step2 $i = 1 $tb = $tbPrefix . $i diff --git a/tests/script/wtest.bat b/tests/script/wtest.bat index e3bbff9db5..f674277df9 100644 --- a/tests/script/wtest.bat +++ b/tests/script/wtest.bat @@ -44,9 +44,10 @@ echo serverPort 7100 >> %TAOS_CFG% echo logDir %LOG_DIR% >> %TAOS_CFG% echo scriptDir %SCRIPT_DIR% >> %TAOS_CFG% echo numOfLogLines 100000000 >> %TAOS_CFG% -echo rpcDebugFlag 135 >> %TAOS_CFG% +echo rpcDebugFlag 143 >> %TAOS_CFG% echo tmrDebugFlag 131 >> %TAOS_CFG% echo cDebugFlag 135 >> %TAOS_CFG% +echo qDebugFlag 143 >> %TAOS_CFG% echo udebugFlag 135 >> %TAOS_CFG% echo wal 0 >> %TAOS_CFG% echo asyncLog 0 >> %TAOS_CFG% diff --git a/tests/system-test/2-query/tsbsQuery.py b/tests/system-test/2-query/tsbsQuery.py index d24e5ea283..8180f511e2 100644 --- a/tests/system-test/2-query/tsbsQuery.py +++ b/tests/system-test/2-query/tsbsQuery.py @@ -8,7 +8,13 @@ from util.sql import * from util.cases import * class TDTestCase: - + + clientCfgDict = {'queryproxy': '1','debugFlag': 135} + clientCfgDict["debugFlag"] = 131 + updatecfgDict = {'clientCfg': {}} + updatecfgDict = {'debugFlag': 131} + updatecfgDict["clientCfg"] = clientCfgDict + def init(self, conn, logSql): tdLog.debug(f"start to excute {__file__}") tdSql.init(conn.cursor(), True) @@ -55,14 +61,37 @@ class TDTestCase: def tsbsIotQuery(self): tdSql.execute("use db_tsbs") + + # test interval and partition + tdSql.query(" SELECT avg(velocity) as mean_velocity ,name,driver,fleet FROM readings WHERE ts > 1451606400000 AND ts <= 1451606460000 partition BY name,driver,fleet; ") + parRows=tdSql.queryRows tdSql.query(" SELECT avg(velocity) as mean_velocity ,name,driver,fleet FROM readings WHERE ts > 1451606400000 AND ts <= 1451606460000 partition BY name,driver,fleet interval(10m); ") - tdSql.checkRows(1) + # tdSql.checkRows(parRows) + + + # test insert into + tdSql.execute("create table testsnode (ts timestamp, c1 float,c2 binary(30),c3 binary(30),c4 binary(30)) ;") + tdSql.query("insert into testsnode SELECT ts,avg(velocity) as mean_velocity,name,driver,fleet FROM readings WHERE ts > 1451606400000 AND ts <= 1451606460000 partition BY name,driver,fleet,ts interval(10m);") + + tdSql.query("insert into testsnode(ts,c1,c2,c3,c4) SELECT ts,avg(velocity) as mean_velocity,name,driver,fleet FROM readings WHERE ts > 1451606400000 AND ts <= 1451606460000 partition BY name,driver,fleet,ts interval(10m);") + # test paitition interval fill + # tdSql.query("SELECT name,floor(avg(velocity)/10)/floor(avg(velocity)/10) AS mv FROM readings WHERE name!='' AND ts > '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' partition by name interval(10m) fill(value,0) ;") + + # # test partition interval limit + # tdSql.query("SELECT ts,model,floor(2*(sum(nzs)/count(nzs)))/floor(2*(sum(nzs)/count(nzs))) AS broken_down FROM (SELECT ts,model, status/status AS nzs FROM diagnostics WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' ) WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' partition BY model,ts interval(10m) limit 10;") + # tdSql.checkRows(10) + + # test partition interval Pseudo time-column + tdSql.query("SELECT count(ms1)/144 FROM (SELECT _wstartts as ts1,model, fleet,avg(status) AS ms1 FROM diagnostics WHERE ts >= '2016-01-01T00:00:00Z' AND ts < '2016-01-05T00:00:01Z' partition by model, fleet interval(10m)) WHERE ts1 >= '2016-01-01T00:00:00Z' AND ts1 < '2016-01-05T00:00:01Z' AND ms1<1;") + + + # test def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring tdLog.printNoPrefix("==========step1:create database and table,insert data ==============") - self.tsbsIotQuery() + self.prepareData() self.tsbsIotQuery() diff --git a/tests/system-test/7-tmq/dataFromTsdbNWal.py b/tests/system-test/7-tmq/dataFromTsdbNWal.py index a55fbbfd18..227ce9d5a5 100644 --- a/tests/system-test/7-tmq/dataFromTsdbNWal.py +++ b/tests/system-test/7-tmq/dataFromTsdbNWal.py @@ -38,9 +38,9 @@ class TDTestCase: 'tagSchema': [{'type': 'INT', 'count':1},{'type': 'BIGINT', 'count':1},{'type': 'DOUBLE', 'count':1},{'type': 'BINARY', 'len':32, 'count':1},{'type': 'NCHAR', 'len':32, 'count':1}], 'ctbPrefix': 'ctb', 'ctbStartIdx': 0, - 'ctbNum': 10, + 'ctbNum': 100, 'rowsPerTbl': 10000, - 'batchNum': 1000, + 'batchNum': 3000, 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 'pollDelay': 10, 'showMsg': 1, @@ -64,9 +64,7 @@ class TDTestCase: ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"], startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx']) - tdLog.info("restart taosd to ensure that the data falls into the disk") - # tdDnodes.stop(1) - # tdDnodes.start(1) + tdLog.info("flush db to let data falls into the disk") tdSql.query("flush database %s"%(paraDict['dbName'])) return @@ -85,7 +83,7 @@ class TDTestCase: 'ctbStartIdx': 0, 'ctbNum': 10, 'rowsPerTbl': 10000, - 'batchNum': 10, + 'batchNum': 100, 'startTs': 1640966400000, # 2022-01-01 00:00:00.000 'pollDelay': 3, 'showMsg': 1, @@ -95,8 +93,6 @@ class TDTestCase: paraDict['vgroups'] = self.vgroups paraDict['ctbNum'] = self.ctbNum paraDict['rowsPerTbl'] = self.rowsPerTbl - paraDict['batchNum'] = 100 - paraDict['startTs'] = paraDict['startTs'] + self.rowsPerTbl topicNameList = ['topic1'] expectRowsList = [] @@ -125,6 +121,8 @@ class TDTestCase: tmqCom.startTmqSimProcess(pollDelay=paraDict['pollDelay'],dbName=paraDict["dbName"],showMsg=paraDict['showMsg'], showRow=paraDict['showRow'],snapshot=paraDict['snapshot']) # after start consume, continue insert some data + paraDict['batchNum'] = 100 + paraDict['startTs'] = paraDict['startTs'] + self.rowsPerTbl tmqCom.insert_data_interlaceByMultiTbl(tsql=tdSql,dbName=paraDict["dbName"],ctbPrefix=paraDict["ctbPrefix"], ctbNum=paraDict["ctbNum"],rowsPerTbl=paraDict["rowsPerTbl"],batchNum=paraDict["batchNum"], startTs=paraDict["startTs"],ctbStartIdx=paraDict['ctbStartIdx']) @@ -137,11 +135,12 @@ class TDTestCase: expectRows = 1 resultList = tmqCom.selectConsumeResult(expectRows) + + tdLog.info("expect consume rows: %d, act consume rows: %d"%(expectRowsList[0], resultList[0])) if expectRowsList[0] != resultList[0]: - 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)): diff --git a/tests/system-test/7-tmq/tmqCommon.py b/tests/system-test/7-tmq/tmqCommon.py index 98c9e37132..060e17c11f 100644 --- a/tests/system-test/7-tmq/tmqCommon.py +++ b/tests/system-test/7-tmq/tmqCommon.py @@ -444,6 +444,7 @@ class TMQCom: # skip first line for it is schema queryFile.readline() + lines = 0 while True: dst = queryFile.readline() diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 2c116113bc..8bafe3c966 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -180,6 +180,7 @@ python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py #python3 ./test.py -f 7-tmq/tmqDnodeRestart.py #python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb.py +#python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py #------------querPolicy 2----------- diff --git a/tests/system-test/test.py b/tests/system-test/test.py index fd0979745e..b893f7af64 100644 --- a/tests/system-test/test.py +++ b/tests/system-test/test.py @@ -37,12 +37,13 @@ def checkRunTimeError(): time.sleep(1) timeCount = timeCount + 1 print("checkRunTimeError",timeCount) - if (timeCount>900): + if (timeCount>600): print("stop the test.") os.system("TASKKILL /F /IM taosd.exe") os.system("TASKKILL /F /IM taos.exe") os.system("TASKKILL /F /IM tmq_sim.exe") os.system("TASKKILL /F /IM mintty.exe") + os.system("TASKKILL /F /IM python.exe") quit(0) hwnd = win32gui.FindWindow(None, "Microsoft Visual C++ Runtime Library") if hwnd: @@ -228,6 +229,22 @@ if __name__ == "__main__": tdDnodes.deploy(1,updateCfgDict) tdDnodes.start(1) tdCases.logSql(logSql) + if queryPolicy != 1: + queryPolicy=int(queryPolicy) + conn = taos.connect( + host, + config=tdDnodes.getSimCfgPath()) + tdSql.init(conn.cursor()) + tdSql.execute("create qnode on dnode 1") + tdSql.execute('alter local "queryPolicy" "%d"'%queryPolicy) + tdSql.query("show local variables;") + for i in range(tdSql.queryRows): + if tdSql.queryResult[i][0] == "queryPolicy" : + if int(tdSql.queryResult[i][1]) == int(queryPolicy): + tdLog.success('alter queryPolicy to %d successfully'%queryPolicy) + else : + tdLog.debug(tdSql.queryResult) + tdLog.exit("alter queryPolicy to %d failed"%queryPolicy) else : tdLog.debug("create an cluster with %s nodes and make %s dnode as independent mnode"%(dnodeNums,mnodeNums)) dnodeslist = cluster.configure_cluster(dnodeNums=dnodeNums,mnodeNums=mnodeNums) diff --git a/tools/taos-tools b/tools/taos-tools index 3f42d428eb..bd496f76b6 160000 --- a/tools/taos-tools +++ b/tools/taos-tools @@ -1 +1 @@ -Subproject commit 3f42d428eb6b90dea2651f4ccea66e44705c831b +Subproject commit bd496f76b64931c66da2f8b0f24143a98a881cde diff --git a/tools/taosadapter b/tools/taosadapter index c885e967e4..df8678f070 160000 --- a/tools/taosadapter +++ b/tools/taosadapter @@ -1 +1 @@ -Subproject commit c885e967e490105999b84d009a15168728dfafaf +Subproject commit df8678f070e3f707faf59baebec90065f6e1268b