diff --git a/include/libs/nodes/plannodes.h b/include/libs/nodes/plannodes.h index 0bd917a9c6..4671c8b81e 100644 --- a/include/libs/nodes/plannodes.h +++ b/include/libs/nodes/plannodes.h @@ -103,6 +103,7 @@ typedef struct SIndefRowsFuncLogicNode { SLogicNode node; SNodeList* pFuncs; bool isTailFunc; + bool isUniqueFunc; } SIndefRowsFuncLogicNode; typedef struct SInterpFuncLogicNode { diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 39c569acef..56d0a3f9b9 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -50,6 +50,7 @@ typedef struct SExprNode { char aliasName[TSDB_COL_NAME_LEN]; char userAlias[TSDB_COL_NAME_LEN]; SArray* pAssociation; + bool orderAlias; } SExprNode; typedef enum EColumnType { COLUMN_TYPE_COLUMN = 1, COLUMN_TYPE_TAG, COLUMN_TYPE_TBNAME } EColumnType; diff --git a/include/libs/planner/planner.h b/include/libs/planner/planner.h index b350837551..727cdd8ad6 100644 --- a/include/libs/planner/planner.h +++ b/include/libs/planner/planner.h @@ -48,6 +48,8 @@ int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan, SArray* pExecNo // @pSource one execution location of this group of datasource subplans int32_t qSetSubplanExecutionNode(SSubplan* pSubplan, int32_t groupId, SDownstreamSourceNode* pSource); +int32_t qClearSubplanExecutionNode(SSubplan* pSubplan, int32_t groupId); + // Convert to subplan to string for the scheduler to send to the executor int32_t qSubPlanToString(const SSubplan* pSubplan, char** pStr, int32_t* pLen); int32_t qStringToSubplan(const char* pStr, SSubplan** pSubplan); diff --git a/include/libs/qcom/query.h b/include/libs/qcom/query.h index 0b767e96f6..9e8ce3ffb6 100644 --- a/include/libs/qcom/query.h +++ b/include/libs/qcom/query.h @@ -271,19 +271,19 @@ extern int32_t (*queryProcessMsgRsp[TDMT_MAX])(void* output, char* msg, int32_t #define qDebug(...) \ do { \ if (qDebugFlag & DEBUG_DEBUG) { \ - taosPrintLog("QRY ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); \ + taosPrintLog("QRY ", DEBUG_DEBUG, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); \ } \ } while (0) #define qTrace(...) \ do { \ if (qDebugFlag & DEBUG_TRACE) { \ - taosPrintLog("QRY ", DEBUG_TRACE, qDebugFlag, __VA_ARGS__); \ + taosPrintLog("QRY ", DEBUG_TRACE, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); \ } \ } while (0) #define qDebugL(...) \ do { \ if (qDebugFlag & DEBUG_DEBUG) { \ - taosPrintLongString("QRY ", DEBUG_DEBUG, qDebugFlag, __VA_ARGS__); \ + taosPrintLongString("QRY ", DEBUG_DEBUG, tsLogEmbedded ? 255 : qDebugFlag, __VA_ARGS__); \ } \ } while (0) diff --git a/source/dnode/vnode/src/inc/sma.h b/source/dnode/vnode/src/inc/sma.h index 4b42ab5263..23ad70bad3 100644 --- a/source/dnode/vnode/src/inc/sma.h +++ b/source/dnode/vnode/src/inc/sma.h @@ -205,16 +205,16 @@ struct STFile { uint8_t state; }; -#define TD_FILE_F(tf) (&((tf)->f)) -#define TD_FILE_PFILE(tf) ((tf)->pFile) -#define TD_FILE_OPENED(tf) (TD_FILE_PFILE(tf) != NULL) -#define TD_FILE_FULL_NAME(tf) (TD_FILE_F(tf)->aname) -#define TD_FILE_REL_NAME(tf) (TD_FILE_F(tf)->rname) -#define TD_FILE_OPENED(tf) (TD_FILE_PFILE(tf) != NULL) -#define TD_FILE_CLOSED(tf) (!TD_FILE_OPENED(tf)) -#define TD_FILE_SET_CLOSED(f) (TD_FILE_PFILE(f) = NULL) -#define TD_FILE_SET_STATE(tf, s) ((tf)->state = (s)) -#define TD_FILE_DID(tf) (TD_FILE_F(tf)->did) +#define TD_TFILE_F(tf) (&((tf)->f)) +#define TD_TFILE_PFILE(tf) ((tf)->pFile) +#define TD_TFILE_OPENED(tf) (TD_TFILE_PFILE(tf) != NULL) +#define TD_TFILE_FULL_NAME(tf) (TD_TFILE_F(tf)->aname) +#define TD_TFILE_REL_NAME(tf) (TD_TFILE_F(tf)->rname) +#define TD_TFILE_OPENED(tf) (TD_TFILE_PFILE(tf) != NULL) +#define TD_TFILE_CLOSED(tf) (!TD_TFILE_OPENED(tf)) +#define TD_TFILE_SET_CLOSED(f) (TD_TFILE_PFILE(f) = NULL) +#define TD_TFILE_SET_STATE(tf, s) ((tf)->state = (s)) +#define TD_TFILE_DID(tf) (TD_TFILE_F(tf)->did) int32_t tdInitTFile(STFile *pTFile, STfs *pTfs, const char *fname); int32_t tdCreateTFile(STFile *pTFile, STfs *pTfs, bool updateHeader, int8_t fType); diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 68ed6dde51..baead763ad 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -64,6 +64,7 @@ typedef struct STsdbSnapshotReader STsdbSnapshotReader; #define VNODE_TQ_DIR "tq" #define VNODE_WAL_DIR "wal" #define VNODE_TSMA_DIR "tsma" +#define VNODE_RSMA_DIR "rsma" #define VNODE_RSMA0_DIR "tsdb" #define VNODE_RSMA1_DIR "rsma1" #define VNODE_RSMA2_DIR "rsma2" @@ -161,7 +162,6 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pSchema, bool // sma int32_t smaOpen(SVnode* pVnode); -int32_t smaClose(SSma* pSma); int32_t smaCloseEnv(SSma* pSma); int32_t smaCloseEx(SSma* pSma); diff --git a/source/dnode/vnode/src/sma/smaOpen.c b/source/dnode/vnode/src/sma/smaOpen.c index 88ed7426f7..641b8c7934 100644 --- a/source/dnode/vnode/src/sma/smaOpen.c +++ b/source/dnode/vnode/src/sma/smaOpen.c @@ -123,7 +123,7 @@ int32_t smaOpen(SVnode *pVnode) { } // restore the rsma -#if 0 +#if 1 if (rsmaRestore(pSma) < 0) { goto _err; } @@ -154,12 +154,6 @@ int32_t smaCloseEx(SSma *pSma) { return 0; } -int32_t smaClose(SSma *pSma) { - smaCloseEnv(pSma); - smaCloseEx(pSma); - return 0; -} - /** * @brief rsma env restore * diff --git a/source/dnode/vnode/src/sma/smaRollup.c b/source/dnode/vnode/src/sma/smaRollup.c index ed5b6f4055..34c3ef8fca 100644 --- a/source/dnode/vnode/src/sma/smaRollup.c +++ b/source/dnode/vnode/src/sma/smaRollup.c @@ -17,11 +17,12 @@ #define RSMA_QTASKINFO_PERSIST_MS 7200000 #define RSMA_QTASKINFO_BUFSIZE 32768 +#define RSMA_QTASKINFO_HEAD_LEN (sizeof(int32_t) + sizeof(int8_t) + sizeof(int64_t)) // len + type + suid typedef enum { TD_QTASK_TMP_FILE = 0, TD_QTASK_CUR_FILE } TD_QTASK_FILE_T; static const char *tdQTaskInfoFname[] = {"qtaskinfo.t", "qtaskinfo"}; typedef struct SRSmaQTaskInfoItem SRSmaQTaskInfoItem; -typedef struct SRSmaQTaskFIter SRSmaQTaskFIter; +typedef struct SRSmaQTaskInfoIter SRSmaQTaskInfoIter; static int32_t tdUidStorePut(STbUidStore *pStore, tb_uid_t suid, tb_uid_t *uid); static int32_t tdUpdateTbUidListImpl(SSma *pSma, tb_uid_t *suid, SArray *tbUids); @@ -32,11 +33,11 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t inputType static void tdRSmaFetchTrigger(void *param, void *tmrId); static void tdRSmaPersistTrigger(void *param, void *tmrId); static void *tdRSmaPersistExec(void *param); -static void tdRSmaQTaskGetFName(int32_t vid, int8_t ftype, char *outputName); +static void tdRSmaQTaskInfoGetFName(int32_t vid, int8_t ftype, char *outputName); -static int32_t tdRSmaQTaskInfoIterInit(SRSmaQTaskFIter *pIter, STFile *pTFile); -static int32_t tdRSmaQTaskInfoIterNextBlock(SRSmaQTaskFIter *pIter, bool *isFinish); -static int32_t tdRSmaQTaskInfoIterNext(SRSmaQTaskFIter *pIter, SRSmaQTaskInfoItem *pItem, bool *isEnd); +static int32_t tdRSmaQTaskInfoIterInit(SRSmaQTaskInfoIter *pIter, STFile *pTFile); +static int32_t tdRSmaQTaskInfoIterNextBlock(SRSmaQTaskInfoIter *pIter, bool *isFinish); +static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, SRSmaQTaskInfoIter *pIter); static int32_t tdRSmaQTaskInfoItemRestore(SSma *pSma, const SRSmaQTaskInfoItem *infoItem); struct SRSmaInfoItem { @@ -63,22 +64,23 @@ struct SRSmaQTaskInfoItem { void *qTaskInfo; }; -struct SRSmaQTaskFIter { +struct SRSmaQTaskInfoIter { STFile *pTFile; int64_t offset; int64_t fsize; int32_t nBytes; int32_t nAlloc; - char *buf; + char *pBuf; // ------------ + char *qBuf; // for iterator int32_t nBufPos; }; static FORCE_INLINE int32_t tdRSmaQTaskInfoContLen(int32_t lenWithHead) { - return lenWithHead - sizeof(int32_t) - sizeof(int8_t) - sizeof(int64_t); + return lenWithHead - RSMA_QTASKINFO_HEAD_LEN; } -static FORCE_INLINE void tdRSmaQTaskInfoIterDestroy(SRSmaQTaskFIter *pIter) { taosMemoryFreeClear(pIter->buf); } +static FORCE_INLINE void tdRSmaQTaskInfoIterDestroy(SRSmaQTaskInfoIter *pIter) { taosMemoryFreeClear(pIter->pBuf); } static FORCE_INLINE void tdFreeTaskHandle(qTaskInfo_t *taskHandle, int32_t vgId, int32_t level) { // Note: free/kill may in RC @@ -294,7 +296,7 @@ int32_t tdProcessRSmaCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con pRSmaInfo = taosHashGet(RSMA_INFO_HASH(pStat), &suid, sizeof(tb_uid_t)); if (pRSmaInfo) { - ASSERT(0); // TODO: free original pRSmaInfo is exists abnormally + ASSERT(0); // TODO: free original pRSmaInfo if exists abnormally smaDebug("vgId:%d, rsma info already exists for table %s, %" PRIi64, SMA_VID(pSma), tbName, suid); return TSDB_CODE_SUCCESS; } @@ -338,10 +340,10 @@ int32_t tdProcessRSmaCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con if (taosHashPut(RSMA_INFO_HASH(pStat), &suid, sizeof(tb_uid_t), &pRSmaInfo, sizeof(pRSmaInfo)) < 0) { goto _err; - } else { - smaDebug("vgId:%d, register rsma info succeed for suid:%" PRIi64, SMA_VID(pSma), suid); } + smaDebug("vgId:%d, register rsma info succeed for suid:%" PRIi64, SMA_VID(pSma), suid); + // start the persist timer if (TASK_TRIGGER_STAT_INIT == atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pStat), TASK_TRIGGER_STAT_INIT, TASK_TRIGGER_STAT_ACTIVE)) { @@ -356,10 +358,9 @@ _err: } /** - * @brief Check and init qTaskInfo_t, only applicable to stable with SRSmaParam. + * @brief Check and init qTaskInfo_t, only applicable to stable with SRSmaParam currently * - * @param pTsdb - * @param pMeta + * @param pVnode * @param pReq * @return int32_t */ @@ -695,8 +696,265 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, void *pMsg, int32_t inputType) { return TSDB_CODE_SUCCESS; } -static void tdRSmaQTaskGetFName(int32_t vid, int8_t ftype, char *outputName) { - tdGetVndFileName(vid, "rsma", tdQTaskInfoFname[ftype], outputName); +int32_t tdProcessRSmaRestoreImpl(SSma *pSma) { + SVnode *pVnode = pSma->pVnode; + + // step 1: iterate all stables to restore the rsma env + SArray *suidList = taosArrayInit(1, sizeof(tb_uid_t)); + if (tsdbGetStbIdList(SMA_META(pSma), 0, suidList) < 0) { + taosArrayDestroy(suidList); + smaError("vgId:%d, failed to restore rsma env since get stb id list error: %s", TD_VID(pVnode), terrstr()); + return TSDB_CODE_FAILED; + } + + int32_t arrSize = taosArrayGetSize(suidList); + if (arrSize == 0) { + taosArrayDestroy(suidList); + smaDebug("vgId:%d, no need to restore rsma env since empty stb id list", TD_VID(pVnode)); + return TSDB_CODE_SUCCESS; + } + + SMetaReader mr = {0}; + metaReaderInit(&mr, SMA_META(pSma), 0); + for (int32_t i = 0; i < arrSize; ++i) { + tb_uid_t suid = *(tb_uid_t *)taosArrayGet(suidList, i); + smaDebug("vgId:%d, rsma restore, suid[%d] is %" PRIi64, TD_VID(pVnode), i, suid); + if (metaGetTableEntryByUid(&mr, suid) < 0) { + smaError("vgId:%d, rsma restore, failed to get table meta for %" PRIi64 " since %s", TD_VID(pVnode), suid, + terrstr()); + goto _err; + } + ASSERT(mr.me.type == TSDB_SUPER_TABLE); + ASSERT(mr.me.uid == suid); + if (TABLE_IS_ROLLUP(mr.me.flags)) { + SRSmaParam *param = &mr.me.stbEntry.rsmaParam; + for (int i = 0; i < TSDB_RETENTION_L2; ++i) { + smaDebug("vgId:%d, rsma restore, table:%" PRIi64 " level:%d, maxdelay:%" PRIi64 " watermark:%" PRIi64 + " qmsgLen:%" PRIi32, + TD_VID(pVnode), suid, i, param->maxdelay[i], param->watermark[i], param->qmsgLen[i]); + } + if (tdProcessRSmaCreateImpl(pSma, &mr.me.stbEntry.rsmaParam, suid, mr.me.name) < 0) { + smaError("vgId:%d, rsma restore env failed for %" PRIi64 " since %s", TD_VID(pVnode), suid, terrstr()); + goto _err; + } + smaDebug("vgId:%d, rsma restore env success for %" PRIi64, TD_VID(pVnode), suid); + } + } + + // step 2: retrieve qtaskinfo items from the persistence file(rsma/qtaskinfo) and restore + STFile tFile = {0}; + char qTaskInfoFName[TSDB_FILENAME_LEN]; + + tdRSmaQTaskInfoGetFName(TD_VID(pVnode), TD_QTASK_CUR_FILE, qTaskInfoFName); + if (tdInitTFile(&tFile, pVnode->pTfs, qTaskInfoFName) < 0) { + goto _err; + } + + if(!taosCheckExistFile(TD_TFILE_FULL_NAME(&tFile))) { + metaReaderClear(&mr); + taosArrayDestroy(suidList); + return TSDB_CODE_SUCCESS; + } + + if (tdOpenTFile(&tFile, TD_FILE_READ) < 0) { + goto _err; + } + + SRSmaQTaskInfoIter fIter = {0}; + if (tdRSmaQTaskInfoIterInit(&fIter, &tFile) < 0) { + goto _err; + } + SRSmaQTaskInfoItem infoItem = {0}; + if (tdRSmaQTaskInfoRestore(pSma, &fIter) < 0) { + tdRSmaQTaskInfoIterDestroy(&fIter); + goto _err; + } + + tdRSmaQTaskInfoIterDestroy(&fIter); + metaReaderClear(&mr); + taosArrayDestroy(suidList); + return TSDB_CODE_SUCCESS; +_err: + metaReaderClear(&mr); + taosArrayDestroy(suidList); + smaError("failed to restore rsma task since %s", terrstr()); + return TSDB_CODE_FAILED; +} + +static int32_t tdRSmaQTaskInfoItemRestore(SSma *pSma, const SRSmaQTaskInfoItem *pItem) { + SRSmaStat *pStat = (SRSmaStat *)SMA_ENV_STAT((SSmaEnv *)pSma->pRSmaEnv); + SRSmaInfo *pRSmaInfo = NULL; + void *qTaskInfo = NULL; + + pRSmaInfo = taosHashGet(RSMA_INFO_HASH(pStat), &pItem->suid, sizeof(pItem->suid)); + + if (!pRSmaInfo || !(pRSmaInfo = *(SRSmaInfo **)pRSmaInfo)) { + smaDebug("vgId:%d, no restore as no rsma info for table:%" PRIu64, SMA_VID(pSma), pItem->suid); + return TSDB_CODE_SUCCESS; + } + + if (pItem->type == 1) { + qTaskInfo = pRSmaInfo->items[0].taskInfo; + } else if (pItem->type == 2) { + qTaskInfo = pRSmaInfo->items[1].taskInfo; + } else { + ASSERT(0); + } + + if (!qTaskInfo) { + smaDebug("vgId:%d, no restore as NULL rsma qTaskInfo for table:%" PRIu64, SMA_VID(pSma), pItem->suid); + return TSDB_CODE_SUCCESS; + } + + if (qDeserializeTaskStatus(qTaskInfo, pItem->qTaskInfo, pItem->len) < 0) { + smaError("vgId:%d, restore rsma task failed for table:%" PRIi64 " level %d since %s", SMA_VID(pSma), pItem->suid, + pItem->type, terrstr(terrno)); + return TSDB_CODE_FAILED; + } + smaDebug("vgId:%d, restore rsma task success for table:%" PRIi64 " level %d", SMA_VID(pSma), pItem->suid, pItem->type); + + return TSDB_CODE_SUCCESS; +} + +static int32_t tdRSmaQTaskInfoIterInit(SRSmaQTaskInfoIter *pIter, STFile *pTFile) { + memset(pIter, 0, sizeof(*pIter)); + pIter->pTFile = pTFile; + pIter->offset = TD_FILE_HEAD_SIZE; + + if (tdGetTFileSize(pTFile, &pIter->fsize) < 0) { + return TSDB_CODE_FAILED; + } + + if ((pIter->fsize - TD_FILE_HEAD_SIZE) < RSMA_QTASKINFO_BUFSIZE) { + pIter->nAlloc = pIter->fsize - TD_FILE_HEAD_SIZE; + } else { + pIter->nAlloc = RSMA_QTASKINFO_BUFSIZE; + } + + if (pIter->nAlloc < TD_FILE_HEAD_SIZE) { + pIter->nAlloc = TD_FILE_HEAD_SIZE; + } + + pIter->pBuf = taosMemoryMalloc(pIter->nAlloc); + if (!pIter->pBuf) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return TSDB_CODE_FAILED; + } + pIter->qBuf = pIter->pBuf; + + return TSDB_CODE_SUCCESS; +} + +static int32_t tdRSmaQTaskInfoIterNextBlock(SRSmaQTaskInfoIter *pIter, bool *isFinish) { + STFile *pTFile = pIter->pTFile; + int64_t nBytes = RSMA_QTASKINFO_BUFSIZE; + + if (pIter->offset >= pIter->fsize) { + *isFinish = true; + return TSDB_CODE_SUCCESS; + } + + if ((pIter->fsize - pIter->offset) < RSMA_QTASKINFO_BUFSIZE) { + nBytes = pIter->fsize - pIter->offset; + } + + if (tdSeekTFile(pTFile, pIter->offset, SEEK_SET) < 0) { + ASSERT(0); + return TSDB_CODE_FAILED; + } + + if (tdReadTFile(pTFile, pIter->qBuf, nBytes) != nBytes) { + ASSERT(0); + return TSDB_CODE_FAILED; + } + + int32_t infoLen = 0; + taosDecodeFixedI32(pIter->qBuf, &infoLen); + if (infoLen > nBytes) { + ASSERT(infoLen > RSMA_QTASKINFO_BUFSIZE); + pIter->nAlloc = infoLen; + void *pBuf = taosMemoryRealloc(pIter->pBuf, infoLen); + if (!pBuf) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return TSDB_CODE_FAILED; + } + pIter->pBuf = pBuf; + pIter->qBuf = pIter->pBuf; + nBytes = infoLen; + + if (tdSeekTFile(pTFile, pIter->offset, SEEK_SET)) { + ASSERT(0); + return TSDB_CODE_FAILED; + } + + if (tdReadTFile(pTFile, pIter->pBuf, nBytes) != nBytes) { + ASSERT(0); + return TSDB_CODE_FAILED; + } + } + + pIter->offset += nBytes; + pIter->nBytes = nBytes; + pIter->nBufPos = 0; + + return TSDB_CODE_SUCCESS; +} + +static int32_t tdRSmaQTaskInfoRestore(SSma *pSma, SRSmaQTaskInfoIter *pIter) { + while (1) { + // block iter + bool isFinish = false; + if (tdRSmaQTaskInfoIterNextBlock(pIter, &isFinish) < 0) { + ASSERT(0); + return TSDB_CODE_FAILED; + } + if (isFinish) { + return TSDB_CODE_SUCCESS; + } + + // consume the block + int32_t qTaskInfoLenWithHead = 0; + pIter->qBuf = taosDecodeFixedI32(pIter->qBuf, &qTaskInfoLenWithHead); + if (qTaskInfoLenWithHead < RSMA_QTASKINFO_HEAD_LEN) { + terrno = TSDB_CODE_TDB_FILE_CORRUPTED; + return TSDB_CODE_FAILED; + } + + while (1) { + if ((pIter->nBufPos + qTaskInfoLenWithHead) <= pIter->nBytes) { + SRSmaQTaskInfoItem infoItem = {0}; + pIter->qBuf = taosDecodeFixedI8(pIter->qBuf, &infoItem.type); + pIter->qBuf = taosDecodeFixedI64(pIter->qBuf, &infoItem.suid); + infoItem.qTaskInfo = pIter->qBuf; + infoItem.len = tdRSmaQTaskInfoContLen(qTaskInfoLenWithHead); + // do the restore job + smaDebug("vgId:%d, restore the qtask info %s offset:%" PRIi64 "\n", SMA_VID(pSma), + TD_TFILE_FULL_NAME(pIter->pTFile), pIter->offset - pIter->nBytes + pIter->nBufPos); + tdRSmaQTaskInfoItemRestore(pSma, &infoItem); + + pIter->qBuf = POINTER_SHIFT(pIter->qBuf, infoItem.len); + pIter->nBufPos += qTaskInfoLenWithHead; + + if ((pIter->nBufPos + RSMA_QTASKINFO_HEAD_LEN) >= pIter->nBytes) { + // prepare and load next block in the file + pIter->offset -= (pIter->nBytes - pIter->nBufPos); + break; + } + + pIter->qBuf = taosDecodeFixedI32(pIter->qBuf, &qTaskInfoLenWithHead); + continue; + } + // prepare and load next block in the file + pIter->offset -= (pIter->nBytes - pIter->nBufPos); + break; + } + } + + return TSDB_CODE_SUCCESS; +} + +static void tdRSmaQTaskInfoGetFName(int32_t vid, int8_t ftype, char *outputName) { + tdGetVndFileName(vid, VNODE_RSMA_DIR, tdQTaskInfoFname[ftype], outputName); } static void *tdRSmaPersistExec(void *param) { @@ -704,6 +962,7 @@ static void *tdRSmaPersistExec(void *param) { SRSmaStat *pRSmaStat = param; SSma *pSma = pRSmaStat->pSma; STfs *pTfs = pSma->pVnode->pTfs; + int32_t vid = SMA_VID(pSma); int64_t toffset = 0; bool isFileCreated = false; @@ -716,26 +975,16 @@ static void *tdRSmaPersistExec(void *param) { goto _end; } - STFile tFile = {0}; - int32_t vid = SMA_VID(pSma); - + STFile tFile = {0}; while (infoHash) { SRSmaInfo *pRSmaInfo = *(SRSmaInfo **)infoHash; - -#if 0 - smaDebug("table %" PRIi64 " sleep 15s start ...", pRSmaInfo->items[0].pRsmaInfo->suid); - for (int32_t i = 15; i > 0; --i) { - taosSsleep(1); - smaDebug("table %" PRIi64 " countdown %d", pRSmaInfo->items[0].pRsmaInfo->suid, i); - } - smaDebug("table %" PRIi64 " sleep 15s end ...", pRSmaInfo->items[0].pRsmaInfo->suid); -#endif for (int32_t i = 0; i < TSDB_RETENTION_L2; ++i) { qTaskInfo_t taskInfo = pRSmaInfo->items[i].taskInfo; if (!taskInfo) { smaDebug("vgId:%d, table %" PRIi64 " level %d qTaskInfo is NULL", vid, pRSmaInfo->suid, i + 1); continue; } + char *pOutput = NULL; int32_t len = 0; int8_t type = (int8_t)(i + 1); @@ -743,69 +992,77 @@ static void *tdRSmaPersistExec(void *param) { smaError("vgId:%d, table %" PRIi64 " level %d serialize rsma task failed since %s", vid, pRSmaInfo->suid, i + 1, terrstr(terrno)); goto _err; - } else { - if (!pOutput) { - smaDebug("vgId:%d, table %" PRIi64 - " level %d serialize rsma task success but no output(len %d) and no need to persist", - vid, pRSmaInfo->suid, i + 1, len); - continue; - } else if (len <= 0) { - smaDebug("vgId:%d, table %" PRIi64 " level %d serialize rsma task success with len %d and no need to persist", - vid, pRSmaInfo->suid, i + 1, len); - taosMemoryFree(pOutput); - } - smaDebug("vgId:%d, table %" PRIi64 " level %d serialize rsma task success with len %d and need persist", vid, - pRSmaInfo->suid, i + 1, len); -#if 1 - if (qDeserializeTaskStatus(taskInfo, pOutput, len) < 0) { - smaError("vgId:%d, table %" PRIi64 "level %d deserialize rsma task failed since %s", vid, pRSmaInfo->suid, - i + 1, terrstr(terrno)); - } else { - smaDebug("vgId:%d, table %" PRIi64 " level %d deserialize rsma task success", vid, pRSmaInfo->suid, i + 1); - } -#endif } + if (!pOutput || len <= 0) { + smaDebug("vgId:%d, table %" PRIi64 " level %d serialize rsma task success but no output(len %d), not persist", + vid, pRSmaInfo->suid, i + 1, len); + taosMemoryFreeClear(pOutput); + continue; + } + + smaDebug("vgId:%d, table %" PRIi64 " level %d serialize rsma task success with len %d, need persist", vid, + pRSmaInfo->suid, i + 1, len); +#if 0 + if (qDeserializeTaskStatus(taskInfo, pOutput, len) < 0) { + smaError("vgId:%d, table %" PRIi64 "level %d deserialize rsma task failed since %s", vid, pRSmaInfo->suid, + i + 1, terrstr(terrno)); + } else { + smaDebug("vgId:%d, table %" PRIi64 " level %d deserialize rsma task success", vid, pRSmaInfo->suid, i + 1); + } +#endif if (!isFileCreated) { char qTaskInfoFName[TSDB_FILENAME_LEN]; - tdRSmaQTaskGetFName(vid, TD_QTASK_TMP_FILE, qTaskInfoFName); + tdRSmaQTaskInfoGetFName(vid, TD_QTASK_TMP_FILE, qTaskInfoFName); tdInitTFile(&tFile, pTfs, qTaskInfoFName); tdCreateTFile(&tFile, pTfs, true, -1); isFileCreated = true; } - len += (sizeof(len) + sizeof(type) + sizeof(pRSmaInfo->suid)); - tdAppendTFile(&tFile, &len, sizeof(len), &toffset); - tdAppendTFile(&tFile, &type, sizeof(type), &toffset); - tdAppendTFile(&tFile, &pRSmaInfo->suid, sizeof(pRSmaInfo->suid), &toffset); + + char tmpBuf[RSMA_QTASKINFO_HEAD_LEN] = {0}; + void *pTmpBuf = &tmpBuf; + int32_t headLen = 0; + headLen += taosEncodeFixedI32(&pTmpBuf, len + RSMA_QTASKINFO_HEAD_LEN); + headLen += taosEncodeFixedI8(&pTmpBuf, type); + headLen += taosEncodeFixedI64(&pTmpBuf, pRSmaInfo->suid); + + ASSERT(headLen <= RSMA_QTASKINFO_HEAD_LEN); + tdAppendTFile(&tFile, (void *)&tmpBuf, headLen, &toffset); + smaDebug("vgId:%d, table %" PRIi64 " level %d head part len:%d appended to offset:%" PRIi64, vid, pRSmaInfo->suid, + i + 1, headLen, toffset); tdAppendTFile(&tFile, pOutput, len, &toffset); + smaDebug("vgId:%d, table %" PRIi64 " level %d body part len:%d appended to offset:%" PRIi64, vid, pRSmaInfo->suid, + i + 1, len, toffset); taosMemoryFree(pOutput); } + infoHash = taosHashIterate(RSMA_INFO_HASH(pRSmaStat), infoHash); } _normal: if (isFileCreated) { if (tdUpdateTFileHeader(&tFile) < 0) { - smaError("vgId:%d, failed to update tfile %s header since %s", vid, TD_FILE_FULL_NAME(&tFile), tstrerror(terrno)); + smaError("vgId:%d, failed to update tfile %s header since %s", vid, TD_TFILE_FULL_NAME(&tFile), + tstrerror(terrno)); tdCloseTFile(&tFile); tdRemoveTFile(&tFile); goto _err; } else { - smaDebug("vgId:%d, succeed to update tfile %s header", vid, TD_FILE_FULL_NAME(&tFile)); + smaDebug("vgId:%d, succeed to update tfile %s header", vid, TD_TFILE_FULL_NAME(&tFile)); } tdCloseTFile(&tFile); char newFName[TSDB_FILENAME_LEN]; - strncpy(newFName, TD_FILE_FULL_NAME(&tFile), TSDB_FILENAME_LEN); + strncpy(newFName, TD_TFILE_FULL_NAME(&tFile), TSDB_FILENAME_LEN); char *pos = strstr(newFName, tdQTaskInfoFname[TD_QTASK_TMP_FILE]); strncpy(pos, tdQTaskInfoFname[TD_QTASK_CUR_FILE], TSDB_FILENAME_LEN - POINTER_DISTANCE(pos, newFName)); - if (taosRenameFile(TD_FILE_FULL_NAME(&tFile), newFName) != 0) { - smaError("vgId:%d, failed to rename %s to %s", vid, TD_FILE_FULL_NAME(&tFile), newFName); + if (taosRenameFile(TD_TFILE_FULL_NAME(&tFile), newFName) != 0) { + smaError("vgId:%d, failed to rename %s to %s", vid, TD_TFILE_FULL_NAME(&tFile), newFName); goto _err; } else { - smaDebug("vgId:%d, succeed to rename %s to %s", vid, TD_FILE_FULL_NAME(&tFile), newFName); + smaDebug("vgId:%d, succeed to rename %s to %s", vid, TD_TFILE_FULL_NAME(&tFile), newFName); } } goto _end; @@ -841,13 +1098,14 @@ static void tdRSmaPersistTask(SRSmaStat *pRSmaStat) { if (TASK_TRIGGER_STAT_INACTIVE == atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_INACTIVE, TASK_TRIGGER_STAT_ACTIVE)) { - smaDebug("persist task is active again"); + smaDebug("vgId:%d, persist task is active again", SMA_VID(pRSmaStat->pSma)); } else if (TASK_TRIGGER_STAT_CANCELLED == atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_CANCELLED, TASK_TRIGGER_STAT_FINISHED)) { - smaDebug(" persist task is cancelled and set finished"); + smaDebug("vgId:%d, persist task is cancelled and set finished", SMA_VID(pRSmaStat->pSma)); } else { - smaWarn("persist task in abnormal stat %" PRIi8, atomic_load_8(RSMA_TRIGGER_STAT(pRSmaStat))); + smaWarn("vgId:%d, persist task in abnormal stat %" PRIi8, atomic_load_8(RSMA_TRIGGER_STAT(pRSmaStat)), + SMA_VID(pRSmaStat->pSma)); ASSERT(0); } atomic_store_8(RSMA_RUNNING_STAT(pRSmaStat), 0); @@ -864,7 +1122,8 @@ static void tdRSmaPersistTask(SRSmaStat *pRSmaStat) { */ static void tdRSmaPersistTrigger(void *param, void *tmrId) { SRSmaStat *pRSmaStat = param; - int8_t tmrStat = + + int8_t tmrStat = atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_ACTIVE, TASK_TRIGGER_STAT_INACTIVE); switch (tmrStat) { case TASK_TRIGGER_STAT_ACTIVE: { @@ -872,7 +1131,7 @@ static void tdRSmaPersistTrigger(void *param, void *tmrId) { if (TASK_TRIGGER_STAT_CANCELLED != atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_CANCELLED, TASK_TRIGGER_STAT_FINISHED)) { - smaDebug("rsma persistence start since active"); + smaDebug("vgId:%d, rsma persistence start since active", SMA_VID(pRSmaStat->pSma)); // start persist task tdRSmaPersistTask(pRSmaStat); @@ -895,252 +1154,6 @@ static void tdRSmaPersistTrigger(void *param, void *tmrId) { } break; default: { smaWarn("rsma persistence not start since unknown stat %" PRIi8, tmrStat); - ASSERT(0); } break; } } - -int32_t tdProcessRSmaRestoreImpl(SSma *pSma) { - SVnode *pVnode = pSma->pVnode; - - // step 1: iterate all stables to restore the rsma env - - SArray *suidList = taosArrayInit(1, sizeof(tb_uid_t)); - if (tsdbGetStbIdList(SMA_META(pSma), 0, suidList) < 0) { - smaError("vgId:%d, failed to restore rsma since get stb id list error: %s", TD_VID(pVnode), terrstr()); - return TSDB_CODE_FAILED; - } - - if (taosArrayGetSize(suidList) == 0) { - smaDebug("vgId:%d no need to restore rsma since empty stb id list", TD_VID(pVnode)); - return TSDB_CODE_SUCCESS; - } - - SMetaReader mr = {0}; - metaReaderInit(&mr, SMA_META(pSma), 0); - for (int32_t i = 0; i < taosArrayGetSize(suidList); ++i) { - tb_uid_t suid = *(tb_uid_t *)taosArrayGet(suidList, i); - smaDebug("suid [%d] is %" PRIi64, i, suid); - if (metaGetTableEntryByUid(&mr, suid) < 0) { - smaError("vgId:%d failed to get table meta for %" PRIi64 " since %s", TD_VID(pVnode), suid, terrstr()); - goto _err; - } - ASSERT(mr.me.type == TSDB_SUPER_TABLE); - ASSERT(mr.me.uid == suid); - if (TABLE_IS_ROLLUP(mr.me.flags)) { - SRSmaParam *param = &mr.me.stbEntry.rsmaParam; - for (int i = 0; i < 2; ++i) { - smaDebug("vgId: %d table:%" PRIi64 " maxdelay[%d]:%" PRIi64 " watermark[%d]:%" PRIi64, TD_VID(pSma->pVnode), - suid, i, param->maxdelay[i], i, param->watermark[i]); - } - if (tdProcessRSmaCreateImpl(pSma, &mr.me.stbEntry.rsmaParam, suid, mr.me.name) < 0) { - smaError("vgId:%d failed to retore rsma env for %" PRIi64 " since %s", TD_VID(pVnode), suid, terrstr()); - goto _err; - } - } - } - - // step 2: retrieve qtaskinfo object from the rsma/qtaskinfo file and restore - STFile tFile = {0}; - char qTaskInfoFName[TSDB_FILENAME_LEN]; - - tdRSmaQTaskGetFName(TD_VID(pVnode), TD_QTASK_CUR_FILE, qTaskInfoFName); - if (tdInitTFile(&tFile, pVnode->pTfs, qTaskInfoFName) < 0) { - goto _err; - } - if (tdOpenTFile(&tFile, TD_FILE_READ) < 0) { - goto _err; - } - SRSmaQTaskFIter fIter = {0}; - if (tdRSmaQTaskInfoIterInit(&fIter, &tFile) < 0) { - goto _err; - } - SRSmaQTaskInfoItem infoItem = {0}; - bool isEnd = false; - int32_t code = 0; - while ((code = tdRSmaQTaskInfoIterNext(&fIter, &infoItem, &isEnd)) == 0) { - if (isEnd) { - break; - } - if ((code = tdRSmaQTaskInfoItemRestore(pSma, &infoItem)) < 0) { - break; - } - } - tdRSmaQTaskInfoIterDestroy(&fIter); - - if (code < 0) { - goto _err; - } - - metaReaderClear(&mr); - taosArrayDestroy(suidList); - return TSDB_CODE_SUCCESS; -_err: - ASSERT(0); - metaReaderClear(&mr); - taosArrayDestroy(suidList); - smaError("failed to restore rsma info since %s", terrstr()); - return TSDB_CODE_FAILED; -} - -static int32_t tdRSmaQTaskInfoItemRestore(SSma *pSma, const SRSmaQTaskInfoItem *infoItem) { - SRSmaStat *pStat = (SRSmaStat *)SMA_ENV_STAT((SSmaEnv *)pSma->pRSmaEnv); - SRSmaInfo *pRSmaInfo = NULL; - void *qTaskInfo = NULL; - - pRSmaInfo = taosHashGet(RSMA_INFO_HASH(pStat), &infoItem->suid, sizeof(infoItem->suid)); - - if (!pRSmaInfo || !(pRSmaInfo = *(SRSmaInfo **)pRSmaInfo)) { - smaDebug("vgId:%d, no restore as no rsma info for suid:%" PRIu64, SMA_VID(pSma), infoItem->suid); - return TSDB_CODE_SUCCESS; - } - - if (infoItem->type == 1) { - qTaskInfo = pRSmaInfo->items[0].taskInfo; - } else if (infoItem->type == 2) { - qTaskInfo = pRSmaInfo->items[1].taskInfo; - } else { - ASSERT(0); - } - - if (!qTaskInfo) { - smaDebug("vgId:%d, no restore as NULL rsma qTaskInfo for suid:%" PRIu64, SMA_VID(pSma), infoItem->suid); - return TSDB_CODE_SUCCESS; - } - - if (qDeserializeTaskStatus(qTaskInfo, infoItem->qTaskInfo, infoItem->len) < 0) { - smaError("vgId:%d, restore rsma failed for suid:%" PRIi64 " level %d since %s", SMA_VID(pSma), infoItem->suid, - infoItem->type, terrstr(terrno)); - return TSDB_CODE_FAILED; - } - smaDebug("vgId:%d, restore rsma success for suid:%" PRIi64 " level %d", SMA_VID(pSma), infoItem->suid, - infoItem->type); - - return TSDB_CODE_SUCCESS; -} - -static int32_t tdRSmaQTaskInfoIterInit(SRSmaQTaskFIter *pIter, STFile *pTFile) { - memset(pIter, 0, sizeof(*pIter)); - pIter->pTFile = pTFile; - pIter->offset = TD_FILE_HEAD_SIZE; - - if (tdGetTFileSize(pTFile, &pIter->fsize) < 0) { - return TSDB_CODE_FAILED; - } - - if ((pIter->fsize - TD_FILE_HEAD_SIZE) < RSMA_QTASKINFO_BUFSIZE) { - pIter->nAlloc = pIter->fsize - TD_FILE_HEAD_SIZE; - } else { - pIter->nAlloc = RSMA_QTASKINFO_BUFSIZE; - } - - if (pIter->nAlloc < TD_FILE_HEAD_SIZE) { - pIter->nAlloc = TD_FILE_HEAD_SIZE; - } - - pIter->buf = taosMemoryMalloc(pIter->nAlloc); - if (!pIter->buf) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return TSDB_CODE_FAILED; - } - - return TSDB_CODE_SUCCESS; -} - -static int32_t tdRSmaQTaskInfoIterNextBlock(SRSmaQTaskFIter *pIter, bool *isFinish) { - STFile *pTFile = pIter->pTFile; - int64_t nBytes = RSMA_QTASKINFO_BUFSIZE; - - if (pIter->offset >= pIter->fsize) { - *isFinish = true; - return TSDB_CODE_SUCCESS; - } - - if ((pIter->fsize - pIter->offset) < RSMA_QTASKINFO_BUFSIZE) { - nBytes = pIter->fsize - pIter->offset; - } - - if (tdSeekTFile(pTFile, pIter->offset, SEEK_SET) < 0) { - ASSERT(0); - return TSDB_CODE_FAILED; - } - - if (tdReadTFile(pTFile, pIter->buf, nBytes) != nBytes) { - ASSERT(0); - return TSDB_CODE_FAILED; - } - - int32_t infoLen = 0; - taosDecodeFixedI32(pIter->buf, &infoLen); - if (infoLen > nBytes) { - ASSERT(infoLen > RSMA_QTASKINFO_BUFSIZE); - pIter->nAlloc = infoLen; - void *pBuf = taosMemoryRealloc(pIter->buf, infoLen); - if (!pBuf) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return TSDB_CODE_FAILED; - } - pIter->buf = pBuf; - nBytes = infoLen; - - if (tdSeekTFile(pTFile, pIter->offset, SEEK_SET)) { - ASSERT(0); - return TSDB_CODE_FAILED; - } - - if (tdReadTFile(pTFile, pIter->buf, nBytes) != nBytes) { - ASSERT(0); - return TSDB_CODE_FAILED; - } - } - - pIter->offset += nBytes; - pIter->nBytes = nBytes; - pIter->nBufPos = 0; - - return TSDB_CODE_SUCCESS; -} - -static int32_t tdRSmaQTaskInfoIterNext(SRSmaQTaskFIter *pIter, SRSmaQTaskInfoItem *pItem, bool *isEnd) { - while (1) { - // block iter - bool isFinish = false; - if (tdRSmaQTaskInfoIterNextBlock(pIter, &isFinish) < 0) { - ASSERT(0); - return TSDB_CODE_FAILED; - } - if (isFinish) { - *isEnd = true; - return TSDB_CODE_SUCCESS; - } - - // consume the block - int32_t qTaskInfoLenWithHead = 0; - pIter->buf = taosDecodeFixedI32(pIter->buf, &qTaskInfoLenWithHead); - if (qTaskInfoLenWithHead < 0) { - terrno = TSDB_CODE_TDB_FILE_CORRUPTED; - return TSDB_CODE_FAILED; - } - while (1) { - if ((pIter->nBufPos + qTaskInfoLenWithHead) <= pIter->nBytes) { - pIter->buf = taosDecodeFixedI8(pIter->buf, &pItem->type); - pIter->buf = taosDecodeFixedI64(pIter->buf, &pItem->suid); - pItem->qTaskInfo = pIter->buf; - pItem->len = tdRSmaQTaskInfoContLen(qTaskInfoLenWithHead); - // do the restore job - printf("%s:%d ###### restore the qtask info offset:%" PRIi64 "\n", __func__, __LINE__, pIter->offset); - - pIter->buf = POINTER_SHIFT(pIter->buf, pItem->len); - pIter->nBufPos += qTaskInfoLenWithHead; - - pIter->buf = taosDecodeFixedI32(pIter->buf, &qTaskInfoLenWithHead); - continue; - } - // prepare and load next block in the file - pIter->offset -= (pIter->nBytes - pIter->nBufPos); - break; - } - } - - return TSDB_CODE_SUCCESS; -} diff --git a/source/dnode/vnode/src/sma/smaUtil.c b/source/dnode/vnode/src/sma/smaUtil.c index 1f60da0b0a..5f78aadddf 100644 --- a/source/dnode/vnode/src/sma/smaUtil.c +++ b/source/dnode/vnode/src/sma/smaUtil.c @@ -22,7 +22,6 @@ #define TD_FILE_INIT_MAGIC 0xFFFFFFFF - static int32_t tdEncodeTFInfo(void **buf, STFInfo *pInfo); static void *tdDecodeTFInfo(void *buf, STFInfo *pInfo); @@ -46,7 +45,7 @@ static void *tdDecodeTFInfo(void *buf, STFInfo *pInfo) { } int64_t tdWriteTFile(STFile *pTFile, void *buf, int64_t nbyte) { - ASSERT(TD_FILE_OPENED(pTFile)); + ASSERT(TD_TFILE_OPENED(pTFile)); int64_t nwrite = taosWriteFile(pTFile->pFile, buf, nbyte); if (nwrite < nbyte) { @@ -58,9 +57,9 @@ int64_t tdWriteTFile(STFile *pTFile, void *buf, int64_t nbyte) { } int64_t tdSeekTFile(STFile *pTFile, int64_t offset, int whence) { - ASSERT(TD_FILE_OPENED(pTFile)); + ASSERT(TD_TFILE_OPENED(pTFile)); - int64_t loffset = taosLSeekFile(TD_FILE_PFILE(pTFile), offset, whence); + int64_t loffset = taosLSeekFile(TD_TFILE_PFILE(pTFile), offset, whence); if (loffset < 0) { terrno = TAOS_SYSTEM_ERROR(errno); return -1; @@ -70,12 +69,12 @@ int64_t tdSeekTFile(STFile *pTFile, int64_t offset, int whence) { } int64_t tdGetTFileSize(STFile *pTFile, int64_t *size) { - ASSERT(TD_FILE_OPENED(pTFile)); + ASSERT(TD_TFILE_OPENED(pTFile)); return taosFStatFile(pTFile->pFile, size, NULL); } int64_t tdReadTFile(STFile *pTFile, void *buf, int64_t nbyte) { - ASSERT(TD_FILE_OPENED(pTFile)); + ASSERT(TD_TFILE_OPENED(pTFile)); int64_t nread = taosReadFile(pTFile->pFile, buf, nbyte); if (nread < 0) { @@ -108,7 +107,7 @@ int32_t tdLoadTFileHeader(STFile *pTFile, STFInfo *pInfo) { char buf[TD_FILE_HEAD_SIZE] = "\0"; uint32_t _version; - ASSERT(TD_FILE_OPENED(pTFile)); + ASSERT(TD_TFILE_OPENED(pTFile)); if (tdSeekTFile(pTFile, 0, SEEK_SET) < 0) { return -1; @@ -133,7 +132,7 @@ void tdUpdateTFileMagic(STFile *pTFile, void *pCksm) { } int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset) { - ASSERT(TD_FILE_OPENED(pTFile)); + ASSERT(TD_TFILE_OPENED(pTFile)); int64_t toffset; @@ -141,6 +140,11 @@ int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset) return -1; } +#if 1 + smaDebug("append to file %s, offset:%" PRIi64 " + nbyte:%" PRIi64 " =%" PRIi64, TD_TFILE_FULL_NAME(pTFile), toffset, + nbyte, toffset + nbyte); +#endif + ASSERT(pTFile->info.fsize == toffset); if (offset) { @@ -157,9 +161,9 @@ int64_t tdAppendTFile(STFile *pTFile, void *buf, int64_t nbyte, int64_t *offset) } int32_t tdOpenTFile(STFile *pTFile, int flags) { - ASSERT(!TD_FILE_OPENED(pTFile)); + ASSERT(!TD_TFILE_OPENED(pTFile)); - pTFile->pFile = taosOpenFile(TD_FILE_FULL_NAME(pTFile), flags); + pTFile->pFile = taosOpenFile(TD_TFILE_FULL_NAME(pTFile), flags); if (pTFile->pFile == NULL) { terrno = TAOS_SYSTEM_ERROR(errno); return -1; @@ -169,9 +173,9 @@ int32_t tdOpenTFile(STFile *pTFile, int flags) { } void tdCloseTFile(STFile *pTFile) { - if (TD_FILE_OPENED(pTFile)) { + if (TD_TFILE_OPENED(pTFile)) { taosCloseFile(&pTFile->pFile); - TD_FILE_SET_CLOSED(pTFile); + TD_TFILE_SET_CLOSED(pTFile); } } @@ -183,8 +187,8 @@ int32_t tdInitTFile(STFile *pTFile, STfs *pTfs, const char *fname) { char fullname[TSDB_FILENAME_LEN]; SDiskID did = {0}; - TD_FILE_SET_STATE(pTFile, TD_FILE_STATE_OK); - TD_FILE_SET_CLOSED(pTFile); + TD_TFILE_SET_STATE(pTFile, TD_FILE_STATE_OK); + TD_TFILE_SET_CLOSED(pTFile); memset(&(pTFile->info), 0, sizeof(pTFile->info)); pTFile->info.magic = TD_FILE_INIT_MAGIC; @@ -202,18 +206,18 @@ int32_t tdInitTFile(STFile *pTFile, STfs *pTfs, const char *fname) { int32_t tdCreateTFile(STFile *pTFile, STfs *pTfs, bool updateHeader, int8_t fType) { ASSERT(pTFile->info.fsize == 0 && pTFile->info.magic == TD_FILE_INIT_MAGIC); - pTFile->pFile = taosOpenFile(TD_FILE_FULL_NAME(pTFile), TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); + pTFile->pFile = taosOpenFile(TD_TFILE_FULL_NAME(pTFile), TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); if (pTFile->pFile == NULL) { if (errno == ENOENT) { // Try to create directory recursively - char *s = strdup(TD_FILE_REL_NAME(pTFile)); - if (tfsMkdirRecurAt(pTfs, taosDirName(s), TD_FILE_DID(pTFile)) < 0) { + char *s = strdup(TD_TFILE_REL_NAME(pTFile)); + if (tfsMkdirRecurAt(pTfs, taosDirName(s), TD_TFILE_DID(pTFile)) < 0) { taosMemoryFreeClear(s); return -1; } taosMemoryFreeClear(s); - pTFile->pFile = taosOpenFile(TD_FILE_FULL_NAME(pTFile), TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); + pTFile->pFile = taosOpenFile(TD_TFILE_FULL_NAME(pTFile), TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC); if (pTFile->pFile == NULL) { terrno = TAOS_SYSTEM_ERROR(errno); return -1; @@ -240,7 +244,7 @@ int32_t tdCreateTFile(STFile *pTFile, STfs *pTfs, bool updateHeader, int8_t fTyp return 0; } -int32_t tdRemoveTFile(STFile *pTFile) { return tfsRemoveFile(TD_FILE_F(pTFile)); } +int32_t tdRemoveTFile(STFile *pTFile) { return tfsRemoveFile(TD_TFILE_F(pTFile)); } // smaXXXUtil ================ // ... \ No newline at end of file diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 4d73dbc406..57d7386667 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -152,14 +152,14 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { return pVnode; _err: - if (pVnode->pSma) smaClose(pVnode->pSma); + if (pVnode->pSma) smaCloseEnv(pVnode->pSma); if (pVnode->pQuery) vnodeQueryClose(pVnode); if (pVnode->pTq) tqClose(pVnode->pTq); if (pVnode->pWal) walClose(pVnode->pWal); if (pVnode->pTsdb) tsdbClose(&pVnode->pTsdb); + if (pVnode->pSma) smaCloseEx(pVnode->pSma); if (pVnode->pMeta) metaClose(pVnode->pMeta); - tsem_destroy(&(pVnode->canCommit)); taosMemoryFree(pVnode); return NULL; diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index e1e8a686aa..d3253212ea 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -1052,7 +1052,8 @@ static int32_t translateUniqueMode(SFunctionNode* pFunc, char* pErrBuf, int32_t SNode* pPara = nodesListGetNode(pFunc->pParameterList, 0); if (!nodesExprHasColumn(pPara)) { - return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, "The parameters of %s must contain columns", isUnique ? "UNIQUE" : "MODE"); + return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, "The parameters of %s must contain columns", + isUnique ? "UNIQUE" : "MODE"); } pFunc->node.resType = ((SExprNode*)pPara)->resType; @@ -1228,19 +1229,19 @@ static int32_t translateSubstr(SFunctionNode* pFunc, char* pErrBuf, int32_t len) static int32_t translateCast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) { // The number of parameters has been limited by the syntax definition - //uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type; + // uint8_t para1Type = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type; // The function return type has been set during syntax parsing uint8_t para2Type = pFunc->node.resType.type; - //if (para2Type != TSDB_DATA_TYPE_BIGINT && para2Type != TSDB_DATA_TYPE_UBIGINT && - // para2Type != TSDB_DATA_TYPE_VARCHAR && para2Type != TSDB_DATA_TYPE_NCHAR && - // para2Type != TSDB_DATA_TYPE_TIMESTAMP) { - // return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); - //} - //if ((para2Type == TSDB_DATA_TYPE_TIMESTAMP && IS_VAR_DATA_TYPE(para1Type)) || - // (para2Type == TSDB_DATA_TYPE_BINARY && para1Type == TSDB_DATA_TYPE_NCHAR)) { - // return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); - //} + // if (para2Type != TSDB_DATA_TYPE_BIGINT && para2Type != TSDB_DATA_TYPE_UBIGINT && + // para2Type != TSDB_DATA_TYPE_VARCHAR && para2Type != TSDB_DATA_TYPE_NCHAR && + // para2Type != TSDB_DATA_TYPE_TIMESTAMP) { + // return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + // } + // if ((para2Type == TSDB_DATA_TYPE_TIMESTAMP && IS_VAR_DATA_TYPE(para1Type)) || + // (para2Type == TSDB_DATA_TYPE_BINARY && para1Type == TSDB_DATA_TYPE_NCHAR)) { + // return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName); + // } int32_t para2Bytes = pFunc->node.resType.bytes; if (IS_VAR_DATA_TYPE(para2Type)) { @@ -2117,7 +2118,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "unique", .type = FUNCTION_TYPE_UNIQUE, - .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_TIMELINE_FUNC | + .classification = FUNC_MGT_SELECT_FUNC | FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_FORBID_WINDOW_FUNC | FUNC_MGT_FORBID_GROUP_BY_FUNC, .translateFunc = translateUnique, .getEnvFunc = getUniqueFuncEnv, diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 9d8baf472b..b372bf75fc 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -100,6 +100,7 @@ static int32_t exprNodeCopy(const SExprNode* pSrc, SExprNode* pDst) { COPY_OBJECT_FIELD(resType, sizeof(SDataType)); COPY_CHAR_ARRAY_FIELD(aliasName); COPY_CHAR_ARRAY_FIELD(userAlias); + COPY_SCALAR_FIELD(orderAlias); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index be6faa92cb..dc9d9b92ee 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -1500,7 +1500,8 @@ typedef struct SCollectFuncsCxt { static EDealRes collectFuncs(SNode* pNode, void* pContext) { SCollectFuncsCxt* pCxt = (SCollectFuncsCxt*)pContext; - if (QUERY_NODE_FUNCTION == nodeType(pNode) && pCxt->classifier(((SFunctionNode*)pNode)->funcId)) { + if (QUERY_NODE_FUNCTION == nodeType(pNode) && pCxt->classifier(((SFunctionNode*)pNode)->funcId) && + !(((SExprNode*)pNode)->orderAlias)) { pCxt->errCode = nodesListStrictAppend(pCxt->pFuncs, nodesCloneNode(pNode)); return (TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR); } diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 45240536e3..7106f8df96 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1355,25 +1355,6 @@ static EDealRes rewriteColToSelectValFunc(STranslateContext* pCxt, SNode** pNode return TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR; } -static EDealRes rewriteExprToGroupKeyFunc(STranslateContext* pCxt, SNode** pNode) { - SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); - if (NULL == pFunc) { - pCxt->errCode = TSDB_CODE_OUT_OF_MEMORY; - return DEAL_RES_ERROR; - } - - strcpy(pFunc->functionName, "_group_key"); - strcpy(pFunc->node.aliasName, ((SExprNode*)*pNode)->aliasName); - pCxt->errCode = nodesListMakeAppend(&pFunc->pParameterList, *pNode); - if (TSDB_CODE_SUCCESS == pCxt->errCode) { - *pNode = (SNode*)pFunc; - pCxt->errCode = fmGetFuncInfo(pFunc, pCxt->msgBuf.buf, pCxt->msgBuf.len); - } - pCxt->pCurrSelectStmt->hasAggFuncs = true; - - return (TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR); -} - static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) { SCheckExprForGroupByCxt* pCxt = (SCheckExprForGroupByCxt*)pContext; if (!nodesIsExprNode(*pNode) || isAliasColumn(*pNode)) { @@ -1393,7 +1374,13 @@ static EDealRes doCheckExprForGroupBy(SNode** pNode, void* pContext) { SNode* pGroupNode = NULL; FOREACH(pGroupNode, getGroupByList(pCxt->pTranslateCxt)) { if (nodesEqualNode(getGroupByNode(pGroupNode), *pNode)) { - return rewriteExprToGroupKeyFunc(pCxt->pTranslateCxt, pNode); + return DEAL_RES_IGNORE_CHILD; + } + } + SNode* pPartKey = NULL; + FOREACH(pPartKey, pCxt->pTranslateCxt->pCurrSelectStmt->pPartitionByList) { + if (nodesEqualNode(pPartKey, *pNode)) { + return DEAL_RES_IGNORE_CHILD; } } if (isScanPseudoColumnFunc(*pNode) || QUERY_NODE_COLUMN == nodeType(*pNode)) { @@ -1451,25 +1438,6 @@ static int32_t rewriteColsToSelectValFunc(STranslateContext* pCxt, SSelectStmt* return pCxt->errCode; } -static EDealRes rewriteExprsToGroupKeyFuncImpl(SNode** pNode, void* pContext) { - STranslateContext* pCxt = pContext; - SNode* pPartKey = NULL; - FOREACH(pPartKey, pCxt->pCurrSelectStmt->pPartitionByList) { - if (nodesEqualNode(pPartKey, *pNode)) { - return rewriteExprToGroupKeyFunc(pCxt, pNode); - } - } - return DEAL_RES_CONTINUE; -} - -static int32_t rewriteExprsToGroupKeyFunc(STranslateContext* pCxt, SSelectStmt* pSelect) { - nodesRewriteExprs(pSelect->pProjectionList, rewriteExprsToGroupKeyFuncImpl, pCxt); - if (TSDB_CODE_SUCCESS == pCxt->errCode && !pSelect->isDistinct) { - nodesRewriteExprs(pSelect->pOrderByList, rewriteExprsToGroupKeyFuncImpl, pCxt); - } - return pCxt->errCode; -} - typedef struct CheckAggColCoexistCxt { STranslateContext* pTranslateCxt; bool existAggFunc; @@ -1529,9 +1497,6 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect) if (cxt.existIndefiniteRowsFunc && cxt.existCol) { return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_NOT_ALLOWED_FUNC); } - if (cxt.existAggFunc && NULL != pSelect->pPartitionByList) { - return rewriteExprsToGroupKeyFunc(pCxt, pSelect); - } return TSDB_CODE_SUCCESS; } @@ -2408,54 +2373,6 @@ static EDealRes rewriteSeletcValueFunc(STranslateContext* pCxt, SNode** pNode) { return TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_IGNORE_CHILD : DEAL_RES_ERROR; } -static EDealRes rewriteUniqueFunc(SNode** pNode, void* pContext) { - SRwriteUniqueCxt* pCxt = pContext; - if (QUERY_NODE_FUNCTION == nodeType(*pNode)) { - SFunctionNode* pFunc = (SFunctionNode*)*pNode; - if (FUNCTION_TYPE_UNIQUE == pFunc->funcType) { - SNode* pExpr = nodesListGetNode(pFunc->pParameterList, 0); - NODES_CLEAR_LIST(pFunc->pParameterList); - strcpy(((SExprNode*)pExpr)->aliasName, ((SExprNode*)*pNode)->aliasName); - nodesDestroyNode(*pNode); - *pNode = pExpr; - pCxt->pExpr = pExpr; - return DEAL_RES_IGNORE_CHILD; - } else if (FUNCTION_TYPE_SELECT_VALUE == pFunc->funcType) { - return rewriteSeletcValueFunc(pCxt->pTranslateCxt, pNode); - } - } - return DEAL_RES_CONTINUE; -} - -static SNode* createGroupingSet(SNode* pExpr) { - SGroupingSetNode* pGroupingSet = (SGroupingSetNode*)nodesMakeNode(QUERY_NODE_GROUPING_SET); - if (NULL == pGroupingSet) { - return NULL; - } - pGroupingSet->groupingSetType = GP_TYPE_NORMAL; - if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pGroupingSet->pParameterList, nodesCloneNode(pExpr))) { - nodesDestroyNode((SNode*)pGroupingSet); - return NULL; - } - return (SNode*)pGroupingSet; -} - -// from: select unique(expr), col1 + col2 from t where_clause partition_by_clause order_by_clause ... -// to: select expr, first(col1) + first(col2) from t where_clause partition_by_clause group by expr order_by_clause ... -static int32_t rewriteUniqueStmt(STranslateContext* pCxt, SSelectStmt* pSelect) { - if (!pSelect->hasUniqueFunc) { - return TSDB_CODE_SUCCESS; - } - - SRwriteUniqueCxt cxt = {.pTranslateCxt = pCxt, .pExpr = NULL}; - nodesRewriteExprs(pSelect->pProjectionList, rewriteUniqueFunc, &cxt); - if (TSDB_CODE_SUCCESS == cxt.pTranslateCxt->errCode) { - cxt.pTranslateCxt->errCode = nodesListMakeStrictAppend(&pSelect->pGroupByList, createGroupingSet(cxt.pExpr)); - } - pSelect->hasIndefiniteRowsFunc = false; - return cxt.pTranslateCxt->errCode; -} - typedef struct SReplaceOrderByAliasCxt { STranslateContext* pTranslateCxt; SNodeList* pProjectionList; @@ -2474,6 +2391,7 @@ static EDealRes replaceOrderByAliasImpl(SNode** pNode, void* pContext) { pCxt->pTranslateCxt->errCode = TSDB_CODE_OUT_OF_MEMORY; return DEAL_RES_ERROR; } + ((SExprNode*)pNew)->orderAlias = true; nodesDestroyNode(*pNode); *pNode = pNew; return DEAL_RES_CONTINUE; @@ -2529,9 +2447,6 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect if (TSDB_CODE_SUCCESS == code) { code = translateInterp(pCxt, pSelect); } - if (TSDB_CODE_SUCCESS == code) { - code = rewriteUniqueStmt(pCxt, pSelect); - } if (TSDB_CODE_SUCCESS == code) { code = rewriteTimelineFunc(pCxt, pSelect); } diff --git a/source/libs/parser/test/parSelectTest.cpp b/source/libs/parser/test/parSelectTest.cpp index f8b8dc58fc..82e07b71af 100644 --- a/source/libs/parser/test/parSelectTest.cpp +++ b/source/libs/parser/test/parSelectTest.cpp @@ -232,8 +232,6 @@ TEST_F(ParserSelectTest, groupBySemanticCheck) { run("SELECT COUNT(*) cnt, c1 FROM t1 WHERE c1 > 0", TSDB_CODE_PAR_NOT_SINGLE_GROUP); run("SELECT COUNT(*) cnt, c2 FROM t1 WHERE c1 > 0 GROUP BY c1", TSDB_CODE_PAR_GROUPBY_LACK_EXPRESSION); - run("SELECT COUNT(*) cnt, c2 FROM t1 WHERE c1 > 0 PARTITION BY c2 GROUP BY c1", - TSDB_CODE_PAR_GROUPBY_LACK_EXPRESSION); } TEST_F(ParserSelectTest, orderBy) { diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 396a7b6193..ef8b109b62 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -437,6 +437,33 @@ static SColumnNode* createColumnByExpr(const char* pStmtName, SExprNode* pExpr) return pCol; } +static SNode* createGroupingSetNode(SNode* pExpr) { + SGroupingSetNode* pGroupingSet = (SGroupingSetNode*)nodesMakeNode(QUERY_NODE_GROUPING_SET); + if (NULL == pGroupingSet) { + return NULL; + } + pGroupingSet->groupingSetType = GP_TYPE_NORMAL; + if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pGroupingSet->pParameterList, nodesCloneNode(pExpr))) { + nodesDestroyNode((SNode*)pGroupingSet); + return NULL; + } + return (SNode*)pGroupingSet; +} + +static int32_t createGroupKeysFromPartKeys(SNodeList* pPartKeys, SNodeList** pOutput) { + SNodeList* pGroupKeys = NULL; + SNode* pPartKey = NULL; + FOREACH(pPartKey, pPartKeys) { + int32_t code = nodesListMakeStrictAppend(&pGroupKeys, createGroupingSetNode(pPartKey)); + if (TSDB_CODE_SUCCESS != code) { + nodesDestroyList(pGroupKeys); + return code; + } + } + *pOutput = pGroupKeys; + return TSDB_CODE_SUCCESS; +} + static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { if (!pSelect->hasAggFuncs && NULL == pSelect->pGroupByList) { return TSDB_CODE_SUCCESS; @@ -459,10 +486,18 @@ static int32_t createAggLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, code = rewriteExprsForSelect(pAgg->pAggFuncs, pSelect, SQL_CLAUSE_GROUP_BY); } + if (NULL != pSelect->pPartitionByList) { + code = createGroupKeysFromPartKeys(pSelect->pPartitionByList, &pAgg->pGroupKeys); + } + if (NULL != pSelect->pGroupByList) { - pAgg->pGroupKeys = nodesCloneList(pSelect->pGroupByList); - if (NULL == pAgg->pGroupKeys) { - code = TSDB_CODE_OUT_OF_MEMORY; + if (NULL != pAgg->pGroupKeys) { + code = nodesListStrictAppendList(pAgg->pGroupKeys, nodesCloneList(pSelect->pGroupByList)); + } else { + pAgg->pGroupKeys = nodesCloneList(pSelect->pGroupByList); + if (NULL == pAgg->pGroupKeys) { + code = TSDB_CODE_OUT_OF_MEMORY; + } } } @@ -508,6 +543,7 @@ static int32_t createIndefRowsFuncLogicNode(SLogicPlanContext* pCxt, SSelectStmt } pIdfRowsFunc->isTailFunc = pSelect->hasTailFunc; + pIdfRowsFunc->isUniqueFunc = pSelect->hasUniqueFunc; // indefinite rows functions and _select_values functions int32_t code = nodesCollectFuncs(pSelect, SQL_CLAUSE_SELECT, fmIsVectorFunc, &pIdfRowsFunc->pFuncs); @@ -809,7 +845,8 @@ static int32_t createProjectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSel } static int32_t createPartitionLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect, SLogicNode** pLogicNode) { - if (NULL == pSelect->pPartitionByList) { + if (NULL == pSelect->pPartitionByList || (pSelect->hasAggFuncs && NULL == pSelect->pWindow) || + NULL != pSelect->pGroupByList) { return TSDB_CODE_SUCCESS; } diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 638e3f5604..42f7f744c5 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -987,6 +987,7 @@ static int32_t smaIndexOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pLogi code = smaIndexOptApplyIndex(pLogicSubplan, pScan, pIndex, pSmaCols, wstrartIndex); taosArrayDestroyEx(pScan->pSmaIndexes, smaIndexOptDestroySmaIndex); pScan->pSmaIndexes = NULL; + pCxt->optimized = true; break; } } @@ -1033,12 +1034,30 @@ static SNodeList* partTagsGetPartKeys(SLogicNode* pNode) { } } +static SNodeList* partTagsGetFuncs(SLogicNode* pNode) { + if (QUERY_NODE_LOGIC_PLAN_PARTITION == nodeType(pNode)) { + return NULL; + } else { + return ((SAggLogicNode*)pNode)->pAggFuncs; + } +} + +static bool partTagsOptAreSupportedFuncs(SNodeList* pFuncs) { + SNode* pFunc = NULL; + FOREACH(pFunc, pFuncs) { + if (fmIsIndefiniteRowsFunc(((SFunctionNode*)pFunc)->funcId) && !fmIsSelectFunc(((SFunctionNode*)pFunc)->funcId)) { + return false; + } + } + return true; +} + static bool partTagsOptMayBeOptimized(SLogicNode* pNode) { if (!partTagsIsOptimizableNode(pNode)) { return false; } - return !partTagsOptHasCol(partTagsGetPartKeys(pNode)); + return !partTagsOptHasCol(partTagsGetPartKeys(pNode)) && partTagsOptAreSupportedFuncs(partTagsGetFuncs(pNode)); } static EDealRes partTagsOptRebuildTbanmeImpl(SNode** pNode, void* pContext) { @@ -1064,6 +1083,59 @@ static int32_t partTagsOptRebuildTbanme(SNodeList* pPartKeys) { return code; } +static SNode* partTagsCreateWrapperFunc(const char* pFuncName, SNode* pNode) { + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); + if (NULL == pFunc) { + return NULL; + } + + strcpy(pFunc->functionName, pFuncName); + if (QUERY_NODE_COLUMN == nodeType(pNode)) { + SColumnNode* pCol = (SColumnNode*)pNode; + sprintf(pFunc->node.aliasName, "%s.%s", pCol->tableAlias, pCol->colName); + } else { + strcpy(pFunc->node.aliasName, ((SExprNode*)pNode)->aliasName); + } + int32_t code = nodesListMakeStrictAppend(&pFunc->pParameterList, nodesCloneNode(pNode)); + if (TSDB_CODE_SUCCESS == code) { + code = fmGetFuncInfo(pFunc, NULL, 0); + } + + if (TSDB_CODE_SUCCESS != code) { + nodesDestroyNode((SNode*)pFunc); + return NULL; + } + + return (SNode*)pFunc; +} + +static bool partTagsHasIndefRowsSelectFunc(SNodeList* pFuncs) { + SNode* pFunc = NULL; + FOREACH(pFunc, pFuncs) { + if (fmIsIndefiniteRowsFunc(((SFunctionNode*)pFunc)->funcId)) { + return true; + } + } + return false; +} + +static int32_t partTagsRewriteGroupTagsToFuncs(SNodeList* pGroupTags, SNodeList* pAggFuncs) { + bool hasIndefRowsSelectFunc = partTagsHasIndefRowsSelectFunc(pAggFuncs); + int32_t code = TSDB_CODE_SUCCESS; + SNode* pNode = NULL; + FOREACH(pNode, pGroupTags) { + if (hasIndefRowsSelectFunc) { + code = nodesListStrictAppend(pAggFuncs, partTagsCreateWrapperFunc("_select_value", pNode)); + } else { + code = nodesListStrictAppend(pAggFuncs, partTagsCreateWrapperFunc("_group_key", pNode)); + } + if (TSDB_CODE_SUCCESS != code) { + break; + } + } + return code; +} + static int32_t partTagsOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan) { SLogicNode* pNode = optFindPossibleNode(pLogicSubplan->pNode, partTagsOptMayBeOptimized); if (NULL == pNode) { @@ -1080,15 +1152,17 @@ static int32_t partTagsOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSub nodesDestroyNode((SNode*)pNode); } } else { - SNode* pGroupKey = NULL; - FOREACH(pGroupKey, ((SAggLogicNode*)pNode)->pGroupKeys) { + SAggLogicNode* pAgg = (SAggLogicNode*)pNode; + SNode* pGroupKey = NULL; + FOREACH(pGroupKey, pAgg->pGroupKeys) { code = nodesListMakeStrictAppend( &pScan->pGroupTags, nodesCloneNode(nodesListGetNode(((SGroupingSetNode*)pGroupKey)->pParameterList, 0))); if (TSDB_CODE_SUCCESS != code) { break; } } - NODES_DESTORY_LIST(((SAggLogicNode*)pNode)->pGroupKeys); + NODES_DESTORY_LIST(pAgg->pGroupKeys); + code = partTagsRewriteGroupTagsToFuncs(pScan->pGroupTags, pAgg->pAggFuncs); } if (TSDB_CODE_SUCCESS == code) { code = partTagsOptRebuildTbanme(pScan->pGroupTags); @@ -1125,7 +1199,8 @@ static bool eliminateProjOptMayBeOptimized(SLogicNode* pNode) { } SProjectLogicNode* pProjectNode = (SProjectLogicNode*)pNode; - if (NULL != pProjectNode->node.pLimit || NULL != pProjectNode->node.pSlimit) { + if (NULL != pProjectNode->node.pLimit || NULL != pProjectNode->node.pSlimit || + NULL != pProjectNode->node.pConditions) { return false; } @@ -1163,6 +1238,7 @@ static int32_t eliminateProjOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* NODES_CLEAR_LIST(pProjectNode->node.pChildren); nodesDestroyNode((SNode*)pProjectNode); } + pCxt->optimized = true; return code; } @@ -1306,6 +1382,7 @@ static int32_t rewriteTailOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pL nodesDestroyNode((SNode*)pSort); nodesDestroyNode((SNode*)pProject); } + pCxt->optimized = true; return code; } @@ -1344,6 +1421,7 @@ static int32_t eliminateSetOpOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pSetOpNode->pChildren = NULL; ERASE_NODE(pSetOpNode->pParent->pChildren); + pCxt->optimized = true; return TSDB_CODE_SUCCESS; } } @@ -1360,15 +1438,192 @@ static int32_t eliminateSetOpOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLo return eliminateSetOpOptimizeImpl(pCxt, pLogicSubplan, pSetOpNode); } -//=================================================================================================================== +static bool rewriteUniqueOptMayBeOptimized(SLogicNode* pNode) { + return QUERY_NODE_LOGIC_PLAN_INDEF_ROWS_FUNC == nodeType(pNode) && ((SIndefRowsFuncLogicNode*)pNode)->isUniqueFunc; +} + +static SNode* rewriteUniqueOptCreateGroupingSet(SNode* pExpr) { + SGroupingSetNode* pGroupingSet = (SGroupingSetNode*)nodesMakeNode(QUERY_NODE_GROUPING_SET); + if (NULL == pGroupingSet) { + return NULL; + } + pGroupingSet->groupingSetType = GP_TYPE_NORMAL; + SExprNode* pGroupExpr = (SExprNode*)nodesCloneNode(pExpr); + if (TSDB_CODE_SUCCESS != nodesListMakeStrictAppend(&pGroupingSet->pParameterList, (SNode*)pGroupExpr)) { + nodesDestroyNode((SNode*)pGroupingSet); + return NULL; + } + return (SNode*)pGroupingSet; +} + +static SNode* rewriteUniqueOptCreateFirstFunc(SFunctionNode* pSelectValue, SNode* pCol) { + SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); + if (NULL == pFunc) { + return NULL; + } + + strcpy(pFunc->functionName, "first"); + if (NULL != pSelectValue) { + sprintf(pFunc->node.aliasName, "%s", pSelectValue->node.aliasName); + } else { + sprintf(pFunc->node.aliasName, "%s.%p", pFunc->functionName, pFunc); + } + int32_t code = nodesListMakeStrictAppend(&pFunc->pParameterList, nodesCloneNode(pCol)); + if (TSDB_CODE_SUCCESS == code) { + code = fmGetFuncInfo(pFunc, NULL, 0); + } + + if (TSDB_CODE_SUCCESS != code) { + nodesDestroyNode((SNode*)pFunc); + return NULL; + } + + return (SNode*)pFunc; +} + +static int32_t rewriteUniqueOptCreateAgg(SIndefRowsFuncLogicNode* pIndef, SLogicNode** pOutput) { + SAggLogicNode* pAgg = (SAggLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_AGG); + if (NULL == pAgg) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + TSWAP(pAgg->node.pChildren, pIndef->node.pChildren); + pAgg->node.precision = pIndef->node.precision; + + int32_t code = TSDB_CODE_SUCCESS; + bool hasSelectPrimaryKey = false; + SNode* pPrimaryKey = NULL; + SNode* pNode = NULL; + FOREACH(pNode, pIndef->pFuncs) { + SFunctionNode* pFunc = (SFunctionNode*)pNode; + SNode* pExpr = nodesListGetNode(pFunc->pParameterList, 0); + if (FUNCTION_TYPE_UNIQUE == pFunc->funcType) { + pPrimaryKey = nodesListGetNode(pFunc->pParameterList, 1); + code = nodesListMakeStrictAppend(&pAgg->pGroupKeys, rewriteUniqueOptCreateGroupingSet(pExpr)); + } else if (PRIMARYKEY_TIMESTAMP_COL_ID == ((SColumnNode*)pExpr)->colId) { // _select_value(ts) => first(ts) + hasSelectPrimaryKey = true; + code = nodesListMakeStrictAppend(&pAgg->pAggFuncs, rewriteUniqueOptCreateFirstFunc(pFunc, pExpr)); + } else { // _select_value(other_col) + code = nodesListMakeStrictAppend(&pAgg->pAggFuncs, nodesCloneNode(pNode)); + } + if (TSDB_CODE_SUCCESS != code) { + break; + } + } + + if (TSDB_CODE_SUCCESS == code) { + code = createColumnByRewriteExprs(pAgg->pGroupKeys, &pAgg->node.pTargets); + } + if (TSDB_CODE_SUCCESS == code && NULL != pAgg->pAggFuncs) { + code = createColumnByRewriteExprs(pAgg->pAggFuncs, &pAgg->node.pTargets); + } + + if (TSDB_CODE_SUCCESS == code && !hasSelectPrimaryKey && NULL != pAgg->pAggFuncs) { + code = nodesListMakeStrictAppend(&pAgg->pAggFuncs, rewriteUniqueOptCreateFirstFunc(NULL, pPrimaryKey)); + } + + if (TSDB_CODE_SUCCESS == code) { + *pOutput = (SLogicNode*)pAgg; + } else { + nodesDestroyNode((SNode*)pAgg); + } + return code; +} + +static SNode* rewriteUniqueOptCreateProjectCol(SFunctionNode* pFunc) { + SColumnNode* pCol = (SColumnNode*)nodesMakeNode(QUERY_NODE_COLUMN); + if (NULL == pCol) { + return NULL; + } + + pCol->node.resType = pFunc->node.resType; + if (FUNCTION_TYPE_UNIQUE == pFunc->funcType) { + SExprNode* pExpr = (SExprNode*)nodesListGetNode(pFunc->pParameterList, 0); + if (QUERY_NODE_COLUMN == nodeType(pExpr)) { + strcpy(pCol->tableAlias, ((SColumnNode*)pExpr)->tableAlias); + strcpy(pCol->colName, ((SColumnNode*)pExpr)->colName); + } else { + strcpy(pCol->colName, pExpr->aliasName); + } + } else { + strcpy(pCol->colName, pFunc->node.aliasName); + } + strcpy(pCol->node.aliasName, pFunc->node.aliasName); + + return (SNode*)pCol; +} + +static int32_t rewriteUniqueOptCreateProject(SIndefRowsFuncLogicNode* pIndef, SLogicNode** pOutput) { + SProjectLogicNode* pProject = (SProjectLogicNode*)nodesMakeNode(QUERY_NODE_LOGIC_PLAN_PROJECT); + if (NULL == pProject) { + return TSDB_CODE_OUT_OF_MEMORY; + } + + TSWAP(pProject->node.pTargets, pIndef->node.pTargets); + pProject->node.precision = pIndef->node.precision; + + int32_t code = TSDB_CODE_SUCCESS; + SNode* pNode = NULL; + FOREACH(pNode, pIndef->pFuncs) { + code = nodesListMakeStrictAppend(&pProject->pProjections, rewriteUniqueOptCreateProjectCol((SFunctionNode*)pNode)); + if (TSDB_CODE_SUCCESS != code) { + break; + } + } + + if (TSDB_CODE_SUCCESS == code) { + *pOutput = (SLogicNode*)pProject; + } else { + nodesDestroyNode((SNode*)pProject); + } + return code; +} + +static int32_t rewriteUniqueOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan, + SIndefRowsFuncLogicNode* pIndef) { + SLogicNode* pAgg = NULL; + SLogicNode* pProject = NULL; + int32_t code = rewriteUniqueOptCreateAgg(pIndef, &pAgg); + if (TSDB_CODE_SUCCESS == code) { + code = rewriteUniqueOptCreateProject(pIndef, &pProject); + } + if (TSDB_CODE_SUCCESS == code) { + code = nodesListMakeAppend(&pProject->pChildren, (SNode*)pAgg); + pAgg->pParent = pProject; + pAgg = NULL; + } + if (TSDB_CODE_SUCCESS == code) { + code = replaceLogicNode(pLogicSubplan, (SLogicNode*)pIndef, pProject); + } + if (TSDB_CODE_SUCCESS == code) { + nodesDestroyNode((SNode*)pIndef); + } else { + nodesDestroyNode((SNode*)pAgg); + nodesDestroyNode((SNode*)pProject); + } + pCxt->optimized = true; + return code; +} + +static int32_t rewriteUniqueOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan) { + SIndefRowsFuncLogicNode* pIndef = + (SIndefRowsFuncLogicNode*)optFindPossibleNode(pLogicSubplan->pNode, rewriteUniqueOptMayBeOptimized); + + if (NULL == pIndef) { + return TSDB_CODE_SUCCESS; + } + + return rewriteUniqueOptimizeImpl(pCxt, pLogicSubplan, pIndef); +} + // merge projects static bool mergeProjectsMayBeOptimized(SLogicNode* pNode) { if (QUERY_NODE_LOGIC_PLAN_PROJECT != nodeType(pNode) || 1 != LIST_LENGTH(pNode->pChildren)) { return false; } - SLogicNode *pChild = (SLogicNode*)nodesListGetNode(pNode->pChildren, 0); + SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pNode->pChildren, 0); if (QUERY_NODE_LOGIC_PLAN_PROJECT != nodeType(pChild) || 1 < LIST_LENGTH(pChild->pChildren) || - NULL != pChild->pConditions || NULL != pNode->pLimit || NULL != pNode->pSlimit) { + NULL != pChild->pConditions || NULL != pChild->pLimit || NULL != pChild->pSlimit) { return false; } return true; @@ -1376,12 +1631,12 @@ static bool mergeProjectsMayBeOptimized(SLogicNode* pNode) { typedef struct SMergeProjectionsContext { SProjectLogicNode* pChildProj; - int32_t errCode; + int32_t errCode; } SMergeProjectionsContext; static EDealRes mergeProjectionsExpr(SNode** pNode, void* pContext) { SMergeProjectionsContext* pCxt = pContext; - SProjectLogicNode* pChildProj = pCxt->pChildProj; + SProjectLogicNode* pChildProj = pCxt->pChildProj; if (QUERY_NODE_COLUMN == nodeType(*pNode)) { SNode* pTarget; FOREACH(pTarget, ((SLogicNode*)pChildProj)->pTargets) { @@ -1406,7 +1661,7 @@ static EDealRes mergeProjectionsExpr(SNode** pNode, void* pContext) { } static int32_t mergeProjectsOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan, SLogicNode* pSelfNode) { - SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pSelfNode->pChildren, 0); + SLogicNode* pChild = (SLogicNode*)nodesListGetNode(pSelfNode->pChildren, 0); SMergeProjectionsContext cxt = {.pChildProj = (SProjectLogicNode*)pChild, .errCode = TSDB_CODE_SUCCESS}; nodesRewriteExprs(((SProjectLogicNode*)pSelfNode)->pProjections, mergeProjectionsExpr, &cxt); @@ -1425,6 +1680,7 @@ static int32_t mergeProjectsOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan* NODES_CLEAR_LIST(pChild->pChildren); } nodesDestroyNode((SNode*)pChild); + pCxt->optimized = true; return code; } @@ -1447,23 +1703,37 @@ static const SOptimizeRule optimizeRuleSet[] = { {.pName = "MergeProjects", .optimizeFunc = mergeProjectsOptimize}, {.pName = "EliminateProject", .optimizeFunc = eliminateProjOptimize}, {.pName = "EliminateSetOperator", .optimizeFunc = eliminateSetOpOptimize}, - {.pName = "RewriteTail", .optimizeFunc = rewriteTailOptimize} + {.pName = "RewriteTail", .optimizeFunc = rewriteTailOptimize}, + {.pName = "RewriteUnique", .optimizeFunc = rewriteUniqueOptimize} }; // clang-format on static const int32_t optimizeRuleNum = (sizeof(optimizeRuleSet) / sizeof(SOptimizeRule)); +static void dumpLogicSubplan(const char* pRuleName, SLogicSubplan* pSubplan) { + char* pStr = NULL; + nodesNodeToString((SNode*)pSubplan, false, &pStr, NULL); + qDebugL("apply optimize %s rule: %s", pRuleName, pStr); + taosMemoryFree(pStr); +} + static int32_t applyOptimizeRule(SPlanContext* pCxt, SLogicSubplan* pLogicSubplan) { SOptimizeContext cxt = {.pPlanCxt = pCxt, .optimized = false}; + bool optimized = false; do { - cxt.optimized = false; + optimized = false; for (int32_t i = 0; i < optimizeRuleNum; ++i) { + cxt.optimized = false; int32_t code = optimizeRuleSet[i].optimizeFunc(&cxt, pLogicSubplan); if (TSDB_CODE_SUCCESS != code) { return code; } + if (cxt.optimized) { + optimized = true; + dumpLogicSubplan(optimizeRuleSet[i].pName, pLogicSubplan); + } } - } while (cxt.optimized); + } while (optimized); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/planner/src/planSpliter.c b/source/libs/planner/src/planSpliter.c index 49ab50f913..9d23df5bda 100644 --- a/source/libs/planner/src/planSpliter.c +++ b/source/libs/planner/src/planSpliter.c @@ -1237,7 +1237,7 @@ static const int32_t splitRuleNum = (sizeof(splitRuleSet) / sizeof(SSplitRule)); static void dumpLogicSubplan(const char* pRuleName, SLogicSubplan* pSubplan) { char* pStr = NULL; nodesNodeToString((SNode*)pSubplan, false, &pStr, NULL); - qDebugL("apply %s rule: %s", pRuleName, pStr); + qDebugL("apply split %s rule: %s", pRuleName, pStr); taosMemoryFree(pStr); } diff --git a/source/libs/planner/src/planner.c b/source/libs/planner/src/planner.c index e75c8375fb..1b9d16311c 100644 --- a/source/libs/planner/src/planner.c +++ b/source/libs/planner/src/planner.c @@ -85,6 +85,11 @@ int32_t qSetSubplanExecutionNode(SSubplan* subplan, int32_t groupId, SDownstream return setSubplanExecutionNode(subplan->pNode, groupId, pSource); } +int32_t qClearSubplanExecutionNode(SSubplan* pSubplan, int32_t groupId) { + // todo + return TSDB_CODE_FAILED; +} + int32_t qSubPlanToString(const SSubplan* pSubplan, char** pStr, int32_t* pLen) { if (SUBPLAN_TYPE_MODIFY == pSubplan->subplanType && NULL == pSubplan->pNode) { SDataInserterNode* insert = (SDataInserterNode*)pSubplan->pDataSink; diff --git a/source/libs/planner/test/planBasicTest.cpp b/source/libs/planner/test/planBasicTest.cpp index 8c19b52a09..ff725c444e 100644 --- a/source/libs/planner/test/planBasicTest.cpp +++ b/source/libs/planner/test/planBasicTest.cpp @@ -56,6 +56,8 @@ TEST_F(PlanBasicTest, uniqueFunc) { run("SELECT UNIQUE(c2 + 10) FROM t1 WHERE c1 > 10"); + run("SELECT UNIQUE(c2 + 10), c2 FROM t1 WHERE c1 > 10"); + run("SELECT UNIQUE(c2 + 10), ts, c2 FROM t1 WHERE c1 > 10"); run("SELECT UNIQUE(c1) a FROM t1 ORDER BY a"); @@ -75,6 +77,8 @@ TEST_F(PlanBasicTest, tailFunc) { run("SELECT TAIL(c2 + 10, 10, 80) FROM t1 WHERE c1 > 10 LIMIT 5"); run("SELECT TAIL(c2 + 10, 10, 80) FROM t1 WHERE c1 > 10 PARTITION BY c1 LIMIT 5"); + + run("SELECT TAIL(c1, 2, 1) FROM st1s1 UNION ALL SELECT c1 FROM st1s2"); } TEST_F(PlanBasicTest, interpFunc) { @@ -97,6 +101,16 @@ TEST_F(PlanBasicTest, lastRowFunc) { run("SELECT LAST_ROW(c1) FROM st1"); } +TEST_F(PlanBasicTest, sampleFunc) { + useDb("root", "test"); + + run("SELECT SAMPLE(c1, 10) FROM t1"); + + run("SELECT SAMPLE(c1, 10) FROM st1"); + + run("SELECT SAMPLE(c1, 10) FROM st1 PARTITION BY TBNAME"); +} + TEST_F(PlanBasicTest, withoutFrom) { useDb("root", "test"); diff --git a/source/libs/planner/test/planOptimizeTest.cpp b/source/libs/planner/test/planOptimizeTest.cpp index 9bd95a79f9..6a9a711dac 100644 --- a/source/libs/planner/test/planOptimizeTest.cpp +++ b/source/libs/planner/test/planOptimizeTest.cpp @@ -20,7 +20,7 @@ using namespace std; class PlanOptimizeTest : public PlannerTestBase {}; -TEST_F(PlanOptimizeTest, optimizeScanData) { +TEST_F(PlanOptimizeTest, scanPath) { useDb("root", "test"); run("SELECT COUNT(*) FROM t1"); @@ -32,7 +32,7 @@ TEST_F(PlanOptimizeTest, optimizeScanData) { run("SELECT PERCENTILE(c1, 40), COUNT(*) FROM t1"); } -TEST_F(PlanOptimizeTest, ConditionPushDown) { +TEST_F(PlanOptimizeTest, pushDownCondition) { useDb("root", "test"); run("SELECT ts, c1 FROM st1 WHERE tag1 > 4"); @@ -42,9 +42,11 @@ TEST_F(PlanOptimizeTest, ConditionPushDown) { run("SELECT ts, c1 FROM st1 WHERE tag1 > 4 AND tag2 = 'hello'"); run("SELECT ts, c1 FROM st1 WHERE tag1 > 4 AND tag2 = 'hello' AND c1 > 10"); + + run("SELECT ts, c1 FROM (SELECT * FROM st1) WHERE tag1 > 4"); } -TEST_F(PlanOptimizeTest, orderByPrimaryKey) { +TEST_F(PlanOptimizeTest, sortPrimaryKey) { useDb("root", "test"); run("SELECT c1 FROM t1 ORDER BY ts"); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 89f0fcee02..f6768bf494 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1488,18 +1488,6 @@ char* syncNode2SimpleStr(const SSyncNode* pSyncNode) { pSyncNode->commitIndex, logBeginIndex, logLastIndex, snapshot.lastApplyIndex, pSyncNode->pRaftCfg->isStandBy, pSyncNode->replicaNum, pSyncNode->pRaftCfg->lastConfigIndex, pSyncNode->changing, pSyncNode->restoreFinish); - /* - snprintf(s, len, - "syncNode: vgId:%d, term:%lu, commit:%ld, state:%d %s, standby:%d, " - "lc:%lu, " - "lc-user:%lu, " - "ems:%d, replica-num:%d, restore:%d, changing:%d", - pSyncNode->vgId, pSyncNode->pRaftStore->currentTerm, pSyncNode->commitIndex, pSyncNode->state, - syncUtilState2String(pSyncNode->state), pSyncNode->pRaftCfg->isStandBy, pSyncNode->electTimerLogicClock, - pSyncNode->electTimerLogicClockUser, pSyncNode->electTimerMS, pSyncNode->replicaNum, - pSyncNode->restoreFinish, pSyncNode->changing); - */ - return s; } diff --git a/source/libs/sync/src/syncSnapshot.c b/source/libs/sync/src/syncSnapshot.c index 13343111f3..0e77876b97 100644 --- a/source/libs/sync/src/syncSnapshot.c +++ b/source/libs/sync/src/syncSnapshot.c @@ -683,7 +683,16 @@ int32_t syncNodeOnSnapshotSendCb(SSyncNode *pSyncNode, SyncSnapshotSend *pMsg) { needRsp = true; } else { - ASSERT(0); + // error log + do { + char logBuf[96]; + snprintf(logBuf, sizeof(logBuf), "snapshot receiver recv error seq:%d, my ack:%d", pMsg->seq, pReceiver->ack); + char *eventLog = snapshotReceiver2SimpleStr(pReceiver, logBuf); + syncNodeErrorLog(pSyncNode, eventLog); + taosMemoryFree(eventLog); + } while (0); + + return -1; } // send ack @@ -764,8 +773,8 @@ int32_t syncNodeOnSnapshotRspCb(SSyncNode *pSyncNode, SyncSnapshotRsp *pMsg) { } else { do { - char logBuf[64]; - snprintf(logBuf, sizeof(logBuf), "error ack, recv ack:%d, my seq:%d", pMsg->ack, pSender->seq); + char logBuf[96]; + snprintf(logBuf, sizeof(logBuf), "snapshot sender recv error ack:%d, my seq:%d", pMsg->ack, pSender->seq); char *eventLog = snapshotSender2SimpleStr(pSender, logBuf); syncNodeErrorLog(pSyncNode, eventLog); taosMemoryFree(eventLog); diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index fea3f10426..b7cedf04a6 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -23,6 +23,10 @@ # ---- dnode ./test.sh -f tsim/dnode/balance_replica1.sim ./test.sh -f tsim/dnode/balance_replica3.sim +./test.sh -f tsim/dnode/balance1.sim +./test.sh -f tsim/dnode/balance2.sim +./test.sh -f tsim/dnode/balance3.sim +./test.sh -f tsim/dnode/balancex.sim ./test.sh -f tsim/dnode/create_dnode.sim ./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim ./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim @@ -30,11 +34,13 @@ ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim +./test.sh -f tsim/dnode/offline_reason.sim ./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v2.sim ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v3.sim +./test.sh -f tsim/dnode/vnode_clean.sim # ---- insert ./test.sh -f tsim/insert/basic0.sim diff --git a/tests/script/sh/move_dnode.sh b/tests/script/sh/move_dnode.sh deleted file mode 100755 index d3650c18ad..0000000000 --- a/tests/script/sh/move_dnode.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -echo "Executing move_dnode.sh" - -UNAME_BIN=`which uname` -OS_TYPE=`$UNAME_BIN` - -SCRIPT_DIR=`dirname $0` -cd $SCRIPT_DIR/../ -SCRIPT_DIR=`pwd` -echo "SCRIPT_DIR: $SCRIPT_DIR" - -IN_TDINTERNAL="community" -if [[ "$SCRIPT_DIR" == *"$IN_TDINTERNAL"* ]]; then - cd ../../.. -else - cd ../../ -fi - -TAOS_DIR=`pwd` -TAOSD_DIR=`find . -name "taosd"|grep bin|head -n1` - -if [[ "$OS_TYPE" != "Darwin" ]]; then - cut_opt="--field=" -else - cut_opt="-f " -fi - -if [[ "$TAOSD_DIR" == *"$IN_TDINTERNAL"* ]]; then - BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2,3` -else - BIN_DIR=`find . -name "taosd"|grep bin|head -n1|cut -d '/' ${cut_opt}2` -fi - -BUILD_DIR=$TAOS_DIR/$BIN_DIR/build - -SIM_DIR=$TAOS_DIR/sim - -NODE_DIR=$SIM_DIR/$NODE_NAME - -if [ -d "$SIM_DIR/$2" ];then - rm -rf $SIM_DIR/$2 -fi -mv $SIM_DIR/$1 $SIM_DIR/$2 - -if [[ $2 =~ "dnode2" ]];then - sed -i 's/serverPort 7100/serverPort 7200/g' $SIM_DIR/$2/cfg/taos.cfg - sed -i 's/dnode1/dnode2/g' $SIM_DIR/$2/cfg/taos.cfg - sed -i 's/7100/7200/g' $SIM_DIR/$2/data/dnode/dnodeEps.json -elif [[ $2 =~ "dnode4" ]];then - sed -i 's/serverPort 7100/serverPort 7400/g' $SIM_DIR/$2/cfg/taos.cfg - sed -i 's/dnode1/dnode4/g' $SIM_DIR/$2/cfg/taos.cfg - sed -i 's/7100/7400/g' $SIM_DIR/dnode2/data/dnode/dnodeEps.json - sed -i 's/7100/7400/g' $SIM_DIR/dnode3/data/dnode/dnodeEps.json - sed -i 's/7100/7400/g' $SIM_DIR/$2/data/dnode/dnodeEps.json -fi diff --git a/tests/script/unique/dnode/balance1.sim b/tests/script/tsim/dnode/balance1.sim similarity index 55% rename from tests/script/unique/dnode/balance1.sim rename to tests/script/tsim/dnode/balance1.sim index 8743204a03..6471529a1e 100644 --- a/tests/script/unique/dnode/balance1.sim +++ b/tests/script/tsim/dnode/balance1.sim @@ -1,40 +1,18 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 2 -system sh/cfg.sh -n dnode2 -c wallevel -v 2 -system sh/cfg.sh -n dnode3 -c wallevel -v 2 -system sh/cfg.sh -n dnode4 -c wallevel -v 2 - -system sh/cfg.sh -n dnode1 -c wallevel -v 2 -system sh/cfg.sh -n dnode2 -c wallevel -v 2 -system sh/cfg.sh -n dnode3 -c wallevel -v 2 -system sh/cfg.sh -n dnode4 -c wallevel -v 2 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 print ========== step1 system sh/exec.sh -n dnode1 -s start sql connect -sql create database d1 +sql create database d1 vgroups 1 sql create table d1.t1 (t timestamp, i int) sql insert into d1.t1 values(now+1s, 15) sql insert into d1.t1 values(now+2s, 14) @@ -43,35 +21,49 @@ sql insert into d1.t1 values(now+4s, 12) sql insert into d1.t1 values(now+5s, 11) sql show dnodes -print dnode1 openVnodes $data2_1 -if $data2_1 != 1 then +print dnode1 openVnodes $data(1)[2] +if $data(1)[2] != 1 then return -1 endi print ========== step2 -sql create dnode $hostname2 +sql create dnode $hostname port 7200 system sh/exec.sh -n dnode2 -s start $x = 0 -show2: +step2: $x = $x + 1 sleep 1000 - if $x == 20 then + if $x == 10 then + print ====> dnode not ready! return -1 endi - sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 0 then - goto show2 +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 endi -if $data2_2 != 1 then - goto show2 +if $data(1)[4] != ready then + goto step2 +endi +if $data(2)[4] != ready then + goto step2 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +if $data(1)[2] != 0 then + return -1 +endi +if $data(2)[2] != 1 then + return -1 endi print ========== step3 -sql create database d2 +sql create database d2 vgroups 1 sql create table d2.t2 (t timestamp, i int) sql insert into d2.t2 values(now+1s, 25) sql insert into d2.t2 values(now+2s, 24) @@ -80,69 +72,67 @@ sql insert into d2.t2 values(now+4s, 22) sql insert into d2.t2 values(now+5s, 21) sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 0 then +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +if $data(1)[2] != 0 then return -1 endi -if $data2_2 != 2 then +if $data(2)[2] != 2 then return -1 endi print ========== step4 -sql drop dnode $hostname2 - -$x = 0 -show4: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - +sql drop dnode 2 sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 2 then - goto show4 +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +if $data(1)[2] != 2 then + return -1 endi -if $data2_2 != null then - goto show4 -endi -if $rows != 1 then - goto show4 +if $data(2)[2] != null then + return -1 endi system sh/exec.sh -n dnode2 -s stop -x SIGINT print ========== step5 -sql create dnode $hostname3 +sql create dnode $hostname port 7300 system sh/exec.sh -n dnode3 -s start $x = 0 -show5: +step5: $x = $x + 1 sleep 1000 - if $x == 30 then + if $x == 10 then + print ====> dnode not ready! return -1 endi - sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -if $data2_1 != 0 then - goto show5 +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 endi -if $data2_2 != null then - goto show5 +if $data(1)[4] != ready then + goto step5 endi -if $data2_3 != 2 then - goto show5 +if $data(3)[4] != ready then + goto step5 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +if $data(1)[2] != 1 then + return -1 +endi +if $data(3)[2] != 1 then + return -1 endi print ========== step6 -sql create database d3 +sql create database d3 vgroups 1 sql create table d3.t3 (t timestamp, i int) sql insert into d3.t3 values(now+1s, 35) sql insert into d3.t3 values(now+2s, 34) @@ -151,52 +141,46 @@ sql insert into d3.t3 values(now+4s, 32) sql insert into d3.t3 values(now+5s, 31) sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 - -if $data2_1 != 0 then +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +if $data(1)[2] != 1 then return -1 endi -if $data2_2 != null then - return -1 -endi -if $data2_3 != 3 then +if $data(3)[2] != 2 then return -1 endi print ========== step7 -sql create dnode $hostname4 +sql create dnode $hostname port 7400 system sh/exec.sh -n dnode4 -s start $x = 0 -show7: +step7: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi - sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show7 +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +if $rows != 3 then + return -1 endi -if $data2_2 != null then - goto show7 +if $data(1)[4] != ready then + goto step7 endi -if $data2_3 != 2 then - goto show7 +if $data(3)[4] != ready then + goto step7 endi -if $data2_4 != 1 then - goto show7 +if $data(4)[4] != ready then + goto step7 endi print ========== step8 -sql create database d4 +sql create database d4 vgroups 1 sql create table d4.t4 (t timestamp, i int) sql insert into d4.t4 values(now+1s, 45) sql insert into d4.t4 values(now+2s, 44) @@ -205,56 +189,32 @@ sql insert into d4.t4 values(now+4s, 42) sql insert into d4.t4 values(now+5s, 41) sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 - -if $data2_1 != 0 then +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +print dnode2 openVnodes $data(4)[2] +if $data(1)[2] != 1 then return -1 endi -if $data2_2 != null then +if $data(3)[2] != 2 then return -1 endi -if $data2_3 != 2 then - return -1 -endi -if $data2_4 != 2 then +if $data(4)[2] != 1 then return -1 endi print ========== step9 -sql drop dnode $hostname3 - -$x = 0 -show9: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - +sql drop dnode 3 sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 - -if $data2_1 != 0 then - goto show9 +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(4)[2] +if $data(1)[2] != 2 then + return -1 endi -if $data2_2 != null then - goto show9 -endi -if $data2_3 != null then - goto show9 -endi -if $data2_4 != 4 then - goto show9 +if $data(4)[2] != 2 then + return -1 endi system sh/exec.sh -n dnode3 -s stop -x SIGINT - sql reset query cache sleep 100 diff --git a/tests/script/tsim/dnode/balance2.sim b/tests/script/tsim/dnode/balance2.sim new file mode 100644 index 0000000000..5da9a659f3 --- /dev/null +++ b/tests/script/tsim/dnode/balance2.sim @@ -0,0 +1,280 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/deploy.sh -n dnode2 -i 2 +system sh/deploy.sh -n dnode3 -i 3 +system sh/deploy.sh -n dnode4 -i 4 +system sh/deploy.sh -n dnode5 -i 5 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode5 -c supportVnodes -v 4 + +print ========== step1 +system sh/exec.sh -n dnode1 -s start +sql connect + +sql create dnode $hostname port 7200 +sql create dnode $hostname port 7300 +system sh/exec.sh -n dnode2 -s start +system sh/exec.sh -n dnode3 -s start + +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +if $rows != 3 then + return -1 +endi +if $data(1)[4] != ready then + goto step1 +endi +if $data(2)[4] != ready then + goto step1 +endi +if $data(3)[4] != ready then + goto step1 +endi + +print ========== step2 +sql create database d1 replica 3 vgroups 1 +sql create table d1.t1 (t timestamp, i int) +sql insert into d1.t1 values(now+1s, 15) +sql insert into d1.t1 values(now+2s, 14) +sql insert into d1.t1 values(now+3s, 13) +sql insert into d1.t1 values(now+4s, 12) +sql insert into d1.t1 values(now+5s, 11) + +sql create database d2 replica 3 vgroups 1 +sql create table d2.t2 (t timestamp, i int) +sql insert into d2.t2 values(now+1s, 25) +sql insert into d2.t2 values(now+2s, 24) +sql insert into d2.t2 values(now+3s, 23) +sql insert into d2.t2 values(now+4s, 22) +sql insert into d2.t2 values(now+5s, 21) + +sql create database d3 replica 3 vgroups 1 +sql create table d3.t3 (t timestamp, i int) +sql insert into d3.t3 values(now+1s, 35) +sql insert into d3.t3 values(now+2s, 34) +sql insert into d3.t3 values(now+3s, 33) +sql insert into d3.t3 values(now+4s, 32) +sql insert into d3.t3 values(now+5s, 31) + +sql create database d4 replica 3 vgroups 1 +sql create table d4.t4 (t timestamp, i int) +sql insert into d4.t4 values(now+1s, 45) +sql insert into d4.t4 values(now+2s, 44) +sql insert into d4.t4 values(now+3s, 43) +sql insert into d4.t4 values(now+4s, 42) +sql insert into d4.t4 values(now+5s, 41) + +print ========== step2.1 +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +print dnode3 openVnodes $data(3)[2] +if $data(1)[2] != 4 then + return -1 +endi +if $data(2)[2] != 4 then + return -1 +endi +if $data(3)[2] != 4 then + return -1 +endi + +print ========== step3 +sql create dnode $hostname port 7400 +sql create dnode $hostname port 7500 +system sh/exec.sh -n dnode4 -s start +system sh/exec.sh -n dnode5 -s start + +$x = 0 +step3: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +print ===> $data30 $data31 $data32 $data33 $data34 $data35 +print ===> $data40 $data41 $data42 $data43 $data44 $data45 +if $rows != 5 then + return -1 +endi +if $data(1)[4] != ready then + goto step3 +endi +if $data(2)[4] != ready then + goto step3 +endi +if $data(3)[4] != ready then + goto step3 +endi +if $data(4)[4] != ready then + goto step3 +endi +if $data(5)[4] != ready then + goto step3 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode3 openVnodes $data(2)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +print dnode5 openVnodes $data(5)[2] +if $data(1)[2] != 2 then + return -1 +endi +if $data(2)[2] != 3 then + return -1 +endi +if $data(3)[2] != 3 then + return -1 +endi +if $data(4)[2] != 2 then + return -1 +endi +if $data(5)[2] != 2 then + return -1 +endi + +print ========== step4 +sql drop dnode 2 +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +print dnode5 openVnodes $data(5)[2] +if $data(1)[2] != 2 then + return -1 +endi +if $data(3)[2] != 3 then + return -1 +endi +if $data(4)[2] != 4 then + return -1 +endi +if $data(5)[2] != 3 then + return -1 +endi + +system sh/exec.sh -n dnode2 -s stop -x SIGINT + +print ========== step5 +sql drop dnode 3 +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +print dnode5 openVnodes $data(5)[2] +if $data(1)[2] != 4 then + return -1 +endi +if $data(3)[2] != null then + return -1 +endi +if $data(4)[2] != 4 then + return -1 +endi +if $data(5)[2] != 4 then + return -1 +endi + +sql reset query cache +sleep 100 +system sh/exec.sh -n dnode3 -s stop -x SIGINT + +print ========== step6 +sql select * from d1.t1 order by t desc +print $data01 $data11 $data21 $data31 $data41 +if $data01 != 11 then + return -1 +endi +if $data11 != 12 then + return -1 +endi +if $data21 != 13 then + return -1 +endi +if $data31 != 14 then + return -1 +endi +if $data41 != 15 then + return -1 +endi + +sql select * from d2.t2 order by t desc +print $data01 $data11 $data21 $data31 $data41 +if $data01 != 21 then + return -1 +endi +if $data11 != 22 then + return -1 +endi +if $data21 != 23 then + return -1 +endi +if $data31 != 24 then + return -1 +endi +if $data41 != 25 then + return -1 +endi + +sql select * from d3.t3 order by t desc +print $data01 $data11 $data21 $data31 $data41 +if $data01 != 31 then + return -1 +endi +if $data11 != 32 then + return -1 +endi +if $data21 != 33 then + return -1 +endi +if $data31 != 34 then + return -1 +endi +if $data41 != 35 then + return -1 +endi + +sql select * from d4.t4 order by t desc +print $data01 $data11 $data21 $data31 $data41 +if $data01 != 41 then + return -1 +endi +if $data11 != 42 then + return -1 +endi +if $data21 != 43 then + return -1 +endi +if $data31 != 44 then + return -1 +endi +if $data41 != 45 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 +system sh/exec.sh -n dnode4 -s stop -x SIGINT +system sh/exec.sh -n dnode5 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/tsim/dnode/balance3.sim b/tests/script/tsim/dnode/balance3.sim new file mode 100644 index 0000000000..0e21861b14 --- /dev/null +++ b/tests/script/tsim/dnode/balance3.sim @@ -0,0 +1,340 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/deploy.sh -n dnode2 -i 2 +system sh/deploy.sh -n dnode3 -i 3 +system sh/deploy.sh -n dnode4 -i 4 +system sh/deploy.sh -n dnode5 -i 5 +system sh/deploy.sh -n dnode6 -i 6 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode5 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode6 -c supportVnodes -v 4 + +print ========== step1 +system sh/exec.sh -n dnode1 -s start +sql connect + +sql create dnode $hostname port 7200 +sql create dnode $hostname port 7300 +sql create dnode $hostname port 7400 +system sh/exec.sh -n dnode2 -s start +system sh/exec.sh -n dnode3 -s start +system sh/exec.sh -n dnode4 -s start + +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +print ===> $data30 $data31 $data32 $data33 $data34 $data35 +if $rows != 4 then + return -1 +endi +if $data(1)[4] != ready then + goto step1 +endi +if $data(2)[4] != ready then + goto step1 +endi +if $data(3)[4] != ready then + goto step1 +endi +if $data(4)[4] != ready then + goto step1 +endi + +sql create database d1 replica 3 vgroups 1 +sql create table d1.t1 (t timestamp, i int) +sql insert into d1.t1 values(now+1s, 15) +sql insert into d1.t1 values(now+2s, 14) +sql insert into d1.t1 values(now+3s, 13) +sql insert into d1.t1 values(now+4s, 12) +sql insert into d1.t1 values(now+5s, 11) + +sql create database d2 replica 3 vgroups 1 +sql create table d2.t2 (t timestamp, i int) +sql insert into d2.t2 values(now+1s, 25) +sql insert into d2.t2 values(now+2s, 24) +sql insert into d2.t2 values(now+3s, 23) +sql insert into d2.t2 values(now+4s, 22) +sql insert into d2.t2 values(now+5s, 21) + +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +if $data(1)[2] != 0 then + return -1 +endi +if $data(2)[2] != 2 then + return -1 +endi +if $data(3)[2] != 2 then + return -1 +endi +if $data(4)[2] != 2 then + return -1 +endi + +print ========== step2 +sql drop dnode 2 +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +if $data(1)[2] != 2 then + return -1 +endi +if $data(2)[2] != null then + return -1 +endi +if $data(3)[2] != 2 then + return -1 +endi +if $data(4)[2] != 2 then + return -1 +endi + +system sh/exec.sh -n dnode2 -s stop -x SIGINT + +print ========== step3 +sql create dnode $hostname port 7500 +system sh/exec.sh -n dnode5 -s start + +$x = 0 +step3: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +print ===> $data30 $data31 $data32 $data33 $data34 $data35 +if $rows != 4 then + return -1 +endi +if $data(1)[4] != ready then + goto step3 +endi +if $data(3)[4] != ready then + goto step3 +endi +if $data(4)[4] != ready then + goto step3 +endi +if $data(5)[4] != ready then + goto step3 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +print dnode5 openVnodes $data(5)[2] +if $data(1)[2] != 1 then + return -1 +endi +if $data(3)[2] != 2 then + return -1 +endi +if $data(4)[2] != 2 then + return -1 +endi +if $data(5)[2] != 1 then + return -1 +endi + +print ========== step4 +sql create database d3 replica 3 vgroups 1 +sql create table d3.t3 (t timestamp, i int) +sql insert into d3.t3 values(now+1s, 35) +sql insert into d3.t3 values(now+2s, 34) +sql insert into d3.t3 values(now+3s, 33) +sql insert into d3.t3 values(now+4s, 32) +sql insert into d3.t3 values(now+5s, 31) + +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +print dnode5 openVnodes $data(5)[2] +if $data(1)[2] != 1 then + return -1 +endi +if $data(3)[2] != 3 then + return -1 +endi +if $data(4)[2] != 3 then + return -1 +endi +if $data(5)[2] != 2 then + return -1 +endi + +print ========== step5 +sql create dnode $hostname port 7600 +system sh/exec.sh -n dnode6 -s start + +$x = 0 +step5: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +print ===> $data30 $data31 $data32 $data33 $data34 $data35 +print ===> $data40 $data41 $data42 $data43 $data44 $data45 +if $rows != 5 then + return -1 +endi +if $data(1)[4] != ready then + goto step5 +endi +if $data(3)[4] != ready then + goto step5 +endi +if $data(4)[4] != ready then + goto step5 +endi +if $data(5)[4] != ready then + goto step5 +endi +if $data(6)[4] != ready then + goto step5 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +print dnode5 openVnodes $data(5)[2] +print dnode5 openVnodes $data(6)[2] +if $data(1)[2] != 1 then + return -1 +endi +if $data(3)[2] != 2 then + return -1 +endi +if $data(4)[2] != 2 then + return -1 +endi +if $data(5)[2] != 2 then + return -1 +endi +if $data(6)[2] != 2 then + return -1 +endi + +print ========== step6 +sql drop dnode 3 +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode3 openVnodes $data(3)[2] +print dnode4 openVnodes $data(4)[2] +print dnode5 openVnodes $data(5)[2] +print dnode5 openVnodes $data(6)[2] +if $data(1)[2] != 2 then + return -1 +endi +if $data(3)[2] != null then + return -1 +endi +if $data(4)[2] != 2 then + return -1 +endi +if $data(5)[2] != 3 then + return -1 +endi +if $data(6)[2] != 2 then + return -1 +endi + +system sh/exec.sh -n dnode3 -s stop -x SIGINT +sql reset query cache +sleep 100 + +print ========== step7 +sql select * from d1.t1 order by t desc +print $data01 $data11 $data21 $data31 $data41 +if $data01 != 11 then + return -1 +endi +if $data11 != 12 then + return -1 +endi +if $data21 != 13 then + return -1 +endi +if $data31 != 14 then + return -1 +endi +if $data41 != 15 then + return -1 +endi + +sql select * from d2.t2 order by t desc +print $data01 $data11 $data21 $data31 $data41 +if $data01 != 21 then + return -1 +endi +if $data11 != 22 then + return -1 +endi +if $data21 != 23 then + return -1 +endi +if $data31 != 24 then + return -1 +endi +if $data41 != 25 then + return -1 +endi + +sql select * from d3.t3 order by t desc +print $data01 $data11 $data21 $data31 $data41 +if $data01 != 31 then + return -1 +endi +if $data11 != 32 then + return -1 +endi +if $data21 != 33 then + return -1 +endi +if $data31 != 34 then + return -1 +endi +if $data41 != 35 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 +system sh/exec.sh -n dnode4 -s stop -x SIGINT +system sh/exec.sh -n dnode5 -s stop -x SIGINT +system sh/exec.sh -n dnode6 -s stop -x SIGINT +system sh/exec.sh -n dnode7 -s stop -x SIGINT +system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/remove1.sim b/tests/script/tsim/dnode/balancex.sim similarity index 51% rename from tests/script/unique/dnode/remove1.sim rename to tests/script/tsim/dnode/balancex.sim index 25e0846129..124ccbebba 100644 --- a/tests/script/unique/dnode/remove1.sim +++ b/tests/script/tsim/dnode/balancex.sim @@ -1,30 +1,18 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 -system sh/cfg.sh -n dnode4 -c wallevel -v 1 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 +system sh/cfg.sh -n dnode1 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode2 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode3 -c supportVnodes -v 4 +system sh/cfg.sh -n dnode4 -c supportVnodes -v 4 print ========== step1 system sh/exec.sh -n dnode1 -s start sql connect -sql create database d1 +sql create database d1 vgroups 1 sql create table d1.t1 (t timestamp, i int) sql insert into d1.t1 values(now+1s, 15) sql insert into d1.t1 values(now+2s, 14) @@ -32,7 +20,7 @@ sql insert into d1.t1 values(now+3s, 13) sql insert into d1.t1 values(now+4s, 12) sql insert into d1.t1 values(now+5s, 11) -sql create database d2 +sql create database d2 vgroups 1 sql create table d2.t2 (t timestamp, i int) sql insert into d2.t2 values(now+1s, 25) sql insert into d2.t2 values(now+2s, 24) @@ -41,36 +29,59 @@ sql insert into d2.t2 values(now+4s, 22) sql insert into d2.t2 values(now+5s, 21) sql show dnodes -print dnode1 openVnodes $data2_1 -if $data2_1 != 2 then +print dnode1 openVnodes $data(1)[2] +if $data(1)[2] != 2 then return -1 endi print ========== step2 -sql create dnode $hostname2 +sql create dnode $hostname port 7200 +sql create dnode $hostname port 7300 system sh/exec.sh -n dnode2 -s start +system sh/exec.sh -n dnode3 -s start + $x = 0 -step2: +step2: $x = $x + 1 sleep 1000 if $x == 10 then + print ====> dnode not ready! return -1 endi - sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +if $rows != 3 then + return -1 +endi +if $data(1)[4] != ready then goto step2 endi -if $data4_2 != ready then +if $data(2)[4] != ready then + goto step2 +endi +if $data(3)[4] != ready then goto step2 endi -sql create database d3 replica 2 +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +print dnode2 openVnodes $data(3)[2] +if $data(1)[2] != 0 then + return -1 +endi +if $data(2)[2] != 1 then + return -1 +endi +if $data(3)[2] != 1 then + return -1 +endi + +print ========== step3 +sql create database d3 replica 3 vgroups 1 sql create table d3.t3 (t timestamp, i int) sql insert into d3.t3 values(now+1s, 35) sql insert into d3.t3 values(now+2s, 34) @@ -78,89 +89,95 @@ sql insert into d3.t3 values(now+3s, 33) sql insert into d3.t3 values(now+4s, 32) sql insert into d3.t3 values(now+5s, 31) -$x = 0 -show2: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 1 then - goto show2 +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +print dnode2 openVnodes $data(3)[2] +if $data(1)[2] != 1 then + return -1 endi -if $data2_2 != 3 then - goto show2 +if $data(2)[2] != 2 then + return -1 +endi +if $data(3)[2] != 2 then + return -1 endi print ========== step3 - -$x = 0 -show3: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 - -print ========== step4 -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -sql drop dnode $hostname2 - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -if $data2_2 != null then - goto show4 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -print ========== step5 -sql create dnode $hostname4 +sql create dnode $hostname port 7400 system sh/exec.sh -n dnode4 -s start $x = 0 -show5: +step3: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show5 +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +print ===> $data30 $data31 $data32 $data33 $data34 $data35 +if $rows != 4 then + return -1 endi -if $data2_2 != null then - goto show5 +if $data(1)[4] != ready then + goto step3 endi -if $data2_3 != 2 then - goto show5 +if $data(2)[4] != ready then + goto step3 endi -if $data2_4 != 2 then - goto show5 +if $data(3)[4] != ready then + goto step3 endi +if $data(4)[4] != ready then + goto step3 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +print dnode2 openVnodes $data(3)[2] +print dnode2 openVnodes $data(4)[2] +if $data(1)[2] != 0 then + return -1 +endi +if $data(2)[2] != 2 then + return -1 +endi +if $data(3)[2] != 2 then + return -1 +endi +if $data(4)[2] != 1 then + return -1 +endi + +print ========== step5 +sql drop dnode 2 +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +print dnode2 openVnodes $data(3)[2] +print dnode2 openVnodes $data(4)[2] +if $data(1)[2] != 1 then + return -1 +endi +if $data(2)[2] != null then + return -1 +endi +if $data(3)[2] != 2 then + return -1 +endi +if $data(4)[2] != 2 then + return -1 +endi + +system sh/exec.sh -n dnode2 -s stop -x SIGINT +sql reset query cache +sleep 100 print ========== step6 sql select * from d1.t1 order by t desc @@ -224,4 +241,4 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT system sh/exec.sh -n dnode5 -s stop -x SIGINT system sh/exec.sh -n dnode6 -s stop -x SIGINT system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT +system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/tsim/dnode/offline_reason.sim b/tests/script/tsim/dnode/offline_reason.sim new file mode 100644 index 0000000000..3c6fff8b59 --- /dev/null +++ b/tests/script/tsim/dnode/offline_reason.sim @@ -0,0 +1,161 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/deploy.sh -n dnode2 -i 2 + +print ========== step1 +system sh/exec.sh -n dnode1 -s start +sql connect +sql create dnode $hostname port 7200 + +sql show dnodes +print dnode1 off: $data(1)[6] +print dnode2 off: $data(2)[6] + +if $data(2)[6] != @status not received@ then + return -1 +endi + +print ========== step2 +system sh/exec.sh -n dnode2 -s start + +$x = 0 +step2: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ====> dnode not ready! + return -1 + endi +sql show dnodes +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 +endi +if $data(1)[4] != ready then + goto step2 +endi +if $data(2)[4] != ready then + goto step2 +endi + +print ========== step3 +system sh/exec.sh -n dnode2 -s stop + +$x = 0 +step3: + $x = $x + 1 + sleep 1000 + if $x == 10 then + return -1 + endi +sql show dnodes +print dnode1 off: $data(1)[6] +print dnode2 off: $data(2)[6] +if $data(2)[6] != @status msg timeout@ then + goto step3 +endi + +print ========== step4 +sql drop dnode 2 +sql show dnodes +if $rows != 1 then + return -1 +endi + +print ========== step5 +system sh/exec.sh -n dnode2 -s start +sql create dnode $hostname port 7200 + +$x = 0 +step5: + $x = $x + 1 + sleep 1000 + if $x == 10 then + return -1 + endi + +sql show dnodes +print dnode1 off: $data(1)[6] +print dnode2 off: $data(3)[6] +if $data(3)[6] != @dnodeId not match@ then + goto step5 +endi + +print ========== step6 +system sh/deploy.sh -n dnode4 -i 4 +system sh/cfg.sh -n dnode4 -c statusInterval -v 4 +system sh/exec.sh -n dnode4 -s start +sql create dnode $hostname port 7400 + +$x = 0 +step6: + $x = $x + 1 + sleep 1000 + if $x == 10 then + return -1 + endi + +sql show dnodes +print dnode1 off: $data(1)[6] +print dnode2 off: $data(3)[6] +print dnode3 off: $data(4)[6] +if $data(4)[6] != @interval not match@ then + goto step6 +endi + +print ========== step7 +system sh/deploy.sh -n dnode5 -i 5 +system sh/cfg.sh -n dnode5 -c locale -v zn_CH.UTF-8 +system sh/exec.sh -n dnode5 -s start +sql create dnode $hostname port 7500 + +$x = 0 +step7: + $x = $x + 1 + sleep 1000 + if $x == 10 then + return -1 + endi + +sql show dnodes +print dnode1 off: $data(1)[6] +print dnode3 off: $data(3)[6] +print dnode4 off: $data(4)[6] +print dnode5 off: $data(5)[6] +if $data(5)[6] != @locale not match@ then + goto step7 +endi + +print ========== step8 +system sh/deploy.sh -n dnode6 -i 6 +system sh/cfg.sh -n dnode6 -c charset -v UTF-16 +system sh/exec.sh -n dnode6 -s start +sql create dnode $hostname port 7600 + +$x = 0 +step8: + $x = $x + 1 + sleep 1000 + if $x == 10 then + return -1 + endi + +sql show dnodes +print dnode1 off: $data(1)[6] +print dnode3 off: $data(3)[6] +print dnode4 off: $data(4)[6] +print dnode5 off: $data(5)[6] +print dnode6 off: $data(6)[6] +if $data(6)[6] != @charset not match@ then + goto step8 +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 +system sh/exec.sh -n dnode4 -s stop -x SIGINT +system sh/exec.sh -n dnode5 -s stop -x SIGINT +system sh/exec.sh -n dnode6 -s stop -x SIGINT +system sh/exec.sh -n dnode7 -s stop -x SIGINT +system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/vnode_clean.sim b/tests/script/tsim/dnode/vnode_clean.sim similarity index 55% rename from tests/script/unique/dnode/vnode_clean.sim rename to tests/script/tsim/dnode/vnode_clean.sim index 76311a6cac..9fcf9451c1 100644 --- a/tests/script/unique/dnode/vnode_clean.sim +++ b/tests/script/tsim/dnode/vnode_clean.sim @@ -1,30 +1,14 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/deploy.sh -n dnode4 -i 4 -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 -system sh/cfg.sh -n dnode4 -c wallevel -v 1 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 - print ========== step1 system sh/exec.sh -n dnode1 -s start sql connect -sql create database d1 +sql create database d1 vgroups 1 sql create table d1.t1 (t timestamp, i int) sql insert into d1.t1 values(now+1s, 15) sql insert into d1.t1 values(now+2s, 14) @@ -33,34 +17,49 @@ sql insert into d1.t1 values(now+4s, 12) sql insert into d1.t1 values(now+5s, 11) sql show dnodes -print dnode1 openVnodes $data2_1 -if $data2_1 != 1 then +print dnode1 openVnodes $data(1)[2] +if $data(1)[2] != 1 then return -1 endi print ========== step2 -sql create dnode $hostname2 +sql create dnode $hostname port 7200 system sh/exec.sh -n dnode2 -s start $x = 0 -show2: +step2: $x = $x + 1 sleep 1000 - if $x == 20 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 0 then - goto show2 +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 endi -if $data2_2 != 1 then - goto show2 +if $data(1)[4] != ready then + goto step2 +endi +if $data(2)[4] != ready then + goto step2 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +if $data(1)[2] != 0 then + return -1 +endi +if $data(2)[2] != 1 then + return -1 endi print ========== step3 -sql create database d2 +sql create database d2 vgroups 1 sql create table d2.t2 (t timestamp, i int) sql insert into d2.t2 values(now+1s, 25) @@ -69,65 +68,68 @@ sql insert into d2.t2 values(now+3s, 23) sql insert into d2.t2 values(now+4s, 22) sql insert into d2.t2 values(now+5s, 21) -$x = 0 sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 0 then +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +if $data(1)[2] != 0 then return -1 endi -if $data2_2 != 2 then +if $data(2)[2] != 2 then return -1 endi print ========== step4 -sql drop dnode $hostname2 - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi +sql drop dnode 2 sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 2 then - goto show4 +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(2)[2] +if $data(1)[2] != 2 then + return -1 endi -if $data2_2 != null then - goto show4 -endi -if $rows != 1 then - goto show4 +if $data(2)[2] != null then + return -1 endi system sh/exec.sh -n dnode2 -s stop -x SIGINT print ========== step5 -sql create dnode $hostname3 +sql create dnode $hostname port 7300 system sh/exec.sh -n dnode3 -s start $x = 0 -show5: +step5: $x = $x + 1 sleep 1000 - if $x == 40 then - return -1 + if $x == 10 then + print ====> dnode not ready! + return -1 endi sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode3 openVnodes $data2_3 -if $data2_1 != 0 then - goto show5 +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +if $rows != 2 then + return -1 endi -if $data2_3 != 2 then - goto show5 +if $data(1)[4] != ready then + goto step5 +endi +if $data(3)[4] != ready then + goto step5 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +if $data(1)[2] != 1 then + return -1 +endi +if $data(3)[2] != 1 then + return -1 endi print ========== step6 -sql create database d3 +sql create database d3 vgroups 1 sql create table d3.t3 (t timestamp, i int) sql insert into d3.t3 values(now+1s, 35) sql insert into d3.t3 values(now+2s, 34) @@ -136,43 +138,61 @@ sql insert into d3.t3 values(now+4s, 32) sql insert into d3.t3 values(now+5s, 31) sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_3 -if $data2_1 != 0 then +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +if $data(1)[2] != 1 then return -1 endi -if $data2_3 != 3 then +if $data(3)[2] != 2 then return -1 endi print ========== step7 -sql create dnode $hostname4 +sql create dnode $hostname port 7400 system sh/exec.sh -n dnode4 -s start $x = 0 -show7: +step7: $x = $x + 1 sleep 1000 - if $x == 40 then + if $x == 10 then + print ====> dnode not ready! return -1 endi - sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show7 +print ===> $data00 $data01 $data02 $data03 $data04 $data05 +print ===> $data10 $data11 $data12 $data13 $data14 $data15 +print ===> $data20 $data21 $data22 $data23 $data24 $data25 +if $rows != 3 then + return -1 endi -if $data2_3 != 2 then - goto show7 +if $data(1)[4] != ready then + goto step7 endi -if $data2_4 != 1 then - goto show7 +if $data(3)[4] != ready then + goto step7 +endi +if $data(4)[4] != ready then + goto step7 +endi + +sql balance vgroup +sql show dnodes +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +print dnode2 openVnodes $data(4)[2] +if $data(1)[2] != 0 then + return -1 +endi +if $data(3)[2] != 2 then + return -1 +endi +if $data(4)[2] != 1 then + return -1 endi print ========== step8 -sql create database d4 +sql create database d4 vgroups 1 sql create table d4.t4 (t timestamp, i int) sql insert into d4.t4 values(now+1s, 45) sql insert into d4.t4 values(now+2s, 44) @@ -180,53 +200,39 @@ sql insert into d4.t4 values(now+3s, 43) sql insert into d4.t4 values(now+4s, 42) sql insert into d4.t4 values(now+5s, 41) -$x = 0 -show8: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show8 +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +print dnode2 openVnodes $data(4)[2] +if $data(1)[2] != 0 then + return -1 endi -if $data2_3 != 2 then - goto show8 +if $data(3)[2] != 2 then + return -1 endi -if $data2_4 != 2 then - goto show8 +if $data(4)[2] != 2 then + return -1 endi print ========== step9 -sql drop dnode $hostname3 - -$x = 0 -show9: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - +sql drop dnode 3 sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show9 +print dnode1 openVnodes $data(1)[2] +print dnode2 openVnodes $data(3)[2] +print dnode2 openVnodes $data(4)[2] +if $data(1)[2] != 1 then + return -1 endi -if $data2_3 != null then - goto show9 +if $data(3)[2] != null then + return -1 endi -if $data2_4 != 4 then - goto show9 +if $data(4)[2] != 3 then + return -1 endi -system sh/exec.sh -n dnode3 -s stop +system sh/exec.sh -n dnode3 -s stop -x SIGINT +sql reset query cache +sleep 100 print ========== step10 sql select * from d1.t1 order by t desc diff --git a/tests/script/unique/dnode/alternativeRole.sim b/tests/script/unique/dnode/alternativeRole.sim deleted file mode 100644 index 14a6e92f06..0000000000 --- a/tests/script/unique/dnode/alternativeRole.sim +++ /dev/null @@ -1,97 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 - -system sh/cfg.sh -n dnode1 -c role -v 1 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 0 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 - - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -sleep 5000 - -sql show dnodes -print dnode1 $data5_1 -print dnode1 $data5_2 -print dnode1 $data5_3 - -if $data5_1 != mnode then - return -1 -endi -if $data5_2 != vnode then - return -1 -endi -if $data5_3 != any then - return -1 -endi - -sql show mnodes -print dnode1 ==> $data2_1 -print dnode2 ==> $data2_2 -print dnode3 ==> $data2_3 -if $data2_1 != master then - return -1 -endi -if $data2_2 != null then - return -1 -endi -if $data2_3 != slave then - return -1 -endi - -print ========== step2 -sql create database d1 -sql create table d1.t1 (ts timestamp, i int) -sql create table d1.t2 (ts timestamp, i int) -sql create table d1.t3 (ts timestamp, i int) -sql create table d1.t4 (ts timestamp, i int) -sql create table d1.t5 (ts timestamp, i int) -sql create table d1.t6 (ts timestamp, i int) -sql create table d1.t7 (ts timestamp, i int) -sql create table d1.t8 (ts timestamp, i int) - -sql show dnodes -print dnode1 $data2_1 -print dnode2 $data2_2 -print dnode3 $data2_3 - -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 1 then - return -1 -endi -if $data2_3 != 1 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/balance2.sim b/tests/script/unique/dnode/balance2.sim deleted file mode 100644 index 4c67e20c3e..0000000000 --- a/tests/script/unique/dnode/balance2.sim +++ /dev/null @@ -1,306 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 -system sh/deploy.sh -n dnode5 -i 5 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 -system sh/cfg.sh -n dnode4 -c wallevel -v 1 -system sh/cfg.sh -n dnode5 -c wallevel -v 1 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -sql create database d1 replica 2 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(now+1s, 15) -sql insert into d1.t1 values(now+2s, 14) -sql insert into d1.t1 values(now+3s, 13) -sql insert into d1.t1 values(now+4s, 12) -sql insert into d1.t1 values(now+5s, 11) - -sql create database d2 replica 2 -sql create table d2.t2 (t timestamp, i int) -sql insert into d2.t2 values(now+1s, 25) -sql insert into d2.t2 values(now+2s, 24) -sql insert into d2.t2 values(now+3s, 23) -sql insert into d2.t2 values(now+4s, 22) -sql insert into d2.t2 values(now+5s, 21) - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 2 then - return -1 -endi -if $data2_3 != 2 then - return -1 -endi - -print ========== step2 -sql drop dnode $hostname2 - -$x = 0 -show2: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -if $data2_1 != 2 then - goto show2 -endi -if $data2_2 != null then - goto show2 -endi -if $data2_3 != 2 then - goto show2 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -print ========== step3 -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start - -$x = 0 -show3: - $x = $x + 1 - sleep 2000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show3 -endi -if $data2_2 != null then - goto show3 -endi -if $data2_3 != 2 then - goto show3 -endi -if $data2_4 != 2 then - goto show3 -endi - -print ========== step4 -sql create database d3 replica 2 -sql create table d3.t3 (t timestamp, i int) -sql insert into d3.t3 values(now+1s, 35) -sql insert into d3.t3 values(now+2s, 34) -sql insert into d3.t3 values(now+3s, 33) -sql insert into d3.t3 values(now+4s, 32) -sql insert into d3.t3 values(now+5s, 31) - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != null then - return -1 -endi -if $data2_3 != 3 then - return -1 -endi -if $data2_4 != 3 then - return -1 -endi - -print ========== step5 -sql create dnode $hostname5 -system sh/exec.sh -n dnode5 -s start - -$x = 0 -show5: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 -if $data2_1 != 0 then - goto show5 -endi -if $data2_2 != null then - goto show5 -endi -if $data2_3 != 2 then - goto show5 -endi -if $data2_4 != 2 then - goto show5 -endi -if $data2_5 != 2 then - goto show5 -endi - -print ========== step6 -sql drop dnode $hostname3 - -$x = 0 -show6: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 -if $data2_1 != 0 then - goto show6 -endi -if $data2_2 != null then - goto show6 -endi -if $data2_3 != null then - goto show6 -endi -if $data2_4 != 3 then - goto show6 -endi -if $data2_5 != 3 then - goto show6 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sql reset query cache -sleep 100 - -print ========== step7 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 11 then - return -1 -endi -if $data11 != 12 then - return -1 -endi -if $data21 != 13 then - return -1 -endi -if $data31 != 14 then - return -1 -endi -if $data41 != 15 then - return -1 -endi - -sql select * from d2.t2 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 21 then - return -1 -endi -if $data11 != 22 then - return -1 -endi -if $data21 != 23 then - return -1 -endi -if $data31 != 24 then - return -1 -endi -if $data41 != 25 then - return -1 -endi - -sql select * from d3.t3 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 31 then - return -1 -endi -if $data11 != 32 then - return -1 -endi -if $data21 != 33 then - return -1 -endi -if $data31 != 34 then - return -1 -endi -if $data41 != 35 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/balance3.sim b/tests/script/unique/dnode/balance3.sim deleted file mode 100644 index f5558d504e..0000000000 --- a/tests/script/unique/dnode/balance3.sim +++ /dev/null @@ -1,337 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 -system sh/deploy.sh -n dnode5 -i 5 -system sh/deploy.sh -n dnode6 -i 6 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode6 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 -system sh/cfg.sh -n dnode4 -c wallevel -v 1 -system sh/cfg.sh -n dnode5 -c wallevel -v 1 -system sh/cfg.sh -n dnode6 -c wallevel -v 1 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode6 -c maxTablesPerVnode -v 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi -if $data4_4 != ready then - goto step1 -endi - -sql create database d1 replica 3 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(now+1s, 15) -sql insert into d1.t1 values(now+2s, 14) -sql insert into d1.t1 values(now+3s, 13) -sql insert into d1.t1 values(now+4s, 12) -sql insert into d1.t1 values(now+5s, 11) - -sql create database d2 replica 3 -sql create table d2.t2 (t timestamp, i int) -sql insert into d2.t2 values(now+1s, 25) -sql insert into d2.t2 values(now+2s, 24) -sql insert into d2.t2 values(now+3s, 23) -sql insert into d2.t2 values(now+4s, 22) -sql insert into d2.t2 values(now+5s, 21) - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 - -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 2 then - return -1 -endi -if $data2_3 != 2 then - return -1 -endi -if $data2_4 != 2 then - return -1 -endi - -print ========== step2 -sql drop dnode $hostname2 - -$x = 0 -show2: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 - -if $data2_1 != 2 then - goto show2 -endi -if $data2_2 != null then - goto show2 -endi -if $data2_3 != 2 then - goto show2 -endi -if $data2_4 != 2 then - goto show2 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT -print ========== step -sql create dnode $hostname5 -system sh/exec.sh -n dnode5 -s start - -$x = 0 -show3: - $x = $x + 1 - sleep 1000 - if $x == 60 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_1 != 0 then - goto show3 -endi -if $data2_2 != null then - goto show3 -endi -if $data2_3 != 2 then - goto show3 -endi -if $data2_4 != 2 then - goto show3 -endi -if $data2_5 != 2 then - goto show3 -endi - -print ========== step4 -sql create database d3 replica 3 -sql create table d3.t3 (t timestamp, i int) -sql insert into d3.t3 values(now+1s, 35) -sql insert into d3.t3 values(now+2s, 34) -sql insert into d3.t3 values(now+3s, 33) -sql insert into d3.t3 values(now+4s, 32) -sql insert into d3.t3 values(now+5s, 31) - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_1 != 0 then - goto show4 -endi -if $data2_2 != null then - goto show4 -endi -if $data2_3 != 3 then - goto show4 -endi -if $data2_4 != 3 then - goto show4 -endi -if $data2_5 != 3 then - goto show4 -endi - -print ========== step5 -sql create dnode $hostname6 -system sh/exec.sh -n dnode6 -s start - -$x = 0 -show5: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode6 openVnodes $data2_6 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_1 != 0 then - goto show5 -endi -if $data2_6 != 2 then - goto show5 -endi - -sleep 8000 - -print ========== step6 -sql drop dnode $hostname3 - -$x = 0 -show6: - $x = $x + 1 - sleep 1000 - if $x == 30 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode6 openVnodes $data2_6 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_1 != 0 then - goto show6 -endi -if $data2_6 != 3 then - goto show6 -endi -if $data2_3 != null then - goto show6 -endi -if $data2_4 != 3 then - goto show6 -endi -if $data2_5 != 3 then - goto show6 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT -sql reset query cache -sleep 100 - -print ========== step7 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 11 then - return -1 -endi -if $data11 != 12 then - return -1 -endi -if $data21 != 13 then - return -1 -endi -if $data31 != 14 then - return -1 -endi -if $data41 != 15 then - return -1 -endi - -sql select * from d2.t2 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 21 then - return -1 -endi -if $data11 != 22 then - return -1 -endi -if $data21 != 23 then - return -1 -endi -if $data31 != 24 then - return -1 -endi -if $data41 != 25 then - return -1 -endi - -sql select * from d3.t3 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 31 then - return -1 -endi -if $data11 != 32 then - return -1 -endi -if $data21 != 33 then - return -1 -endi -if $data31 != 34 then - return -1 -endi -if $data41 != 35 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/balancex.sim b/tests/script/unique/dnode/balancex.sim deleted file mode 100644 index d2c738ee97..0000000000 --- a/tests/script/unique/dnode/balancex.sim +++ /dev/null @@ -1,215 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 -system sh/cfg.sh -n dnode4 -c wallevel -v 1 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sleep 2000 - -sql create database d1 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(now+1s, 15) -sql insert into d1.t1 values(now+2s, 14) -sql insert into d1.t1 values(now+3s, 13) -sql insert into d1.t1 values(now+4s, 12) -sql insert into d1.t1 values(now+5s, 11) - -sql create database d2 -sql create table d2.t2 (t timestamp, i int) -sql insert into d2.t2 values(now+1s, 25) -sql insert into d2.t2 values(now+2s, 24) -sql insert into d2.t2 values(now+3s, 23) -sql insert into d2.t2 values(now+4s, 22) -sql insert into d2.t2 values(now+5s, 21) - -sql show dnodes -print dnode1 openVnodes $data2_1 -if $data2_1 != 2 then - return -1 -endi - -print ========== step2 -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -show2: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 0 then - goto show2 -endi -if $data2_2 != 2 then - goto show2 -endi - -print ========== step3 -sql create database d3 replica 2 -sql create table d3.t3 (t timestamp, i int) -sql insert into d3.t3 values(now+1s, 35) -sql insert into d3.t3 values(now+2s, 34) -sql insert into d3.t3 values(now+3s, 33) -sql insert into d3.t3 values(now+4s, 32) -sql insert into d3.t3 values(now+5s, 31) - -$x = 0 -show3: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 1 then - goto show3 -endi -if $data2_2 != 3 then - goto show3 -endi - -print ========== step3 -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -show4: - $x = $x + 1 - sleep 2000 - if $x == 20 then - return -1 - endi -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -if $data2_1 != 0 then - goto show4 -endi -if $data2_2 != 2 then - goto show4 -endi -if $data2_3 != 2 then - goto show4 -endi - -print ========== step5 -sql drop dnode $hostname2 - -$x = 0 -show5: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -if $data2_1 != 1 then - goto show5 -endi -if $data2_2 != null then - goto show5 -endi -if $data2_3 != 3 then - goto show5 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep 3000 - -sql reset query cache -sleep 1000 - -print ========== step6 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 11 then - return -1 -endi -if $data11 != 12 then - return -1 -endi -if $data21 != 13 then - return -1 -endi -if $data31 != 14 then - return -1 -endi -if $data41 != 15 then - return -1 -endi - -sql select * from d2.t2 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 21 then - return -1 -endi -if $data11 != 22 then - return -1 -endi -if $data21 != 23 then - return -1 -endi -if $data31 != 24 then - return -1 -endi -if $data41 != 25 then - return -1 -endi - -sql select * from d3.t3 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 31 then - return -1 -endi -if $data11 != 32 then - return -1 -endi -if $data21 != 33 then - return -1 -endi -if $data31 != 34 then - return -1 -endi -if $data41 != 35 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/data1.sim b/tests/script/unique/dnode/data1.sim deleted file mode 100644 index 75a484abb6..0000000000 --- a/tests/script/unique/dnode/data1.sim +++ /dev/null @@ -1,137 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 2 -system sh/cfg.sh -n dnode2 -c wallevel -v 2 -system sh/cfg.sh -n dnode3 -c wallevel -v 2 -system sh/cfg.sh -n dnode4 -c wallevel -v 2 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sleep 2000 - -print ========== step2 -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start - -$x = 0 -show2: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show2 -endi -if $data2_2 != 0 then - goto show2 -endi -if $data2_3 != 0 then - goto show2 -endi -if $data2_4 != 0 then - goto show2 -endi - -print ========== step3 -sql create database d1 replica 3 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(now+1s, 35) -sql insert into d1.t1 values(now+2s, 34) -sql insert into d1.t1 values(now+3s, 33) -sql insert into d1.t1 values(now+4s, 32) -sql insert into d1.t1 values(now+5s, 31) - -$x = 0 -show3: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show3 -endi -if $data2_2 != 1 then - goto show3 -endi -if $data2_3 != 1 then - goto show3 -endi -if $data2_4 != 1 then - goto show3 -endi - -print ========== step4 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -system sh/exec.sh -n dnode4 -s stop -x SIGINT - -print ========== step5 -system_content rm -rf ../../../sim/dnode4/data/vnode/vnode2/tsdb/data - -print ========== step6 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -sleep 10000 - -print ========== step7 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 31 then - return -1 -endi -if $data11 != 32 then - return -1 -endi -if $data21 != 33 then - return -1 -endi -if $data31 != 34 then - return -1 -endi -if $data41 != 35 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/datatrans_1node.sim b/tests/script/unique/dnode/datatrans_1node.sim deleted file mode 100644 index a156c32672..0000000000 --- a/tests/script/unique/dnode/datatrans_1node.sim +++ /dev/null @@ -1,53 +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/exec.sh -n dnode1 -s start - -sleep 2000 -sql connect - -print =============== step1 -sql drop database -x step1 -step1: -sql create database db -sql use db -sql create table m1 (ts timestamp, speed int) - -print =============== step 2 -$x = 0 -while $x < 10 - $cc = $x * 60000 - $ms = 1601481600000 + $cc - - sql insert into m1 values ($ms , $x ) - $x = $x + 1 -endw - -sql select * from m1 - -print $rows points data are retrieved -if $rows != 10 then - return -1 -endi - -system sh/exec.sh -n dnode1 -s stop -x SIGINT - -print =============== step 3 -system sh/move_dnode.sh dnode1 dnode2 -system sh/exec.sh -n dnode2 -s start - - -print =============== step 4 -sleep 2000 -sql connect - -sql select * from db.m1 - -print $rows points data are retrieved -if $rows != 10 then - return -1 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/datatrans_3node.sim b/tests/script/unique/dnode/datatrans_3node.sim deleted file mode 100644 index 7948eb6d3a..0000000000 --- a/tests/script/unique/dnode/datatrans_3node.sim +++ /dev/null @@ -1,91 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 - - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 - - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 2 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 - - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 - - - - -print ============== step1: start dnode1 -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sleep 2000 - -# create table -sql drop database -x step1 -step1: -sql create database db -sql use db -sql create table m1 (ts timestamp, speed int) - -# insert data -$x = 0 -while $x < 10 - $cc = $x * 60000 - $ms = 1601481600000 + $cc - - sql insert into m1 values ($ms , $x ) - $x = $x + 1 -endw - -sql select * from m1 - -print $rows points data are retrieved -if $rows != 10 then - return -1 -endi - -print ============== step3: stop cluster , then move_dnode1 ,start cluster -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 - -system sh/move_dnode.sh dnode1 dnode4 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start - -print =============== step 4 -sleep 2000 -sql connect - -sql select * from db.m1 - -print $rows points data are retrieved -if $rows != 10 then - return -1 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -system sh/exec.sh -n dnode4 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/datatrans_3node_2.sim b/tests/script/unique/dnode/datatrans_3node_2.sim deleted file mode 100644 index 844afc5b02..0000000000 --- a/tests/script/unique/dnode/datatrans_3node_2.sim +++ /dev/null @@ -1,91 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 - - -system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 -system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 - - -system sh/cfg.sh -n dnode1 -c walLevel -v 2 -system sh/cfg.sh -n dnode2 -c walLevel -v 2 -system sh/cfg.sh -n dnode3 -c walLevel -v 2 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c role -v 2 -system sh/cfg.sh -n dnode2 -c role -v 2 -system sh/cfg.sh -n dnode3 -c role -v 2 - - -system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4 - - - - -print ============== step1: start dnode1 -system sh/exec.sh -n dnode1 -s start -sleep 2000 -sql connect - -print ============== step2: start dnode2/dnode3 and add into cluster , then create database with replica 2, and create table, insert data -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname2 -sql create dnode $hostname3 -sleep 2000 - -# create table -sql drop database -x step1 -step1: -sql create database db replica 2 -sql use db -sql create table m1 (ts timestamp, speed int) - -# insert data -$x = 0 -while $x < 10 - $cc = $x * 60000 - $ms = 1601481600000 + $cc - - sql insert into m1 values ($ms , $x ) - $x = $x + 1 -endw - -sql select * from m1 - -print $rows points data are retrieved -if $rows != 10 then - return -1 -endi - -print ============== step3: stop cluster , then move_dnode1 ,start cluster -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 - -system sh/move_dnode.sh dnode1 dnode4 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start - -print =============== step 4 -sleep 2000 -sql connect - -sql select * from db.m1 - -print $rows points data are retrieved -if $rows != 10 then - return -1 -endi - -system sh/exec.sh -n dnode2 -s stop -x SIGINT -system sh/exec.sh -n dnode3 -s stop -x SIGINT -system sh/exec.sh -n dnode4 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/lossdata.sim b/tests/script/unique/dnode/lossdata.sim deleted file mode 100644 index 89ba716970..0000000000 --- a/tests/script/unique/dnode/lossdata.sim +++ /dev/null @@ -1,165 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 -system sh/deploy.sh -n dnode5 -i 5 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -print ========== step2 - -sql create database d1 replica 2 -sql create table d1.t1 (t timestamp, i int) - -print ========== step2.1 - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 - -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 1 then - return -1 -endi -if $data2_3 != 1 then - return -1 -endi - -print ========== step3 -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start - -$x = 0 -show3: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 - -if $data2_2 != 1 then - goto show3 -endi -if $data2_3 != 1 then - goto show3 -endi -if $data2_4 != 0 then - goto show3 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 - -print ========== step4 -sql drop dnode $hostname3 - -$i = 0 -$rowNum = 10000 - -while $i < $rowNum - $ts = 1500000000000 + $i - sql insert into d1.t1 values( $ts , $i ) - - $i = $i + 1 -endw - -print insert $rowNum finished - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_2 != 1 then - goto show4 -endi -if $data2_3 != null then - goto show4 -endi -if $data2_4 != 1 then - goto show4 -endi - -system sh/exec.sh -n dnode3 -s stop -x SIGINT - -print ========== step5 -sql select count(*) from d1.t1 -print select count(*) from d1.t1 ==> $data00 -if $data00 != $rowNum 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/m2.sim b/tests/script/unique/dnode/m2.sim deleted file mode 100644 index 5fdf3b7400..0000000000 --- a/tests/script/unique/dnode/m2.sim +++ /dev/null @@ -1,367 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 -system sh/deploy.sh -n dnode5 -i 5 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi - -print ========== step2 - -sql create database d1 replica 2 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(now+1s, 15) -sql insert into d1.t1 values(now+2s, 14) -sql insert into d1.t1 values(now+3s, 13) -sql insert into d1.t1 values(now+4s, 12) -sql insert into d1.t1 values(now+5s, 11) - -sql create database d2 replica 2 -sql create table d2.t2 (t timestamp, i int) -sql insert into d2.t2 values(now+1s, 25) -sql insert into d2.t2 values(now+2s, 24) -sql insert into d2.t2 values(now+3s, 23) -sql insert into d2.t2 values(now+4s, 22) -sql insert into d2.t2 values(now+5s, 21) - -sql create database d3 replica 2 -sql create table d3.t3 (t timestamp, i int) -sql insert into d3.t3 values(now+1s, 35) -sql insert into d3.t3 values(now+2s, 34) -sql insert into d3.t3 values(now+3s, 33) -sql insert into d3.t3 values(now+4s, 32) -sql insert into d3.t3 values(now+5s, 31) - -sql create database d4 replica 2 -sql create table d4.t4 (t timestamp, i int) -sql insert into d4.t4 values(now+1s, 45) -sql insert into d4.t4 values(now+2s, 44) -sql insert into d4.t4 values(now+3s, 43) -sql insert into d4.t4 values(now+4s, 42) -sql insert into d4.t4 values(now+5s, 41) - -print ========== step2.1 - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 - -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 4 then - return -1 -endi -if $data2_3 != 4 then - return -1 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 - -sql show d2.vgroups; -print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 - -sql show d3.vgroups; -print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 - -sql show d4.vgroups; -print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 - -print ========== step3 -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname5 -system sh/exec.sh -n dnode5 -s start - - -$x = 0 -show3: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_2 != 2 then - goto show3 -endi -if $data2_3 != 2 then - goto show3 -endi -if $data2_4 != 2 then - goto show3 -endi -if $data2_5 != 2 then - goto show3 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show3 -endi - -sql show d2.vgroups; -print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show3 -endi - -sql show d3.vgroups; -print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show3 -endi - -sql show d4.vgroups; -print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show3 -endi - -print ========== step4 -sql drop dnode $hostname2 - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_2 != null then - goto show4 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show4 -endi - -sql show d2.vgroups; -print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show4 -endi - -sql show d3.vgroups; -print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show4 -endi - -sql show d4.vgroups; -print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show4 -endi - -sql reset query cache -sleep 100 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -print ========== step5 -sql drop dnode $hostname3 - -$x = 0 -show5: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_2 != null then - goto show5 -endi -if $data2_3 != null then - goto show5 -endi -if $data2_4 != 4 then - goto show5 -endi -if $data2_5 != 4 then - goto show4 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show5 -endi - -sql show d2.vgroups; -print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show5 -endi - -sql show d3.vgroups; -print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show5 -endi - -sql show d4.vgroups; -print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data03 != 2 then - goto show5 -endi - -sql reset query cache -sleep 100 -system sh/exec.sh -n dnode3 -s stop -x SIGINT - -print ========== step6 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 11 then - return -1 -endi -if $data11 != 12 then - return -1 -endi -if $data21 != 13 then - return -1 -endi -if $data31 != 14 then - return -1 -endi -if $data41 != 15 then - return -1 -endi - -sql select * from d2.t2 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 21 then - return -1 -endi -if $data11 != 22 then - return -1 -endi -if $data21 != 23 then - return -1 -endi -if $data31 != 24 then - return -1 -endi -if $data41 != 25 then - return -1 -endi - -sql select * from d3.t3 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 31 then - return -1 -endi -if $data11 != 32 then - return -1 -endi -if $data21 != 33 then - return -1 -endi -if $data31 != 34 then - return -1 -endi -if $data41 != 35 then - return -1 -endi - -sql select * from d4.t4 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 41 then - return -1 -endi -if $data11 != 42 then - return -1 -endi -if $data21 != 43 then - return -1 -endi -if $data31 != 44 then - return -1 -endi -if $data41 != 45 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/m3.sim b/tests/script/unique/dnode/m3.sim deleted file mode 100644 index 5850147d04..0000000000 --- a/tests/script/unique/dnode/m3.sim +++ /dev/null @@ -1,359 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 -system sh/deploy.sh -n dnode5 -i 5 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 10 -system sh/cfg.sh -n dnode5 -c balanceInterval -v 10 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create dnode $hostname2 -sql create dnode $hostname3 -sql create dnode $hostname4 -system sh/exec.sh -n dnode2 -s start -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode4 -s start -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi -if $data4_4 != ready then - goto step1 -endi - -print ========== step2 - -sql create database d1 replica 3 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(now+1s, 15) -sql insert into d1.t1 values(now+2s, 14) -sql insert into d1.t1 values(now+3s, 13) -sql insert into d1.t1 values(now+4s, 12) -sql insert into d1.t1 values(now+5s, 11) - -sql create database d2 replica 3 -sql create table d2.t2 (t timestamp, i int) -sql insert into d2.t2 values(now+1s, 25) -sql insert into d2.t2 values(now+2s, 24) -sql insert into d2.t2 values(now+3s, 23) -sql insert into d2.t2 values(now+4s, 22) -sql insert into d2.t2 values(now+5s, 21) - -sql create database d3 replica 3 -sql create table d3.t3 (t timestamp, i int) -sql insert into d3.t3 values(now+1s, 35) -sql insert into d3.t3 values(now+2s, 34) -sql insert into d3.t3 values(now+3s, 33) -sql insert into d3.t3 values(now+4s, 32) -sql insert into d3.t3 values(now+5s, 31) - -sql create database d4 replica 3 -sql create table d4.t4 (t timestamp, i int) -sql insert into d4.t4 values(now+1s, 45) -sql insert into d4.t4 values(now+2s, 44) -sql insert into d4.t4 values(now+3s, 43) -sql insert into d4.t4 values(now+4s, 42) -sql insert into d4.t4 values(now+5s, 41) - -print ========== step2.1 - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 - -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 4 then - return -1 -endi -if $data2_3 != 4 then - return -1 -endi -if $data2_4 != 4 then - return -1 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 4 then - return -1 -endi - -sql show d2.vgroups; -print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 3 then - return -1 -endi - -sql show d3.vgroups; -print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 2 then - return -1 -endi - -sql show d4.vgroups; -print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 4 then - return -1 -endi - -print ========== step3 -sql create dnode $hostname5 -system sh/exec.sh -n dnode5 -s start - -$x = 0 -show3: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_2 != 3 then - goto show3 -endi -if $data2_3 != 3 then - goto show3 -endi -if $data2_4 != 3 then - goto show3 -endi -if $data2_5 != 3 then - goto show3 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 5 then - return -1 -endi -if $data03 != 3 then - goto show3 -endi - -sql show d2.vgroups; -print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 5 then - return -1 -endi -if $data03 != 3 then - goto show3 -endi - -sql show d3.vgroups; -print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 2 then - return -1 -endi -if $data03 != 3 then - goto show3 -endi - -sql show d4.vgroups; -print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 4 then - return -1 -endi -if $data03 != 3 then - goto show3 -endi - -print ========== step4 -sql drop dnode $hostname2 - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 40 then - return -1 - endi - - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -print dnode5 openVnodes $data2_5 - -if $data2_2 != null then - goto show4 -endi -if $data2_3 != 4 then - goto show4 -endi -if $data2_4 != 4 then - goto show4 -endi -if $data2_5 != 4 then - goto show4 -endi - -sql show d1.vgroups; -print d1.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 5 then - return -1 -endi -if $data03 != 3 then - goto show4 -endi - -sql show d2.vgroups; -print d2.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 3 then - return -1 -endi -if $data03 != 3 then - goto show4 -endi - -sql show d3.vgroups; -print d3.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 4 then - return -1 -endi -if $data03 != 3 then - goto show4 -endi - -sql show d4.vgroups; -print d4.vgroups $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data04 != 4 then - return -1 -endi -if $data03 != 3 then - goto show4 -endi - -sql reset query cache -sleep 100 - -print ========== step5 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 11 then - return -1 -endi -if $data11 != 12 then - return -1 -endi -if $data21 != 13 then - return -1 -endi -if $data31 != 14 then - return -1 -endi -if $data41 != 15 then - return -1 -endi - -sql select * from d2.t2 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 21 then - return -1 -endi -if $data11 != 22 then - return -1 -endi -if $data21 != 23 then - return -1 -endi -if $data31 != 24 then - return -1 -endi -if $data41 != 25 then - return -1 -endi - -sql select * from d3.t3 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 31 then - return -1 -endi -if $data11 != 32 then - return -1 -endi -if $data21 != 33 then - return -1 -endi -if $data31 != 34 then - return -1 -endi -if $data41 != 35 then - return -1 -endi - -sql select * from d4.t4 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 41 then - return -1 -endi -if $data11 != 42 then - return -1 -endi -if $data21 != 43 then - return -1 -endi -if $data31 != 44 then - return -1 -endi -if $data41 != 45 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/monitor_bug.sim b/tests/script/unique/dnode/monitor_bug.sim deleted file mode 100644 index 60c6524d9c..0000000000 --- a/tests/script/unique/dnode/monitor_bug.sim +++ /dev/null @@ -1,77 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 - -system sh/cfg.sh -n dnode1 -c monitor -v 1 -system sh/cfg.sh -n dnode2 -c monitor -v 0 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sleep 3000 - -sql show dnodes -print dnode1 openVnodes $data2_1 -if $data2_1 > 2 then - return -1 -endi - -print ========== step2 -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -show2: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 0 then - goto show2 -endi -if $data2_2 > 2 then - goto show2 -endi - -print ========== step3 -sql show log.tables - -print $data00 -print $data10 -print $data20 -print $data30 -print $data40 -print $data50 - -if $rows > 5 then - return -1 -endi - -print ========== step4 -sql select * from log.dn1 -print $rows -$rows1 = $rows - -sleep 2000 -sql select * from log.dn1 -print $rows -$rows2 = $rows - -if $rows2 <= $rows1 then - return -1 -endi - -system sh/exec.sh -n dnode1 -s stop -x SIGINT -system sh/exec.sh -n dnode2 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/offline1.sim b/tests/script/unique/dnode/offline1.sim deleted file mode 100644 index 9bbd14cf07..0000000000 --- a/tests/script/unique/dnode/offline1.sim +++ /dev/null @@ -1,77 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 - -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 5 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 5 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 5 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sleep 2000 - -sql show dnodes -print dnode1 $data4_1 -print dnode1 $data4_2 - -if $data4_1 != ready then - return -1 -endi -if $data4_2 != ready then - return -1 -endi - -print ========== step2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep 8000 - -sql show dnodes -print dnode1 $data4_1 -print dnode1 $data4_2 - -if $data4_1 != ready then - return -1 -endi -if $data4_2 == ready then - return -1 -endi - -print ========== step3 -sleep 10000 - -sql show dnodes -print dnode1 $data4_1 -print dnode1 $data4_2 - -if $data4_1 != ready then - return -1 -endi -if $data4_2 != null 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/offline2.sim b/tests/script/unique/dnode/offline2.sim deleted file mode 100644 index 711488cf3f..0000000000 --- a/tests/script/unique/dnode/offline2.sim +++ /dev/null @@ -1,126 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 - -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 10 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 10 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 5 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 5 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 5 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 - - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 - - -system sh/cfg.sh -n dnode1 -c wallevel -v 1 -system sh/cfg.sh -n dnode2 -c wallevel -v 1 -system sh/cfg.sh -n dnode3 -c wallevel -v 1 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sleep 2000 - -sql create database d1 replica 2 -sql create table d1.t1(ts timestamp, i int) -sql insert into d1.t1 values(1588262400001, 1) - -sql show dnodes -print dnode1 $data4_1 -print dnode1 $data4_2 - -if $data4_1 != ready then - return -1 -endi -if $data4_2 != ready then - return -1 -endi - -print ========== step2 -system sh/exec.sh -n dnode2 -s stop -x SIGINT -sleep 8000 - -sql show dnodes -print dnode1 $data4_1 -print dnode1 $data4_2 - -if $data4_1 != ready then - return -1 -endi -if $data4_2 == ready then - return -1 -endi - -print ========== step3 -sleep 10000 - -sql show dnodes -print dnode1 $data4_1 -print dnode1 $data4_2 - -if $data4_1 != ready then - return -1 -endi -if $data4_2 != dropping then - return -1 -endi - -print ========== step4 -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -system sh/exec.sh -n dnode2 -s start -sql drop dnode $hostname2 - -sleep 3000 -$x = 0 -show4: - $x = $x + 1 - sleep 3000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -if $data4_1 != ready then - goto show4 -endi -if $data4_2 != null then - goto show4 -endi -if $data4_3 != ready then - goto show4 -endi - -print ======================== step5 -sql reset query cache -sleep 1000 - -sql select * from d1.t1 -if $rows != 1 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/offline3.sim b/tests/script/unique/dnode/offline3.sim deleted file mode 100644 index 93c75e3b13..0000000000 --- a/tests/script/unique/dnode/offline3.sim +++ /dev/null @@ -1,111 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c offlineThreshold -v 3 -system sh/cfg.sh -n dnode2 -c offlineThreshold -v 3 -system sh/cfg.sh -n dnode3 -c offlineThreshold -v 3 -system sh/cfg.sh -n dnode4 -c offlineThreshold -v 3 - -system sh/cfg.sh -n dnode1 -c balanceInterval -v 300 -system sh/cfg.sh -n dnode2 -c balanceInterval -v 300 -system sh/cfg.sh -n dnode3 -c balanceInterval -v 300 -system sh/cfg.sh -n dnode4 -c balanceInterval -v 300 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi -if $data4_3 != ready then - goto step1 -endi -if $data4_4 != ready then - goto step1 -endi - -sql show mnodes -print mnode1 $data2_1 -if $data2_1 != master then - goto step1 -endi - -print ========== step2 -sql create database db replica 3 -sql use db -sql create table tb (ts timestamp, value int) -sql insert into tb values (now, 1) -sql insert into tb values (now, 2) - -sql show vgroups; -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 - -print ========== step2 -system sh/exec.sh -n dnode4 -s stop -x SIGINT - -$x = 0 -step2: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show vgroups; -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step2 -endi -if $data4_2 != ready then - goto step2 -endi -if $data4_3 != ready then - goto step2 -endi -if $data4_4 != null then - goto step2 -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/unique/dnode/reason.sim b/tests/script/unique/dnode/reason.sim deleted file mode 100644 index c685b1129d..0000000000 --- a/tests/script/unique/dnode/reason.sim +++ /dev/null @@ -1,203 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect -sql create dnode $hostname2 - -sql show dnodes -print dnode1 off: $data7_1 -print dnode2 off: $data7_2 -if $data7_2 != @status not received@ then - return -1 -endi - -print ========== step2 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 - -if $data4_1 != ready then - goto step1 -endi -if $data4_2 != ready then - goto step1 -endi - -print ========== step3 -system sh/exec.sh -n dnode2 -s stop - -$x = 0 -step3: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi -sql show dnodes -print dnode1 off: $data7_1 -print dnode2 off: $data7_2 -if $data7_2 != @status msg timeout@ then - goto step3 -endi - -print ========== step4 -sql drop dnode $hostname2 -$x = 0 -step4: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -if $rows != 1 then - goto step4 -endi - -print ========== step5 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname2 - -$x = 0 -step5: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 off: $data7_1 -print dnode2 off: $data7_3 -if $data7_3 != @dnodeId not match@ then - goto step5 -endi - -print ========== step6 -system sh/deploy.sh -n dnode4 -i 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 3 -system sh/exec.sh -n dnode4 -s start -sql create dnode $hostname4 - -$x = 0 -step6: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 off: $data7_1 -print dnode4 off: $data7_4 -if $data7_4 != @mnEqualVn not match@ then - goto step6 -endi - -print ========== step7 -system sh/deploy.sh -n dnode5 -i 5 -system sh/cfg.sh -n dnode5 -c statusInterval -v 3 -system sh/exec.sh -n dnode5 -s start -sql create dnode $hostname5 - -$x = 0 -step7: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 off: $data7_1 -print dnode5 off: $data7_5 -if $data7_5 != @interval not match@ then - goto step7 -endi - -print ========== step8 -system sh/deploy.sh -n dnode6 -i 6 -system sh/cfg.sh -n dnode6 -c balance -v 0 -system sh/exec.sh -n dnode6 -s start -sql create dnode $hostname6 - -$x = 0 -step8: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 off: $data7_1 -print dnode6 off: $data7_6 -if $data7_6 != @balance not match@ then - goto step8 -endi - -print ========== step9 -system sh/deploy.sh -n dnode7 -i 7 -system sh/cfg.sh -n dnode7 -c maxTablesPerVnode -v 3000 -system sh/exec.sh -n dnode7 -s start -sql create dnode $hostname7 - -$x = 0 -step9: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 off: $data7_1 -print dnode7 off: $data7_7 -if $data7_7 != @maxTabPerVn not match@ then - goto step9 -endi - -print ========== step10 -system sh/deploy.sh -n dnode8 -i 8 -system sh/cfg.sh -n dnode8 -c maxVgroupsPerDb -v 3 -system sh/exec.sh -n dnode8 -s start -sql create dnode $hostname8 - -$x = 0 -step10: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 off: $data7_1 -print dnode8 off: $data7_8 -if $data7_8 != @maxVgPerDb not match@ then - goto step10 -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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/remove2.sim b/tests/script/unique/dnode/remove2.sim deleted file mode 100644 index 1d707bc4a3..0000000000 --- a/tests/script/unique/dnode/remove2.sim +++ /dev/null @@ -1,204 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 -system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 - -system sh/cfg.sh -n dnode1 -c wallevel -v 2 -system sh/cfg.sh -n dnode2 -c wallevel -v 2 -system sh/cfg.sh -n dnode3 -c wallevel -v 2 -system sh/cfg.sh -n dnode4 -c wallevel -v 2 - -system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 4 -system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create database d1 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(1588262400001, 15) -sql insert into d1.t1 values(1588262400002, 14) -sql insert into d1.t1 values(1588262400003, 13) -sql insert into d1.t1 values(1588262400004, 12) -sql insert into d1.t1 values(1588262400005, 11) - -sql create database d2 -sql create table d2.t2 (t timestamp, i int) -sql insert into d2.t2 values(1588262400001, 25) -sql insert into d2.t2 values(1588262400002, 24) -sql insert into d2.t2 values(1588262400003, 23) -sql insert into d2.t2 values(1588262400004, 22) -sql insert into d2.t2 values(1588262400005, 21) - -sql show dnodes -print dnode1 openVnodes $data2_1 -if $data2_1 != 2 then - return -1 -endi - -print ========== step2 -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -$x = 0 -step2: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_1 != ready then - goto step2 -endi -if $data4_2 != ready then - goto step2 -endi - -sql create database d3 replica 2 -sql create table d3.t3 (t timestamp, i int) -sql insert into d3.t3 values(1588262400001, 35) -sql insert into d3.t3 values(1588262400002, 34) -sql insert into d3.t3 values(1588262400003, 33) -sql insert into d3.t3 values(1588262400004, 32) -sql insert into d3.t3 values(1588262400005, 31) - -$x = 0 -show2: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -if $data2_1 != 1 then - goto show2 -endi -if $data2_2 != 3 then - goto show2 -endi - -print ========== step3 -system sh/exec.sh -n dnode2 -s stop -x SIGINT - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 - -print ========== step4 -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start - -$x = 0 -step4: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -# wait dnode3 create first vgroup in dnode-status msg -if $data2_3 != 1 then - goto step4 -endi - -print ============ step 4.1 -system sh/exec.sh -n dnode2 -s start - -$x = 0 -step4.1: - $x = $x + 1 - sleep 1000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 $data4_1 -print dnode2 $data4_2 -print dnode3 $data4_3 -print dnode4 $data4_4 - -if $data4_2 != ready then - goto step4.1 -endi - -sql drop dnode $hostname2 - -$x = 0 -show4: - $x = $x + 1 - sleep 1000 - if $x == 20 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -if $data2_1 != 1 then - goto show4 -endi -if $data2_2 != null then - goto show4 -endi -if $data2_3 != 3 then - goto show4 -endi - -print ========== step5 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 - -sql select * from d2.t2 order by t desc -print $data01 $data11 $data21 $data31 $data41 - -sql select * from d3.t3 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 31 then - return -1 -endi -if $data11 != 32 then - return -1 -endi -if $data21 != 33 then - return -1 -endi -if $data31 != 34 then - return -1 -endi -if $data41 != 35 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT -system sh/exec.sh -n dnode5 -s stop -x SIGINT -system sh/exec.sh -n dnode6 -s stop -x SIGINT -system sh/exec.sh -n dnode7 -s stop -x SIGINT -system sh/exec.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/unique/dnode/simple.sim b/tests/script/unique/dnode/simple.sim deleted file mode 100644 index 38d8c08d75..0000000000 --- a/tests/script/unique/dnode/simple.sim +++ /dev/null @@ -1,147 +0,0 @@ -system sh/stop_dnodes.sh - -system sh/deploy.sh -n dnode1 -i 1 -system sh/deploy.sh -n dnode2 -i 2 -system sh/deploy.sh -n dnode3 -i 3 -system sh/deploy.sh -n dnode4 -i 4 - -print ========== step1 -system sh/exec.sh -n dnode1 -s start -sql connect - -sql create dnode $hostname2 -system sh/exec.sh -n dnode2 -s start -sql create dnode $hostname3 -system sh/exec.sh -n dnode3 -s start -sleep 2000 - -sql create database d1 replica 2 -sql create table d1.t1 (t timestamp, i int) -sql insert into d1.t1 values(now+1s, 15) -sql insert into d1.t1 values(now+2s, 14) -sql insert into d1.t1 values(now+3s, 13) -sql insert into d1.t1 values(now+4s, 12) -sql insert into d1.t1 values(now+5s, 11) - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 1 then - return -1 -endi -if $data2_3 != 1 then - return -1 -endi -if $data2_4 != null then - return -1 -endi - -print ========== step2 -sql create dnode $hostname4 -system sh/exec.sh -n dnode4 -s start -sleep 2000 - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - return -1 -endi -if $data2_2 != 1 then - return -1 -endi -if $data2_3 != 1 then - return -1 -endi -if $data2_4 != 0 then - return -1 -endi - -print ========== step3 -sql drop dnode $hostname2 - -$x = 0 -show3: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 0 then - goto show3 -endi -if $data2_2 != null then - goto show3 -endi -if $data2_3 != 1 then - goto show3 -endi -if $data2_4 != 1 then - goto show3 -endi - -print ========== step4 -sql drop dnode $hostname3 - -$x = 0 -show4: - $x = $x + 1 - sleep 2000 - if $x == 10 then - return -1 - endi - -sql show dnodes -print dnode1 openVnodes $data2_1 -print dnode2 openVnodes $data2_2 -print dnode3 openVnodes $data2_3 -print dnode4 openVnodes $data2_4 -if $data2_1 != 1 then - goto show4 -endi -if $data2_2 != null then - goto show4 -endi -if $data2_3 != null then - goto show4 -endi -if $data2_4 != 1 then - goto show4 -endi - -print ========== step5 -sql select * from d1.t1 order by t desc -print $data01 $data11 $data21 $data31 $data41 -if $data01 != 11 then - return -1 -endi -if $data11 != 12 then - return -1 -endi -if $data21 != 13 then - return -1 -endi -if $data31 != 14 then - return -1 -endi -if $data41 != 15 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 -system sh/exec.sh -n dnode4 -s stop -x SIGINT diff --git a/tests/script/unique/dnode/testSuite.sim b/tests/script/unique/dnode/testSuite.sim deleted file mode 100644 index ecd43cc224..0000000000 --- a/tests/script/unique/dnode/testSuite.sim +++ /dev/null @@ -1,9 +0,0 @@ -run unique/dnode/balance1.sim -run unique/dnode/balance2.sim -run unique/dnode/balance3.sim -run unique/dnode/balancex.sim -run unique/dnode/offline1.sim -run unique/dnode/offline2.sim -run unique/dnode/remove1.sim -run unique/dnode/remove2.sim -run unique/dnode/vnode_clean.sim diff --git a/tests/script/windows/alter/metrics.sim b/tests/script/windows/alter/metrics.sim deleted file mode 100644 index 7dfda05bd0..0000000000 --- a/tests/script/windows/alter/metrics.sim +++ /dev/null @@ -1,769 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -print ======== step1 -sql create database d2 -sql use d2 -sql create table mt (ts timestamp, a int) TAGS (t int) -sql create table tb using mt tags (1) -sql insert into tb values(now-28d, -28) -sql insert into tb values(now-27d, -27) -sql insert into tb values(now-26d, -26) -sql select * from tb -if $rows != 3 then - return -1 -endi -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != t then - return -1 -endi -if $data21 != INT then - return -1 -endi - -print ======== step2 -sql alter table mt add column b smallint -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != t then - return -1 -endi -if $data31 != INT then - return -1 -endi - -print ======== step3 -sql alter table mt add column c tinyint -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != t then - return -1 -endi -if $data41 != INT then - return -1 -endi - -print ======== step4 -sql alter table mt add column d int -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != t then - return -1 -endi -if $data51 != INT then - return -1 -endi - -print ======== step5 -sql alter table mt add column e bigint -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != t then - return -1 -endi -if $data61 != INT then - return -1 -endi - -print ======== step6 -sql alter table mt add column f float -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi -if $data70 != t then - return -1 -endi -if $data71 != INT then - return -1 -endi - -print ======== step7 -sql alter table mt add column g double -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi -if $data70 != g then - return -1 -endi -if $data71 != DOUBLE then - return -1 -endi -if $data80 != t then - return -1 -endi -if $data81 != INT then - return -1 -endi - -print ======== step8 -sql alter table mt add column h binary(10) -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi -if $data70 != g then - return -1 -endi -if $data71 != DOUBLE then - return -1 -endi -if $data80 != h then - return -1 -endi -if $data81 != BINARY then - return -1 -endi -if $data82 != 10 then - return -1 -endi -if $data90 != t then - return -1 -endi -if $data91 != INT then - return -1 -endi - -print ======== step9 -print ======== step10 -system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 3000 -system sh/exec.sh -n dnode1 -s start -sleep 3000 - -sql use d2 -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi -if $data70 != g then - return -1 -endi -if $data71 != DOUBLE then - return -1 -endi -if $data80 != h then - return -1 -endi -if $data81 != BINARY then - return -1 -endi -if $data82 != 10 then - return -1 -endi -if $data90 != t then - return -1 -endi -if $data91 != INT then - return -1 -endi - -print ======== step11 -#sql alter table mt drop column a -x step111 -# return -1 -#step111: - -#sql alter table mt drop column ts -x step112 -# return -1 -#step112: - -#sql alter table mt drop column cdfg -x step113 -# return -1 -#step113: - -#sql alter table mt add column a -x step114 -# return -1 -#step114: - -#sql alter table mt add column b -x step115 -# return -1 -#step115: - -print ======== step12 -sql alter table mt drop column b -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != c then - return -1 -endi -if $data21 != TINYINT then - return -1 -endi -if $data30 != d then - return -1 -endi -if $data31 != INT then - return -1 -endi -if $data40 != e then - return -1 -endi -if $data41 != BIGINT then - return -1 -endi -if $data50 != f then - return -1 -endi -if $data51 != FLOAT then - return -1 -endi -if $data60 != g then - return -1 -endi -if $data61 != DOUBLE then - return -1 -endi -if $data70 != h then - return -1 -endi -if $data71 != BINARY then - return -1 -endi -if $data72 != 10 then - return -1 -endi -if $data80 != t then - return -1 -endi -if $data81 != INT then - return -1 -endi - -print ======== step13 -sql alter table mt drop column c -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != d then - return -1 -endi -if $data21 != INT then - return -1 -endi -if $data30 != e then - return -1 -endi -if $data31 != BIGINT then - return -1 -endi -if $data40 != f then - return -1 -endi -if $data41 != FLOAT then - return -1 -endi -if $data50 != g then - return -1 -endi -if $data51 != DOUBLE then - return -1 -endi -if $data60 != h then - return -1 -endi -if $data61 != BINARY then - return -1 -endi -if $data62 != 10 then - return -1 -endi -if $data70 != t then - return -1 -endi -if $data71 != INT then - return -1 -endi - -print ======== step14 -sql alter table mt drop column d -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != e then - return -1 -endi -if $data21 != BIGINT then - return -1 -endi -if $data30 != f then - return -1 -endi -if $data31 != FLOAT then - return -1 -endi -if $data40 != g then - return -1 -endi -if $data41 != DOUBLE then - return -1 -endi -if $data50 != h then - return -1 -endi -if $data51 != BINARY then - return -1 -endi -if $data52 != 10 then - return -1 -endi -if $data60 != t then - return -1 -endi -if $data61 != INT then - return -1 -endi - -print ======== step15 -sql alter table mt drop column e -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != f then - return -1 -endi -if $data21 != FLOAT then - return -1 -endi -if $data30 != g then - return -1 -endi -if $data31 != DOUBLE then - return -1 -endi -if $data40 != h then - return -1 -endi -if $data41 != BINARY then - return -1 -endi -if $data42 != 10 then - return -1 -endi -if $data50 != t then - return -1 -endi -if $data51 != INT then - return -1 -endi - -print ======== step16 -sql alter table mt drop column f -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != g then - return -1 -endi -if $data21 != DOUBLE then - return -1 -endi -if $data30 != h then - return -1 -endi -if $data31 != BINARY then - return -1 -endi -if $data32 != 10 then - return -1 -endi -if $data40 != t then - return -1 -endi -if $data41 != INT then - return -1 -endi - -print ======== step17 -sql alter table mt drop column g -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != h then - return -1 -endi -if $data21 != BINARY then - return -1 -endi -if $data22 != 10 then - return -1 -endi -if $data30 != t then - return -1 -endi -if $data31 != INT then - return -1 -endi - -print ============= step18 -sql alter table mt drop column h -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != t then - return -1 -endi -if $data21 != INT then - return -1 -endi -if $data30 != null then - return -1 -endi - -print ======= over -sql drop database d2 -sql show databases -if $rows != 0 then - return -1 -endi - diff --git a/tests/script/windows/alter/table.sim b/tests/script/windows/alter/table.sim deleted file mode 100644 index 52757da20e..0000000000 --- a/tests/script/windows/alter/table.sim +++ /dev/null @@ -1,672 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -print ======== step1 -sql create database d1 -sql use d1 -sql create table tb (ts timestamp, a int) -sql insert into tb values(now-28d, -28) -sql insert into tb values(now-27d, -27) -sql insert into tb values(now-26d, -26) -sql select * from tb -if $rows != 3 then - return -1 -endi -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi - -print ======== step2 -sql alter table tb add column b smallint -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi - -print ======== step3 -sql alter table tb add column c tinyint -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi - -print ======== step4 -sql alter table tb add column d int -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi - -print ======== step5 -sql alter table tb add column e bigint -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi - -print ======== step6 -sql alter table tb add column f float -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi - -print ======== step7 -sql alter table tb add column g double -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi -if $data70 != g then - return -1 -endi -if $data71 != DOUBLE then - return -1 -endi - -print ======== step8 -sql alter table tb add column h binary(10) -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi -if $data70 != g then - return -1 -endi -if $data71 != DOUBLE then - return -1 -endi -if $data80 != h then - return -1 -endi -if $data81 != BINARY then - return -1 -endi -if $data82 != 10 then - return -1 -endi - -print ======== step9 -print ======== step10 -system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 3000 -system sh/exec.sh -n dnode1 -s start -sleep 3000 - -sql use d1 -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != b then - return -1 -endi -if $data21 != SMALLINT then - return -1 -endi -if $data30 != c then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data40 != d then - return -1 -endi -if $data41 != INT then - return -1 -endi -if $data50 != e then - return -1 -endi -if $data51 != BIGINT then - return -1 -endi -if $data60 != f then - return -1 -endi -if $data61 != FLOAT then - return -1 -endi -if $data70 != g then - return -1 -endi -if $data71 != DOUBLE then - return -1 -endi -if $data80 != h then - return -1 -endi -if $data81 != BINARY then - return -1 -endi -if $data82 != 10 then - return -1 -endi - -print ======== step11 -sql alter table drop column a -x step111 - return -1 -step111: - -sql alter table drop column ts -x step112 - return -1 -step112: - -sql alter table drop column cdfg -x step113 - return -1 -step113: - -sql alter table add column a -x step114 - return -1 -step114: - -sql alter table add column b -x step115 - return -1 -step115: - -print ======== step12 -sql alter table tb drop column b -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != c then - return -1 -endi -if $data21 != TINYINT then - return -1 -endi -if $data30 != d then - return -1 -endi -if $data31 != INT then - return -1 -endi -if $data40 != e then - return -1 -endi -if $data41 != BIGINT then - return -1 -endi -if $data50 != f then - return -1 -endi -if $data51 != FLOAT then - return -1 -endi -if $data60 != g then - return -1 -endi -if $data61 != DOUBLE then - return -1 -endi -if $data70 != h then - return -1 -endi -if $data71 != BINARY then - return -1 -endi -if $data72 != 10 then - return -1 -endi - -print ======== step13 -sql alter table tb drop column c -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != d then - return -1 -endi -if $data21 != INT then - return -1 -endi -if $data30 != e then - return -1 -endi -if $data31 != BIGINT then - return -1 -endi -if $data40 != f then - return -1 -endi -if $data41 != FLOAT then - return -1 -endi -if $data50 != g then - return -1 -endi -if $data51 != DOUBLE then - return -1 -endi -if $data60 != h then - return -1 -endi -if $data61 != BINARY then - return -1 -endi -if $data62 != 10 then - return -1 -endi - -print ======== step14 -sql alter table tb drop column d -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != e then - return -1 -endi -if $data21 != BIGINT then - return -1 -endi -if $data30 != f then - return -1 -endi -if $data31 != FLOAT then - return -1 -endi -if $data40 != g then - return -1 -endi -if $data41 != DOUBLE then - return -1 -endi -if $data50 != h then - return -1 -endi -if $data51 != BINARY then - return -1 -endi -if $data52 != 10 then - return -1 -endi - -print ======== step15 -sql alter table tb drop column e -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != f then - return -1 -endi -if $data21 != FLOAT then - return -1 -endi -if $data30 != g then - return -1 -endi -if $data31 != DOUBLE then - return -1 -endi -if $data40 != h then - return -1 -endi -if $data41 != BINARY then - return -1 -endi -if $data42 != 10 then - return -1 -endi - -print ======== step16 -sql alter table tb drop column f -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != g then - return -1 -endi -if $data21 != DOUBLE then - return -1 -endi -if $data30 != h then - return -1 -endi -if $data31 != BINARY then - return -1 -endi -if $data32 != 10 then - return -1 -endi - -print ======== step17 -sql alter table tb drop column g -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != h then - return -1 -endi -if $data21 != BINARY then - return -1 -endi -if $data22 != 10 then - return -1 -endi - -print ============= step18 -sql alter table tb drop column h -sql describe tb -if $data00 != ts then - return -1 -endi -if $data01 != TIMESTAMP then - return -1 -endi -if $data10 != a then - return -1 -endi -if $data11 != INT then - return -1 -endi -if $data20 != null then - return -1 -endi - -print ======= over -sql drop database d1 -sql show databases -if $rows != 0 then - return -1 -endi - diff --git a/tests/script/windows/compute/avg.sim b/tests/script/windows/compute/avg.sim deleted file mode 100644 index 7445808db5..0000000000 --- a/tests/script/windows/compute/avg.sim +++ /dev/null @@ -1,158 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_av_db -$tbPrefix = m_av_tb -$mtPrefix = m_av_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select avg(tbcol) from $tb -print ===> $data00 -if $data00 != 9.500000000 then - return -1 -endi - -print =============== step3 -sql select avg(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -print =============== step4 -sql select avg(tbcol) as b from $tb -print ===> $data00 -if $data00 != 9.500000000 then - return -1 -endi - -print =============== step5 -sql select avg(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data11 != 1.000000000 then - return -1 -endi - -sql select avg(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 9.500000000 then - return -1 -endi - -print =============== step6 -sql select avg(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data01 -if $data41 != 4.000000000 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select avg(tbcol) from $mt -print ===> $data00 -if $data00 != 9.500000000 then - return -1 -endi - -print =============== step8 -sql select avg(tbcol) as c from $mt where ts < now + 4m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select avg(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 9.500000000 then - return -1 -endi - -sql select avg(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -print =============== step9 -sql select avg(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1.000000000 then - return -1 -endi - -sql select avg(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 9.500000000 then - return -1 -endi - -print =============== step10 -sql select avg(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != 9.500000000 then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select avg(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1.000000000 then - return -1 -endi -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/bottom.sim b/tests/script/windows/compute/bottom.sim deleted file mode 100644 index 18f6c0bd09..0000000000 --- a/tests/script/windows/compute/bottom.sim +++ /dev/null @@ -1,99 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_bo_db -$tbPrefix = m_bo_tb -$mtPrefix = m_bo_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $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 - return -1 -endi - -print =============== step3 -sql select bottom(tbcol, 1) from $tb where ts > now + 4m -print ===> $data01 -if $data01 != 5 then - return -1 -endi - -print =============== step4 -sql select bottom(tbcol, 1) as b from $tb -print ===> $data01 -if $data01 != 0 then - return -1 -endi - -print =============== step5 -sql select bottom(tbcol, 2) as b from $tb -print ===> $data01 $data11 -if $data01 != 0 then - return -1 -endi -if $data11 != 1 then - return -1 -endi - -print =============== step6 -sql select bottom(tbcol, 2) as b from $tb where ts > now + 4m -print ===> $data01 $data11 -if $data01 != 5 then - return -1 -endi -if $data11 != 6 then - return -1 -endi - -sql select bottom(tbcol, 122) as b from $tb -x step6 - return -1 -step6: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/count.sim b/tests/script/windows/compute/count.sim deleted file mode 100644 index 227b49a8bd..0000000000 --- a/tests/script/windows/compute/count.sim +++ /dev/null @@ -1,174 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_co_db -$tbPrefix = m_co_tb -$mtPrefix = m_co_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $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 - return -1 -endi - -sql select count(tbcol) from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -print =============== step3 -sql select count(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol) as b from $tb -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -print =============== step5 -sql select count(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 1 then - return -1 -endi - -sql select count(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != $rowNum then - return -1 -endi - -print =============== step6 -sql select count(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select count(*) from $mt -print ===> $data00 -if $data00 != $totalNum then - return -1 -endi - -sql select count(tbcol) from $mt -print ===> $data00 -if $data00 != $totalNum then - return -1 -endi - -print =============== step8 -sql select count(tbcol) as c from $mt where ts < now + 4m -print ===> $data00 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m -print ===> $data00 -if $data00 != 25 then - return -1 -endi - -print =============== step9 -sql select count(tbcol) as b from $mt interval(1m) -print ===> $data01 -if $data01 != 10 then - return -1 -endi -if $data11 != 10 then - return -1 -endi - -sql select count(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 200 then - return -1 -endi - -print =============== step10 -sql select count(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != $rowNum then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select count(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol -print ===> $data01 -if $data01 != 1 then - return -1 -endi -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/diff.sim b/tests/script/windows/compute/diff.sim deleted file mode 100644 index bdc5a0e3d8..0000000000 --- a/tests/script/windows/compute/diff.sim +++ /dev/null @@ -1,91 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_di_db -$tbPrefix = m_di_tb -$mtPrefix = m_di_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $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 - return -1 -endi - -print =============== step3 -sql select diff(tbcol) from $tb where ts > now + 4m -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select diff(tbcol) from $tb where ts < now + 4m -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -print =============== step4 -sql select diff(tbcol) as b from $tb -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -print =============== step5 -sql select diff(tbcol) as b from $tb interval(1m) -x step5 - return -1 -step5: - -print =============== step6 -sql select diff(tbcol) as b from $tb where ts < now + 4m interval(1m) -x step6 - return -1 -step6: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/first.sim b/tests/script/windows/compute/first.sim deleted file mode 100644 index a83939c2a6..0000000000 --- a/tests/script/windows/compute/first.sim +++ /dev/null @@ -1,160 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_fi_db -$tbPrefix = m_fi_tb -$mtPrefix = m_fi_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select first(tbcol) from $tb -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step3 -sql select first(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step4 -sql select first(tbcol) as b from $tb -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step5 -sql select first(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 0 then - return -1 -endi - -sql select first(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 0 then - return -1 -endi - -print =============== step6 -sql select first(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data01 -if $data41 != 4 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select first(tbcol) from $mt -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step8 -sql select first(tbcol) as c from $mt where ts < now + 4m -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -sql select first(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -sql select first(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m -print ===> $data00 -if $data00 != 0 then - return -1 -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 - return -1 -endi - -sql select first(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 0 then - return -1 -endi - -print =============== step10 -sql select first(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select first(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then - return -1 -endi -print ===> $rows -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/interval.sim b/tests/script/windows/compute/interval.sim deleted file mode 100644 index feacce1606..0000000000 --- a/tests/script/windows/compute/interval.sim +++ /dev/null @@ -1,176 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_in_db -$tbPrefix = m_in_tb -$mtPrefix = m_in_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb interval(1m) -print ===> $rows -if $rows < $rowNum then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data05 != 1 then - return -1 -endi - -print =============== step3 -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now + 4m interval(1m) -print ===> $rows -if $rows > 10 then - return -1 -endi -if $rows < 3 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data05 != 1 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now-1m interval(1m) -print ===> $rows -if $rows < 18 then - return -1 -endi -if $rows > 22 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data05 != 1 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now+1m interval(1m) fill(value,0) -print ===> $rows -if $rows < 30 then - return -1 -endi -if $rows > 50 then - return -1 -endi -if $data21 != 1 then - return -1 -endi -if $data25 != 1 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt interval(1m) -print ===> $rows -if $rows < 18 then - return -1 -endi -if $rows > 22 then - return -1 -endi -if $data11 > 15 then - return -1 -endi -if $data11 < 5 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now + 4m interval(1m) -print ===> $rows -if $rows < 3 then - return -1 -endi -if $rows > 7 then - return -1 -endi -if $data11 > 15 then - return -1 -endi -if $data11 < 5 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now-1m interval(1m) -print ===> $rows -if $rows < 18 then - return -1 -endi -if $rows > 22 then - return -1 -endi -if $data11 > 15 then - return -1 -endi -if $data11 < 5 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now+1m interval(1m) fill(value, 0) -if $rows < 30 then - return -1 -endi -if $rows > 50 then - return -1 -endi -if $data11 > 15 then - return -1 -endi -if $data11 < 5 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/last.sim b/tests/script/windows/compute/last.sim deleted file mode 100644 index 379a5ae64a..0000000000 --- a/tests/script/windows/compute/last.sim +++ /dev/null @@ -1,159 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_la_db -$tbPrefix = m_la_tb -$mtPrefix = m_la_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select last(tbcol) from $tb -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -print =============== step3 -sql select last(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 4 then - return -1 -endi - -print =============== step4 -sql select last(tbcol) as b from $tb -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -print =============== step5 -sql select last(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select last(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 19 then - return -1 -endi - -print =============== step6 -sql select last(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select last(tbcol) from $mt -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -print =============== step8 -sql select last(tbcol) as c from $mt where ts < now + 4m -print ===> $data00 -if $data00 != 4 then - return -1 -endi - -sql select last(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -sql select last(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m -print ===> $data00 -if $data00 != 4 then - return -1 -endi - -print =============== step9 -sql select last(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select last(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 19 then - return -1 -endi - -print =============== step10 -sql select last(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select last(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then - return -1 -endi -print ===> $rows -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/leastsquare.sim b/tests/script/windows/compute/leastsquare.sim deleted file mode 100644 index 20353a409e..0000000000 --- a/tests/script/windows/compute/leastsquare.sim +++ /dev/null @@ -1,102 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_le_db -$tbPrefix = m_le_tb -$mtPrefix = m_le_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db keep 36500 -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 2 - $ms = 1000 - while $x < $rowNum - $ms = $ms + 1000 - sql insert into $tb values ($ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select leastsquares(tbcol, 1, 1) from $tb -print ===> $data00 -if $data00 != @{slop:1.000000, intercept:1.000000}@ then - return -1 -endi - -print =============== step3 -sql select leastsquares(tbcol, 1, 1) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != @{slop:1.000000, intercept:1.000000}@ then - return -1 -endi - -print =============== step4 -sql select leastsquares(tbcol, 1, 1) as b from $tb -print ===> $data00 -if $data00 != @{slop:1.000000, intercept:1.000000}@ then - return -1 -endi - -print =============== step5 -print select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) -sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m) -print ===> $data01 -if $data01 != @{slop:1.000000, intercept:1.000000}@ then - return -1 -endi - -print select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) -sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d) -print ===> $data01 -if $data01 != @{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 - return -1 -endi -print ===> $rows -if $rows != 1 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/compute/max.sim b/tests/script/windows/compute/max.sim deleted file mode 100644 index 641b31fe36..0000000000 --- a/tests/script/windows/compute/max.sim +++ /dev/null @@ -1,159 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_ma_db -$tbPrefix = m_ma_tb -$mtPrefix = m_ma_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select max(tbcol) from $tb -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -print =============== step3 -sql select max(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 4 then - return -1 -endi - -print =============== step4 -sql select max(tbcol) as b from $tb -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -print =============== step5 -sql select max(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select max(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 19 then - return -1 -endi - -print =============== step6 -sql select max(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select max(tbcol) from $mt -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -print =============== step8 -sql select max(tbcol) as c from $mt where ts < now + 4m -print ===> $data00 -if $data00 != 4 then - return -1 -endi - -sql select max(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -sql select max(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m -print ===> $data00 -if $data00 != 4 then - return -1 -endi - -print =============== step9 -sql select max(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select max(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 19 then - return -1 -endi - -print =============== step10 -sql select max(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != 19 then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select max(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then - return -1 -endi -print ===> $rows -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/min.sim b/tests/script/windows/compute/min.sim deleted file mode 100644 index 3528f573ce..0000000000 --- a/tests/script/windows/compute/min.sim +++ /dev/null @@ -1,159 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_mi_db -$tbPrefix = m_mi_tb -$mtPrefix = m_mi_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select min(tbcol) from $tb -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step3 -sql select min(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step4 -sql select min(tbcol) as b from $tb -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step5 -sql select min(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select min(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 0 then - return -1 -endi - -print =============== step6 -sql select min(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select min(tbcol) from $mt -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step8 -sql select min(tbcol) as c from $mt where ts < now + 4m -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -sql select min(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -sql select min(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -print =============== step9 -sql select min(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select min(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 0 then - return -1 -endi - -print =============== step10 -sql select min(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != 0 then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select min(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol -print ===> $data11 -if $data11 != 1 then - return -1 -endi -print ===> $rows -if $rows != 50 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/percentile.sim b/tests/script/windows/compute/percentile.sim deleted file mode 100644 index fa6212f013..0000000000 --- a/tests/script/windows/compute/percentile.sim +++ /dev/null @@ -1,116 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_pe_db -$tbPrefix = m_pe_tb -$mtPrefix = m_pe_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select percentile(tbcol, 10) from $tb -print ===> $data00 -if $data00 != 1.900000000 then - return -1 -endi - -sql select percentile(tbcol, 20) from $tb -print ===> $data00 -if $data00 != 3.800000000 then - return -1 -endi - -sql select percentile(tbcol, 100) from $tb -print ===> $data00 -if $data00 != 19.000000000 then - return -1 -endi - -sql select percentile(tbcol, 110) from $tb -x step2 - return -1 -step2: - -print =============== step3 -sql select percentile(tbcol, 1) from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 5.140000000 then - return -1 -endi - -sql select percentile(tbcol, 5) from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 5.700000000 then - return -1 -endi - -sql select percentile(tbcol, 0) from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -print =============== step4 -sql select percentile(tbcol, 1) as c from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 5.140000000 then - return -1 -endi - -sql select percentile(tbcol, 5) as c from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 5.700000000 then - return -1 -endi - -sql select percentile(tbcol, 0) as c from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/stddev.sim b/tests/script/windows/compute/stddev.sim deleted file mode 100644 index eea6c8aa05..0000000000 --- a/tests/script/windows/compute/stddev.sim +++ /dev/null @@ -1,98 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_st_db -$tbPrefix = m_st_tb -$mtPrefix = m_st_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select stddev(tbcol) from $tb -print ===> $data00 -if $data00 != 5.766281297 then - return -1 -endi - -print =============== step3 -sql select stddev(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 1.414213562 then - return -1 -endi - -print =============== step4 -sql select stddev(tbcol) as b from $tb -print ===> $data00 -if $data00 != 5.766281297 then - return -1 -endi - -print =============== step5 -sql select stddev(tbcol) as b from $tb interval(1m) -print ===> $data01 -if $data01 != 0.000000000 then - return -1 -endi - -sql select stddev(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 5.766281297 then - return -1 -endi - -print =============== step6 -sql select stddev(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data01 -if $data01 != 0.000000000 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/sum.sim b/tests/script/windows/compute/sum.sim deleted file mode 100644 index a429ce99e0..0000000000 --- a/tests/script/windows/compute/sum.sim +++ /dev/null @@ -1,159 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_su_db -$tbPrefix = m_su_tb -$mtPrefix = m_su_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select sum(tbcol) from $tb -print ===> $data00 -if $data00 != 190 then - return -1 -endi - -print =============== step3 -sql select sum(tbcol) from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 10 then - return -1 -endi - -print =============== step4 -sql select sum(tbcol) as b from $tb -print ===> $data00 -if $data00 != 190 then - return -1 -endi - -print =============== step5 -sql select sum(tbcol) as b from $tb interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi - -sql select sum(tbcol) as b from $tb interval(1d) -print ===> $data01 -if $data01 != 190 then - return -1 -endi - -print =============== step6 -sql select sum(tbcol) as b from $tb where ts < now + 4m interval(1m) -print ===> $data11 -if $data11 != 1 then - return -1 -endi -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select sum(tbcol) from $mt -print ===> $data00 -if $data00 != 1900 then - return -1 -endi - -print =============== step8 -sql select sum(tbcol) as c from $mt where ts < now + 4m -print ===> $data00 -if $data00 != 100 then - return -1 -endi - -sql select sum(tbcol) as c from $mt where tgcol < 5 -print ===> $data00 -if $data00 != 950 then - return -1 -endi - -sql select sum(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m -print ===> $data00 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select sum(tbcol) as b from $mt interval(1m) -print ===> $data11 -if $data11 < 5 then - return -1 -endi - -sql select sum(tbcol) as b from $mt interval(1d) -print ===> $data01 -if $data01 != 1900 then - return -1 -endi - -print =============== step10 -sql select sum(tbcol) as b from $mt group by tgcol -print ===> $data00 -if $data00 != 190 then - return -1 -endi - -if $rows != $tbNum then - return -1 -endi - -print =============== step11 -sql select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol -print select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol -print ===> $data01 -if $data01 != 10 then - return -1 -endi -if $rows != 10 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/compute/top.sim b/tests/script/windows/compute/top.sim deleted file mode 100644 index 65e448b0fa..0000000000 --- a/tests/script/windows/compute/top.sim +++ /dev/null @@ -1,99 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_to_db -$tbPrefix = m_to_tb -$mtPrefix = m_to_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select top(tbcol, 1) from $tb -print ===> $data01 -if $data01 != 19 then - return -1 -endi - -print =============== step3 -sql select top(tbcol, 1) from $tb where ts < now + 4m -print ===> $data01 -if $data01 != 4 then - return -1 -endi - -print =============== step4 -sql select top(tbcol, 1) as b from $tb -print ===> $data01 -if $data01 != 19 then - return -1 -endi - -print =============== step5 -sql select top(tbcol, 2) as b from $tb -print ===> $data01 $data11 -if $data01 != 18 then - return -1 -endi -if $data11 != 19 then - return -1 -endi - -print =============== step6 -sql select top(tbcol, 2) as b from $tb where ts < now + 4m -print ===> $data01 $data11 -if $data01 != 3 then - return -1 -endi -if $data11 != 4 then - return -1 -endi - -sql select top(tbcol, 122) as b from $tb -x step6 - return -1 -step6: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/db/basic.sim b/tests/script/windows/db/basic.sim deleted file mode 100644 index 1f0fc31a6b..0000000000 --- a/tests/script/windows/db/basic.sim +++ /dev/null @@ -1,193 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -print ============================ dnode1 start - -$i = 0 -$dbPrefix = ob_db_db -$tbPrefix = ob_db_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db replica 1 duration 20 keep 2000 cache 16 -sql show databases -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 -if $data00 != $db then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0 then - return -1 -endi -if $data04 != 1 then - return -1 -endi -if $data06 != 20 then - return -1 -endi -if $data08 != 16 then - return -1 -endi - -print =============== step2 -sql create database $db -sql show databases -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step4 -sql_error drop database $db - -print =============== step5 -sql create database $db replica 1 duration 15 keep 1500 -sql show databases -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 -if $data00 != $db then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0 then - return -1 -endi -if $data04 != 1 then - return -1 -endi -if $data06 != 15 then - return -1 -endi - -print =============== step6 -sql use $db -sql create table $tb (ts timestamp, speed int) -$i = 1 -while $i < 4 - $db = $dbPrefix . $i - $tb = $tbPrefix . $i - sql create database $db - sql use $db - sql create table $tb (ts timestamp, speed int) - $i = $i + 1 -endw - -sql show databases -if $rows != 4 then - return -1 -endi - -$i = 4 -$db = $dbPrefix . $i -$tb = $tbPrefix . $i -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed int) - -print =============== step7 -$i = 0 -while $i < 5 - $db = $dbPrefix . $i - sql drop database $db - $i = $i + 1 -endw - -print =============== step8 -$i = 0 -$db = $dbPrefix . $i -$tb = $tbPrefix . $i -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed int) -sql show tables -if $rows != 1 then - return -1 -endi - -print =============== step9 -sql drop database $db - -print =============== step10 -sql create database $db -sql use $db -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step11 -sql create table $tb (ts timestamp, speed int) -sql show tables -if $rows != 1 then - return -1 -endi - -print =============== step12 -sql drop database $db - -print =============== step13 -sql create database $db -sql use $db -sql show tables -if $rows != 0 then - return -1 -endi -sql create table $tb (ts timestamp, speed int) -sql show tables -if $rows != 1 then - return -1 -endi -sql insert into $tb values (now+1a, 0) -sql insert into $tb values (now+2a, 1) -sql insert into $tb values (now+3a, 2) -sql insert into $tb values (now+4a, 3) -sql insert into $tb values (now+5a, 4) -sql select * from $tb -if $rows != 5 then - return -1 -endi - -print =============== step14 -sql drop database $db - -print =============== step15 -sql create database $db -sql use $db -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step16 -sql create table $tb (ts timestamp, speed int) -sql show tables -if $rows != 1 then - return -1 -endi -sql select * from $tb -if $rows != 0 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/db/len.sim b/tests/script/windows/db/len.sim deleted file mode 100644 index 3356165117..0000000000 --- a/tests/script/windows/db/len.sim +++ /dev/null @@ -1,92 +0,0 @@ -sleep 2000 -sql connect - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -print =============== step1 -sql_error drop database dd - -sql create database -x step1 - return -1 -step1: - -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step2 -sql create database a -sql show databases -if $rows != 1 then - return -1 -endi - -sql drop database a -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step3 -sql create database a12345678 -sql show databases -if $rows != 1 then - return -1 -endi - -sql drop database a12345678 -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step4 -sql create database a012345678901201234567890120123456789012a012345678901201234567890120123456789012 -x step4 - return -1 -step4: -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step5 -sql create database a;1 -sql drop database a -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step6 -sql create database a'1 -x step6 - return -1 -step6: - -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step7 -sql create database (a) -x step7 - return -1 -step7: -sql show databases -if $rows != 0 then - return -1 -endi - -print =============== step8 -sql create database a.1 -x step8 - return -1 -step8: -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/2.sim b/tests/script/windows/field/2.sim deleted file mode 100644 index e258fbe80e..0000000000 --- a/tests/script/windows/field/2.sim +++ /dev/null @@ -1,295 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_bt_db -$tbPrefix = fi_bt_tb -$mtPrefix = fi_bt_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol2 bool, tbcol int) TAGS(tgcol bool, tgcol2 int) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0, 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1, 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tbcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where ts > now + 4m and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tbcol = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tbcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tbcol = 1 and tbcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 where tbcol2 = 1 interval(1d) group by tgcol order by tgcol desc -print $db -print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 interval(1d) group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/3.sim b/tests/script/windows/field/3.sim deleted file mode 100644 index e3fe0b0b11..0000000000 --- a/tests/script/windows/field/3.sim +++ /dev/null @@ -1,521 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_3_db -$tbPrefix = fi_3_tb -$mtPrefix = fi_3_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 int, tbcol3 float) TAGS(tgcol1 smallint, tgcol2 int, tgcol3 float) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0, 0, 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1, 1, 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tbcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tbcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step14 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step15 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step16 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step17 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step18 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step19 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/4.sim b/tests/script/windows/field/4.sim deleted file mode 100644 index aabfe2be2c..0000000000 --- a/tests/script/windows/field/4.sim +++ /dev/null @@ -1,711 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_4_db -$tbPrefix = fi_4_tb -$mtPrefix = fi_4_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 bigint, tbcol3 float, tbcol4 double) TAGS(tgcol1 smallint, tgcol2 bigint, tgcol3 float, tgcol4 double) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0, 0, 0, 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1, 1, 1, 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tbcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tbcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where tbcol4 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step14 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step15 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step16 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step17 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step18 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step19 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step20 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step21 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step22 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step23 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step24 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/5.sim b/tests/script/windows/field/5.sim deleted file mode 100644 index 874730ff1c..0000000000 --- a/tests/script/windows/field/5.sim +++ /dev/null @@ -1,834 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_5_db -$tbPrefix = fi_5_tb -$mtPrefix = fi_5_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol1 tinyint, tbcol2 int, tbcol3 bigint, tbcol4 double, tbcol5 smallint) TAGS(tgcol1 tinyint, tgcol2 int, tgcol3 bigint, tgcol4 double, tgcol5 smallint) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0, 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0, 0, 0, 0, 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1, 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1, 1, 1, 1, 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tbcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tbcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where tbcol4 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step7 -sql select * from $mt where tbcol5 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol5 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol5 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol5 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step8 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tbcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step14 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step15 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step16 -sql select * from $mt where ts > now + 4m and tbcol5 = 1 and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 1 and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step17 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step18 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step19 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step20 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 and tbcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 and tbcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step21 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step22 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step23 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step24 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol5 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step25 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step26 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - - -print =============== step27 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 interval(1d) group by tgcol5 order by tgcol5 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/6.sim b/tests/script/windows/field/6.sim deleted file mode 100644 index 77277df35b..0000000000 --- a/tests/script/windows/field/6.sim +++ /dev/null @@ -1,989 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_6_db -$tbPrefix = fi_6_tb -$mtPrefix = fi_6_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 bigint, tbcol3 smallint, tbcol4 bigint, tbcol5 float, tbcol6 bool) TAGS(tgcol1 smallint, tgcol2 bigint, tgcol3 smallint, tgcol4 bigint, tgcol5 float, tgcol6 bool) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0, 0, 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0, 0, 0, 0, 0, 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1, 1, 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1, 1, 1, 1, 1, 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol1 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tbcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tbcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where tbcol4 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol4 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step7 -sql select * from $mt where tbcol5 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol5 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol5 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol5 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step8 -sql select * from $mt where tbcol6 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol6 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol6 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol6 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select * from $mt where ts > now + 4m and tbcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step14 -sql select * from $mt where ts > now + 4m and tbcol6 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol6 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol6 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol6 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step15 -sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step16 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step17 -sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step18 -sql select * from $mt where ts > now + 4m and tbcol5 = 1 and tbcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 1 and tbcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 = 0 and tbcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 and tbcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m and ts < now + 5m and tbcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step19 -sql select * from $mt where ts > now + 4m and tbcol5 = 1 and tbcol6 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 1 and tbcol6 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 = 0 and tbcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol5 <> 0 and tbcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 = 0 and tbcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol5 <> 0 and tbcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol5 <> 0 and tbcol6 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol5 <> 0 and ts < now + 5m and ts < now + 5m and tbcol6 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step20 -sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step21 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step22 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step23 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 and tbcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 and tbcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step24 -sql select * from $mt where ts > now + 4m and tbcol4 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol1 = 1 and tbcol5 = 1 and tbcol6 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 1 and tbcol2 <> 1 and tbcol3 <> 1 and tbcol1 <> 1 and tbcol5 <> 1 and tbcol6 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 and tbcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 = 0 and tbcol2 = 0 and tbcol3 = 0 and tbcol1 = 0 and tbcol5 = 0 and tbcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol4 <> 0 and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol4 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0 and tbcol1 <> 0 and tbcol5 <> 0 and tbcol6 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step25 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step26 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step27 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step28 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol5 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol6 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step29 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step30 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step31 -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 interval(1d) group by tgcol4 order by tgcol4 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 interval(1d) group by tgcol5 order by tgcol5 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 and tbcol4 = 1 and tbcol5 = 1 and tbcol6 = 1 interval(1d) group by tgcol6 order by tgcol6 desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/bigint.sim b/tests/script/windows/field/bigint.sim deleted file mode 100644 index f912ee968b..0000000000 --- a/tests/script/windows/field/bigint.sim +++ /dev/null @@ -1,160 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_bi_db -$tbPrefix = fi_bi_tb -$mtPrefix = fi_bi_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol bigint) TAGS(tgcol bigint) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where ts > now + 4m and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/binary.sim b/tests/script/windows/field/binary.sim deleted file mode 100644 index aa641878e4..0000000000 --- a/tests/script/windows/field/binary.sim +++ /dev/null @@ -1,77 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_by_db -$tbPrefix = fi_by_tb -$mtPrefix = fi_by_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol binary(10)) TAGS(tgcol binary(10)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , '0' ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , '1' ) - $x = $x + 1 - endw - $i = $i + 1 -endw - - -print =============== step2 - -sql select * from $mt where tbcol = '0' -if $rows != 100 then - return -1 -endi - -sql select * from $mt where ts > now + 4m and tbcol = '1' -if $rows != 75 then - return -1 -endi - -print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' -sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' group by tgcol -sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol -sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' interval(1d) group by tgcol - -#can't filter binary fields - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/bool.sim b/tests/script/windows/field/bool.sim deleted file mode 100644 index 3ef56a1d95..0000000000 --- a/tests/script/windows/field/bool.sim +++ /dev/null @@ -1,161 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_bo_db -$tbPrefix = fi_bo_tb -$mtPrefix = fi_bo_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol bool) TAGS(tgcol bool) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = false -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> false -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where ts > now + 4m and tbcol = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> false and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc -print select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/double.sim b/tests/script/windows/field/double.sim deleted file mode 100644 index ef404d28dc..0000000000 --- a/tests/script/windows/field/double.sim +++ /dev/null @@ -1,160 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_do_db -$tbPrefix = fi_do_tb -$mtPrefix = fi_do_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol double) TAGS(tgcol double) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where ts > now + 4m and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/float.sim b/tests/script/windows/field/float.sim deleted file mode 100644 index 8435f31c1f..0000000000 --- a/tests/script/windows/field/float.sim +++ /dev/null @@ -1,160 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_fl_db -$tbPrefix = fi_fl_tb -$mtPrefix = fi_fl_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol float) TAGS(tgcol float) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where ts > now + 4m and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/int.sim b/tests/script/windows/field/int.sim deleted file mode 100644 index 781b939484..0000000000 --- a/tests/script/windows/field/int.sim +++ /dev/null @@ -1,160 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_in_db -$tbPrefix = fi_in_tb -$mtPrefix = fi_in_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where ts > now + 4m and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/single.sim b/tests/script/windows/field/single.sim deleted file mode 100644 index b6b4402091..0000000000 --- a/tests/script/windows/field/single.sim +++ /dev/null @@ -1,218 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_si_db -$tbPrefix = fi_si_tb -$mtPrefix = fi_si_mt -$rowNum = 20 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql create database $db -sql use $db -sql create table $tb (ts timestamp, tbcol int) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - -print =============== step2 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi - -sql select * from $tb where tbcol = 10 -if $rows != 1 then - return -1 -endi -if $data01 != 10 then - return -1 -endi - -sql select * from $tb where tbcol = 8 -if $rows != 1 then - return -1 -endi -if $data01 != 8 then - return -1 -endi - -sql select * from $tb where tbcol < 10 -if $rows != 10 then - return -1 -endi -if $data91 != 9 then - return -1 -endi - -sql select * from $tb where tbcol <= 10 -if $rows != 11 then - return -1 -endi -if $data81 != 8 then - return -1 -endi - -sql select * from $tb where tbcol > 10 -if $rows != 9 then - return -1 -endi -if $data81 != 19 then - return -1 -endi - -sql select * from $tb where tbcol > 10 order by ts asc -if $rows != 9 then - return -1 -endi -if $data01 != 11 then - return -1 -endi - -sql select * from $tb where tbcol < 10 and tbcol > 5 order by ts desc -if $rows != 4 then - return -1 -endi -if $data01 != 9 then - return -1 -endi -if $data31 != 6 then - return -1 -endi - -sql select * from $tb where tbcol < 10 and tbcol > 5 order by ts asc -if $rows != 4 then - return -1 -endi -if $data01 != 6 then - return -1 -endi -if $data31 != 9 then - return -1 -endi - -sql select * from $tb where tbcol > 10 and tbcol < 5 order by ts asc -if $rows != 0 then - return -1 -endi - -print =============== step3 -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi - -sql select * from $tb where tbcol = 10 and ts < now + 4m -print select * from $tb where tbcol = 10 and ts < now + 4m -if $rows != 0 then - return -1 -endi - -sql select * from $tb where tbcol = 4 and ts < now + 4m order by ts desc -if $rows != 1 then - return -1 -endi -if $data01 != 4 then - return -1 -endi - -sql select * from $tb where tbcol < 10 and ts < now + 4m order by ts desc -if $rows != 5 then - return -1 -endi -if $data01 != 4 then - return -1 -endi - -sql select * from $tb where tbcol < 10 and ts > now + 4m and ts < now + 5m order by ts desc -print $rows $data00 $data01 -if $rows != 1 then - return -1 -endi -if $data01 != 5 then - return -1 -endi - -print =============== step4 -sql select count(*) from $tb -if $data00 != $rowNum then - return -1 -endi - -sql select count(*) from $tb where tbcol = 10 -if $data00 != 1 then - return -1 -endi - -#sql select count(*) from $tb where tbcol = 8 or tbcol = 9 -#if $data00 != 2 then -# return -1 -#endi - -sql select count(*) from $tb where tbcol < 10 -if $data00 != 10 then - return -1 -endi - -sql select count(*) from $tb where tbcol <= 10 -if $data00 != 11 then - return -1 -endi - -sql select count(*) from $tb where tbcol < 10 and tbcol > 5 -if $data00 != 4 then - return -1 -endi - -sql select count(*) from $tb where tbcol < 10 and tbcol > 5 order by ts asc -x step4 -# return -1 -step4: - -print =============== step5 -sql select count(*) from $tb where ts < now + 4m -if $data00 != 5 then - return -1 -endi - -#sql select count(*) from $tb where tbcol = 10 and ts < now + 4m -#if $data00 != 0 then -# return -1 -#endi - -sql select count(*) from $tb where tbcol = 4 and ts < now + 4m -if $data00 != 1 then - return -1 -endi - -sql select count(*) from $tb where tbcol < 10 and ts < now + 4m -if $data00 != 5 then - return -1 -endi - -sql select count(*) from $tb where tbcol < 10 and ts > now + 4m and ts < now + 5m -if $data00 != 1 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/smallint.sim b/tests/script/windows/field/smallint.sim deleted file mode 100644 index 5f1839226b..0000000000 --- a/tests/script/windows/field/smallint.sim +++ /dev/null @@ -1,160 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_sm_db -$tbPrefix = fi_sm_tb -$mtPrefix = fi_sm_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol smallint) TAGS(tgcol smallint) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where ts > now + 4m and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/field/tinyint.sim b/tests/script/windows/field/tinyint.sim deleted file mode 100644 index c90ff3f932..0000000000 --- a/tests/script/windows/field/tinyint.sim +++ /dev/null @@ -1,160 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = fi_ti_db -$tbPrefix = fi_ti_tb -$mtPrefix = fi_ti_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol tinyint) TAGS(tgcol tinyint) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 0 ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , 1 ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tbcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step3 -sql select * from $mt where ts > now + 4m and tbcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tbcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/import/basic.sim b/tests/script/windows/import/basic.sim deleted file mode 100644 index ee19893ae2..0000000000 --- a/tests/script/windows/import/basic.sim +++ /dev/null @@ -1,125 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -sql create database ibadb -sql use ibadb -sql create table tb(ts timestamp, i int) - -print ================= step1 - -sql import into tb values(1564641710000, 10000) -sql select * from tb; -if $rows != 1 then - return -1 -endi - -print ================= step2 -sql insert into tb values(1564641708000, 8000) -sql select * from tb; -if $rows != 2 then - return -1 -endi - -print ================= step3 -sql insert into tb values(1564641720000, 20000) -sql select * from tb; -if $rows != 3 then - return -1 -endi - -print ================= step4 -sql import into tb values(1564641708000, 8000) -sql import into tb values(1564641715000, 15000) -sql import into tb values(1564641730000, 30000) -sql select * from tb; -if $rows != 5 then - return -1 -endi - -print ================= step5 -sql insert into tb values(1564641708000, 8000) -sql insert into tb values(1564641714000, 14000) -sql insert into tb values(1564641725000, 25000) -sql insert into tb values(1564641740000, 40000) -sql select * from tb; -if $rows != 8 then - return -1 -endi - -print ================= step6 -sql import into tb values(1564641707000, 7000) -sql import into tb values(1564641712000, 12000) -sql import into tb values(1564641723000, 23000) -sql import into tb values(1564641734000, 34000) -sql import into tb values(1564641750000, 50000) -sql select * from tb; -if $rows != 13 then - return -1 -endi - -print ================= step7 -sql import into tb values(1564641707001, 7001) -sql import into tb values(1564641712001, 12001) -sql import into tb values(1564641723001, 23001) -sql import into tb values(1564641734001, 34001) -sql import into tb values(1564641750001, 50001) -sql select * from tb; -if $rows != 18 then - return -1 -endi - -print ================= step8 -sql insert into tb values(1564641708002, 8002) -sql insert into tb values(1564641714002, 14002) -sql insert into tb values(1564641725002, 25002) -sql insert into tb values(1564641900000, 200000) -sql select * from tb; -if $rows != 22 then - return -1 -endi - -print ================= step9 only insert last one -sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000) -sql select * from tb; -if $rows != 25 then - return -1 -endi - -print ================= step10 -sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000) -sql select * from tb; -if $rows != 25 then - return -1 -endi - -print ================= step11 -sql import into tb values(1564642400000, 700000) -sql select * from tb; -if $rows != 25 then - return -1 -endi - -print ================= step12 -sql import into tb values(1564641709527, 9527)(1564641709527, 9528) -sql select * from tb; -print rows=> $rows -if $rows != 26 then - return -1 -endi - -print ================= step13 -sql import into tb values(1564641709898, 9898)(1564641709897, 9897) -sql select * from tb; -print rows=> $rows -if $rows != 28 then - return -1 -endi - -sql drop database ibadb \ No newline at end of file diff --git a/tests/script/windows/insert/basic.sim b/tests/script/windows/insert/basic.sim deleted file mode 100644 index a516f80e10..0000000000 --- a/tests/script/windows/insert/basic.sim +++ /dev/null @@ -1,49 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = tb_in_db -$tbPrefix = tb_in_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql drop database -x step1 -step1: -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed int) - -$x = 0 -while $x < 10 - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw - -print =============== step 2 -sql insert into $tb values (now - 5m , 10) -sql insert into $tb values (now - 6m , 10) -sql insert into $tb values (now - 7m , 10) -sql insert into $tb values (now - 8m , 10) - -sql select * from $tb - -print $rows points data are retrieved -if $rows != 14 then - return -1 -endi - -sql drop database $db -sleep 1000 -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/insert/query_block1_file.sim b/tests/script/windows/insert/query_block1_file.sim deleted file mode 100644 index 62b74ac19c..0000000000 --- a/tests/script/windows/insert/query_block1_file.sim +++ /dev/null @@ -1,195 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = tb_1f_db -$tbPrefix = tb_1f_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql drop database -x step1 -step1: -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed int) - -#commit to file will trigger if insert 82 rows - -$N = 82 - -print =============== step 1 -$x = $N -$y = $N / 2 -while $x > $y - $ms = $x . m - $xt = - . $x - sql insert into $tb values (now - $ms , $x ) - $x = $x - 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $y then - return -1 -endi - -$x = $N / 2 -$y = $N -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $N then - return -1 -endi - -print =============== step 2 - -$R = 4 -$x = $N * 2 -$y = $N * $R -$expect = $y + $N -$y = $y + $x -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - -print =============== step 3 - -$N1 = $N + 1 -$result1 = $N / 2 -$result2 = $N -$step = $N1 . m - -$start1 = now- . $step -$start2 = now -$start3 = now+ . $step -$end1 = now- . $step -$end2 = now -$end3 = now+ . $step - - -sql select * from $tb where ts < $start1 and ts > $end1 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 -print select * from $tb where ts < $start2 and ts > $end1 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 -print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 -print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 -if $rows != 0 then - return -1 -endi - -print ================= order by ts desc - -sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc -print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -clear: - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/insert/query_block1_memory.sim b/tests/script/windows/insert/query_block1_memory.sim deleted file mode 100644 index 6c3e58d70e..0000000000 --- a/tests/script/windows/insert/query_block1_memory.sim +++ /dev/null @@ -1,177 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = tb_1m_db -$tbPrefix = tb_1m_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql drop database -x step1 -step1: -sql create database $db -sql use $db - -sql create table $tb (ts timestamp, speed int) - -#commit to file will trigger if insert 82 rows - -$N = 82 - -print =============== step 1 -$x = $N -$y = $N / 2 -while $x > $y - $ms = $x . m - $xt = - . $x - sql insert into $tb values (now - $ms , -$x ) - $x = $x - 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $y then - return -1 -endi - -$x = $N / 2 -$y = $N -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $N then - return -1 -endi - -print =============== step 2 - -$N1 = $N + 1 -$result1 = $N / 2 -$result2 = $N -$step = $N1 . m - -$start1 = now- . $step -$start2 = now -$start3 = now+ . $step -$end1 = now- . $step -$end2 = now -$end3 = now+ . $step - -sql select * from $tb where ts < $start1 and ts > $end1 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 -print select * from $tb where ts < $start2 and ts > $end1 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 -print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 -print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 -if $rows != 0 then - return -1 -endi - -print ================= order by ts desc - -sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc -print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -clear: - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - diff --git a/tests/script/windows/insert/query_block2_file.sim b/tests/script/windows/insert/query_block2_file.sim deleted file mode 100644 index 164c8a1124..0000000000 --- a/tests/script/windows/insert/query_block2_file.sim +++ /dev/null @@ -1,210 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = tb_2f_db -$tbPrefix = tb_2f_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -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 - -#commit to file will trigger if insert 82 rows -$N = 82 - -print =============== step 1 -$x = $N * 2 -$y = $N -$expect = $N -while $x > $y - $ms = $x . m - $xt = - . $x - sql insert into $tb values (now - $ms , $xt ) - $x = $x - 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - -$x = $N -$y = $N * 2 -$expect = $N * 2 -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - -print =============== step 2 - -$R = 4 -$y = $N * $R - -$expect = $y + $N -$expect = $expect + $N - -$x = $N * 3 -$y = $y + $x - -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - - -print =============== step 2 - -$N2 = $N -$result1 = $N -$result2 = 2 * $N -$N1 = $result2 + 1 -$step = $N1 . m - -$start1 = now- . $step -$start2 = now -$start3 = now+ . $step -$end1 = now- . $step -$end2 = now -$end3 = now+ . $step - -sql select * from $tb where ts < $start1 and ts > $end1 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 -print select * from $tb where ts < $start2 and ts > $end1 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 -print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 -print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 -if $rows != 0 then - return -1 -endi - -print ================= order by ts desc - -sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc -print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -clear: - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - diff --git a/tests/script/windows/insert/query_block2_memory.sim b/tests/script/windows/insert/query_block2_memory.sim deleted file mode 100644 index f3ceb503ac..0000000000 --- a/tests/script/windows/insert/query_block2_memory.sim +++ /dev/null @@ -1,172 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = tb_2m_db -$tbPrefix = tb_2m_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql drop database -x step1 -step1: -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed int) - -$N = 82 - -$x = $N * 2 -$y = $N -while $x > $y - $ms = $x . m - $xt = - . $x - sql insert into $tb values (now - $ms , $xt ) - $x = $x - 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $y then - return -1 -endi - -$x = $N -$y = $N * 2 -$expect = $N * 2 -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - -print =============== step 2 - -$result1 = $N -$result2 = $N * 2 - -$N1 = $result2 + 1 -$step = $N1 . m - -$start1 = now- . $step -$start2 = now -$start3 = now+ . $step -$end1 = now- . $step -$end2 = now -$end3 = now+ . $step - -sql select * from $tb where ts < $start1 and ts > $end1 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 -print select * from $tb where ts < $start2 and ts > $end1 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 -print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 -print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 -if $rows != 0 then - return -1 -endi - -print ================= order by ts desc - -sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc -print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/insert/query_file_memory.sim b/tests/script/windows/insert/query_file_memory.sim deleted file mode 100644 index d9752c40c9..0000000000 --- a/tests/script/windows/insert/query_file_memory.sim +++ /dev/null @@ -1,209 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = tb_fm_db -$tbPrefix = tb_fm_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -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 - -#commit to file will trigger if insert 82 rows - -$N = 82 - -$x = $N * 2 -$y = $N -$expect = $y -while $x > $y - $ms = $x . m - $xt = - . $x - sql insert into $tb values (now - $ms , $xt ) - $x = $x - 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - -$x = $N -$y = $N * 2 -$expect = $N * 2 -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - -$R = 4 -$R = $R - 1 - -$y = $N * $R -$expect = $y + $N -$expect = $expect + $N - -$x = $N * 3 -$y = $y + $x -while $x < $y - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 -endw - -sql select * from $tb -print sql select * from $tb -> $rows points -if $rows != $expect then - return -1 -endi - - -print =============== step 2 - -$result1 = $N -$result2 = $N * 2 -$N1 = $result2 + 1 -$step = $N1 . m - -$start1 = now- . $step -$start2 = now -$start3 = now+ . $step -$end1 = now- . $step -$end2 = now -$end3 = now+ . $step - - -sql select * from $tb where ts < $start1 and ts > $end1 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 -print select * from $tb where ts < $start2 and ts > $end1 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 -print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 -print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 -if $rows != 0 then - return -1 -endi - -print ================= order by ts desc - -sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc -print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points -if $rows != $result2 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points -if $rows != $result1 then - return -1 -endi - -sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc -if $rows != 0 then - return -1 -endi - -clear: - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - - diff --git a/tests/script/windows/insert/query_multi_file.sim b/tests/script/windows/insert/query_multi_file.sim deleted file mode 100644 index ba617ce63c..0000000000 --- a/tests/script/windows/insert/query_multi_file.sim +++ /dev/null @@ -1,55 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = tb_mf_db -$tbPrefix = tb_mf_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -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 - -$N = 20000 - -$x = 0 - -while $x < $N - $ms = $x . s - #print insert into $tb values (now + $ms , $x ) - sql insert into $tb values (now + $ms , $x ) -x error_insert - $x = $x + 1 -endw -error_insert: - -sql select * from $tb -print $rows points data are retrieved -> exepct $N rows -if $rows < $N then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - diff --git a/tests/script/windows/table/binary.sim b/tests/script/windows/table/binary.sim deleted file mode 100644 index 5efa0bc666..0000000000 --- a/tests/script/windows/table/binary.sim +++ /dev/null @@ -1,63 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = lm_bn_db -$tbPrefix = lm_bn_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed binary(5)) - -sql insert into $tb values (now, ) -x step1 - return -1 -step1: - -print =============== step2 -sql insert into $tb values (now+1a, '1234') -sql select speed from $tb order by ts desc -if $rows != 1 then - return -1 -endi -if $data00 != 1234 then - return -1 -endi - -print =============== step3 -sql insert into $tb values (now+2a, '23456') -sql select speed from $tb order by ts desc -if $rows != 2 then - return -1 -endi -print ==> $data00 -if $data00 != 23456 then - return -1 -endi - -print =============== step4 -sql_error insert into $tb values (now+3a, '345678') -sql insert into $tb values (now+3a, '34567') -sql select speed from $tb order by ts desc -if $rows != 3 then - return -1 -endi -print ==> $data00 -if $data00 != 34567 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/table/bool.sim b/tests/script/windows/table/bool.sim deleted file mode 100644 index 0d185d31e8..0000000000 --- a/tests/script/windows/table/bool.sim +++ /dev/null @@ -1,92 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = lm_bo_db -$tbPrefix = lm_bo_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db -$x = 0 -sql create table $tb (ts timestamp, speed bool) - -sql insert into $tb values (now, true) -sql select * from $tb -if $rows != 1 then - return -1 -endi - -if $data01 != 1 then - return -1 -endi - -print =============== step2 -sql insert into $tb values (now+1m, 1) -sql select * from $tb order by ts desc -if $rows != 2 then - return -1 -endi - -if $data01 != 1 then - return -1 -endi - -print =============== step3 -sql insert into $tb values (now+2m, 2) -sql select * from $tb order by ts desc -if $rows != 3 then - return -1 -endi - -if $data01 != 1 then - return -1 -endi - -print =============== step4 -sql insert into $tb values (now+3m, 0) -sql select * from $tb order by ts desc -if $rows != 4 then - return -1 -endi - -if $data01 != 0 then - return -1 -endi - -print =============== step5 -sql insert into $tb values (now+4m, -1) -sql select * from $tb order by ts desc -if $rows != 5 then - return -1 -endi - -if $data01 != 1 then - return -1 -endi - -print =============== step6 -sql insert into $tb values (now+5m, false) -sql select * from $tb order by ts desc -if $rows != 6 then - return -1 -endi - -if $data01 != 0 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/table/column_name.sim b/tests/script/windows/table/column_name.sim deleted file mode 100644 index 6f9f954461..0000000000 --- a/tests/script/windows/table/column_name.sim +++ /dev/null @@ -1,91 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - - -$i = 0 -$dbPrefix = lm_cm_db -$tbPrefix = lm_cm_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db - -sql drop table dd -x step0 - return -1 -step0: - -sql create table $tb(ts timestamp, int) -x step1 - return -1 -step1: - -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step2 -sql create table $tb (ts timestamp, s int) -sql show tables -if $rows != 1 then - return -1 -endi - -sql drop table $tb -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step3 -sql create table $tb (ts timestamp, a0123456789 int) -sql show tables -if $rows != 1 then - return -1 -endi - -sql drop table $tb -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step4 -sql create table $tb (ts timestamp, a0123456789012345678901234567890123456789 int) -sql drop table $tb - -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step5 -sql create table $tb (ts timestamp, a0123456789 int) -sql show tables -if $rows != 1 then - return -1 -endi - -sql insert into $tb values (now , 1) -sql select * from $tb -if $rows != 1 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - - - - diff --git a/tests/script/windows/table/column_num.sim b/tests/script/windows/table/column_num.sim deleted file mode 100644 index 395ee02cde..0000000000 --- a/tests/script/windows/table/column_num.sim +++ /dev/null @@ -1,86 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - - -$i = 0 -$dbPrefix = lm_cn_db -$tbPrefix = lm_cn_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db - -sql create table $tb() -x step1 - return -1 -step1: - -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step2 -sql create table $tb (ts timestamp) -x step2 - return -1 -step2: - -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step3 -sql create table $tb (ts int) -x step3 - return -1 -step3: - -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step4 -sql create table $tb (ts timestamp, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a10 int, a11 int, a12 int, a13 int, a14 int, a15 int, a16 int, a17 int, a18 int, a19 int, a20 int, a21 int, a22 int, a23 int, a24 int, a25 int, a26 int, a27 int, a28 int,a29 int,a30 int,a31 int,a32 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int, b7 int, b8 int, b9 int, b10 int, b11 int, b12 int, b13 int, b14 int, b15 int, b16 int, b17 int, b18 int, b19 int, b20 int, b21 int, b22 int, b23 int, b24 int, b25 int, b26 int, b27 int, b28 int,b29 int,b30 int,b31 int,b32 int) - -sql show tables -if $rows != 1 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb = $tbPrefix . $i - -sql create table $tb (ts timestamp, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a10 int, a11 int, a12 int, a13 int, a14 int, a15 int, a16 int, a17 int, a18 int, a19 int, a20 int, a21 int, a22 int, a23 int, a24 int, a25 int, a26 int, a27 int, a28 int,a29 int,a30 int,a31 int,a32 int, b1 int, b2 int, b3 int, b4 int, b5 int) - -sql show tables -if $rows != 2 then - return -1 -endi - -sql insert into $tb values (now, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 ,26 , 27 ,28 ,29,30,31, 32, 33, 34, 35, 36, 37) -sql select * from $tb -if $rows != 1 then - return -1 -endi - -sql drop table $tb -sql show tables -if $rows != 1 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/table/column_value.sim b/tests/script/windows/table/column_value.sim deleted file mode 100644 index 8db85f16ad..0000000000 --- a/tests/script/windows/table/column_value.sim +++ /dev/null @@ -1,80 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - - -$i = 0 -$dbPrefix = lm_cv_db -$tbPrefix = lm_cv_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db - -sql create table $tb (ts timestamp, speed int, v1 binary(100), v2 binary(100), v3 binary(100), v4 binary(100), v5 binary(100)) -sql show tables -if $rows != 1 then - return -1 -endi -sql insert into $tb values(now, 1, '1', '2', '3', '4', '5') -sql insert into $tb values(now+1a, 1, '1', '2', '3', '4', '5') -sql select * from $tb -if $rows != 2 then - return -1 -endi -sql drop table $tb -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step2 -sql create table $tb (ts timestamp, speed bigint, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) -sql show tables -if $rows != 1 then - return -1 -endi -sql drop table $tb - -print =============== step3 -sql create table $tb (ts timestamp, speed float, v1 binary(100), v2 binary(100), v3 binary(100), v4 binary(100), v5 binary(100)) -sql show tables -if $rows != 1 then - return -1 -endi -sql insert into $tb values(now+2a, 1, '1', '2', '3', '4', '5') -sql insert into $tb values(now+3a, 1, '1', '2', '3', '4', '5') -sql select * from $tb -if $rows != 2 then - return -1 -endi -sql drop table $tb -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step4 -sql create table $tb (ts timestamp, speed double, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) -sql show tables -if $rows != 1 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - - - - diff --git a/tests/script/windows/table/db.table.sim b/tests/script/windows/table/db.table.sim deleted file mode 100644 index 0e207c9982..0000000000 --- a/tests/script/windows/table/db.table.sim +++ /dev/null @@ -1,48 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - - -$i = 0 -$dbPrefix = lm_dt_db -$tbPrefix = lm_dt_tb -$db = $dbPrefix -$tb = $tbPrefix - -print =============== step1 -sql create database $db -$table = lm_dt_db.lm_dt_tb - -print =============== step2 -sql create table $table (ts timestamp, speed int) - -print =============== step3 -sql insert into $table values (now, 1) - -print =============== step4 -sql select * from $table -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi - -print =============== step5 -sql describe $table - -print =============== step6 -sql drop table $table - - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/table/double.sim b/tests/script/windows/table/double.sim deleted file mode 100644 index b88ac4a199..0000000000 --- a/tests/script/windows/table/double.sim +++ /dev/null @@ -1,98 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = lm_do_db -$tbPrefix = lm_do_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed double) -#sql insert into $tb values (now, -1.79E+308) -x step1 -# return -1 -#step1: - -print =============== step2 -#sql insert into $tb values (now+1a, 1.79E+308) -x step2 -# return -1 -#step2: - -sql select * from $tb order by ts desc -if $rows != 0 then - return -1 -endi - -print =============== step3 -sql insert into $tb values (now+2a, 2.85) -sql select * from $tb order by ts desc -if $rows != 1 then - return -1 -endi -if $data01 != 2.850000000 then - return -1 -endi - -print =============== step4 -sql insert into $tb values (now+3a, 3.4) -sql select * from $tb order by ts desc -if $rows != 2 then - return -1 -endi -if $data01 != 3.400000000 then - return -1 -endi - -print =============== step5 -sql insert into $tb values (now+4a, a2) -x step51 - return -1 -step51: -sql insert into $tb values (now+4a, 0) -sql select * from $tb order by ts desc -if $rows != 3 then - return -1 -endi -if $data01 != 0.000000000 then - return -1 -endi - -print =============== step6 -sql insert into $tb values (now+5a, 2a) -x step6 - return -1 -step6: -sql insert into $tb values(now+5a, 2) -sql select * from $tb order by ts desc -if $rows != 4 then - return -1 -endi -if $data01 != 2.000000000 then - return -1 -endi - -print =============== step7 -sql insert into $tb values (now+6a, 2a'1) -x step7 - return -1 -step7: -sql insert into $tb values(now+6a, 2) -sql select * from $tb order by ts desc -if $rows != 5 then - return -1 -endi -if $data01 != 2.000000000 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/table/float.sim b/tests/script/windows/table/float.sim deleted file mode 100644 index 741525830d..0000000000 --- a/tests/script/windows/table/float.sim +++ /dev/null @@ -1,98 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = lm_fl_db -$tbPrefix = lm_fl_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db -sql create table $tb (ts timestamp, speed float) -#sql insert into $tb values (now, -3.40E+38) -x step1 -# return -1 -#step1: - -print =============== step2 -#sql insert into $tb values (now+1a, 3.40E+308) -x step2 -# return -1 -#step2: - -sql select * from $tb order by ts desc -if $rows != 0 then - return -1 -endi - -print =============== step3 -sql insert into $tb values (now+2a, 2.85) -sql select * from $tb order by ts desc -if $rows != 1 then - return -1 -endi -if $data01 != 2.85000 then - return -1 -endi - -print =============== step4 -sql insert into $tb values (now+3a, 3.4) -sql select * from $tb order by ts desc -if $rows != 2 then - return -1 -endi -if $data01 != 3.40000 then - return -1 -endi - -print =============== step5 -sql insert into $tb values (now+4a, a2) -x step5 - return -1 -step5: -sql insert into $tb values (now+4a, 0) -sql select * from $tb order by ts desc -if $rows != 3 then - return -1 -endi -if $data01 != 0.00000 then - return -1 -endi - -print =============== step6 -sql insert into $tb values (now+5a, 2a) -x step6 - return -1 -step6: -sql insert into $tb values (now+5a, 2) -sql select * from $tb order by ts desc -if $rows != 4 then - return -1 -endi -if $data01 != 2.00000 then - return -1 -endi - -print =============== step7 -sql insert into $tb values (now+6a, 2a'1) -x step7 - return -1 -step7: -sql insert into $tb values (now+6a, 2) -sql select * from $tb order by ts desc -if $rows != 5 then - return -1 -endi -if $data01 != 2.00000 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/table/table.sim b/tests/script/windows/table/table.sim deleted file mode 100644 index 13d1576277..0000000000 --- a/tests/script/windows/table/table.sim +++ /dev/null @@ -1,225 +0,0 @@ -sql connect -sleep 2000 -print ============================ dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = ob_tb_db -$tbPrefix = ob_tb_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql drop database $db -x step1 -step1: -sql create database $db - -print =============== step2-3-4 -sql use $db - -$i = 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val tinyint, val2 tinyint) -sql insert into $tb values(now, 1, 1) -sql select * from $tb -if $data01 != 1 then - return -1 -endi - -$i = 2 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val smallint, val2 smallint) -sql insert into $tb values(now, 2, 2) -sql select * from $tb -if $data01 != 2 then - return -1 -endi - -$i = 3 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val int, val2 int) -sql insert into $tb values(now, 3, 3) -sql select * from $tb -if $data01 != 3 then - return -1 -endi - -$i = 4 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val bigint, val2 bigint) -sql insert into $tb values(now, 4, 4) -sql select * from $tb -if $data01 != 4 then - return -1 -endi - -$i = 5 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val float, val2 float) -sql insert into $tb values(now, 5, 5) -sql select * from $tb -print ==> $data01 $data02 -if $data01 != 5.00000 then - return -1 -endi - -$i = 6 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val double, val2 double) -sql insert into $tb values(now, 6, 6) -sql select * from $tb -print ==> $data01 $data02 -if $data01 != 6.000000000 then - return -1 -endi - -$i = 7 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val binary(20), val2 binary(20)) -sql insert into $tb values(now, '7', '7') -sql select * from $tb -if $data01 != 7 then - return -1 -endi - -print =============== step5 -sql show tables -if $rows != 7 then - return -1 -endi - -$i = 1 -while $i < 8 - $tb = $tbPrefix . $i - sql drop table $tb - $i = $i + 1 -endw - -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step6-9 -$i = 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val tinyint, val2 tinyint) -sql select * from $tb -if $rows != 0 then - return -1 -endi -sql insert into $tb values(now, 1, 1) -sql select * from $tb -if $data01 != 1 then - return -1 -endi - -$i = 2 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val smallint, val2 smallint) -sql select * from $tb -if $rows != 0 then - return -1 -endi -sql insert into $tb values(now, 2, 2) -sql select * from $tb -if $data01 != 2 then - return -1 -endi - -$i = 3 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val int, val2 int) -sql select * from $tb -if $rows != 0 then - return -1 -endi -sql insert into $tb values(now, 3, 3) -sql select * from $tb -if $data01 != 3 then - return -1 -endi - -$i = 4 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val bigint, val2 bigint) -sql select * from $tb -if $rows != 0 then - return -1 -endi -sql insert into $tb values(now, 4, 4) -sql select * from $tb -if $data01 != 4 then - return -1 -endi - -$i = 5 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val float, val2 float) -sql select * from $tb -if $rows != 0 then - return -1 -endi -sql insert into $tb values(now, 5, 5) -sql select * from $tb -print ==> $data01 $data02 -if $data01 != 5.00000 then - return -1 -endi - -$i = 6 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val double, val2 double) -sql select * from $tb -if $rows != 0 then - return -1 -endi -sql insert into $tb values(now, 6, 6) -sql select * from $tb -print ==> $data01 $data02 -if $data01 != 6.000000000 then - return -1 -endi - -$i = 7 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, val binary(20), val2 binary(20)) -sql select * from $tb -if $rows != 0 then - return -1 -endi -sql insert into $tb values(now, '7', '7') -sql select * from $tb -if $data01 != 7 then - return -1 -endi - -print =============== step10 -$i = 1 -$tb = $tbPrefix . $i -sql 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 show tables -if $rows != 7 then - return -1 -endi - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi - - diff --git a/tests/script/windows/table/table_len.sim b/tests/script/windows/table/table_len.sim deleted file mode 100644 index 72ed549466..0000000000 --- a/tests/script/windows/table/table_len.sim +++ /dev/null @@ -1,105 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$i = 0 -$dbPrefix = lm_tb_db -$tbPrefix = lm_tb_tb -$db = $dbPrefix . $i -$tb = $tbPrefix . $i - -print =============== step1 -sql create database $db -sql use $db - -sql drop table dd -x step0 - return -1 -step0: - -sql create table (ts timestamp, speed int) -x step1 - return -1 -step1: - -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step2 -sql create table a (ts timestamp, speed int) -sql show tables -if $rows != 1 then - return -1 -endi - -sql drop table a -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step3 -sql create table a0123456789 (ts timestamp, speed int) -sql show tables -if $rows != 1 then - return -1 -endi - -sql drop table a0123456789 -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step4 -sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 - return -1 -step4: -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step5 -sql create table a;1 (ts timestamp, speed int) -x step5 - return -1 -step5: -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step6 -sql create table a'1 (ts timestamp, speed int) -x step6 - return -1 -step6: -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step7 -sql create table (a) (ts timestamp, speed int) -x step7 - return -1 -step7: -sql show tables -if $rows != 0 then - return -1 -endi - -print =============== step8 -sql create table a.1 (ts timestamp, speed int) -x step8 - return -1 -step8: - -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/3.sim b/tests/script/windows/tag/3.sim deleted file mode 100644 index 5479be158b..0000000000 --- a/tests/script/windows/tag/3.sim +++ /dev/null @@ -1,521 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_3_db -$tbPrefix = ta_3_tb -$mtPrefix = ta_3_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 float) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = false -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> false -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tgcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tgcol1 = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> false and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol1 = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol1 = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol1 = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step14 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step15 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step16 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step17 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step18 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/4.sim b/tests/script/windows/tag/4.sim deleted file mode 100644 index 17552010b0..0000000000 --- a/tests/script/windows/tag/4.sim +++ /dev/null @@ -1,711 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_4_db -$tbPrefix = ta_4_tb -$mtPrefix = ta_4_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 bigint, tgcol3 float, tgcol4 double) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tgcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where tgcol4 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step14 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step15 -sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step16 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step17 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step18 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step19 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step20 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step21 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step22 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step23 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/5.sim b/tests/script/windows/tag/5.sim deleted file mode 100644 index f06d78e7b5..0000000000 --- a/tests/script/windows/tag/5.sim +++ /dev/null @@ -1,834 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_5_db -$tbPrefix = ta_5_tb -$mtPrefix = ta_5_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 tinyint, tgcol2 int, tgcol3 bigint, tgcol4 double, tgcol5 binary(20)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0, 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1, 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tgcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where tgcol4 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step7 -sql select * from $mt where tgcol5 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol5 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol5 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol5 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step8 -sql select * from $mt where ts > now + 4m and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tgcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step14 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step15 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step16 -sql select * from $mt where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step17 -sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step18 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step19 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step20 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step21 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step22 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step23 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step24 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol5 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step25 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step26 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/6.sim b/tests/script/windows/tag/6.sim deleted file mode 100644 index 64cb9df6f0..0000000000 --- a/tests/script/windows/tag/6.sim +++ /dev/null @@ -1,989 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_6_db -$tbPrefix = ta_6_tb -$mtPrefix = ta_6_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 bigint, tgcol3 smallint, tgcol4 bigint, tgcol5 binary(30), tgcol6 binary(20)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0', 0, 0, 0, '0', '0' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1', 1, 1, 1, '1', '1' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where tgcol3 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step6 -sql select * from $mt where tgcol4 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol4 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step7 -sql select * from $mt where tgcol5 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol5 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol5 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol5 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step8 -sql select * from $mt where tgcol6 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol6 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol6 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol6 <> 1 -if $rows != 100 then - return -1 -endi - -print =============== step9 -sql select * from $mt where ts > now + 4m and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step10 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step11 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step12 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step13 -sql select * from $mt where ts > now + 4m and tgcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step14 -sql select * from $mt where ts > now + 4m and tgcol6 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol6 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol6 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol6 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step15 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step16 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step17 -sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step18 -sql select * from $mt where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step19 -sql select * from $mt where ts > now + 4m and tgcol5 = 1 and tgcol6 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and tgcol6 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol6 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step20 -sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step21 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step22 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step23 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step24 -sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step25 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step26 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step27 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -print =============== step28 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol5 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol6 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step29 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step30 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -endi - -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/add.sim b/tests/script/windows/tag/add.sim deleted file mode 100644 index 02d027ccf4..0000000000 --- a/tests/script/windows/tag/add.sim +++ /dev/null @@ -1,854 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_ad_db -$tbPrefix = ta_ad_tb -$mtPrefix = ta_ad_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i - -sql create database $db -sql use $db - -print =============== step2 -$i = 2 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt add tag tgcol4 int -sql reset query cache -sql alter table $tb set tag tgcol4 =4 -sql reset query cache - -sql select * from $mt where tgcol4 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step2 - return -1 -step2: - -print =============== step3 -$i = 3 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt add tag tgcol4 tinyint -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql reset query cache - -sql select * from $mt where tgcol4 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step3 - return -1 -step3: - -print =============== step4 -$i = 4 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi - -sql describe $tb -print sql describe $tb -if $data21 != BIGINT then - return -1 -endi -if $data31 != FLOAT then - return -1 -endi -if $data23 != TAG then - return -1 -endi -if $data33 != TAG then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt add tag tgcol4 float -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql reset query cache - -sql select * from $mt where tgcol4 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 4.00000 then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step4 - return -1 -step4: - -print =============== step5 -$i = 5 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) -sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = '2' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt add tag tgcol4 smallint -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql reset query cache - -sql select * from $mt where tgcol4 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql select * from $mt where tgcol3 = '1' -x step5 - return -1 -step5: - -print =============== step6 -$i = 6 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 tinyint) -sql create table $tb using $mt tags( 1, 2, 3 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt add tag tgcol5 binary(10) -sql alter table $mt add tag tgcol6 binary(10) - -sql reset query cache -sql alter table $tb set tag tgcol4=false -sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=6 -sql reset query cache - -sql select * from $mt where tgcol5 = '5' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 5 then - return -1 -endi -if $data04 != 6 then - return -1 -endi - -sql select * from $mt where tgcol6 = '6' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 5 then - return -1 -endi -if $data04 != 6 then - return -1 -endi - -sql select * from $mt where tgcol4 = 1 -if $rows != 0 then - return -1 -endi -sql select * from $mt where tgcol3 = 1 -x step52 - return -1 -step52: - -print =============== step7 -$i = 7 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint, tgcol3 binary(10)) -sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol3 = '3' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt add tag tgcol5 bigint -sql alter table $mt add tag tgcol6 tinyint - -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=6 -sql reset query cache - -sql select * from $mt where tgcol6 = 6 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 4 then - return -1 -endi -if $data03 != 5 then - return -1 -endi -if $data04 != 6 then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step71 - return -1 -step71: -sql select * from $mt where tgcol3 = 1 -x step72 - return -1 -step72: - -print =============== step8 -$i = 8 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float, tgcol3 binary(10)) -sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol3 = '3' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt add tag tgcol5 binary(17) -sql alter table $mt add tag tgcol6 bool -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=1 -sql reset query cache - -sql select * from $mt where tgcol5 = '5' -print select * from $mt where tgcol5 = 5 -print $data01 $data02 $data03 $data04 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 4 then - return -1 -endi -if $data03 != 5 then - return -1 -endi -if $data04 != 1 then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step81 - return -1 -step81: -sql select * from $mt where tgcol3 = 1 -x step82 - return -1 -step82: - -print =============== step9 -$i = 9 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10)) -sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = '2' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt add tag tgcol5 bool -sql alter table $mt add tag tgcol6 float - -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=1 -sql alter table $tb set tag tgcol6=6 -sql reset query cache - -sql select * from $mt where tgcol5 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 4.000000000 then - return -1 -endi -if $data03 != 1 then - return -1 -endi -if $data04 != 6.00000 then - return -1 -endi - -sql select * from $mt where tgcol3 = 1 -x step91 - return -1 -step91: -sql select * from $mt where tgcol2 = 1 -x step92 - return -1 -step92: - -print =============== step10 -$i = 10 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10)) -sql create table $tb using $mt tags( '1', '2', '3', '4' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol4 = '4' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol4 -x step103 - return -1 -step103: - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol4 -sql reset query cache -sql alter table $mt add tag tgcol4 binary(10) -sql alter table $mt add tag tgcol5 bool - -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=false -sql reset query cache - -sql select * from $mt where tgcol4 = '4' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 4 then - return -1 -endi -if $data04 != 0 then - return -1 -endi -if $data05 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step101 - return -1 -step101: -sql select * from $mt where tgcol3 = 1 -x step102 - return -1 -step102: - -print =============== step11 -$i = 11 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10)) -sql create table $tb using $mt tags( 1, 2, 3, 4, '5' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4.00000 then - return -1 -endi -if $data06 != 5 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol4 -x step114 - return -1 -step114: - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol4 -sql alter table $mt drop tag tgcol5 -sql reset query cache -sql alter table $mt add tag tgcol4 binary(10) -sql alter table $mt add tag tgcol5 int -sql alter table $mt add tag tgcol6 binary(10) -sql alter table $mt add tag tgcol7 bigint -sql alter table $mt add tag tgcol8 smallint - -sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=6 -sql alter table $tb set tag tgcol7=7 -sql alter table $tb set tag tgcol8=8 -sql reset query cache - -sql select * from $mt where tgcol5 =5 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 4 then - return -1 -endi -if $data04 != 5 then - return -1 -endi -if $data05 != 6 then - return -1 -endi -if $data06 != 7 then - return -1 -endi -if $data07 != 8 then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step111 - return -1 -step111: -sql select * from $mt where tgcol3 = 1 -x step112 - return -1 -step112: -sql select * from $mt where tgcol9 = 1 -x step113 - return -1 -step113: - -print =============== step12 -$i = 12 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(20)) -sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3.00000 then - return -1 -endi -if $data05 != 4.000000000 then - return -1 -endi -if $data06 != 5 then - return -1 -endi -if $data07 != 6 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol4 -sql alter table $mt drop tag tgcol5 -sql reset query cache -sql alter table $mt add tag tgcol2 binary(10) -sql alter table $mt add tag tgcol3 int -sql alter table $mt add tag tgcol4 binary(10) -sql alter table $mt add tag tgcol5 bigint - -sql reset query cache -sql alter table $tb set tag tgcol1=false -sql alter table $tb set tag tgcol2=5 -sql alter table $tb set tag tgcol3=4 -sql alter table $tb set tag tgcol4=3 -sql alter table $tb set tag tgcol5=2 -sql alter table $tb set tag tgcol6=1 -sql reset query cache - -sql select * from $mt where tgcol4 = '3' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 1 then - return -1 -endi -if $data04 != 5 then - return -1 -endi -if $data05 != 4 then - return -1 -endi -if $data06 != 3 then - return -1 -endi -if $data07 != 2 then - return -1 -endi - -sql select * from $mt where tgcol2 = '5' -if $rows != 1 then - return -1 -endi - -sql select * from $mt where tgcol3 = 4 -if $rows != 1 then - return -1 -endi - -sql select * from $mt where tgcol5 = 2 -if $rows != 1 then - return -1 -endi - -sql select * from $mt where tgcol6 = '1' -if $rows != 1 then - return -1 -endi - -print =============== step13 -$i = 13 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) -sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = '1' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4 then - return -1 -endi -if $data06 != 5.000000000 then - return -1 -endi -if $data07 != 6 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol4 -sql alter table $mt drop tag tgcol6 -sql reset query cache -sql alter table $mt add tag tgcol2 binary(10) -sql alter table $mt add tag tgcol4 int -sql alter table $mt add tag tgcol6 bigint - -sql reset query cache -sql alter table $tb set tag tgcol1=7 -sql alter table $tb set tag tgcol2=8 -sql alter table $tb set tag tgcol3=9 -sql alter table $tb set tag tgcol4=10 -sql alter table $tb set tag tgcol5=11 -sql alter table $tb set tag tgcol6=12 -sql reset query cache - -sql select * from $mt where tgcol2 = '8' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 7 then - return -1 -endi -if $data03 != 9 then - return -1 -endi -if $data04 != 11.000000000 then - return -1 -endi -if $data05 != 8 then - return -1 -endi -if $data06 != 10 then - return -1 -endi -if $data07 != 12 then - return -1 -endi - -print =============== step14 -$i = 14 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 bigint) -sql create table $tb using $mt tags( 1, 1 ) -sql insert into $tb values(now, 1) - -sql alter table $mt add tag tgcol3 binary(10) -sql alter table $mt add tag tgcol4 int -sql alter table $mt add tag tgcol5 bigint -sql alter table $mt add tag tgcol6 bigint - -return -sql alter table $mt add tag tgcol7 bigint -x step141 - return -1 -step141: -sql reset query cache -sql alter table $mt drop tag tgcol6 -sql alter table $mt add tag tgcol7 bigint -sql alter table $mt add tag tgcol8 bigint -x step142 - return -1 -step142: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/bigint.sim b/tests/script/windows/tag/bigint.sim deleted file mode 100644 index ebb67d452c..0000000000 --- a/tests/script/windows/tag/bigint.sim +++ /dev/null @@ -1,241 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_bi_db -$tbPrefix = ta_bi_tb -$mtPrefix = ta_bi_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bigint) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/binary.sim b/tests/script/windows/tag/binary.sim deleted file mode 100644 index c59039b6a6..0000000000 --- a/tests/script/windows/tag/binary.sim +++ /dev/null @@ -1,241 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_by_db -$tbPrefix = ta_by_tb -$mtPrefix = ta_by_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '0' -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> '0' -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> '0' and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/binary_binary.sim b/tests/script/windows/tag/binary_binary.sim deleted file mode 100644 index 361a6edb8b..0000000000 --- a/tests/script/windows/tag/binary_binary.sim +++ /dev/null @@ -1,308 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_bib_db -$tbPrefix = ta_bib_tb -$mtPrefix = ta_bib_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(5), tgcol2 binary(5)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0', '0' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1', '1' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol = '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> '0' -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> '1' -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> '0' -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> '0' and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tgcol2 = '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tgcol2 = '1' and tgcol = '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and tgcol <> '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = '0' and tgcol = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and tgcol <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and tgcol = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' and tgcol <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' and tgcol <> '0' -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m and ts < now + 5m and tgcol <> '0' -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = '1' and tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = '1' and tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - - -print =============== step13 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/bool.sim b/tests/script/windows/tag/bool.sim deleted file mode 100644 index adf12338d0..0000000000 --- a/tests/script/windows/tag/bool.sim +++ /dev/null @@ -1,238 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_bo_db -$tbPrefix = ta_bo_tb -$mtPrefix = ta_bo_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = false -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> false -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> false and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/bool_binary.sim b/tests/script/windows/tag/bool_binary.sim deleted file mode 100644 index 064677ee40..0000000000 --- a/tests/script/windows/tag/bool_binary.sim +++ /dev/null @@ -1,308 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_bob_db -$tbPrefix = ta_bob_tb -$mtPrefix = ta_bob_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 binary(5)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, '0' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, '1' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = false -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> false -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> '1' -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> false and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tgcol2 = '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tgcol2 = '1' and tgcol = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and tgcol <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = '0' and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' and tgcol <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m and ts < now + 5m and tgcol <> false -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = true and tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = true and tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - - -print =============== step13 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/bool_int.sim b/tests/script/windows/tag/bool_int.sim deleted file mode 100644 index ef5cd27553..0000000000 --- a/tests/script/windows/tag/bool_int.sim +++ /dev/null @@ -1,324 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_boi_db -$tbPrefix = ta_boi_tb -$mtPrefix = ta_boi_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 int) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = false -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> false -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> true -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = false -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> false -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> false and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol = true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol <> true -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol = false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol <> false -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> false -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> false -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = true and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = true and tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - - -print =============== step13 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/change.sim b/tests/script/windows/tag/change.sim deleted file mode 100644 index 4126ea1181..0000000000 --- a/tests/script/windows/tag/change.sim +++ /dev/null @@ -1,513 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_ch_db -$tbPrefix = ta_ch_tb -$mtPrefix = ta_ch_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i - -sql create database $db -sql use $db - -print =============== step2 -$i = 2 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt change tag tagcx tgcol3 -x step21 - return -1 -step21: -sql alter table $mt change tag tgcol1 tgcol2 -x step22 - return -1 -step22: -#sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20 -# return -1 -#step20: - -sql alter table $mt change tag tgcol1 tgcol3 -sql alter table $mt change tag tgcol2 tgcol4 -sql alter table $mt change tag tgcol4 tgcol3 -x step23 - return -1 -step23: - -print =============== step3 -$i = 3 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol3 -sql alter table $mt change tag tgcol2 tgcol4 - -print =============== step4 -$i = 4 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol3 -sql alter table $mt change tag tgcol2 tgcol4 - -print =============== step5 -$i = 5 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) -sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = '2' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt change tag tgcol1 tgcol3 -sql alter table $mt change tag tgcol2 tgcol4 - -print =============== step6 -$i = 6 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) -sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = '1' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4 then - return -1 -endi -if $data06 != 5.000000000 then - return -1 -endi -if $data07 != 6 then - return -1 -endi - -sql alter table $mt drop tag tgcol3 -sql reset query cache -sql alter table $mt change tag tgcol4 tgcol3 -sql alter table $mt change tag tgcol1 tgcol7 -sql alter table $mt change tag tgcol2 tgcol8 -sql reset query cache -sql alter table $mt change tag tgcol3 tgcol9 -sql alter table $mt change tag tgcol5 tgcol10 -sql alter table $mt change tag tgcol6 tgcol11 - -sleep 3000 -sql reset query cache - -print =============== step2 -$i = 2 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -x step24 - return -1 -step24: -sql select * from $mt where tgcol2 = 1 -x step25 - return -1 -step25: - -sql select * from $mt where tgcol3 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql select * from $mt where tgcol4 = 2 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -print =============== step3 -$i = 3 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -x step31 - return -1 -step31: -sql select * from $mt where tgcol2 = 1 -x step32 - return -1 -step32: - -sql select * from $mt where tgcol3 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql select * from $mt where tgcol4 = 2 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -print =============== step4 -$i = 4 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -x step41 - return -1 -step41: -sql select * from $mt where tgcol2 = 1 -x step42 - return -1 -step42: - -sql select * from $mt where tgcol3 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi - -sql select * from $mt where tgcol4 = 2 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi - -print =============== step5 -$i = 5 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -x step51 - return -1 -step51: -sql select * from $mt where tgcol2 = 1 -x step52 - return -1 -step52: - -sql select * from $mt where tgcol3 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql select * from $mt where tgcol4 = '2' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -print =============== step6 -$i = 6 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -x step61 - return -1 -step61: -sql select * from $mt where tgcol2 = 1 -x step62 - return -1 -step62: -sql select * from $mt where tgcol3 = 1 -x step63 - return -1 -step63: -sql select * from $mt where tgcol4 = 1 -x step64 - return -1 -step64: -sql select * from $mt where tgcol5 = 1 -x step65 - return -1 -step65: -sql select * from $mt where tgcol6 = 1 -x step66 - return -1 -step66: - -sql select * from $mt where tgcol7 = '1' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 4 then - return -1 -endi -if $data05 != 5.000000000 then - return -1 -endi -if $data06 != 6 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol8 = 2 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 4 then - return -1 -endi -if $data05 != 5.000000000 then - return -1 -endi -if $data06 != 6 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol9 = '4' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 4 then - return -1 -endi -if $data05 != 5.000000000 then - return -1 -endi -if $data06 != 6 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol10 = 5 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 4 then - return -1 -endi -if $data05 != 5.000000000 then - return -1 -endi -if $data06 != 6 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol11 = '6' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 4 then - return -1 -endi -if $data05 != 5.000000000 then - return -1 -endi -if $data06 != 6 then - return -1 -endi -if $data07 != null then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi diff --git a/tests/script/windows/tag/column.sim b/tests/script/windows/tag/column.sim deleted file mode 100644 index 40159bcae3..0000000000 --- a/tests/script/windows/tag/column.sim +++ /dev/null @@ -1,93 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_co_db -$tbPrefix = ta_co_tb -$mtPrefix = ta_co_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db - -$i = 0 -sql create table $mt (ts timestamp, tbcol int, tbcol2 binary(10)) TAGS(tgcol int, tgcol2 binary(10)) - -print =============== step2 - -$i = 0 -$tb = $tbPrefix . $i -sql create table $tb using $mt tags( 0, '0' ) - -$i = 1 -$tb = $tbPrefix . $i -sql create table $tb using $mt tags( 1, 1 ) - -$i = 2 -$tb = $tbPrefix . $i -sql create table $tb using $mt tags( '2', '2' ) - -$i = 3 -$tb = $tbPrefix . $i -sql create table $tb using $mt tags( '3', 3 ) - -sql show tables -if $rows != 4 then - return -1 -endi - -print =============== step3 - -$i = 0 -$tb = $tbPrefix . $i -sql insert into $tb values(now, 0, '0') - -$i = 1 -$tb = $tbPrefix . $i -sql insert into $tb values(now, 1, 1 ) - -$i = 2 -$tb = $tbPrefix . $i -sql insert into $tb values(now, '2', '2') - -$i = 3 -$tb = $tbPrefix . $i -sql insert into $tb values(now, '3', 3) - -print =============== step4 -sql select * from $mt where tgcol2 = '1' -if $rows != 1 then - return -1 -endi - -print =============== step5 -sql select * from $mt -if $rows != 4 then - return -1 -endi - -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/create.sim b/tests/script/windows/tag/create.sim deleted file mode 100644 index 62dc8a7a21..0000000000 --- a/tests/script/windows/tag/create.sim +++ /dev/null @@ -1,601 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_cr_db -$tbPrefix = ta_cr_tb -$mtPrefix = ta_cr_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i - -sql create database $db -sql use $db - -print =============== step2 -$i = 2 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool) -sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 0 then - return -1 -endi - -print =============== step3 -$i = 3 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol smallint) -sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 0 then - return -1 -endi - -print =============== step4 -$i = 4 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol tinyint) -sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 0 then - return -1 -endi - -print =============== step5 -$i = 5 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) -sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 0 then - return -1 -endi - -print =============== step6 -$i = 6 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bigint) -sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 0 then - return -1 -endi - -print =============== step7 -$i = 7 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol float) -sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 0 then - print expect 0, actual: $rows - return -1 -endi - -print =============== step8 -$i = 8 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol double) -sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 0 then - return -1 -endi - -print =============== step9 -$i = 9 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10)) -sql create table $tb using $mt tags( '1') -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = '1' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol = '0' -if $rows != 0 then - return -1 -endi - -print =============== step10 -$i = 10 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 bool) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - print expect 1, actual: $rows - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step11 -$i = 11 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 smallint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step12 -$i = 12 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 tinyint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step13 -$i = 13 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 int) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step14 -$i = 14 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 bigint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi - -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi -print =============== step15 -$i = 15 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 float) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step16 -$i = 16 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 double) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step17 -$i = 17 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 binary(10)) -sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = true -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step18 -$i = 18 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol smallint, tgcol2 tinyint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step19 -$i = 19 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol tinyint, tgcol2 int) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step20 -$i = 20 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int, tgcol2 bigint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step21 -$i = 21 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bigint, tgcol2 float) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step22 -$i = 22 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol float, tgcol2 double) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step23 -$i = 23 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol double, tgcol2 binary(10)) -sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = '2' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 0 then - return -1 -endi - -print =============== step24 -$i = 24 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 bool, tgcol3 int, tgcol4 float, tgcol5 double, tgcol6 binary(10)) -sql create table $tb using $mt tags( 1, 2, 3, 4, 5, '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol3 = 3 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol4 = 4 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol5 = 5 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol6 = '6' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol6 = '0' -if $rows != 0 then - return -1 -endi - -print =============== step25 -$i = 25 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 int, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(10)) -sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol6 = '6' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol6 = '0' -if $rows != 0 then - return -1 -endi - -print =============== step26 -$i = 26 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10), tgcol5 binary(10), tgcol6 binary(10)) -sql create table $tb using $mt tags( '1', '2', '3', '4', '5', '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol3 = '3' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -sql select * from $mt where tgcol3 = '0' -if $rows != 0 then - return -1 -endi - -print =============== step27 -$i = 27 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 bool, tgcol3 int, tgcol4 float, tgcol5 double, tgcol6 binary(10), tgcol7) -x step27 - return -1 -step27: - -print =============== step28 -$i = 28 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(250), tgcol2 binary(250)) -sql create table $tb using $mt tags('1', '1') -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = '1' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi - -print =============== step29 -$i = 29 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(25), tgcol2 binary(250)) -sql create table $tb using $mt tags('1', '1') -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol = '1' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi - -print =============== step30 -$i = 30 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(250), tgcol2 binary(250), tgcol3 binary(30)) -x step30 -# return -1 -step30: - -print =============== step31 -$i = 31 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(5)) -sql_error create table $tb using $mt tags('1234567') -sql create table $tb using $mt tags('12345') -sql insert into $tb values(now, 1) -sql select * from $mt -print sql select * from $mt -if $rows != 1 then - return -1 -endi - -print $data00 $data01 $data02 -if $data02 != 12345 then - return -1 -endi diff --git a/tests/script/windows/tag/delete.sim b/tests/script/windows/tag/delete.sim deleted file mode 100644 index 2b503fdf47..0000000000 --- a/tests/script/windows/tag/delete.sim +++ /dev/null @@ -1,825 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_de_db -$tbPrefix = ta_de_tb -$mtPrefix = ta_de_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i - -sql create database $db -sql use $db - -print =============== step2 -$i = 2 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 - -print =============== step3 -$i = 3 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 - -print =============== step4 -$i = 4 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 < 3 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi - -sql describe $tb -if $data21 != BIGINT then - return -1 -endi -if $data31 != FLOAT then - return -1 -endi -if $data23 != TAG then - return -1 -endi - -sql alter table $mt drop tag tgcol1 -x step40 - return -1 -step40: -sql alter table $mt drop tag tgcol2 - -print =============== step5 -$i = 5 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) -sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = '2' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $mt drop tag tgcol1 -x step50 - return -1 -step50: -sql alter table $mt drop tag tgcol2 - -print =============== step6 -$i = 6 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 tinyint) -sql create table $tb using $mt tags( 1, 2, 3 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 - -print =============== step7 -$i = 7 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint, tgcol3 binary(10)) -sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol3 = '3' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql describe $tb -if $data21 != SMALLINT then - return -1 -endi -if $data31 != TINYINT then - return -1 -endi -if $data41 != BINARY then - return -1 -endi -if $data22 != 2 then - return -1 -endi -if $data32 != 1 then - return -1 -endi -if $data42 != 10 then - return -1 -endi -if $data23 != TAG then - return -1 -endi -if $data33 != TAG then - return -1 -endi -if $data43 != TAG then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 - -print =============== step8 -$i = 8 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float, tgcol3 binary(10)) -sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol3 = '3' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 - -print =============== step9 -$i = 9 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10)) -sql create table $tb using $mt tags( 1, '2', '3' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = 2 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi - -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol2 - -print =============== step10 -$i = 10 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10)) -sql create table $tb using $mt tags( '1', '2', '3', '4' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol4 = '4' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4 then - return -1 -endi - -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol4 - -print =============== step11 -$i = 11 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10)) -sql create table $tb using $mt tags( 1, 2, 3, 4, '5' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4.00000 then - return -1 -endi -if $data06 != 5 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol5 - -print =============== step12 -$i = 12 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(20)) -sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3.00000 then - return -1 -endi -if $data05 != 4.000000000 then - return -1 -endi -if $data06 != 5 then - return -1 -endi -if $data07 != 6 then - return -1 -endi - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol5 -sql alter table $mt drop tag tgcol6 - -print =============== step13 -$i = 13 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) -sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = '1' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4 then - return -1 -endi -if $data06 != 5.000000000 then - return -1 -endi -if $data07 != 6 then - return -1 -endi - -sql alter table $mt drop tag tgcol3 -sql alter table $mt drop tag tgcol4 -sql alter table $mt drop tag tgcol6 - -sleep 3000 - -print =============== step2 -$i = 2 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step2 - return -1 -step2: - -print =============== step3 -$i = 3 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step3 - return -1 -step3: - -print =============== step4 -$i = 4 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step4 - return -1 -step4: - -print =============== step5 -$i = 5 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = '1' -x step5 - return -1 -step5: - -print =============== step6 -$i = 6 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != null then - return -1 -endi -if $data04 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step51 - return -1 -step51: -sql select * from $mt where tgcol3 = 1 -x step52 - return -1 -step52: - -print =============== step7 -$i = 7 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != null then - return -1 -endi -if $data04 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step71 - return -1 -step71: -sql select * from $mt where tgcol3 = 1 -x step72 - return -1 -step72: - -print =============== step8 -$i = 8 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != null then - return -1 -endi -if $data04 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step81 - return -1 -step81: -sql select * from $mt where tgcol3 = 1 -x step82 - return -1 -step82: - -print =============== step9 -$i = 9 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = 1 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != null then - return -1 -endi -if $data04 != null then - return -1 -endi - -sql select * from $mt where tgcol3 = 1 -x step91 - return -1 -step91: -sql select * from $mt where tgcol2 = 1 -x step92 - return -1 -step92: - -print =============== step10 -$i = 10 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol1 = '1' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != null then - return -1 -endi -if $data04 != null then - return -1 -endi -if $data05 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step101 - return -1 -step101: -sql select * from $mt where tgcol3 = 1 -x step102 - return -1 -step102: -sql select * from $mt where tgcol4 = 1 -x step103 - return -1 -step103: - -print =============== step11 -$i = 11 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol4=4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 4.00000 then - return -1 -endi -if $data04 != null then - return -1 -endi -if $data05 != null then - return -1 -endi -if $data06 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step111 - return -1 -step111: -sql select * from $mt where tgcol3 = 1 -x step112 - return -1 -step112: -sql select * from $mt where tgcol5 = 1 -x step113 - return -1 -step113: - -print =============== step12 -$i = 12 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql select * from $mt where tgcol4 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 4.000000000 then - return -1 -endi -if $data04 != null then - return -1 -endi -if $data05 != null then - return -1 -endi -if $data06 != null then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 1 -x step120 - return -1 -step120: -sql select * from $mt where tgcol3 = 1 -x step121 - return -1 -step121: -sql select * from $mt where tgcol5 = 1 -x step122 - return -1 -step122: -sql select * from $mt where tgcol6 = 1 -x step123 - return -1 -step123: - -print =============== step13 -$i = 13 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i - -sql reset query cache -sql select * from $mt where tgcol2 = 2 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 5.000000000 then - return -1 -endi -if $data05 != null then - return -1 -endi -if $data06 != null then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol3 = 1 -x step130 - return -1 -step130: -sql select * from $mt where tgcol4 = 1 -x step131 - return -1 -step131: -sql select * from $mt where tgcol6 = 1 -x step133 - return -1 -step133: - -print =============== step14 -$i = 14 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 bigint) -sql create table $tb using $mt tags( 1, 1 ) -sql insert into $tb values(now, 1) - -sql alter table xxmt drop tag tag1 -x step141 - return -1 -step141: -sql alter table $tb drop tag tag1 -x step142 - return -1 -step142: -sql alter table $mt drop tag tag1 -x step143 - return -1 -step143: - -sql alter table $mt drop tag tagcol1 -x step144 - return -1 -step144: - -sql alter table $mt drop tag tgcol2 -sql alter table $mt drop tag tgcol1 -x step145 - return -1 -step145: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/double.sim b/tests/script/windows/tag/double.sim deleted file mode 100644 index 4381aa20f9..0000000000 --- a/tests/script/windows/tag/double.sim +++ /dev/null @@ -1,241 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_do_db -$tbPrefix = ta_do_tb -$mtPrefix = ta_do_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol double) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/filter.sim b/tests/script/windows/tag/filter.sim deleted file mode 100644 index 802e9a312f..0000000000 --- a/tests/script/windows/tag/filter.sim +++ /dev/null @@ -1,149 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_fi_db -$tbPrefix = ta_fi_tb -$mtPrefix = ta_fi_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tg = '1' -x step2 - return -1 -step2: - -print =============== step3 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where noexist = '1' -x step3 - return -1 -step3: - -print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' -if $rows != 1 then - return -1 -endi -if $data00 != 10 then - return -1 -endi - -print =============== step5 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(cc), sum(xx), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -x step6 - return -1 -step6: - -print =============== step7 -sql select count(tgcol), avg(tgcol), sum(tgcol), min(tgcol), max(tgcol), first(tgcol), last(tgcol) from $mt -x step7 - return -1 -step7: - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tbcol - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by noexist -x step9 - return -1 -step9: - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol) as c from $mt group by tbcol - -print =============== step12 -sql select count(tbcol) as c from $mt group by noexist -x step12 - return -1 -step12: - -print =============== step13 -sql select count(tbcol) as c from $mt group by tgcol -print $data00 -if $data00 != 100 then - return -1 -endi - -print =============== step14 -sql select count(tbcol) as c from $mt where ts > 1000 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - print expect 100, actual $data00 - return -1 -endi - -print =============== step15 -sql select count(tbcol) as c from $mt where noexist < 1 group by tgcol -x step15 - return -1 -step15: - -print =============== step16 -sql select count(tbcol) as c from $mt where tgcol = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/float.sim b/tests/script/windows/tag/float.sim deleted file mode 100644 index 8df44c24a5..0000000000 --- a/tests/script/windows/tag/float.sim +++ /dev/null @@ -1,241 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_fl_db -$tbPrefix = ta_fl_tb -$mtPrefix = ta_fl_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol float) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/int.sim b/tests/script/windows/tag/int.sim deleted file mode 100644 index dbff8c15b6..0000000000 --- a/tests/script/windows/tag/int.sim +++ /dev/null @@ -1,241 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_in_db -$tbPrefix = ta_in_tb -$mtPrefix = ta_in_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/int_binary.sim b/tests/script/windows/tag/int_binary.sim deleted file mode 100644 index 94aa9eb7f4..0000000000 --- a/tests/script/windows/tag/int_binary.sim +++ /dev/null @@ -1,308 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_inb_db -$tbPrefix = ta_inb_tb -$mtPrefix = ta_inb_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int, tgcol2 binary(5)) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, '0' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, '1' ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 = '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> '0' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = '1' -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> '1' -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tgcol2 = '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '1' -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tgcol2 = '1' and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = '0' and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = 1 and tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = 1 and tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - - -print =============== step13 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/int_float.sim b/tests/script/windows/tag/int_float.sim deleted file mode 100644 index 9789c9ea06..0000000000 --- a/tests/script/windows/tag/int_float.sim +++ /dev/null @@ -1,324 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_inf_db -$tbPrefix = ta_inf_tb -$mtPrefix = ta_inf_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int, tgcol2 float) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step3 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol2 > 0.5 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 < 0.5 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 > 0.5 and tgcol2 < 1.5 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step7 -sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step12 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 tgcol = 1 and tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - - -print =============== step13 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then - return -1 -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 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/set.sim b/tests/script/windows/tag/set.sim deleted file mode 100644 index 54b87c7d0c..0000000000 --- a/tests/script/windows/tag/set.sim +++ /dev/null @@ -1,457 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_se_db -$tbPrefix = ta_se_tb -$mtPrefix = ta_se_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i - -sql create database $db -sql use $db - -print =============== step2 -$i = 2 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $tb set tag tagcx 1 -x step21 - return -1 -step21: -sql alter table $tb set tag tgcol1=false -sql alter table $tb set tag tgcol2=4 - -sql reset query cache - -sql select * from $mt where tgcol1 = false -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql select * from $mt where tgcol2 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql describe $tb -print $data21 $data23 $data32 $data33 -if $data21 != BOOL then - return -1 -endi -if $data31 != INT then - return -1 -endi -if $data23 != TAG then - return -1 -endi -if $data33 != TAG then - return -1 -endi - -print =============== step3 -$i = 3 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $tb set tag tgcol1=3 -sql alter table $tb set tag tgcol2=4 - -sql reset query cache - -sql select * from $mt where tgcol1 = 3 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 3 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql select * from $mt where tgcol2 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 3 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql select * from $mt where tgcol2 = 2 -if $rows != 0 then - return -1 -endi - - -print =============== step4 -$i = 4 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) -sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = 1 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2.00000 then - return -1 -endi - -sql alter table $tb set tag tgcol1=3 -sql alter table $tb set tag tgcol2=4 - -sql reset query cache - -sql select * from $mt where tgcol1 = 3 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 3 then - return -1 -endi -if $data03 != 4.00000 then - return -1 -endi - -sql select * from $mt where tgcol2 = 4 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 3 then - return -1 -endi -if $data03 != 4.00000 then - return -1 -endi - - -print =============== step5 -$i = 5 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) -sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol2 = '2' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1.000000000 then - return -1 -endi -if $data03 != 2 then - return -1 -endi - -sql alter table $tb set tag tgcol1=3 -sql alter table $tb set tag tgcol2='4' - -sql reset query cache - -sql select * from $mt where tgcol1 = 3 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 3.000000000 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -sql select * from $mt where tgcol2 = '4' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 3.000000000 then - return -1 -endi -if $data03 != 4 then - return -1 -endi - -print =============== step6 -$i = 6 -$mt = $mtPrefix . $i -$tb = $tbPrefix . $i -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) -sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) -sql select * from $mt where tgcol1 = '1' -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 1 then - return -1 -endi -if $data03 != 2 then - return -1 -endi -if $data04 != 3 then - return -1 -endi -if $data05 != 4 then - return -1 -endi -if $data06 != 5.000000000 then - return -1 -endi -if $data07 != 6 then - return -1 -endi - -sql alter table $mt drop tag tgcol3 -sql alter table $tb set tag tgcol1='7' -sql alter table $tb set tag tgcol2=8 -sql alter table $tb set tag tgcol4='9' -sql alter table $tb set tag tgcol5=10 -sql alter table $tb set tag tgcol6='11' - -sql reset query cache - -sql select * from $mt where tgcol1 = '7' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 7 then - return -1 -endi -if $data03 != 8 then - return -1 -endi -if $data04 != 9 then - return -1 -endi -if $data05 != 10.000000000 then - return -1 -endi -if $data06 != 11 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol2 = 8 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 7 then - return -1 -endi -if $data03 != 8 then - return -1 -endi -if $data04 != 9 then - return -1 -endi -if $data05 != 10.000000000 then - return -1 -endi -if $data06 != 11 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol4 = '9' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 7 then - return -1 -endi -if $data03 != 8 then - return -1 -endi -if $data04 != 9 then - return -1 -endi -if $data05 != 10.000000000 then - return -1 -endi -if $data06 != 11 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol5 = 10 -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 7 then - return -1 -endi -if $data03 != 8 then - return -1 -endi -if $data04 != 9 then - return -1 -endi -if $data05 != 10.000000000 then - return -1 -endi -if $data06 != 11 then - return -1 -endi -if $data07 != null then - return -1 -endi - -sql select * from $mt where tgcol6 = '11' -print $data01 $data02 $data03 -if $rows != 1 then - return -1 -endi -if $data01 != 1 then - return -1 -endi -if $data02 != 7 then - return -1 -endi -if $data03 != 8 then - return -1 -endi -if $data04 != 9 then - return -1 -endi -if $data05 != 10.000000000 then - return -1 -endi -if $data06 != 11 then - return -1 -endi -if $data07 != null then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/smallint.sim b/tests/script/windows/tag/smallint.sim deleted file mode 100644 index bc668b164d..0000000000 --- a/tests/script/windows/tag/smallint.sim +++ /dev/null @@ -1,241 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_sm_db -$tbPrefix = ta_sm_tb -$mtPrefix = ta_sm_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol smallint) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/tag/tinyint.sim b/tests/script/windows/tag/tinyint.sim deleted file mode 100644 index 44fc9ba4dc..0000000000 --- a/tests/script/windows/tag/tinyint.sim +++ /dev/null @@ -1,241 +0,0 @@ -sql connect -sleep 2000 -print ======================== dnode1 start - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = ta_ti_db -$tbPrefix = ta_ti_tb -$mtPrefix = ta_ti_mt -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol tinyint) - -$i = 0 -while $i < 5 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw -while $i < 10 - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - $i = $i + 1 -endw - -print =============== step2 -sleep 100 -sql select * from $tb -if $rows != $rowNum then - return -1 -endi -sql select * from $tb where ts < now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts <= now + 4m -if $rows != 5 then - return -1 -endi -sql select * from $tb where ts > now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts >= now + 4m -if $rows != 15 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then - return -1 -endi -sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then - return -1 -endi -sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then - return -1 -endi - -print =============== step3 -sql select * from $mt -if $rows != $totalNum then - return -1 -endi - -sql select * from $mt where ts < now + 4m -if $rows != 50 then - return -1 -endi -sql select * from $mt where ts > now + 4m -if $rows != 150 then - return -1 -endi -sql select * from $mt where ts = now + 4m -if $rows != 0 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then - return -1 -endi - -print =============== step4 -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 1 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol = 0 -if $rows != 100 then - return -1 -endi -sql select * from $mt where tgcol <> 0 -if $rows != 100 then - return -1 -endi - -print =============== step5 -sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then - return -1 -endi -sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then - return -1 -endi -sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then - return -1 -endi - -print =============== step6 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then - return -1 -endi - -print =============== step7 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step8 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then - return -1 -endi - -print =============== step9 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then - return -1 -endi - -print =============== step11 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -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 $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data01 != 100 then - return -1 -endi - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/testSuite.sim b/tests/script/windows/testSuite.sim deleted file mode 100644 index e372217b62..0000000000 --- a/tests/script/windows/testSuite.sim +++ /dev/null @@ -1,93 +0,0 @@ -run windows/alter/table.sim -run windows/alter/metrics.sim - -run windows/compute/avg.sim -run windows/compute/bottom.sim -run windows/compute/count.sim -run windows/compute/diff.sim -run windows/compute/first.sim -run windows/compute/interval.sim -run windows/compute/last.sim -run windows/compute/leastsquare.sim -run windows/compute/max.sim -run windows/compute/min.sim -run windows/compute/percentile.sim -run windows/compute/stddev.sim -run windows/compute/sum.sim -run windows/compute/top.sim - -run windows/db/basic.sim -run windows/db/len.sim - -run windows/field/2.sim -run windows/field/3.sim -run windows/field/4.sim -run windows/field/5.sim -run windows/field/6.sim -run windows/field/bigint.sim -run windows/field/binary.sim -run windows/field/bool.sim -run windows/field/double.sim -run windows/field/float.sim -run windows/field/int.sim -run windows/field/single.sim -run windows/field/smallint.sim -run windows/field/tinyint.sim - -run windows/import/basic.sim - -run windows/insert/basic.sim -run windows/insert/query_block1_file.sim -run windows/insert/query_block1_memory.sim -run windows/insert/query_block2_file.sim -run windows/insert/query_block2_memory.sim -run windows/insert/query_file_memory.sim -run windows/insert/query_multi_file.sim - -run windows/table/binary.sim -run windows/table/bool.sim -run windows/table/column_num.sim -run windows/table/column_name.sim -run windows/table/column_value.sim -run windows/table/db.table.sim -run windows/table/double.sim -run windows/table/float.sim -run windows/table/table_len.sim -run windows/table/table.sim - -run windows/tag/3.sim -run windows/tag/4.sim -run windows/tag/5.sim -run windows/tag/6.sim -run windows/tag/add.sim -run windows/tag/bigint.sim -run windows/tag/binary_binary.sim -run windows/tag/binary.sim -run windows/tag/bool_binary.sim -run windows/tag/bool_int.sim -run windows/tag/bool.sim -run windows/tag/change.sim -run windows/tag/column.sim -run windows/tag/create.sim -run windows/tag/delete.sim -run windows/tag/double.sim -run windows/tag/filter.sim -run windows/tag/float.sim -run windows/tag/int_binary.sim -run windows/tag/int_float.sim -run windows/tag/int.sim -run windows/tag/set.sim -run windows/tag/smallint.sim -run windows/tag/tinyint.sim - -run windows/vector/metrics_field.sim -run windows/vector/metrics_mix.sim -run windows/vector/metrics_query.sim -run windows/vector/metrics_tag.sim -run windows/vector/metrics_time.sim -run windows/vector/multi.sim -run windows/vector/single.sim -run windows/vector/table_field.sim -run windows/vector/table_mix.sim -run windows/vector/table_query.sim -run windows/vector/table_time.sim diff --git a/tests/script/windows/vector/metrics_field.sim b/tests/script/windows/vector/metrics_field.sim deleted file mode 100644 index dfaa7e1d99..0000000000 --- a/tests/script/windows/vector/metrics_field.sim +++ /dev/null @@ -1,622 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_mf_db -$tbPrefix = m_mf_tb -$mtPrefix = m_mf_mt - -$dbPrefix = db -$tbPrefix = tb -$mtPrefix = mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $mt where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - a from $mt where a = 5 -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select b - f from $mt where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - b from $mt where a = 5 -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select c - f from $mt where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select d - f from $mt where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select e - f from $mt where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - f from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $mt where a = 5 -x step21 - return -1 -step21: - -sql select h - f from $mt where a = 5 -x step22 - return -1 -step22: - -sql select ts - f from $mt where a = 5 -x step23 - return -1 -step23: - -sql select a - e from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $mt where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a + f from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + a from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select b + f from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + b from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select c + f from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select d + f from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select e + f from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + f from $mt where a = 5 -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + e from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + e from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d + e from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + d from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + d from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + d from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + c from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + c from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + b from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + a from $mt where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a * f from $mt where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * a from $mt where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select b * f from $mt where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * b from $mt where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select c * f from $mt where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select d * f from $mt where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select e * f from $mt where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * f from $mt where a = 5 -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * e from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * e from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select d * e from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * d from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * d from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * d from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * c from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * c from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * b from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * a from $mt where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a / f from $mt where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / a from $mt where a = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b / f from $mt where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / b from $mt where a = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c / f from $mt where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select d / f from $mt where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select e / f from $mt where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / f from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $mt where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $mt where a = 5 -print ===> $data00 -if $data00 != 2.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $mt where a = 5 -print ===> $data00 -if $data00 != 0.400000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $mt where a = 5 -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $mt where a = 5 -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $mt where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $mt where a = 5 -print ===> $data00 -if $data00 != -15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $mt where a = 5 -print ===> $data00 -if $data00 != -1.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $mt where a = 5 -print ===> $data00 -if $data00 != -150.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $mt where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $mt where a = 5 -print ===> $data00 -if $data00 != -25.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $mt where a = 5 -print ===> $data00 -if $data00 != -1300.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $mt where a = 5 -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $mt where a = 5 -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $mt where a = 5 -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/metrics_mix.sim b/tests/script/windows/vector/metrics_mix.sim deleted file mode 100644 index 111fdebb05..0000000000 --- a/tests/script/windows/vector/metrics_mix.sim +++ /dev/null @@ -1,622 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_mx_db -$tbPrefix = m_mx_tb -$mtPrefix = m_mx_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - ffrom $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step020 - return -1 -step020: - -sql select a -f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select b - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select c - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select d - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select e - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step21 - return -1 -step21: - -sql select h - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step22 - return -1 -step22: - -sql select ts - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step23 - return -1 -step23: - -sql select a - e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a + f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select b + f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select c + f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select d + f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select e + f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d + e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select b * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select c * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select d * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select e * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select d * e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select d / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select e / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.400000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -150.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -25.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1300.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $mt where a = 5 and tgcol = 5 and ts > now + 4m and ts < now + 6m -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/metrics_query.sim b/tests/script/windows/vector/metrics_query.sim deleted file mode 100644 index 45e734f468..0000000000 --- a/tests/script/windows/vector/metrics_query.sim +++ /dev/null @@ -1,618 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_mq_db -$tbPrefix = m_mq_tb -$mtPrefix = m_mq_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $mt -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - a from $mt -print ===> $data00 -if $data00 != 9.000000000 then - return -1 -endi - -sql select b - f from $mt -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - b from $mt -print ===> $data00 -if $data00 != 9.000000000 then - return -1 -endi - -sql select c - f from $mt -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select d - f from $mt -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select e - f from $mt -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - f from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $mt -x step21 - return -1 -step21: - -sql select h - f from $mt -x step22 - return -1 -step22: - -sql select ts - f from $mt -x step23 - return -1 -step23: - -sql select a - e from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $mt -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb = $tbPrefix . $i - -sql select a + f from $mt -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + a from $mt -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select b + f from $mt -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + b from $mt -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select c + f from $mt -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select d + f from $mt -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select e + f from $mt -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + f from $mt -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + e from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c + e from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select d + e from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + d from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + d from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c + d from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + c from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + c from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + b from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + a from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb = $tbPrefix . $i - -sql select a * f from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * a from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b * f from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * b from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c * f from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d * f from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select e * f from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * f from $mt -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c * e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d * e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * d from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * d from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c * d from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * c from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * c from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * b from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * a from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb = $tbPrefix . $i - -sql select a / f from $mt -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / a from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b / f from $mt -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / b from $mt -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c / f from $mt -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select d / f from $mt -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select e / f from $mt -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / f from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $mt -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $mt -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $mt -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $mt -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $mt -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $mt -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $mt -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $mt -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $mt -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $mt -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $mt -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $mt -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $mt -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $mt -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $mt -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/metrics_tag.sim b/tests/script/windows/vector/metrics_tag.sim deleted file mode 100644 index 80c204fa10..0000000000 --- a/tests/script/windows/vector/metrics_tag.sim +++ /dev/null @@ -1,618 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_mtg_db -$tbPrefix = m_mtg_tb -$mtPrefix = m_mtg_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $mt -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 9.000000000 then - return -1 -endi - -sql select b - f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 9.000000000 then - return -1 -endi - -sql select c - f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select d - f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select e - f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $mt where tgcol = 5 -x step21 - return -1 -step21: - -sql select h - f from $mt where tgcol = 5 -x step22 - return -1 -step22: - -sql select ts - f from $mt where tgcol = 5 -x step23 - return -1 -step23: - -sql select a - e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb = $tbPrefix . $i - -sql select a + f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select b + f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select c + f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select d + f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select e + f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c + e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select d + e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c + d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb = $tbPrefix . $i - -sql select a * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select e * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c * e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d * e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c * d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb = $tbPrefix . $i - -sql select a / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select d / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select e / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $mt where tgcol = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $mt where tgcol = 5 -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $mt where tgcol = 5 -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $mt where tgcol = 5 -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $mt where tgcol = 5 -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/metrics_time.sim b/tests/script/windows/vector/metrics_time.sim deleted file mode 100644 index c127fe78fc..0000000000 --- a/tests/script/windows/vector/metrics_time.sim +++ /dev/null @@ -1,618 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_mt_db -$tbPrefix = m_mt_tb -$mtPrefix = m_mt_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select b - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select c - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select d - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select e - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step21 - return -1 -step21: - -sql select h - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step22 - return -1 -step22: - -sql select ts - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step23 - return -1 -step23: - -sql select a - e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a + f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select b + f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select c + f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select d + f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select e + f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d + e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select b * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select c * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select d * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select e * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select d * e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select d / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select e / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb where tgcol = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.400000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -150.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -25.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1300.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $mt where tgcol = 5 and ts > now + 4m and ts < now + 6m -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/multi.sim b/tests/script/windows/vector/multi.sim deleted file mode 100644 index ff63cda9a5..0000000000 --- a/tests/script/windows/vector/multi.sim +++ /dev/null @@ -1,215 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_mu_db -$tbPrefix = m_mu_tb -$mtPrefix = m_mu_mt - -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f binary(10), g bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a + b from $tb -print ===> $data00 $data10 $data20 $data30 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + c from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + d from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + e from $tb where ts < now + 4m order by ts desc - -sql select a + a from $tb where ts > now + 4m order by ts desc - -sql select a + c from $tb where ts < now + 4m order by ts asc - -sql select a + f from $tb where ts > now + 4m order by ts asc -x step24 - return -1 -step24: - -print =============== step3 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - e from $tb -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select a - b from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - e from $tb where ts > now + 4m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb = $tbPrefix . $i - -sql select a * b + e from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select a * b + c from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a * b -d from $tb where ts > now + 4m -print ===> $data20 -if $data20 != 42.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb = $tbPrefix . $i - -sql select a / 2 + e from $tb -print ===> $data00 -if $data00 != 10.500000000 then - return -1 -endi - -sql select a / 2 from $tb where ts < now + 4m -print ===> $data10 -if $data10 != 1.000000000 then - return -1 -endi - -sql select a / 2 * e from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a / e from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb = $tbPrefix . $i -sql select a + ts from $tb -x step61 - return -1 -step61: - -sql select a + f from $tb -x step62 - return -1 -step62: - -sql select a + g from $tb -x step63 - return -1 -step63: - -print =============== step7 -$i = 1 -$tb = $tbPrefix . $i - -sql select a + b from $tb where a = 2 -print ===> $data00 -if $data00 != 4.000000000 then - return -1 -endi - -sql select * from $tb where b < 2 -print ===> $rows -if $rows != 1 then - return -1 -endi - -sql select * from $tb where b > 2 -print ===> $rows -if $rows != 17 then - return -1 -endi - -sql select a + c from $tb where b = 2 and ts < now + 4m -print ===> $data00 -if $data00 != 4.000000000 then - return -1 -endi - -sql select a + d from $tb where c = 10 and ts > now + 4m -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $tb where d = 2 and ts < now + 4m order by ts desc - -sql select a + a from $tb where e = 2 and ts > now + 4m order by ts desc - -sql select a + c from $tb where f = 2 and ts < now + 4m order by ts asc - -sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc -x step74 - return -1 -step74: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/single.sim b/tests/script/windows/vector/single.sim deleted file mode 100644 index fb3a52760b..0000000000 --- a/tests/script/windows/vector/single.sim +++ /dev/null @@ -1,302 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_si_db -$tbPrefix = m_si_tb -$mtPrefix = m_si_mt - -$tbNum = 10 -$rowNum = 20 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 0 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select tbcol + 1 from $tb -print ===> $data00 $data10 $data20 $data30 -if $data00 != 1.000000000 then - return -1 -endi - -sql select tbcol + 1 from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select tbcol + 1 from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 6.000000000 then - return -1 -endi - -sql select tbcol + 1 from $tb where ts < now + 4m order by ts desc - -sql select tbcol + 1 from $tb where ts > now + 4m order by ts desc - -sql select tbcol + 1 from $tb where ts < now + 4m order by ts asc - -sql select tbcol + 1 from $tb where ts > now + 4m order by ts asc - -print =============== step3 -$i = 1 -$tb = $tbPrefix . $i - -sql select tbcol - 1 from $tb -print ===> $data00 -if $data00 != -1.000000000 then - return -1 -endi - -sql select tbcol - 1 from $tb where ts < now + 4m -print ===> $data00 -if $data00 != -1.000000000 then - return -1 -endi - -sql select tbcol - 1 from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 4.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb = $tbPrefix . $i - -sql select tbcol * 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select tbcol * 2 from $tb where ts < now + 4m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select tbcol * 2 from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb = $tbPrefix . $i - -sql select tbcol / 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select tbcol / 2 from $tb where ts < now + 4m -print ===> $data10 -if $data10 != 0.500000000 then - return -1 -endi - -sql select tbcol / 2 from $tb where ts > now + 4m -print ===> $data00 -if $data00 != 2.500000000 then - return -1 -endi - -sql select tbcol / 0 from $tb where ts > now + 4m -print ===> $data00 -#if $data00 != 0.000000000 then -# return -1 -#endi - -print =============== step6 -$i = 11 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, tbcol bool) -sql insert into $tb values(now, 0) -sql select tbcol + 2 from $tb -x step6 - return -1 -step6: - -print =============== step7 -$i = $i + 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, tbcol tinyint) -sql insert into $tb values(now, 0); -sql select tbcol + 2 from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi -sql select tbcol - 2 from $tb -print ===> $data00 -if $data00 != -2.000000000 then - return -1 -endi -sql select tbcol * 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi -sql select tbcol / 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step8 -$i = $i + 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, tbcol smallint) -sql insert into $tb values(now, 0); -sql select tbcol + 2 from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi -sql select tbcol - 2 from $tb -print ===> $data00 -if $data00 != -2.000000000 then - return -1 -endi -sql select tbcol * 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi -sql select tbcol / 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step9 -$i = $i + 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, tbcol bigint) -sql insert into $tb values(now, 0); -sql select tbcol + 2 from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi -sql select tbcol - 2 from $tb -print ===> $data00 -if $data00 != -2.000000000 then - return -1 -endi -sql select tbcol * 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi -sql select tbcol / 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step10 -$i = $i + 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, tbcol float) -sql insert into $tb values(now, 0); -sql select tbcol + 2 from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi -sql select tbcol - 2 from $tb -print ===> $data00 -if $data00 != -2.000000000 then - return -1 -endi -sql select tbcol * 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi -sql select tbcol / 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step11 -$i = $i + 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, tbcol double) -sql insert into $tb values(now, 0); -sql select tbcol + 2 from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi -sql select tbcol - 2 from $tb -print ===> $data00 -if $data00 != -2.000000000 then - return -1 -endi -sql select tbcol * 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi -sql select tbcol / 2 from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step12 -$i = $i + 1 -$tb = $tbPrefix . $i -sql create table $tb (ts timestamp, tbcol binary(100)) -sql insert into $tb values(now, '0'); -sql select tbcol + 2 from $tb -x step12 - return -1 -step12: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/table_field.sim b/tests/script/windows/vector/table_field.sim deleted file mode 100644 index 10c5148243..0000000000 --- a/tests/script/windows/vector/table_field.sim +++ /dev/null @@ -1,618 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_tf_db -$tbPrefix = m_tf_tb -$mtPrefix = m_tf_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $tb where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - a from $tb where a = 5 -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select b - f from $tb where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - b from $tb where a = 5 -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select c - f from $tb where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select d - f from $tb where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select e - f from $tb where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - f from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $tb where a = 5 -x step21 - return -1 -step21: - -sql select h - f from $tb where a = 5 -x step22 - return -1 -step22: - -sql select ts - f from $tb where a = 5 -x step23 - return -1 -step23: - -sql select a - e from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $tb where a = 5 -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb where a = 5 = $tbPrefix . $i - -sql select a + f from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + a from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select b + f from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + b from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select c + f from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select d + f from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select e + f from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + f from $tb where a = 5 -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + e from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + e from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d + e from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + d from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + d from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + d from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + c from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + c from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + b from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + a from $tb where a = 5 -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb where a = 5 = $tbPrefix . $i - -sql select a * f from $tb where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * a from $tb where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select b * f from $tb where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * b from $tb where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select c * f from $tb where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select d * f from $tb where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select e * f from $tb where a = 5 -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * f from $tb where a = 5 -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * e from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * e from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select d * e from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * d from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * d from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * d from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * c from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * c from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * b from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * a from $tb where a = 5 -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb where a = 5 = $tbPrefix . $i - -sql select a / f from $tb where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / a from $tb where a = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b / f from $tb where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / b from $tb where a = 5 -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c / f from $tb where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select d / f from $tb where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select e / f from $tb where a = 5 -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / f from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $tb where a = 5 -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb where a = 5 = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $tb where a = 5 -print ===> $data00 -if $data00 != 2.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $tb where a = 5 -print ===> $data00 -if $data00 != 0.400000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $tb where a = 5 -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $tb where a = 5 -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $tb where a = 5 -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $tb where a = 5 -print ===> $data00 -if $data00 != -15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $tb where a = 5 -print ===> $data00 -if $data00 != -1.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $tb where a = 5 -print ===> $data00 -if $data00 != -150.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $tb where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $tb where a = 5 -print ===> $data00 -if $data00 != -25.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $tb where a = 5 -print ===> $data00 -if $data00 != -1300.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $tb where a = 5 -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $tb where a = 5 -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $tb where a = 5 -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/table_mix.sim b/tests/script/windows/vector/table_mix.sim deleted file mode 100644 index 7418cb453d..0000000000 --- a/tests/script/windows/vector/table_mix.sim +++ /dev/null @@ -1,618 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_tm_db -$tbPrefix = m_tm_tb -$mtPrefix = m_tm_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $tb where a = 5 -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select b - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select c - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select d - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select e - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step21 - return -1 -step21: - -sql select h - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step22 - return -1 -step22: - -sql select ts - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step23 - return -1 -step23: - -sql select a - e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb where a = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a + f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select b + f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select c + f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select d + f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select e + f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d + e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb where a = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select b * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select c * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select d * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select e * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select d * e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb where a = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select d / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select e / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb where a = 5 and ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.400000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -150.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -25.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $tb where a = 5 and ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1300.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $tb where a = 5 and ts > now + 4m and ts < now + 6m -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/table_query.sim b/tests/script/windows/vector/table_query.sim deleted file mode 100644 index 7654688b26..0000000000 --- a/tests/script/windows/vector/table_query.sim +++ /dev/null @@ -1,618 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_tq_db -$tbPrefix = m_tq_tb -$mtPrefix = m_tq_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $tb -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - a from $tb -print ===> $data00 -if $data00 != 9.000000000 then - return -1 -endi - -sql select b - f from $tb -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - b from $tb -print ===> $data00 -if $data00 != 9.000000000 then - return -1 -endi - -sql select c - f from $tb -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select d - f from $tb -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select e - f from $tb -print ===> $data00 -if $data00 != -9.000000000 then - return -1 -endi - -sql select f - f from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $tb -x step21 - return -1 -step21: - -sql select h - f from $tb -x step22 - return -1 -step22: - -sql select ts - f from $tb -x step23 - return -1 -step23: - -sql select a - e from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $tb -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb = $tbPrefix . $i - -sql select a + f from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + a from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select b + f from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + b from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select c + f from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select d + f from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select e + f from $tb -print ===> $data00 -if $data00 != 11.000000000 then - return -1 -endi - -sql select f + f from $tb -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + e from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c + e from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select d + e from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + d from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + d from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c + d from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + c from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + c from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select a + b from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b + a from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb = $tbPrefix . $i - -sql select a * f from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * a from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b * f from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * b from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c * f from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d * f from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select e * f from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select f * f from $tb -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c * e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d * e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * d from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * d from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c * d from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * c from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * c from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a * b from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b * a from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb = $tbPrefix . $i - -sql select a / f from $tb -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / a from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b / f from $tb -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / b from $tb -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c / f from $tb -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select d / f from $tb -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select e / f from $tb -print ===> $data00 -if $data00 != 0.100000000 then - return -1 -endi - -sql select f / f from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $tb -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $tb -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $tb -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $tb -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $tb -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $tb -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $tb -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $tb -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $tb -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $tb -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $tb -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $tb -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $tb -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $tb -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $tb -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/script/windows/vector/table_time.sim b/tests/script/windows/vector/table_time.sim deleted file mode 100644 index bea9d41d1b..0000000000 --- a/tests/script/windows/vector/table_time.sim +++ /dev/null @@ -1,618 +0,0 @@ -sql connect -sleep 2000 - -sql show databases -sql drop database $data00 -x e1 -e1: -sql show databases -sql drop database $data00 -x e2 -e2: - -$dbPrefix = m_tt_db -$tbPrefix = m_tt_tb -$mtPrefix = m_tt_mt - -$tbNum = 10 -$rowNum = 21 -$totalNum = 200 - -print =============== step1 -$i = 0 -$db = $dbPrefix . $i -$mt = $mtPrefix . $i - -sql drop database $db -x step1 -step1: -sql create database $db -sql use $db -sql create table $mt (ts timestamp, a int, b float, c smallint, d double, e tinyint, f bigint, g binary(10), h bool) TAGS(tgcol int) - -$i = 0 -while $i < $tbNum - $tb = $tbPrefix . $i - sql create table $tb using $mt tags( $i ) - - $x = 1 - while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x , $x , $x , $x , $x , 10 , '11' , true ) - $x = $x + 1 - endw - - $i = $i + 1 -endw - -sleep 100 - -print =============== step2 -$i = 1 -$tb = $tbPrefix . $i - -sql select a - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select b - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 5.000000000 then - return -1 -endi - -sql select c - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select d - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select e - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select f - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select g - f from $tb where ts > now + 4m and ts < now + 6m -x step21 - return -1 -step21: - -sql select h - f from $tb where ts > now + 4m and ts < now + 6m -x step22 - return -1 -step22: - -sql select ts - f from $tb where ts > now + 4m and ts < now + 6m -x step23 - return -1 -step23: - -sql select a - e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select d - e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select c - d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select a - b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -sql select b - a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.000000000 then - return -1 -endi - -print =============== step3 -$i = 1 -$tb where ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a + f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select b + f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select c + f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select d + f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select e + f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f + f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 20.000000000 then - return -1 -endi - -sql select a + e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select d + e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select c + d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select a + b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -sql select b + a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 10.000000000 then - return -1 -endi - -print =============== step4 -$i = 1 -$tb where ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select b * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select c * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select d * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select e * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 50.000000000 then - return -1 -endi - -sql select f * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 100.000000000 then - return -1 -endi - -sql select a * e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select d * e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select c * d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select a * b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -sql select b * a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 25.000000000 then - return -1 -endi - -print =============== step5 -$i = 1 -$tb where ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select a / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select b / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.000000000 then - return -1 -endi - -sql select c / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select d / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select e / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.500000000 then - return -1 -endi - -sql select f / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select d / e from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select c / d from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / c from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select a / b from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -sql select b / a from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 1.000000000 then - return -1 -endi - -print =============== step6 -$i = 1 -$tb where ts > now + 4m and ts < now + 6m = $tbPrefix . $i - -sql select (a+b+c+d+e) / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 2.500000000 then - return -1 -endi - -sql select f / (a+b+c+d+e) from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 0.400000000 then - return -1 -endi - -sql select (a+b+c+d+e) * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select f * (a+b+c+d+e) from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 250.000000000 then - return -1 -endi - -sql select (a+b+c+d+e) - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != 15.000000000 then - return -1 -endi - -sql select f - (a+b+c+d+e) from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -15.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) / f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1.500000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) * f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -150.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) + f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -5.000000000 then - return -1 -endi - -sql select (f - (a+b+c+d+e)) - f from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -25.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e) * f as zz from $tb where ts > now + 4m and ts < now + 6m -print ===> $data00 -if $data00 != -1300.000000000 then - return -1 -endi - -sql select (f - (a*b+c)*a + d + e))) * f as zz from $tb where ts > now + 4m and ts < now + 6m -x step61 - return -1 -step61: - -sql select (f - (a*b+c)*a + d + e))) * 2f as zz from $tb where ts > now + 4m and ts < now + 6m -x step62 - return -1 -step62: - -sql select (f - (a*b+c)*a + d + e))) ** f as zz from $tb where ts > now + 4m and ts < now + 6m -x step63 - return -1 -step63: - -print =============== clear -sql drop database $db -sql show databases -if $rows != 0 then - return -1 -endi \ No newline at end of file diff --git a/tests/system-test/0-others/udfTest.py b/tests/system-test/0-others/udfTest.py index 9b145e9093..375b7a6272 100644 --- a/tests/system-test/0-others/udfTest.py +++ b/tests/system-test/0-others/udfTest.py @@ -301,13 +301,13 @@ class TDTestCase: tdSql.checkRows(1) tdSql.query("select ceil(num1) , min(num1) from tb;") tdSql.checkRows(1) - tdSql.error("select udf1(num1) , first(num1) from tb;") + tdSql.query("select udf1(num1) , first(num1) from tb;") - tdSql.error("select abs(num1) , first(num1) from tb;") + tdSql.query("select abs(num1) , first(num1) from tb;") - tdSql.error("select udf1(num1) , last(num1) from tb;") + tdSql.query("select udf1(num1) , last(num1) from tb;") - tdSql.error("select round(num1) , last(num1) from tb;") + tdSql.query("select round(num1) , last(num1) from tb;") tdSql.query("select udf1(num1) , top(num1,1) from tb;") tdSql.checkRows(1) @@ -327,9 +327,9 @@ class TDTestCase: tdSql.checkRows(1) tdSql.query("select floor(c1) , min(c1) from stb1;") tdSql.checkRows(1) - tdSql.error("select udf1(c1) , first(c1) from stb1;") + tdSql.query("select udf1(c1) , first(c1) from stb1;") - tdSql.error("select udf1(c1) , last(c1) from stb1;") + tdSql.query("select udf1(c1) , last(c1) from stb1;") tdSql.query("select udf1(c1) , top(c1 ,1) from stb1;") tdSql.checkRows(1) diff --git a/tests/system-test/0-others/udf_create.py b/tests/system-test/0-others/udf_create.py index 11ad8e1584..5f3ab2e863 100644 --- a/tests/system-test/0-others/udf_create.py +++ b/tests/system-test/0-others/udf_create.py @@ -303,13 +303,13 @@ class TDTestCase: tdSql.checkRows(1) tdSql.query("select ceil(num1) , min(num1) from tb;") tdSql.checkRows(1) - tdSql.error("select udf1(num1) , first(num1) from tb;") + tdSql.query("select udf1(num1) , first(num1) from tb;") - tdSql.error("select abs(num1) , first(num1) from tb;") + tdSql.query("select abs(num1) , first(num1) from tb;") - tdSql.error("select udf1(num1) , last(num1) from tb;") + tdSql.query("select udf1(num1) , last(num1) from tb;") - tdSql.error("select round(num1) , last(num1) from tb;") + tdSql.query("select round(num1) , last(num1) from tb;") tdSql.query("select udf1(num1) , top(num1,1) from tb;") tdSql.checkRows(1) @@ -329,9 +329,9 @@ class TDTestCase: tdSql.checkRows(1) tdSql.query("select floor(c1) , min(c1) from stb1;") tdSql.checkRows(1) - tdSql.error("select udf1(c1) , first(c1) from stb1;") + tdSql.query("select udf1(c1) , first(c1) from stb1;") - tdSql.error("select udf1(c1) , last(c1) from stb1;") + tdSql.query("select udf1(c1) , last(c1) from stb1;") tdSql.query("select udf1(c1) , top(c1 ,1) from stb1;") tdSql.checkRows(1) diff --git a/tests/system-test/0-others/udf_restart_taosd.py b/tests/system-test/0-others/udf_restart_taosd.py index c9eb22cf15..857921e32c 100644 --- a/tests/system-test/0-others/udf_restart_taosd.py +++ b/tests/system-test/0-others/udf_restart_taosd.py @@ -300,13 +300,13 @@ class TDTestCase: tdSql.checkRows(1) tdSql.query("select ceil(num1) , min(num1) from tb;") tdSql.checkRows(1) - tdSql.error("select udf1(num1) , first(num1) from tb;") + tdSql.query("select udf1(num1) , first(num1) from tb;") - tdSql.error("select abs(num1) , first(num1) from tb;") + tdSql.query("select abs(num1) , first(num1) from tb;") - tdSql.error("select udf1(num1) , last(num1) from tb;") + tdSql.query("select udf1(num1) , last(num1) from tb;") - tdSql.error("select round(num1) , last(num1) from tb;") + tdSql.query("select round(num1) , last(num1) from tb;") tdSql.query("select udf1(num1) , top(num1,1) from tb;") tdSql.checkRows(1) @@ -326,9 +326,9 @@ class TDTestCase: tdSql.checkRows(1) tdSql.query("select floor(c1) , min(c1) from stb1;") tdSql.checkRows(1) - tdSql.error("select udf1(c1) , first(c1) from stb1;") + tdSql.query("select udf1(c1) , first(c1) from stb1;") - tdSql.error("select udf1(c1) , last(c1) from stb1;") + tdSql.query("select udf1(c1) , last(c1) from stb1;") tdSql.query("select udf1(c1) , top(c1 ,1) from stb1;") tdSql.checkRows(1) diff --git a/tests/system-test/2-query/unique.py b/tests/system-test/2-query/unique.py index f910ff1439..aeebf2425a 100644 --- a/tests/system-test/2-query/unique.py +++ b/tests/system-test/2-query/unique.py @@ -266,7 +266,7 @@ class TDTestCase: tdSql.query("select unique(c1) from ct4") tdSql.checkRows(10) - tdSql.error("select unique(c1),tbname from ct1") + #tdSql.error("select unique(c1),tbname from ct1") #support #tdSql.error("select unique(c1),t1 from ct1") #support # unique with common col diff --git a/tools/taos-tools b/tools/taos-tools index a875a057d1..28a49b447f 160000 --- a/tools/taos-tools +++ b/tools/taos-tools @@ -1 +1 @@ -Subproject commit a875a057d1225d85c6323b9edaccc2b1a9641987 +Subproject commit 28a49b447f71c4f014ebbac858b7215b897d57fd