From 3a0ea21342749f91c8e4d80a35c91c40b1e73c9e Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 13 Oct 2022 19:54:25 +0800 Subject: [PATCH 01/99] fix: get SLastCol from array instead of SColVal --- source/dnode/vnode/src/tsdb/tsdbCache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index ac6be9af2d..1615edb6ce 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -1189,7 +1189,8 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { setNoneCol = false; for (iCol = noneCol; iCol < nCol; ++iCol) { // high version's column value - SColVal *tColVal = (SColVal *)taosArrayGet(pColArray, iCol); + SLastCol *lastColVal = (SLastCol *)taosArrayGet(pColArray, iCol); + SColVal *tColVal = &lastColVal->colVal; tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); if (!COL_VAL_IS_VALUE(tColVal) && COL_VAL_IS_VALUE(pColVal)) { From 977fc4b15cd93a1c7d5144e75237c5c3d4398ac5 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Fri, 14 Oct 2022 15:28:19 +0800 Subject: [PATCH 02/99] fix(tsdb/cache): release lock when table's empty --- source/dnode/vnode/src/tsdb/tsdbCache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 1615edb6ce..4088d35d3e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -1311,6 +1311,8 @@ int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUHand // if table's empty or error, return code of -1 // if (code < 0 || pRow == NULL) { if (code < 0 || pLastArray == NULL) { + taosThreadMutexUnlock(&pTsdb->lruMutex); + *handle = NULL; return 0; } From b62fa20b53fd9640d92250ed59ce22e5e9821d3a Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 17 Oct 2022 17:20:32 +0800 Subject: [PATCH 03/99] tsdb/cache: return last row as array of SLastCol --- source/dnode/vnode/src/tsdb/tsdbCache.c | 122 ++++++++++++++------ source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 3 +- 2 files changed, 91 insertions(+), 34 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 4088d35d3e..e27fc252a0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -61,8 +61,6 @@ static void getTableCacheKey(tb_uid_t uid, int cacheType, char *key, int *len) { *len = sizeof(uint64_t); } -static void deleteTableCacheLastrow(const void *key, size_t keyLen, void *value) { taosMemoryFree(value); } - static void deleteTableCacheLast(const void *key, size_t keyLen, void *value) { taosArrayDestroy(value); } int32_t tsdbCacheDeleteLastrow(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { @@ -75,13 +73,23 @@ int32_t tsdbCacheDeleteLastrow(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { getTableCacheKey(uid, 0, key, &keyLen); LRUHandle *h = taosLRUCacheLookup(pCache, key, keyLen); if (h) { - STSRow *pRow = (STSRow *)taosLRUCacheValue(pCache, h); - if (pRow->ts <= eKey) { + SArray *pLast = (SArray *)taosLRUCacheValue(pCache, h); + bool invalidate = false; + int16_t nCol = taosArrayGetSize(pLast); + + for (int16_t iCol = 0; iCol < nCol; ++iCol) { + SLastCol *tTsVal = (SLastCol *)taosArrayGet(pLast, iCol); + if (eKey >= tTsVal->ts) { + invalidate = true; + break; + } + } + + if (invalidate) { taosLRUCacheRelease(pCache, h, true); } else { taosLRUCacheRelease(pCache, h, false); } - // void taosLRUCacheErase(SLRUCache * cache, const void *key, size_t keyLen); } @@ -130,14 +138,23 @@ int32_t tsdbCacheDelete(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { getTableCacheKey(uid, 0, key, &keyLen); LRUHandle *h = taosLRUCacheLookup(pCache, key, keyLen); if (h) { - STSRow *pRow = (STSRow *)taosLRUCacheValue(pCache, h); - if (pRow->ts <= eKey) { + SArray *pLast = (SArray *)taosLRUCacheValue(pCache, h); + bool invalidate = false; + int16_t nCol = taosArrayGetSize(pLast); + + for (int16_t iCol = 0; iCol < nCol; ++iCol) { + SLastCol *tTsVal = (SLastCol *)taosArrayGet(pLast, iCol); + if (eKey >= tTsVal->ts) { + invalidate = true; + break; + } + } + + if (invalidate) { taosLRUCacheRelease(pCache, h, true); } else { taosLRUCacheRelease(pCache, h, false); } - - // void taosLRUCacheErase(SLRUCache * cache, const void *key, size_t keyLen); } // getTableCacheKey(uid, "l", key, &keyLen); @@ -177,6 +194,46 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, ST getTableCacheKey(uid, 0, key, &keyLen); LRUHandle *h = taosLRUCacheLookup(pCache, key, keyLen); if (h) { + STSchema *pTSchema = metaGetTbTSchema(pTsdb->pVnode->pMeta, uid, -1, 1); + TSKEY keyTs = row->ts; + bool invalidate = false; + + SArray *pLast = (SArray *)taosLRUCacheValue(pCache, h); + int16_t nCol = taosArrayGetSize(pLast); + int16_t iCol = 0; + + SLastCol *tTsVal = (SLastCol *)taosArrayGet(pLast, iCol); + if (keyTs > tTsVal->ts) { + STColumn *pTColumn = &pTSchema->columns[0]; + SColVal tColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = keyTs}); + + taosArraySet(pLast, iCol, &(SLastCol){.ts = keyTs, .colVal = tColVal}); + } + + for (++iCol; iCol < nCol; ++iCol) { + SLastCol *tTsVal1 = (SLastCol *)taosArrayGet(pLast, iCol); + if (keyTs >= tTsVal1->ts) { + SColVal *tColVal = &tTsVal1->colVal; + + SColVal colVal = {0}; + tTSRowGetVal(row, pTSchema, iCol, &colVal); + if (!COL_VAL_IS_NONE(&colVal)) { + if (keyTs == tTsVal1->ts && !COL_VAL_IS_NONE(tColVal)) { + invalidate = true; + + break; + } + } else { + taosArraySet(pLast, iCol, &(SLastCol){.ts = keyTs, .colVal = colVal}); + } + } + } + + _invalidate: + taosMemoryFreeClear(pTSchema); + + taosLRUCacheRelease(pCache, h, invalidate); + /* cacheRow = (STSRow *)taosLRUCacheValue(pCache, h); if (row->ts >= cacheRow->ts) { if (row->ts == cacheRow->ts) { @@ -218,9 +275,9 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, ST if (status != TAOS_LRU_STATUS_OK) { code = -1; } - /* tsdbCacheInsertLastrow(pCache, uid, row, dup); */ + // tsdbCacheInsertLastrow(pCache, uid, row, dup); } - } + }*/ } /*else { if (dup) { cacheRow = tdRowDup(row); @@ -1031,7 +1088,7 @@ _err: return code; } -static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRow) { +static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppColArray) { int32_t code = 0; STSchema *pTSchema = metaGetTbTSchema(pTsdb->pVnode->pMeta, uid, -1, 1); @@ -1055,12 +1112,14 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRo break; } + TSKEY rowTs = TSDBROW_TS(pRow); + if (lastRowTs == TSKEY_MAX) { - lastRowTs = TSDBROW_TS(pRow); + lastRowTs = rowTs; STColumn *pTColumn = &pTSchema->columns[0]; *pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = lastRowTs}); - if (taosArrayPush(pColArray, pColVal) == NULL) { + if (taosArrayPush(pColArray, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal}) == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err; } @@ -1068,7 +1127,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRo for (iCol = 1; iCol < nCol; ++iCol) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); - if (taosArrayPush(pColArray, pColVal) == NULL) { + if (taosArrayPush(pColArray, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal}) == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err; } @@ -1079,15 +1138,15 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRo } } if (!setNoneCol) { - // goto build the result ts row + // done, goto return pColArray break; } else { continue; } } - if ((TSDBROW_TS(pRow) < lastRowTs)) { - // goto build the result ts row + if ((rowTs < lastRowTs)) { + // done, goto return pColArray break; } @@ -1099,7 +1158,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRo tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal)) { - taosArraySet(pColArray, iCol, pColVal); + taosArraySet(pColArray, iCol, &(SLastCol){.ts = rowTs, .colVal = *pColVal}); } else if (COL_VAL_IS_NONE(tColVal) && COL_VAL_IS_NONE(pColVal) && !setNoneCol) { noneCol = iCol; setNoneCol = true; @@ -1110,14 +1169,13 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, STSRow **ppRo // build the result ts row here *dup = false; if (taosArrayGetSize(pColArray) == nCol) { - code = tdSTSRowNew(pColArray, pTSchema, ppRow); - if (code) goto _err; + *ppColArray = NULL; + taosArrayDestroy(pColArray); } else { - *ppRow = NULL; + *ppColArray = pColArray; } nextRowIterClose(&iter); - taosArrayDestroy(pColArray); taosMemoryFreeClear(pTSchema); return code; @@ -1178,7 +1236,7 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { } } if (!setNoneCol) { - // goto build the result ts row + // done, goto return pColArray break; } else { continue; @@ -1202,7 +1260,6 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { } } while (setNoneCol); - // build the result ts row here if (taosArrayGetSize(pColArray) <= 0) { *ppLastArray = NULL; taosArrayDestroy(pColArray); @@ -1233,13 +1290,13 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUH h = taosLRUCacheLookup(pCache, key, keyLen); if (!h) { - STSRow *pRow = NULL; + SArray *pArray = NULL; bool dup = false; // which is always false for now - code = mergeLastRow(uid, pTsdb, &dup, &pRow); + code = mergeLastRow(uid, pTsdb, &dup, &pArray); // if table's empty or error, return code of -1 - if (code < 0 || pRow == NULL) { - if (!dup && pRow) { - taosMemoryFree(pRow); + if (code < 0 || pArray == NULL) { + if (!dup && pArray) { + taosArrayDestroy(pArray); } taosThreadMutexUnlock(&pTsdb->lruMutex); @@ -1249,9 +1306,9 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUH return 0; } - _taos_lru_deleter_t deleter = deleteTableCacheLastrow; + _taos_lru_deleter_t deleter = deleteTableCacheLast; LRUStatus status = - taosLRUCacheInsert(pCache, key, keyLen, pRow, TD_ROW_LEN(pRow), deleter, NULL, TAOS_LRU_PRIORITY_LOW); + taosLRUCacheInsert(pCache, key, keyLen, pArray, pArray->capacity, deleter, NULL, TAOS_LRU_PRIORITY_LOW); if (status != TAOS_LRU_STATUS_OK) { code = -1; } @@ -1309,7 +1366,6 @@ int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUHand SArray *pLastArray = NULL; code = mergeLast(uid, pTsdb, &pLastArray); // if table's empty or error, return code of -1 - // if (code < 0 || pRow == NULL) { if (code < 0 || pLastArray == NULL) { taosThreadMutexUnlock(&pTsdb->lruMutex); diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 81219e1442..d0d0563649 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -128,7 +128,8 @@ static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint // no data in the table of Uid if (*h != NULL) { - *pRow = (STSRow*)taosLRUCacheValue(lruCache, *h); + //*pRow = (STSRow*)taosLRUCacheValue(lruCache, *h); + SArray* pLastrow = (SArray*)taosLRUCacheValue(lruCache, *h); } } else { code = tsdbCacheGetLastH(lruCache, uid, pr->pVnode->pTsdb, h); From da9df994615e5fd6634c829ecf4d8076c729a493 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 17 Oct 2022 17:59:43 +0800 Subject: [PATCH 04/99] fix(query): opt last query. --- include/common/tcommon.h | 21 +++++ source/dnode/vnode/src/inc/tsdb.h | 5 ++ source/dnode/vnode/src/tsdb/tsdbCache.c | 5 -- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 97 +++++++++++++++++---- source/libs/function/src/builtinsimpl.c | 21 ----- 5 files changed, 106 insertions(+), 43 deletions(-) diff --git a/include/common/tcommon.h b/include/common/tcommon.h index eaddf4e983..c32fe81335 100644 --- a/include/common/tcommon.h +++ b/include/common/tcommon.h @@ -78,6 +78,27 @@ typedef struct { int32_t exprIdx; } STupleKey; +typedef struct STuplePos { + union { + struct { + int32_t pageId; + int32_t offset; + }; + STupleKey streamTupleKey; + }; +} STuplePos; + +typedef struct SFirstLastRes { + bool hasResult; + // used for last_row function only, isNullRes in SResultRowEntry can not be passed to downstream.So, + // this attribute is required + bool isNull; + int32_t bytes; + int64_t ts; + STuplePos pos; + char buf[]; +} SFirstLastRes; + static inline int STupleKeyCmpr(const void* pKey1, int kLen1, const void* pKey2, int kLen2) { STupleKey* pTuple1 = (STupleKey*)pKey1; STupleKey* pTuple2 = (STupleKey*)pKey2; diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index bf110f1ae3..91761663e8 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -306,6 +306,11 @@ int32_t tsdbMerge(STsdb *pTsdb); #define TSDB_CACHE_LAST(c) (((c).cacheLast & 2) > 0) // tsdbCache ============================================================================================== +typedef struct { + TSKEY ts; + SColVal colVal; +} SLastCol; + int32_t tsdbOpenCache(STsdb *pTsdb); void tsdbCloseCache(STsdb *pTsdb); int32_t tsdbCacheInsertLast(SLRUCache *pCache, tb_uid_t uid, STSRow *row, STsdb *pTsdb); diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index de26df6c54..b5624db51c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -15,11 +15,6 @@ #include "tsdb.h" -typedef struct { - TSKEY ts; - SColVal colVal; -} SLastCol; - int32_t tsdbOpenCache(STsdb *pTsdb) { int32_t code = 0; SLRUCache *pCache = NULL; diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index d0d0563649..2d4a1b54cd 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -29,7 +29,7 @@ typedef struct SCacheRowsReader { SArray* pTableList; // table id list } SCacheRowsReader; -static void saveOneRow(STSRow* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds) { +static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds) { ASSERT(pReader->numOfCols <= taosArrayGetSize(pBlock->pDataBlock)); int32_t numOfRows = pBlock->info.rows; @@ -37,20 +37,35 @@ static void saveOneRow(STSRow* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea for (int32_t i = 0; i < pReader->numOfCols; ++i) { SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + SFirstLastRes *pRes = taosMemoryCalloc(1, sizeof(SFirstLastRes) + TSDB_KEYSIZE); + SLastCol *pColVal = (SLastCol *)taosArrayGet(pRow, i); + if (slotIds[i] == -1) { - colDataAppend(pColInfoData, numOfRows, (const char*)&pRow->ts, false); + pRes->ts = pColVal->ts; + pRes->bytes = TSDB_KEYSIZE; + pRes->isNull = false; + pRes->hasResult = true; + + colDataAppend(pColInfoData, numOfRows, (const char*)pRes, false); } else { int32_t slotId = slotIds[i]; - tTSRowGetVal(pRow, pReader->pSchema, slotId, &colVal); + int32_t bytes = pReader->pSchema->columns[slotId].bytes; + pRes = taosMemoryCalloc(1, sizeof(SFirstLastRes) + bytes); + pRes->bytes = bytes; + pRes->hasResult = true; if (IS_VAR_DATA_TYPE(colVal.type)) { if (!COL_VAL_IS_VALUE(&colVal)) { - colDataAppendNULL(pColInfoData, numOfRows); + pRes->isNull = true; + pRes->ts = pColVal->ts; + + colDataAppend(pColInfoData, numOfRows, (const char*)pRes, false); } else { - varDataSetLen(pReader->transferBuf[slotId], colVal.value.nData); - memcpy(varDataVal(pReader->transferBuf[slotId]), colVal.value.pData, colVal.value.nData); - colDataAppend(pColInfoData, numOfRows, pReader->transferBuf[slotId], false); + varDataSetLen(pRes->buf, colVal.value.nData); + memcpy(varDataVal(pRes->buf), colVal.value.pData, colVal.value.nData); + pRes->bytes = colVal.value.nData; + colDataAppend(pColInfoData, numOfRows, (const char*)pRes, false); } } else { colDataAppend(pColInfoData, numOfRows, (const char*)&colVal.value, !COL_VAL_IS_VALUE(&colVal)); @@ -117,7 +132,7 @@ void* tsdbCacherowsReaderClose(void* pReader) { return NULL; } -static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint64_t uid, STSRow** pRow, +static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint64_t uid, SArray** pRow, LRUHandle** h) { int32_t code = TSDB_CODE_SUCCESS; if ((pr->type & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW) { @@ -127,9 +142,8 @@ static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint } // no data in the table of Uid - if (*h != NULL) { - //*pRow = (STSRow*)taosLRUCacheValue(lruCache, *h); - SArray* pLastrow = (SArray*)taosLRUCacheValue(lruCache, *h); + if (*h != NULL) { // todo convert to SArray + *pRow = (SArray*)taosLRUCacheValue(lruCache, *h); } } else { code = tsdbCacheGetLastH(lruCache, uid, pr->pVnode->pTsdb, h); @@ -139,8 +153,7 @@ static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint // no data in the table of Uid if (*h != NULL) { - SArray* pLast = (SArray*)taosLRUCacheValue(lruCache, *h); - tsdbCacheLastArray2Row(pLast, pRow, pr->pSchema); + *pRow = (SArray*)taosLRUCacheValue(lruCache, *h); } } @@ -157,13 +170,17 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 int32_t code = TSDB_CODE_SUCCESS; SLRUCache* lruCache = pr->pVnode->pTsdb->lruCache; LRUHandle* h = NULL; - STSRow* pRow = NULL; + SArray* pRow = NULL; size_t numOfTables = taosArrayGetSize(pr->pTableList); + int64_t* lastTs = taosMemoryMalloc(TSDB_KEYSIZE * pr->pSchema->numOfCols); + for(int32_t i = 0; i < pr->pSchema->numOfCols; ++i) { + lastTs[i] = INT64_MIN; + } + // retrieve the only one last row of all tables in the uid list. if ((pr->type & CACHESCAN_RETRIEVE_TYPE_SINGLE) == CACHESCAN_RETRIEVE_TYPE_SINGLE) { - int64_t lastKey = INT64_MIN; - bool internalResult = false; + bool internalResult = false; for (int32_t i = 0; i < numOfTables; ++i) { STableKeyInfo* pKeyInfo = taosArrayGet(pr->pTableList, i); @@ -176,7 +193,53 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 continue; } + { + SFirstLastRes** pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES); + for(int32_t j = 0; j < pr->numOfCols; ++j) { + pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + pr->pSchema->columns[slotIds[j]].bytes); + pRes[j]->ts = INT64_MIN; + } + + for (int32_t k = 0; k < pr->numOfCols; ++k) { + SColumnInfoData* pColInfoData = taosArrayGet(pResBlock->pDataBlock, k); + + if (slotIds[k] == -1) { // the primary timestamp + SLastCol *pColVal = (SLastCol *)taosArrayGet(pRow, k); + if (pColVal->ts > pRes[k]->ts || !pRes[k]->hasResult) { + pRes[k]->hasResult = true; + pRes[k]->ts = pColVal->ts; + memcpy(pRes[k]->buf, &pColVal->ts, TSDB_KEYSIZE); + + colDataAppend(pColInfoData, 1, (const char*)pRes[k], false); + } + } else { + int32_t slotId = slotIds[k]; + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); + + if (pColVal->ts > pRes[k]->ts || !pRes[k]->hasResult) { + pRes[k]->hasResult = true; + pRes[k]->ts = pColVal->ts; + + pRes[k]->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal); + if (!pRes[k]->isNull) { + if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { + varDataSetLen(pRes[k]->buf, pColVal->colVal.value.nData); + memcpy(varDataVal(pRes[k]->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); + } else { + memcpy(pRes[k]->buf, &pColVal->colVal.value, pr->pSchema->columns[slotId].bytes); + } + } + + colDataAppend(pColInfoData, 1, (const char*)pRes[k], false); + } + } + } + } + +/* if (pRow->ts > lastKey) { + printf("qualified:%ld, old Value:%ld\n", pRow->ts, lastKey); + // Set result row into the same rowIndex repeatly, so we need to check if the internal result row has already // appended or not. if (internalResult) { @@ -189,7 +252,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 internalResult = true; lastKey = pRow->ts; } - +*/ tsdbCacheRelease(lruCache, h); } } else if ((pr->type & CACHESCAN_RETRIEVE_TYPE_ALL) == CACHESCAN_RETRIEVE_TYPE_ALL) { diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 7077a9b780..493561ca1e 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -57,16 +57,6 @@ typedef struct SAvgRes { int16_t type; // store the original input type, used in merge function } SAvgRes; -typedef struct STuplePos { - union { - struct { - int32_t pageId; - int32_t offset; - }; - STupleKey streamTupleKey; - }; -} STuplePos; - typedef struct SMinmaxResInfo { bool assign; // assign the first value or not int64_t v; @@ -93,17 +83,6 @@ typedef struct STopBotRes { STopBotResItem* pItems; } STopBotRes; -typedef struct SFirstLastRes { - bool hasResult; - // used for last_row function only, isNullRes in SResultRowEntry can not be passed to downstream.So, - // this attribute is required - bool isNull; - int32_t bytes; - int64_t ts; - STuplePos pos; - char buf[]; -} SFirstLastRes; - typedef struct SStddevRes { double result; int64_t count; From 109d50a4cc7af9cb0e5decef9b8b47a2b1f96850 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Mon, 17 Oct 2022 18:13:38 +0800 Subject: [PATCH 05/99] fix: last row array form bug --- source/dnode/vnode/src/tsdb/tsdbCache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index b5624db51c..f67a5cc444 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -1181,7 +1181,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo // build the result ts row here *dup = false; - if (taosArrayGetSize(pColArray) == nCol) { + if (taosArrayGetSize(pColArray) != nCol) { *ppColArray = NULL; taosArrayDestroy(pColArray); } else { From c8b180b129cf0155884c78d3e88762bd987aaf21 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 17 Oct 2022 19:14:06 +0800 Subject: [PATCH 06/99] fix(query): update the cached last query. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 97 +++++++------------ source/libs/executor/src/cachescanoperator.c | 1 + source/libs/executor/src/timewindowoperator.c | 28 +++--- source/libs/function/src/builtins.c | 2 +- source/libs/function/src/builtinsimpl.c | 93 ------------------ 5 files changed, 54 insertions(+), 167 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 2d4a1b54cd..be36848fec 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -29,48 +29,37 @@ typedef struct SCacheRowsReader { SArray* pTableList; // table id list } SCacheRowsReader; -static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds) { +static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds, + SFirstLastRes** pRes) { ASSERT(pReader->numOfCols <= taosArrayGetSize(pBlock->pDataBlock)); int32_t numOfRows = pBlock->info.rows; - SColVal colVal = {0}; for (int32_t i = 0; i < pReader->numOfCols; ++i) { SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); - SFirstLastRes *pRes = taosMemoryCalloc(1, sizeof(SFirstLastRes) + TSDB_KEYSIZE); - SLastCol *pColVal = (SLastCol *)taosArrayGet(pRow, i); - - if (slotIds[i] == -1) { - pRes->ts = pColVal->ts; - pRes->bytes = TSDB_KEYSIZE; - pRes->isNull = false; - pRes->hasResult = true; - - colDataAppend(pColInfoData, numOfRows, (const char*)pRes, false); + if (slotIds[i] == -1) { // the primary timestamp + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); + pRes[i]->ts = pColVal->ts; + memcpy(pRes[i]->buf, &pColVal->ts, TSDB_KEYSIZE); } else { - int32_t slotId = slotIds[i]; + int32_t slotId = slotIds[i]; + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); - int32_t bytes = pReader->pSchema->columns[slotId].bytes; - pRes = taosMemoryCalloc(1, sizeof(SFirstLastRes) + bytes); - pRes->bytes = bytes; - pRes->hasResult = true; + pRes[i]->ts = pColVal->ts; + pRes[i]->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal); - if (IS_VAR_DATA_TYPE(colVal.type)) { - if (!COL_VAL_IS_VALUE(&colVal)) { - pRes->isNull = true; - pRes->ts = pColVal->ts; - - colDataAppend(pColInfoData, numOfRows, (const char*)pRes, false); + if (!pRes[i]->isNull) { + if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { + varDataSetLen(pRes[i]->buf, pColVal->colVal.value.nData); + memcpy(varDataVal(pRes[i]->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); } else { - varDataSetLen(pRes->buf, colVal.value.nData); - memcpy(varDataVal(pRes->buf), colVal.value.pData, colVal.value.nData); - pRes->bytes = colVal.value.nData; - colDataAppend(pColInfoData, numOfRows, (const char*)pRes, false); + memcpy(pRes[i]->buf, &pColVal->colVal.value, pReader->pSchema->columns[slotId].bytes); } - } else { - colDataAppend(pColInfoData, numOfRows, (const char*)&colVal.value, !COL_VAL_IS_VALUE(&colVal)); } } + + pRes[i]->hasResult = true; + colDataAppend(pColInfoData, numOfRows, (const char*)pRes[i], false); } pBlock->info.rows += 1; @@ -142,7 +131,7 @@ static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint } // no data in the table of Uid - if (*h != NULL) { // todo convert to SArray + if (*h != NULL) { *pRow = (SArray*)taosLRUCacheValue(lruCache, *h); } } else { @@ -172,15 +161,16 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 LRUHandle* h = NULL; SArray* pRow = NULL; size_t numOfTables = taosArrayGetSize(pr->pTableList); + bool hasRes = false; - int64_t* lastTs = taosMemoryMalloc(TSDB_KEYSIZE * pr->pSchema->numOfCols); - for(int32_t i = 0; i < pr->pSchema->numOfCols; ++i) { - lastTs[i] = INT64_MIN; + SFirstLastRes** pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES); + for (int32_t j = 0; j < pr->numOfCols; ++j) { + pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + pr->pSchema->columns[slotIds[j]].bytes); + pRes[j]->ts = INT64_MIN; } // retrieve the only one last row of all tables in the uid list. if ((pr->type & CACHESCAN_RETRIEVE_TYPE_SINGLE) == CACHESCAN_RETRIEVE_TYPE_SINGLE) { - bool internalResult = false; for (int32_t i = 0; i < numOfTables; ++i) { STableKeyInfo* pKeyInfo = taosArrayGet(pr->pTableList, i); @@ -194,18 +184,13 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 } { - SFirstLastRes** pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES); - for(int32_t j = 0; j < pr->numOfCols; ++j) { - pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + pr->pSchema->columns[slotIds[j]].bytes); - pRes[j]->ts = INT64_MIN; - } - for (int32_t k = 0; k < pr->numOfCols; ++k) { SColumnInfoData* pColInfoData = taosArrayGet(pResBlock->pDataBlock, k); - if (slotIds[k] == -1) { // the primary timestamp - SLastCol *pColVal = (SLastCol *)taosArrayGet(pRow, k); + if (slotIds[k] == -1) { // the primary timestamp + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, k); if (pColVal->ts > pRes[k]->ts || !pRes[k]->hasResult) { + hasRes = true; pRes[k]->hasResult = true; pRes[k]->ts = pColVal->ts; memcpy(pRes[k]->buf, &pColVal->ts, TSDB_KEYSIZE); @@ -217,6 +202,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); if (pColVal->ts > pRes[k]->ts || !pRes[k]->hasResult) { + hasRes = true; pRes[k]->hasResult = true; pRes[k]->ts = pColVal->ts; @@ -236,25 +222,13 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 } } -/* - if (pRow->ts > lastKey) { - printf("qualified:%ld, old Value:%ld\n", pRow->ts, lastKey); - - // Set result row into the same rowIndex repeatly, so we need to check if the internal result row has already - // appended or not. - if (internalResult) { - pResBlock->info.rows -= 1; - taosArrayClear(pTableUidList); - } - - saveOneRow(pRow, pResBlock, pr, slotIds); - taosArrayPush(pTableUidList, &pKeyInfo->uid); - internalResult = true; - lastKey = pRow->ts; - } -*/ tsdbCacheRelease(lruCache, h); } + + if (hasRes) { + pResBlock->info.rows = 1; + } + } else if ((pr->type & CACHESCAN_RETRIEVE_TYPE_ALL) == CACHESCAN_RETRIEVE_TYPE_ALL) { for (int32_t i = pr->tableIndex; i < numOfTables; ++i) { STableKeyInfo* pKeyInfo = taosArrayGet(pr->pTableList, i); @@ -267,9 +241,10 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 continue; } - saveOneRow(pRow, pResBlock, pr, slotIds); - taosArrayPush(pTableUidList, &pKeyInfo->uid); + saveOneRow(pRow, pResBlock, pr, slotIds, pRes); + // TODO reset the pRes + taosArrayPush(pTableUidList, &pKeyInfo->uid); tsdbCacheRelease(lruCache, h); pr->tableIndex += 1; diff --git a/source/libs/executor/src/cachescanoperator.c b/source/libs/executor/src/cachescanoperator.c index 6106544a35..5d63892b7b 100644 --- a/source/libs/executor/src/cachescanoperator.c +++ b/source/libs/executor/src/cachescanoperator.c @@ -193,6 +193,7 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { pInfo->currentGroupIndex += 1; // check for tag values + // TODO NOTE: The uid of pInfo->pRes is required. if (pInfo->pRes->info.rows > 0) { if (pInfo->pseudoExprSup.numOfExprs > 0) { SExprSupp* pSup = &pInfo->pseudoExprSup; diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index c1478bc935..9c219d2765 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -1420,8 +1420,9 @@ static void doDeleteWindows(SOperatorInfo* pOperator, SInterval* pInterval, SSDa SColumnInfoData* pGpCol = taosArrayGet(pBlock->pDataBlock, GROUPID_COLUMN_INDEX); uint64_t* pGpDatas = (uint64_t*)pGpCol->pData; for (int32_t i = 0; i < pBlock->info.rows; i++) { - SResultRowInfo dumyInfo; + SResultRowInfo dumyInfo = {0}; dumyInfo.cur.pageId = -1; + STimeWindow win = {0}; if (IS_FINAL_OP(pInfo)) { win.skey = startTsCols[i]; @@ -5828,27 +5829,30 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys pInfo->ignoreExpiredData = pIntervalPhyNode->window.igExpired; pInfo->isFinal = false; - if (pIntervalPhyNode->window.pExprs != NULL) { - int32_t numOfScalar = 0; - SExprInfo* pScalarExprInfo = createExprInfo(pIntervalPhyNode->window.pExprs, NULL, &numOfScalar); - int32_t code = initExprSupp(&pInfo->scalarSupp, pScalarExprInfo, numOfScalar); - if (code != TSDB_CODE_SUCCESS) { - goto _error; - } - } + pInfo->primaryTsIndex = ((SColumnNode*)pIntervalPhyNode->window.pTspk)->slotId; initResultSizeInfo(&pOperator->resultInfo, 4096); SExprSupp* pSup = &pOperator->exprSupp; + + initBasicInfo(&pInfo->binfo, pResBlock); + initStreamFunciton(pSup->pCtx, pSup->numOfExprs); + initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); + size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; int32_t code = initAggInfo(pSup, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } - initBasicInfo(&pInfo->binfo, pResBlock); - initStreamFunciton(pSup->pCtx, pSup->numOfExprs); - initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); + if (pIntervalPhyNode->window.pExprs != NULL) { + int32_t numOfScalar = 0; + SExprInfo* pScalarExprInfo = createExprInfo(pIntervalPhyNode->window.pExprs, NULL, &numOfScalar); + code = initExprSupp(&pInfo->scalarSupp, pScalarExprInfo, numOfScalar); + if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + } pInfo->invertible = allInvertible(pSup->pCtx, numOfCols); pInfo->invertible = false; diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 2308aaf214..54e8c27d5b 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2402,7 +2402,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .translateFunc = translateFirstLast, .getEnvFunc = getFirstLastFuncEnv, .initFunc = functionSetup, - .processFunc = cachedLastRowFunction, + .processFunc = lastFunctionMerge, .finalizeFunc = firstLastFinalize }, { diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 493561ca1e..3255ef7d26 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -6148,99 +6148,6 @@ int32_t groupKeyFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { return pResInfo->numOfRes; } -int32_t interpFunction(SqlFunctionCtx* pCtx) { -#if 0 - int32_t fillType = (int32_t) pCtx->param[2].i64; - //bool ascQuery = (pCtx->order == TSDB_ORDER_ASC); - - if (pCtx->start.key == pCtx->startTs) { - assert(pCtx->start.key != INT64_MIN); - - COPY_TYPED_DATA(pCtx->pOutput, pCtx->inputType, &pCtx->start.val); - - goto interp_success_exit; - } else if (pCtx->end.key == pCtx->startTs && pCtx->end.key != INT64_MIN && fillType == TSDB_FILL_NEXT) { - COPY_TYPED_DATA(pCtx->pOutput, pCtx->inputType, &pCtx->end.val); - - goto interp_success_exit; - } - - switch (fillType) { - case TSDB_FILL_NULL: - setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes); - break; - - case TSDB_FILL_SET_VALUE: - tVariantDump(&pCtx->param[1], pCtx->pOutput, pCtx->inputType, true); - break; - - case TSDB_FILL_LINEAR: - if (pCtx->start.key == INT64_MIN || pCtx->start.key > pCtx->startTs - || pCtx->end.key == INT64_MIN || pCtx->end.key < pCtx->startTs) { - goto interp_exit; - } - - double v1 = -1, v2 = -1; - GET_TYPED_DATA(v1, double, pCtx->inputType, &pCtx->start.val); - GET_TYPED_DATA(v2, double, pCtx->inputType, &pCtx->end.val); - - SPoint point1 = {.key = pCtx->start.key, .val = &v1}; - SPoint point2 = {.key = pCtx->end.key, .val = &v2}; - SPoint point = {.key = pCtx->startTs, .val = pCtx->pOutput}; - - int32_t srcType = pCtx->inputType; - if (isNull((char *)&pCtx->start.val, srcType) || isNull((char *)&pCtx->end.val, srcType)) { - setNull(pCtx->pOutput, srcType, pCtx->inputBytes); - } else { - bool exceedMax = false, exceedMin = false; - taosGetLinearInterpolationVal(&point, pCtx->outputType, &point1, &point2, TSDB_DATA_TYPE_DOUBLE, &exceedMax, &exceedMin); - if (exceedMax || exceedMin) { - __compar_fn_t func = getComparFunc((int32_t)pCtx->inputType, 0); - if (func(&pCtx->start.val, &pCtx->end.val) <= 0) { - COPY_TYPED_DATA(pCtx->pOutput, pCtx->inputType, exceedMax ? &pCtx->start.val : &pCtx->end.val); - } else { - COPY_TYPED_DATA(pCtx->pOutput, pCtx->inputType, exceedMax ? &pCtx->end.val : &pCtx->start.val); - } - } - } - break; - - case TSDB_FILL_PREV: - if (pCtx->start.key == INT64_MIN || pCtx->start.key > pCtx->startTs) { - goto interp_exit; - } - - COPY_TYPED_DATA(pCtx->pOutput, pCtx->inputType, &pCtx->start.val); - break; - - case TSDB_FILL_NEXT: - if (pCtx->end.key == INT64_MIN || pCtx->end.key < pCtx->startTs) { - goto interp_exit; - } - - COPY_TYPED_DATA(pCtx->pOutput, pCtx->inputType, &pCtx->end.val); - break; - - case TSDB_FILL_NONE: - // do nothing - default: - goto interp_exit; - } - - - interp_success_exit: - *(TSKEY*)pCtx->ptsOutputBuf = pCtx->startTs; - INC_INIT_VAL(pCtx, 1); - - interp_exit: - pCtx->start.key = INT64_MIN; - pCtx->end.key = INT64_MIN; - pCtx->endTs = pCtx->startTs; -#endif - - return TSDB_CODE_SUCCESS; -} - int32_t cachedLastRowFunction(SqlFunctionCtx* pCtx) { int32_t numOfElems = 0; From 0228caaa0d23944c3ff0eb1f842bbabcd6490257 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 18 Oct 2022 11:38:59 +0800 Subject: [PATCH 07/99] enh: last cache optimize --- include/libs/function/functionMgt.h | 3 + source/libs/function/src/builtins.c | 10 +++ source/libs/function/src/functionMgt.c | 6 ++ source/libs/planner/src/planOptimizer.c | 78 +++++++++++++++++-- source/libs/planner/test/planBasicTest.cpp | 18 ----- source/libs/planner/test/planOptimizeTest.cpp | 19 +++++ 6 files changed, 109 insertions(+), 25 deletions(-) diff --git a/include/libs/function/functionMgt.h b/include/libs/function/functionMgt.h index 569c16675d..6968f1712c 100644 --- a/include/libs/function/functionMgt.h +++ b/include/libs/function/functionMgt.h @@ -129,6 +129,7 @@ typedef enum EFunctionType { FUNCTION_TYPE_TO_COLUMN, FUNCTION_TYPE_GROUP_KEY, FUNCTION_TYPE_CACHE_LAST_ROW, + FUNCTION_TYPE_CACHE_LAST, // distributed splitting functions FUNCTION_TYPE_APERCENTILE_PARTIAL = 4000, @@ -216,6 +217,8 @@ bool fmIsKeepOrderFunc(int32_t funcId); bool fmIsCumulativeFunc(int32_t funcId); bool fmIsInterpPseudoColumnFunc(int32_t funcId); +void getLastCacheDataType(SDataType* pType); + int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc); typedef enum EFuncDataRequired { diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 54e8c27d5b..f03d8354fa 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2405,6 +2405,16 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .processFunc = lastFunctionMerge, .finalizeFunc = firstLastFinalize }, + { + .name = "_cache_last", + .type = FUNCTION_TYPE_CACHE_LAST, + .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_MULTI_RES_FUNC | FUNC_MGT_FORBID_STREAM_FUNC, + .translateFunc = translateFirstLast, + .getEnvFunc = getFirstLastFuncEnv, + .initFunc = functionSetup, + .processFunc = lastFunctionMerge, + .finalizeFunc = firstLastFinalize + }, { .name = "_last_row_partial", .type = FUNCTION_TYPE_LAST_PARTIAL, diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index ca8ddbc60a..40af7bb567 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -16,6 +16,7 @@ #include "functionMgt.h" #include "builtins.h" +#include "builtinsimpl.h" #include "functionMgtInt.h" #include "taos.h" #include "taoserror.h" @@ -314,6 +315,11 @@ bool fmIsSameInOutType(int32_t funcId) { return res; } +void getLastCacheDataType(SDataType* pType) { + pType->bytes = getFirstLastInfoSize(pType->bytes) + VARSTR_HEADER_SIZE; + pType->type = TSDB_DATA_TYPE_BINARY; +} + static int32_t getFuncInfo(SFunctionNode* pFunc) { char msg[128] = {0}; return fmGetFuncInfo(pFunc, msg, sizeof(msg)); diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 9a2cfa3339..0fc1be8a70 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2120,6 +2120,22 @@ static int32_t rewriteUniqueOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLog return rewriteUniqueOptimizeImpl(pCxt, pLogicSubplan, pIndef); } +static EDealRes lastRowScanOptHasTagImpl(SNode* pNode, void* pContext) { + if (QUERY_NODE_COLUMN == nodeType(pNode)) { + if (COLUMN_TYPE_TAG == ((SColumnNode*)pNode)->colType || COLUMN_TYPE_TBNAME == ((SColumnNode*)pNode)->colType) { + *(bool*)pContext = true; + return DEAL_RES_END; + } + } + return DEAL_RES_CONTINUE; +} + +static bool lastRowScanOptHasTag(SNode* pExpr) { + bool hasTag = false; + nodesWalkExpr(pExpr, lastRowScanOptHasTagImpl, &hasTag); + return hasTag; +} + static bool lastRowScanOptMayBeOptimized(SLogicNode* pNode) { if (QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode) || 1 != LIST_LENGTH(pNode->pChildren) || QUERY_NODE_LOGIC_PLAN_SCAN != nodeType(nodesListGetNode(pNode->pChildren, 0))) { @@ -2134,12 +2150,22 @@ static bool lastRowScanOptMayBeOptimized(SLogicNode* pNode) { return false; } + bool hasLastFunc = false; + bool hasSelectFunc = false; SNode* pFunc = NULL; FOREACH(pFunc, ((SAggLogicNode*)pNode)->pAggFuncs) { - if (FUNCTION_TYPE_LAST_ROW != ((SFunctionNode*)pFunc)->funcType && - FUNCTION_TYPE_LAST != ((SFunctionNode*)pFunc)->funcType && - FUNCTION_TYPE_SELECT_VALUE != ((SFunctionNode*)pFunc)->funcType && - FUNCTION_TYPE_GROUP_KEY != ((SFunctionNode*)pFunc)->funcType) { + SFunctionNode* pAggFunc = (SFunctionNode*)pFunc; + if (FUNCTION_TYPE_LAST == pAggFunc->funcType) { + if (hasSelectFunc || lastRowScanOptHasTag(nodesListGetNode(pAggFunc->pParameterList, 0))) { + return false; + } + hasLastFunc = true; + } else if (FUNCTION_TYPE_SELECT_VALUE == pAggFunc->funcType || FUNCTION_TYPE_GROUP_KEY == pAggFunc->funcType) { + if (hasLastFunc) { + return false; + } + hasSelectFunc = true; + } else if (FUNCTION_TYPE_LAST_ROW != pAggFunc->funcType) { return false; } } @@ -2147,6 +2173,31 @@ static bool lastRowScanOptMayBeOptimized(SLogicNode* pNode) { return true; } +typedef struct SLastRowScanOptSetColDataTypeCxt { + bool doAgg; + SNodeList* pLastCols; +} SLastRowScanOptSetColDataTypeCxt; + +static EDealRes lastRowScanOptSetColDataType(SNode* pNode, void* pContext) { + if (QUERY_NODE_COLUMN == nodeType(pNode)) { + SLastRowScanOptSetColDataTypeCxt* pCxt = pContext; + if (pCxt->doAgg) { + nodesListMakeAppend(&pCxt->pLastCols, pNode); + getLastCacheDataType(&(((SColumnNode*)pNode)->node.resType)); + } else { + SNode* pCol = NULL; + FOREACH(pCol, pCxt->pLastCols) { + if (nodesEqualNode(pCol, pNode)) { + getLastCacheDataType(&(((SColumnNode*)pNode)->node.resType)); + break; + } + } + } + return DEAL_RES_IGNORE_CHILD; + } + return DEAL_RES_CONTINUE; +} + static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogicSubplan) { SAggLogicNode* pAgg = (SAggLogicNode*)optFindPossibleNode(pLogicSubplan->pNode, lastRowScanOptMayBeOptimized); @@ -2154,22 +2205,35 @@ static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogic return TSDB_CODE_SUCCESS; } - SNode* pNode = NULL; + SLastRowScanOptSetColDataTypeCxt cxt = {.doAgg = true, .pLastCols = NULL}; + SNode* pNode = NULL; FOREACH(pNode, pAgg->pAggFuncs) { SFunctionNode* pFunc = (SFunctionNode*)pNode; - if (FUNCTION_TYPE_LAST_ROW == pFunc->funcType || FUNCTION_TYPE_LAST == pFunc->funcType) { - int32_t len = snprintf(pFunc->functionName, sizeof(pFunc->functionName), "_cache_last_row"); + int32_t funcType = pFunc->funcType; + if (FUNCTION_TYPE_LAST_ROW == funcType || FUNCTION_TYPE_LAST == funcType) { + int32_t len = snprintf(pFunc->functionName, sizeof(pFunc->functionName), + FUNCTION_TYPE_LAST_ROW == funcType ? "_cache_last_row" : "_cache_last"); pFunc->functionName[len] = '\0'; int32_t code = fmGetFuncInfo(pFunc, NULL, 0); if (TSDB_CODE_SUCCESS != code) { + nodesClearList(cxt.pLastCols); return code; } + if (FUNCTION_TYPE_LAST == funcType) { + nodesWalkExpr(nodesListGetNode(pFunc->pParameterList, 0), lastRowScanOptSetColDataType, &cxt); + } } } SScanLogicNode* pScan = (SScanLogicNode*)nodesListGetNode(pAgg->node.pChildren, 0); pScan->scanType = SCAN_TYPE_LAST_ROW; pScan->igLastNull = pAgg->hasLast ? true : false; + if (NULL != cxt.pLastCols) { + cxt.doAgg = false; + nodesWalkExprs(pScan->pScanCols, lastRowScanOptSetColDataType, &cxt); + nodesWalkExprs(pScan->pScanPseudoCols, lastRowScanOptSetColDataType, &cxt); + nodesClearList(cxt.pLastCols); + } pAgg->hasLastRow = false; pAgg->hasLast = false; diff --git a/source/libs/planner/test/planBasicTest.cpp b/source/libs/planner/test/planBasicTest.cpp index 0baec147a2..c5a9a447c7 100644 --- a/source/libs/planner/test/planBasicTest.cpp +++ b/source/libs/planner/test/planBasicTest.cpp @@ -105,24 +105,6 @@ TEST_F(PlanBasicTest, interpFunc) { run("SELECT _IROWTS, INTERP(c1) FROM t1 RANGE('2017-7-14 18:00:00', '2017-7-14 19:00:00') EVERY(5s) FILL(LINEAR)"); } -TEST_F(PlanBasicTest, lastRowFunc) { - useDb("root", "cache_db"); - - run("SELECT LAST_ROW(c1) FROM t1"); - - run("SELECT LAST_ROW(*) FROM t1"); - - run("SELECT LAST_ROW(c1, c2) FROM t1"); - - run("SELECT LAST_ROW(c1), c2 FROM t1"); - - run("SELECT LAST_ROW(c1) FROM st1"); - - run("SELECT LAST_ROW(c1) FROM st1 PARTITION BY TBNAME"); - - run("SELECT LAST_ROW(c1), SUM(c3) FROM t1"); -} - TEST_F(PlanBasicTest, lastRowFuncWithoutCache) { useDb("root", "test"); diff --git a/source/libs/planner/test/planOptimizeTest.cpp b/source/libs/planner/test/planOptimizeTest.cpp index c2a0aee847..fb4f32a9bf 100644 --- a/source/libs/planner/test/planOptimizeTest.cpp +++ b/source/libs/planner/test/planOptimizeTest.cpp @@ -109,9 +109,28 @@ TEST_F(PlanOptimizeTest, mergeProjects) { TEST_F(PlanOptimizeTest, pushDownProjectCond) { useDb("root", "test"); + run("select 1-abs(c1) from (select unique(c1) c1 from st1s3) where 1-c1>5 order by 1 nulls first"); } +TEST_F(PlanOptimizeTest, LastRowScan) { + useDb("root", "cache_db"); + + run("SELECT LAST_ROW(c1), c2 FROM t1"); + + run("SELECT LAST_ROW(c1), c2, tag1, tbname FROM st1"); + + run("SELECT LAST_ROW(c1) FROM st1 PARTITION BY TBNAME"); + + run("SELECT LAST_ROW(c1), SUM(c3) FROM t1"); + + run("SELECT LAST_ROW(tag1) FROM st1"); + + run("SELECT LAST(c1) FROM st1"); + + run("SELECT LAST(c1), c2 FROM st1"); +} + TEST_F(PlanOptimizeTest, tagScan) { useDb("root", "test"); run("select tag1 from st1 group by tag1"); From 60e7f2800bc350f53333efd0c341bab0febf5dc7 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 18 Oct 2022 17:39:28 +0800 Subject: [PATCH 08/99] fix(query): fix bug in cached last query. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 151 ++++++++++++-------- source/libs/planner/src/planOptimizer.c | 1 + 2 files changed, 95 insertions(+), 57 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index be36848fec..791c73047c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -30,36 +30,69 @@ typedef struct SCacheRowsReader { } SCacheRowsReader; static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds, - SFirstLastRes** pRes) { + void** pRes) { ASSERT(pReader->numOfCols <= taosArrayGetSize(pBlock->pDataBlock)); int32_t numOfRows = pBlock->info.rows; - for (int32_t i = 0; i < pReader->numOfCols; ++i) { - SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + if ((pReader->type & CACHESCAN_RETRIEVE_LAST) == CACHESCAN_RETRIEVE_LAST) { + for (int32_t i = 0; i < pReader->numOfCols; ++i) { + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + SFirstLastRes* p = (SFirstLastRes*)varDataVal(pRes[i]); - if (slotIds[i] == -1) { // the primary timestamp - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); - pRes[i]->ts = pColVal->ts; - memcpy(pRes[i]->buf, &pColVal->ts, TSDB_KEYSIZE); - } else { - int32_t slotId = slotIds[i]; - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); + if (slotIds[i] == -1) { // the primary timestamp + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); + p->ts = pColVal->ts; + p->bytes = TSDB_KEYSIZE; + *(int64_t*)p->buf = pColVal->ts; + } else { + int32_t slotId = slotIds[i]; + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); - pRes[i]->ts = pColVal->ts; - pRes[i]->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal); + p->ts = pColVal->ts; + p->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal); + if (!p->isNull) { + if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { + varDataSetLen(p->buf, pColVal->colVal.value.nData); + memcpy(varDataVal(p->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); + p->bytes = pColVal->colVal.value.nData; + } else { + memcpy(p->buf, &pColVal->colVal.value, pReader->pSchema->columns[slotId].bytes); + p->bytes = pReader->pSchema->columns[slotId].bytes; + } + } + } - if (!pRes[i]->isNull) { - if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { - varDataSetLen(pRes[i]->buf, pColVal->colVal.value.nData); - memcpy(varDataVal(pRes[i]->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); + p->hasResult = true; + varDataSetLen(pRes[i], pColInfoData->info.bytes); + colDataAppend(pColInfoData, numOfRows, (const char*)pRes[i], false); + } + } else { + ASSERT((pReader->type & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW); + + SColVal colVal = {0}; + for (int32_t i = 0; i < pReader->numOfCols; ++i) { + SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); + + if (slotIds[i] == -1) { + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, 0); + colDataAppend(pColInfoData, numOfRows, (const char*)&pColVal->ts, false); + } else { + int32_t slotId = slotIds[i]; + SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); + + if (IS_VAR_DATA_TYPE(colVal.type)) { + if (!COL_VAL_IS_VALUE(&pColVal->colVal)) { + colDataAppendNULL(pColInfoData, numOfRows); + } else { + varDataSetLen(pReader->transferBuf[slotId], colVal.value.nData); + memcpy(varDataVal(pReader->transferBuf[slotId]), colVal.value.pData, colVal.value.nData); + colDataAppend(pColInfoData, numOfRows, pReader->transferBuf[slotId], false); + } } else { - memcpy(pRes[i]->buf, &pColVal->colVal.value, pReader->pSchema->columns[slotId].bytes); + colDataAppend(pColInfoData, numOfRows, (const char*)&colVal.value, !COL_VAL_IS_VALUE(&pColVal->colVal)); } } } - - pRes[i]->hasResult = true; - colDataAppend(pColInfoData, numOfRows, (const char*)pRes[i], false); } pBlock->info.rows += 1; @@ -126,24 +159,17 @@ static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint int32_t code = TSDB_CODE_SUCCESS; if ((pr->type & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW) { code = tsdbCacheGetLastrowH(lruCache, uid, pr->pVnode->pTsdb, h); - if (code != TSDB_CODE_SUCCESS) { - return code; - } - - // no data in the table of Uid - if (*h != NULL) { - *pRow = (SArray*)taosLRUCacheValue(lruCache, *h); - } } else { code = tsdbCacheGetLastH(lruCache, uid, pr->pVnode->pTsdb, h); - if (code != TSDB_CODE_SUCCESS) { - return code; - } + } - // no data in the table of Uid - if (*h != NULL) { - *pRow = (SArray*)taosLRUCacheValue(lruCache, *h); - } + if (code != TSDB_CODE_SUCCESS) { + return code; + } + + // no data in the table of Uid + if (*h != NULL) { + *pRow = (SArray*)taosLRUCacheValue(lruCache, *h); } return code; @@ -163,10 +189,26 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 size_t numOfTables = taosArrayGetSize(pr->pTableList); bool hasRes = false; - SFirstLastRes** pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES); + void** pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES); for (int32_t j = 0; j < pr->numOfCols; ++j) { - pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + pr->pSchema->columns[slotIds[j]].bytes); - pRes[j]->ts = INT64_MIN; + pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + pr->pSchema->columns[slotIds[j]].bytes + VARSTR_HEADER_SIZE); + SFirstLastRes* p = (SFirstLastRes*)varDataVal(pRes[j]); + p->ts = INT64_MIN; + } + + SArray* pLastCols = taosArrayInit(pr->pSchema->numOfCols, sizeof(SLastCol)); + for (int32_t i = 0; i < pr->numOfCols; ++i) { + SLastCol p = {0}; + p.ts = INT64_MIN; + + struct STColumn* pCol = &pr->pSchema->columns[i]; + p.colVal.type = pCol->type; + + if (IS_VAR_DATA_TYPE(pCol->type)) { + p.colVal.value.pData = taosMemoryCalloc(pCol->bytes, sizeof(char)); + } + + taosArrayPush(pLastCols, &p); } // retrieve the only one last row of all tables in the uid list. @@ -185,38 +227,32 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 { for (int32_t k = 0; k < pr->numOfCols; ++k) { - SColumnInfoData* pColInfoData = taosArrayGet(pResBlock->pDataBlock, k); - + SLastCol* p = taosArrayGet(pLastCols, k); if (slotIds[k] == -1) { // the primary timestamp - SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, k); - if (pColVal->ts > pRes[k]->ts || !pRes[k]->hasResult) { + SLastCol* pCol = (SLastCol*)taosArrayGet(pRow, k); + if (pCol->ts > p->ts) { hasRes = true; - pRes[k]->hasResult = true; - pRes[k]->ts = pColVal->ts; - memcpy(pRes[k]->buf, &pColVal->ts, TSDB_KEYSIZE); - - colDataAppend(pColInfoData, 1, (const char*)pRes[k], false); + p->ts = pCol->ts; + p->colVal = pCol->colVal; } } else { int32_t slotId = slotIds[k]; SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); - if (pColVal->ts > pRes[k]->ts || !pRes[k]->hasResult) { + if (pColVal->ts > p->ts) { hasRes = true; - pRes[k]->hasResult = true; - pRes[k]->ts = pColVal->ts; + p->ts = pColVal->ts; - pRes[k]->isNull = !COL_VAL_IS_VALUE(&pColVal->colVal); - if (!pRes[k]->isNull) { + if (!COL_VAL_IS_VALUE(&pColVal->colVal)) { if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { - varDataSetLen(pRes[k]->buf, pColVal->colVal.value.nData); - memcpy(varDataVal(pRes[k]->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); + uint8_t* px = p->colVal.value.pData; + p->colVal = pColVal->colVal; + p->colVal.value.pData = px; + memcpy(px, pColVal->colVal.value.pData, pColVal->colVal.value.nData); } else { - memcpy(pRes[k]->buf, &pColVal->colVal.value, pr->pSchema->columns[slotId].bytes); + p->colVal = pColVal->colVal; } } - - colDataAppend(pColInfoData, 1, (const char*)pRes[k], false); } } } @@ -227,6 +263,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 if (hasRes) { pResBlock->info.rows = 1; + saveOneRow(pLastCols, pResBlock, pr, slotIds, pRes); } } else if ((pr->type & CACHESCAN_RETRIEVE_TYPE_ALL) == CACHESCAN_RETRIEVE_TYPE_ALL) { diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 0fc1be8a70..7a145e7dde 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2232,6 +2232,7 @@ static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogic cxt.doAgg = false; nodesWalkExprs(pScan->pScanCols, lastRowScanOptSetColDataType, &cxt); nodesWalkExprs(pScan->pScanPseudoCols, lastRowScanOptSetColDataType, &cxt); + nodesWalkExprs(pScan->node.pTargets, lastRowScanOptSetColDataType, &cxt); nodesClearList(cxt.pLastCols); } pAgg->hasLastRow = false; From e4940e82c53ac6d616077768438fe15189705d6d Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 18 Oct 2022 17:54:29 +0800 Subject: [PATCH 09/99] fix(query): update last_row callback function. --- source/libs/function/src/builtins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index f03d8354fa..4644b15dea 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2402,7 +2402,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .translateFunc = translateFirstLast, .getEnvFunc = getFirstLastFuncEnv, .initFunc = functionSetup, - .processFunc = lastFunctionMerge, + .processFunc = lastRowFunction, .finalizeFunc = firstLastFinalize }, { From cbfc9872c6b134ae8c4b862e9ab7a2e878d65233 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 18 Oct 2022 18:28:49 +0800 Subject: [PATCH 10/99] fix: add cachesize in show create database result --- include/common/tmsg.h | 1 + source/common/src/tmsg.c | 2 ++ source/dnode/mnode/impl/src/mndDb.c | 1 + source/libs/command/src/command.c | 4 ++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 5e2ca8896a..0febcdbba7 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -889,6 +889,7 @@ typedef struct { int32_t numOfVgroups; int32_t numOfStables; int32_t buffer; + int32_t cacheSize; int32_t pageSize; int32_t pages; int32_t daysPerFile; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 55e5616dd5..a3135c1f55 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -2761,6 +2761,7 @@ int32_t tSerializeSDbCfgRsp(void *buf, int32_t bufLen, const SDbCfgRsp *pRsp) { if (tEncodeI32(&encoder, pRsp->numOfVgroups) < 0) return -1; if (tEncodeI32(&encoder, pRsp->numOfStables) < 0) return -1; if (tEncodeI32(&encoder, pRsp->buffer) < 0) return -1; + if (tEncodeI32(&encoder, pRsp->cacheSize) < 0) return -1; if (tEncodeI32(&encoder, pRsp->pageSize) < 0) return -1; if (tEncodeI32(&encoder, pRsp->pages) < 0) return -1; if (tEncodeI32(&encoder, pRsp->daysPerFile) < 0) return -1; @@ -2800,6 +2801,7 @@ int32_t tDeserializeSDbCfgRsp(void *buf, int32_t bufLen, SDbCfgRsp *pRsp) { if (tDecodeI32(&decoder, &pRsp->numOfVgroups) < 0) return -1; if (tDecodeI32(&decoder, &pRsp->numOfStables) < 0) return -1; if (tDecodeI32(&decoder, &pRsp->buffer) < 0) return -1; + if (tDecodeI32(&decoder, &pRsp->cacheSize) < 0) return -1; if (tDecodeI32(&decoder, &pRsp->pageSize) < 0) return -1; if (tDecodeI32(&decoder, &pRsp->pages) < 0) return -1; if (tDecodeI32(&decoder, &pRsp->daysPerFile) < 0) return -1; diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 3b31873857..b62097a4f0 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -863,6 +863,7 @@ static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq) { cfgRsp.numOfVgroups = pDb->cfg.numOfVgroups; cfgRsp.numOfStables = pDb->cfg.numOfStables; cfgRsp.buffer = pDb->cfg.buffer; + cfgRsp.cacheSize = pDb->cfg.cacheLastSize; cfgRsp.pageSize = pDb->cfg.pageSize; cfgRsp.pages = pDb->cfg.pages; cfgRsp.daysPerFile = pDb->cfg.daysPerFile; diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 33e5b0e1e4..c32adb17ae 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -268,10 +268,10 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S len += sprintf( buf2 + VARSTR_HEADER_SIZE, - "CREATE DATABASE `%s` BUFFER %d CACHEMODEL '%s' COMP %d DURATION %dm " + "CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %dm " "WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d " "STRICT '%s' WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d", - dbFName, pCfg->buffer, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile, pCfg->walFsyncPeriod, + dbFName, pCfg->buffer, pCfg->cacheSize, cacheModelStr(pCfg->cacheLast), pCfg->compression, pCfg->daysPerFile, pCfg->walFsyncPeriod, pCfg->maxRows, pCfg->minRows, pCfg->daysToKeep0, pCfg->daysToKeep1, pCfg->daysToKeep2, pCfg->pages, pCfg->pageSize, prec, pCfg->replications, strictStr(pCfg->strict), pCfg->walLevel, pCfg->numOfVgroups, 1 == pCfg->numOfStables); From d7e01b30c7ba5e67bc71b1387d11376347daecba Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 18 Oct 2022 19:13:42 +0800 Subject: [PATCH 11/99] fix(query): update last_row callback function. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 791c73047c..38c10e8354 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -54,7 +54,7 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { varDataSetLen(p->buf, pColVal->colVal.value.nData); memcpy(varDataVal(p->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); - p->bytes = pColVal->colVal.value.nData; + p->bytes = pColVal->colVal.value.nData + VARSTR_HEADER_SIZE; } else { memcpy(p->buf, &pColVal->colVal.value, pReader->pSchema->columns[slotId].bytes); p->bytes = pReader->pSchema->columns[slotId].bytes; From c7c99ae34634be4ec6852bdc6f6961c132264c8b Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 19 Oct 2022 09:33:54 +0800 Subject: [PATCH 12/99] fix(query): update last_row callback function. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 27 +++++++++++++++++---- source/libs/function/src/builtins.c | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 38c10e8354..63c889985a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -188,15 +188,26 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 SArray* pRow = NULL; size_t numOfTables = taosArrayGetSize(pr->pTableList); bool hasRes = false; + SArray* pLastCols = NULL; void** pRes = taosMemoryCalloc(pr->numOfCols, POINTER_BYTES); + if (pRes == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _end; + } + for (int32_t j = 0; j < pr->numOfCols; ++j) { pRes[j] = taosMemoryCalloc(1, sizeof(SFirstLastRes) + pr->pSchema->columns[slotIds[j]].bytes + VARSTR_HEADER_SIZE); SFirstLastRes* p = (SFirstLastRes*)varDataVal(pRes[j]); p->ts = INT64_MIN; } - SArray* pLastCols = taosArrayInit(pr->pSchema->numOfCols, sizeof(SLastCol)); + pLastCols = taosArrayInit(pr->pSchema->numOfCols, sizeof(SLastCol)); + if (pLastCols == NULL) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _end; + } + for (int32_t i = 0; i < pr->numOfCols; ++i) { SLastCol p = {0}; p.ts = INT64_MIN; @@ -262,7 +273,6 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 } if (hasRes) { - pResBlock->info.rows = 1; saveOneRow(pLastCols, pResBlock, pr, slotIds, pRes); } @@ -286,12 +296,19 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 pr->tableIndex += 1; if (pResBlock->info.rows >= pResBlock->info.capacity) { - return TSDB_CODE_SUCCESS; + goto _end; } } } else { - return TSDB_CODE_INVALID_PARA; + code = TSDB_CODE_INVALID_PARA; } - return TSDB_CODE_SUCCESS; + _end: + for (int32_t j = 0; j < pr->numOfCols; ++j) { + taosMemoryFree(pRes[j]); + } + + taosMemoryFree(pRes); + taosArrayDestroy(pLastCols); + return code; } diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 4644b15dea..ce440a525a 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2402,7 +2402,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { .translateFunc = translateFirstLast, .getEnvFunc = getFirstLastFuncEnv, .initFunc = functionSetup, - .processFunc = lastRowFunction, + .processFunc = cachedLastRowFunction, .finalizeFunc = firstLastFinalize }, { From 5dcd319d3b566b16e25ae4ee83c982de133a9a79 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 19 Oct 2022 10:07:20 +0800 Subject: [PATCH 13/99] fix(query): update last_row callback function. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 63c889985a..53f8d5be16 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -69,7 +69,6 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea } else { ASSERT((pReader->type & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW); - SColVal colVal = {0}; for (int32_t i = 0; i < pReader->numOfCols; ++i) { SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); @@ -79,17 +78,18 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea } else { int32_t slotId = slotIds[i]; SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); + SColVal* pVal = &pColVal->colVal; - if (IS_VAR_DATA_TYPE(colVal.type)) { + if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { if (!COL_VAL_IS_VALUE(&pColVal->colVal)) { colDataAppendNULL(pColInfoData, numOfRows); } else { - varDataSetLen(pReader->transferBuf[slotId], colVal.value.nData); - memcpy(varDataVal(pReader->transferBuf[slotId]), colVal.value.pData, colVal.value.nData); + varDataSetLen(pReader->transferBuf[slotId], pVal->value.nData); + memcpy(varDataVal(pReader->transferBuf[slotId]), pVal->value.pData, pVal->value.nData); colDataAppend(pColInfoData, numOfRows, pReader->transferBuf[slotId], false); } } else { - colDataAppend(pColInfoData, numOfRows, (const char*)&colVal.value, !COL_VAL_IS_VALUE(&pColVal->colVal)); + colDataAppend(pColInfoData, numOfRows, (const char*)&pVal->value.val, !COL_VAL_IS_VALUE(pVal)); } } } @@ -157,6 +157,8 @@ void* tsdbCacherowsReaderClose(void* pReader) { static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint64_t uid, SArray** pRow, LRUHandle** h) { int32_t code = TSDB_CODE_SUCCESS; + *pRow = NULL; + if ((pr->type & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW) { code = tsdbCacheGetLastrowH(lruCache, uid, pr->pVnode->pTsdb, h); } else { @@ -208,12 +210,9 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 goto _end; } - for (int32_t i = 0; i < pr->numOfCols; ++i) { - SLastCol p = {0}; - p.ts = INT64_MIN; - + for (int32_t i = 0; i < pr->pSchema->numOfCols; ++i) { struct STColumn* pCol = &pr->pSchema->columns[i]; - p.colVal.type = pCol->type; + SLastCol p = {.ts = INT64_MIN, .colVal.type = pCol->type}; if (IS_VAR_DATA_TYPE(pCol->type)) { p.colVal.value.pData = taosMemoryCalloc(pCol->bytes, sizeof(char)); @@ -254,7 +253,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 hasRes = true; p->ts = pColVal->ts; - if (!COL_VAL_IS_VALUE(&pColVal->colVal)) { + if (COL_VAL_IS_VALUE(&pColVal->colVal)) { if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { uint8_t* px = p->colVal.value.pData; p->colVal = pColVal->colVal; From 467c6386edd71c116e99acec2091650bff9e4972 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 19 Oct 2022 11:06:08 +0800 Subject: [PATCH 14/99] fix: last_row array element type --- source/dnode/vnode/src/tsdb/tsdbCache.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index f67a5cc444..7f664f9e37 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -1109,7 +1109,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo int16_t iCol = 0; int16_t noneCol = 0; bool setNoneCol = false; - SArray *pColArray = taosArrayInit(nCol, sizeof(SColVal)); + SArray *pColArray = taosArrayInit(nCol, sizeof(SLastCol)); SColVal *pColVal = &(SColVal){0}; TSKEY lastRowTs = TSKEY_MAX; @@ -1140,7 +1140,14 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo for (iCol = 1; iCol < nCol; ++iCol) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); - if (taosArrayPush(pColArray, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal}) == NULL) { + SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal}; + /* + if (IS_VAR_DATA_TYPE(pColVal->type)) { + lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); + } + */ + if (taosArrayPush(pColArray, &lastCol) == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err; } From 12fd11c481b21dbb48194c53609674d25c8341cd Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 19 Oct 2022 11:41:30 +0800 Subject: [PATCH 15/99] fix(query): fix syntax error. --- source/libs/executor/src/timewindowoperator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index db9ebf12c2..1bcf274460 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -5462,9 +5462,11 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys } SStreamIntervalPhysiNode* pIntervalPhyNode = (SStreamIntervalPhysiNode*)pPhyNode; + int32_t code = TSDB_CODE_SUCCESS; int32_t numOfCols = 0; SExprInfo* pExprInfo = createExprInfo(pIntervalPhyNode->window.pFuncs, NULL, &numOfCols); ASSERT(numOfCols > 0); + SSDataBlock* pResBlock = createResDataBlock(pPhyNode->pOutputDataBlockDesc); SInterval interval = { .interval = pIntervalPhyNode->interval, @@ -5474,6 +5476,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys .offset = pIntervalPhyNode->offset, .precision = ((SColumnNode*)pIntervalPhyNode->window.pTspk)->node.resType.precision, }; + STimeWindowAggSupp twAggSupp = { .waterMark = pIntervalPhyNode->window.watermark, .calTrigger = pIntervalPhyNode->window.triggerType, @@ -5481,6 +5484,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys .minTs = INT64_MAX, .deleteMark = INT64_MAX, }; + ASSERT(twAggSupp.calTrigger != STREAM_TRIGGER_MAX_DELAY); pOperator->pTaskInfo = pTaskInfo; pInfo->interval = interval; @@ -5502,7 +5506,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys } size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; - int32_t code = initAggInfo(pSup, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); + code = initAggInfo(pSup, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } From a1c18bba33dc550dc5f6690cc4cf7f4212023482 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 19 Oct 2022 13:58:59 +0800 Subject: [PATCH 16/99] fix: cache load calculation --- source/dnode/vnode/src/tsdb/tsdbCache.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 7f664f9e37..d3051f78c7 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -1328,9 +1328,9 @@ int32_t tsdbCacheGetLastrowH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUH return 0; } + size_t charge = pArray->capacity * pArray->elemSize + sizeof(*pArray); _taos_lru_deleter_t deleter = deleteTableCacheLast; - LRUStatus status = - taosLRUCacheInsert(pCache, key, keyLen, pArray, pArray->capacity, deleter, NULL, TAOS_LRU_PRIORITY_LOW); + LRUStatus status = taosLRUCacheInsert(pCache, key, keyLen, pArray, charge, deleter, NULL, TAOS_LRU_PRIORITY_LOW); if (status != TAOS_LRU_STATUS_OK) { code = -1; } @@ -1395,9 +1395,10 @@ int32_t tsdbCacheGetLastH(SLRUCache *pCache, tb_uid_t uid, STsdb *pTsdb, LRUHand return 0; } + size_t charge = pLastArray->capacity * pLastArray->elemSize + sizeof(*pLastArray); _taos_lru_deleter_t deleter = deleteTableCacheLast; - LRUStatus status = taosLRUCacheInsert(pCache, key, keyLen, pLastArray, pLastArray->capacity, deleter, NULL, - TAOS_LRU_PRIORITY_LOW); + LRUStatus status = + taosLRUCacheInsert(pCache, key, keyLen, pLastArray, charge, deleter, NULL, TAOS_LRU_PRIORITY_LOW); if (status != TAOS_LRU_STATUS_OK) { code = -1; } From ceec953498ad481a885c835644921c47c785e625 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 19 Oct 2022 14:50:36 +0800 Subject: [PATCH 17/99] fix: copy binary type column data out --- source/dnode/vnode/src/tsdb/tsdbCache.c | 46 +++++++++++++++++++++---- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index d3051f78c7..d4cca40b89 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -56,7 +56,18 @@ static void getTableCacheKey(tb_uid_t uid, int cacheType, char *key, int *len) { *len = sizeof(uint64_t); } -static void deleteTableCacheLast(const void *key, size_t keyLen, void *value) { taosArrayDestroy(value); } +static void deleteTableCacheLast(const void *key, size_t keyLen, void *value) { + SArray *pLastArray = (SArray *)value; + int16_t nCol = taosArrayGetSize(pLastArray); + for (int16_t iCol = 0; iCol < nCol; ++iCol) { + SLastCol *pLastCol = (SLastCol *)taosArrayGet(pLastArray, iCol); + if (IS_VAR_DATA_TYPE(pLastCol->colVal.type)) { + taosMemoryFree(pLastCol->colVal.value.pData); + } + } + + taosArrayDestroy(value); +} int32_t tsdbCacheDeleteLastrow(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) { int32_t code = 0; @@ -1141,12 +1152,11 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal}; - /* if (IS_VAR_DATA_TYPE(pColVal->type)) { lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); } - */ + if (taosArrayPush(pColArray, &lastCol) == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err; @@ -1178,7 +1188,16 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal)) { - taosArraySet(pColArray, iCol, &(SLastCol){.ts = rowTs, .colVal = *pColVal}); + SLastCol lastCol = {.ts = rowTs, .colVal = *pColVal}; + if (IS_VAR_DATA_TYPE(pColVal->type)) { + SLastCol *pLastCol = (SLastCol *)taosArrayGet(pColArray, iCol); + taosMemoryFree(pLastCol->colVal.value.pData); + + lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); + } + + taosArraySet(pColArray, iCol, &lastCol); } else if (COL_VAL_IS_NONE(tColVal) && COL_VAL_IS_NONE(pColVal) && !setNoneCol) { noneCol = iCol; setNoneCol = true; @@ -1245,7 +1264,13 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { for (iCol = 1; iCol < nCol; ++iCol) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); - if (taosArrayPush(pColArray, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal}) == NULL) { + SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal}; + if (IS_VAR_DATA_TYPE(pColVal->type)) { + lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); + } + + if (taosArrayPush(pColArray, &lastCol) == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _err; } @@ -1272,7 +1297,16 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); if (!COL_VAL_IS_VALUE(tColVal) && COL_VAL_IS_VALUE(pColVal)) { - taosArraySet(pColArray, iCol, &(SLastCol){.ts = rowTs, .colVal = *pColVal}); + SLastCol lastCol = {.ts = rowTs, .colVal = *pColVal}; + if (IS_VAR_DATA_TYPE(pColVal->type)) { + SLastCol *pLastCol = (SLastCol *)taosArrayGet(pColArray, iCol); + taosMemoryFree(pLastCol->colVal.value.pData); + + lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); + } + + taosArraySet(pColArray, iCol, &lastCol); } else if (!COL_VAL_IS_VALUE(tColVal) && !COL_VAL_IS_VALUE(pColVal) && !setNoneCol) { noneCol = iCol; setNoneCol = true; From 640338893df2ea7feb5cfe58f9b97b87cff4723a Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 19 Oct 2022 15:01:49 +0800 Subject: [PATCH 18/99] tsdb/cache: handle OOM exceptions --- source/dnode/vnode/src/tsdb/tsdbCache.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index d4cca40b89..e2bc9d0bec 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -1144,6 +1144,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo *pColVal = COL_VAL_VALUE(pTColumn->colId, pTColumn->type, (SValue){.val = lastRowTs}); if (taosArrayPush(pColArray, &(SLastCol){.ts = lastRowTs, .colVal = *pColVal}) == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY; goto _err; } @@ -1154,6 +1155,11 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal}; if (IS_VAR_DATA_TYPE(pColVal->type)) { lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + if (lastCol.colVal.value.pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); } @@ -1194,6 +1200,11 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo taosMemoryFree(pLastCol->colVal.value.pData); lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + if (lastCol.colVal.value.pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); } @@ -1267,6 +1278,11 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal}; if (IS_VAR_DATA_TYPE(pColVal->type)) { lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + if (lastCol.colVal.value.pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); } @@ -1303,6 +1319,11 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { taosMemoryFree(pLastCol->colVal.value.pData); lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); + if (lastCol.colVal.value.pData == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + code = TSDB_CODE_OUT_OF_MEMORY; + goto _err; + } memcpy(lastCol.colVal.value.pData, pColVal->value.pData, pColVal->value.nData); } From 116d1451e4c3fb4488d29c4b79a007548ad6087a Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 19 Oct 2022 15:43:58 +0800 Subject: [PATCH 19/99] fix(query): do some internal refactor. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 35 +++++++++++++------ tests/script/tsim/parser/last_cache_query.sim | 5 +-- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 53f8d5be16..99c314fa45 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -29,12 +29,14 @@ typedef struct SCacheRowsReader { SArray* pTableList; // table id list } SCacheRowsReader; +#define HASTYPE(_type, _t) (((_type) & (_t)) == (_t)) + static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pReader, const int32_t* slotIds, void** pRes) { ASSERT(pReader->numOfCols <= taosArrayGetSize(pBlock->pDataBlock)); int32_t numOfRows = pBlock->info.rows; - if ((pReader->type & CACHESCAN_RETRIEVE_LAST) == CACHESCAN_RETRIEVE_LAST) { + if (HASTYPE(pReader->type, CACHESCAN_RETRIEVE_LAST)) { for (int32_t i = 0; i < pReader->numOfCols; ++i) { SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); SFirstLastRes* p = (SFirstLastRes*)varDataVal(pRes[i]); @@ -54,7 +56,7 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { varDataSetLen(p->buf, pColVal->colVal.value.nData); memcpy(varDataVal(p->buf), pColVal->colVal.value.pData, pColVal->colVal.value.nData); - p->bytes = pColVal->colVal.value.nData + VARSTR_HEADER_SIZE; + p->bytes = pColVal->colVal.value.nData + VARSTR_HEADER_SIZE; // binary needs to plus the header size } else { memcpy(p->buf, &pColVal->colVal.value, pReader->pSchema->columns[slotId].bytes); p->bytes = pReader->pSchema->columns[slotId].bytes; @@ -62,12 +64,13 @@ static void saveOneRow(SArray* pRow, SSDataBlock* pBlock, SCacheRowsReader* pRea } } + // pColInfoData->info.bytes includes the VARSTR_HEADER_SIZE, need to substruct it p->hasResult = true; - varDataSetLen(pRes[i], pColInfoData->info.bytes); + varDataSetLen(pRes[i], pColInfoData->info.bytes - VARSTR_HEADER_SIZE); colDataAppend(pColInfoData, numOfRows, (const char*)pRes[i], false); } } else { - ASSERT((pReader->type & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW); + ASSERT(HASTYPE(pReader->type, CACHESCAN_RETRIEVE_LAST_ROW)); for (int32_t i = 0; i < pReader->numOfCols; ++i) { SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, i); @@ -177,6 +180,13 @@ static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint return code; } +static void freeItem(void* pItem) { + SLastCol* pCol = (SLastCol*) pItem; + if (IS_VAR_DATA_TYPE(pCol->colVal.type)) { + taosMemoryFree(pCol->colVal.value.pData); + } +} + int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32_t* slotIds, SArray* pTableUidList) { if (pReader == NULL || pResBlock == NULL) { return TSDB_CODE_INVALID_PARA; @@ -217,7 +227,6 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 if (IS_VAR_DATA_TYPE(pCol->type)) { p.colVal.value.pData = taosMemoryCalloc(pCol->bytes, sizeof(char)); } - taosArrayPush(pLastCols, &p); } @@ -237,19 +246,25 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 { for (int32_t k = 0; k < pr->numOfCols; ++k) { - SLastCol* p = taosArrayGet(pLastCols, k); - if (slotIds[k] == -1) { // the primary timestamp - SLastCol* pCol = (SLastCol*)taosArrayGet(pRow, k); + int32_t slotId = slotIds[k]; + + if (slotId == -1) { // the primary timestamp + SLastCol* p = taosArrayGet(pLastCols, 0); + SLastCol* pCol = (SLastCol*)taosArrayGet(pRow, 0); if (pCol->ts > p->ts) { hasRes = true; p->ts = pCol->ts; p->colVal = pCol->colVal; } } else { - int32_t slotId = slotIds[k]; + SLastCol* p = taosArrayGet(pLastCols, slotId); SLastCol* pColVal = (SLastCol*)taosArrayGet(pRow, slotId); if (pColVal->ts > p->ts) { + if (!COL_VAL_IS_VALUE(&pColVal->colVal) && HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST)) { + continue; + } + hasRes = true; p->ts = pColVal->ts; @@ -308,6 +323,6 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 } taosMemoryFree(pRes); - taosArrayDestroy(pLastCols); + taosArrayDestroyEx(pLastCols, freeItem); return code; } diff --git a/tests/script/tsim/parser/last_cache_query.sim b/tests/script/tsim/parser/last_cache_query.sim index f32435960c..6cd5309590 100644 --- a/tests/script/tsim/parser/last_cache_query.sim +++ b/tests/script/tsim/parser/last_cache_query.sim @@ -39,6 +39,7 @@ if $data02 != 5.000000000 then return -1 endi if $data03 != 3 then + print expect 3, actual: $data03 return -1 endi if $data04 != @70-01-01 07:59:57.000@ then @@ -210,7 +211,7 @@ if $data01 != 6 then return -1 endi if $data02 != 37.000000000 then - print $data02 + print expect 37.000000000 actual: $data02 return -1 endi if $data03 != 27 then @@ -233,7 +234,7 @@ if $data01 != 6 then return -1 endi if $data02 != 37.000000000 then - print $data02 + print expect 37.000000000, acutal: $data02 return -1 endi if $data03 != 27 then From 325712fdf9454ffe19dca9a8333c656483f44408 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 19 Oct 2022 15:54:43 +0800 Subject: [PATCH 20/99] fix(query): add some init functions. --- source/libs/executor/src/timewindowoperator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 1bcf274460..8792569f14 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -5492,9 +5492,13 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys pInfo->ignoreExpiredData = pIntervalPhyNode->window.igExpired; pInfo->isFinal = false; + SExprSupp* pSup = &pOperator->exprSupp; + initBasicInfo(&pInfo->binfo, pResBlock); + initStreamFunciton(pSup->pCtx, pSup->numOfExprs); + initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window); + pInfo->primaryTsIndex = ((SColumnNode*)pIntervalPhyNode->window.pTspk)->slotId; initResultSizeInfo(&pOperator->resultInfo, 4096); - SExprSupp* pSup = &pOperator->exprSupp; if (pIntervalPhyNode->window.pExprs != NULL) { int32_t numOfScalar = 0; From 35e829dc28e4b262d9661a610d236c70942c9cb5 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Wed, 19 Oct 2022 15:58:51 +0800 Subject: [PATCH 21/99] fix: cache inapplicability --- source/libs/planner/src/planOptimizer.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index f5d32796b2..2e2e4e6dcf 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2155,6 +2155,22 @@ static bool lastRowScanOptHasTag(SNode* pExpr) { return hasTag; } +static bool hasSuitableCache(int8_t cacheLastMode, bool hasLastRow, bool hasLast) { + switch (cacheLastMode) { + case TSDB_CACHE_MODEL_NONE: + return false; + case TSDB_CACHE_MODEL_LAST_ROW: + return hasLastRow; + case TSDB_CACHE_MODEL_LAST_VALUE: + return hasLast; + case TSDB_CACHE_MODEL_BOTH: + return true; + default: + break; + } + return false; +} + static bool lastRowScanOptMayBeOptimized(SLogicNode* pNode) { if (QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode) || 1 != LIST_LENGTH(pNode->pChildren) || QUERY_NODE_LOGIC_PLAN_SCAN != nodeType(nodesListGetNode(pNode->pChildren, 0))) { @@ -2165,7 +2181,8 @@ static bool lastRowScanOptMayBeOptimized(SLogicNode* pNode) { SScanLogicNode* pScan = (SScanLogicNode*)nodesListGetNode(pNode->pChildren, 0); // Only one of LAST and LASTROW can appear if (pAgg->hasLastRow == pAgg->hasLast || NULL != pAgg->pGroupKeys || NULL != pScan->node.pConditions || - 0 == pScan->cacheLastMode || IS_TSWINDOW_SPECIFIED(pScan->scanRange)) { + !hasSuitableCache(pScan->cacheLastMode, pAgg->hasLastRow, pAgg->hasLast) || + IS_TSWINDOW_SPECIFIED(pScan->scanRange)) { return false; } From 6dea891571dca633d930e24428b18ff9dc499674 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 19 Oct 2022 16:07:53 +0800 Subject: [PATCH 22/99] fix: release data file reader --- source/dnode/vnode/src/tsdb/tsdbCache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index e2bc9d0bec..96504f343a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -519,6 +519,11 @@ static int32_t getNextRowFromFSLast(void *iter, TSDBROW **ppRow) { return code; } + if (state->pDataFReader != NULL) { + tsdbDataFReaderClose(&state->pDataFReader); + state->pDataFReader = NULL; + } + code = tsdbDataFReaderOpen(&state->pDataFReader, state->pTsdb, pFileSet); if (code) goto _err; @@ -662,6 +667,8 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow) { */ state->pBlockIdx = taosArraySearch(state->aBlockIdx, state->pBlockIdxExp, tCmprBlockIdx, TD_EQ); if (!state->pBlockIdx) { + tsdbDataFReaderClose(&state->pDataFReader); + state->pDataFReader = NULL; goto _next_fileset; } From 4aff4dbbce60339e8be182baf874600528a65df2 Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Wed, 19 Oct 2022 17:06:13 +0800 Subject: [PATCH 23/99] test: add debug log info --- tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py index ecdb0a4358..313ff7476e 100644 --- a/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py +++ b/tests/system-test/7-tmq/tmqConsFromTsdb1-1ctb.py @@ -214,7 +214,7 @@ class TDTestCase: resultList = tmqCom.selectConsumeResult(expectRows) actConsumeTotalRows = resultList[0] - + tdLog.info("act consume rows: %d, expect rows range (0, %d)"%(actConsumeTotalRows, totalRowsInserted)) if not (actConsumeTotalRows > 0 and actConsumeTotalRows < totalRowsInserted): tdLog.info("act consume rows: %d"%(actConsumeTotalRows)) tdLog.info("and second consume rows should be between 0 and %d"%(totalRowsInserted)) From a69fbf5b9eb1109e5fc78b00142d4adce4019320 Mon Sep 17 00:00:00 2001 From: plum-lihui Date: Wed, 19 Oct 2022 17:11:31 +0800 Subject: [PATCH 24/99] test: reopen test cases --- tests/system-test/fulltest.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 39adfc9d53..898ef04e0a 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -287,7 +287,7 @@ python3 ./test.py -f 7-tmq/subscribeDb0.py python3 ./test.py -f 7-tmq/subscribeDb1.py python3 ./test.py -f 7-tmq/subscribeDb2.py python3 ./test.py -f 7-tmq/subscribeDb3.py -#python3 ./test.py -f 7-tmq/subscribeDb4.py +python3 ./test.py -f 7-tmq/subscribeDb4.py python3 ./test.py -f 7-tmq/subscribeStb.py python3 ./test.py -f 7-tmq/subscribeStb0.py python3 ./test.py -f 7-tmq/subscribeStb1.py @@ -302,14 +302,14 @@ python3 ./test.py -f 7-tmq/tmqCheckData.py python3 ./test.py -f 7-tmq/tmqCheckData1.py #python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 5 python3 ./test.py -f 7-tmq/tmqConsumerGroup.py -#python3 ./test.py -f 7-tmq/tmqShow.py +python3 ./test.py -f 7-tmq/tmqShow.py python3 ./test.py -f 7-tmq/tmqAlterSchema.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb1.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py From 54526adcc3e304c48ef521669020f9ec1bbd2410 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 17:18:41 +0800 Subject: [PATCH 25/99] fix: commit txn for rsma --- source/dnode/vnode/src/inc/vnodeInt.h | 1 + source/dnode/vnode/src/sma/smaCommit.c | 24 ++++++++++++++++++++++++ source/dnode/vnode/src/vnd/vnodeCommit.c | 20 +++++++++++--------- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 42ab0c2a37..a5dc4431ab 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -211,6 +211,7 @@ int32_t smaSyncCommit(SSma* pSma); int32_t smaSyncPostCommit(SSma* pSma); int32_t smaPreCommit(SSma* pSma); int32_t smaCommit(SSma* pSma); +int32_t smaFinishCommit(SSma* pSma); int32_t smaPostCommit(SSma* pSma); int32_t smaDoRetention(SSma* pSma, int64_t now); diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 3dce724de7..d1717f9a1e 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -112,6 +112,30 @@ int32_t smaBegin(SSma *pSma) { return TSDB_CODE_SUCCESS; } +int32_t smaFinishCommit(SSma *pSma) { + int32_t code = 0; + SVnode *pVnode = pSma->pVnode; + SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); + if (!pSmaEnv) { + goto _exit; + } + if ((code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { + smaError("vgId:%d, failed to finish commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); + goto _exit; + } + if ((code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { + smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); + goto _exit; + } + if ((code = tsdbFinishCommit(VND_RSMA2(pVnode))) < 0) { + smaError("vgId:%d, failed to finish commit tsdb rsma2 since %s", TD_VID(pVnode), tstrerror(code)); + goto _exit; + } +_exit: + terrno = code; + return code; +} + #if 0 /** * @brief pre-commit for rollup sma(sync commit). diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 24b678b5eb..0bc1623d8b 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -239,10 +239,8 @@ int vnodeCommit(SVnode *pVnode) { } walBeginSnapshot(pVnode->pWal, pVnode->state.applied); - if (smaPreCommit(pVnode->pSma) < 0) { - vError("vgId:%d, failed to pre-commit sma since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } + code = smaPreCommit(pVnode->pSma); + TSDB_CHECK_CODE(code, lino, _exit); vnodeBufPoolUnRef(pVnode->inUse); pVnode->inUse = NULL; @@ -254,10 +252,8 @@ int vnodeCommit(SVnode *pVnode) { } if (VND_IS_RSMA(pVnode)) { - if (smaCommit(pVnode->pSma) < 0) { - vError("vgId:%d, failed to commit sma since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } + code = smaCommit(pVnode->pSma); + TSDB_CHECK_CODE(code, lino, _exit); } else { code = tsdbCommit(pVnode->pTsdb); TSDB_CHECK_CODE(code, lino, _exit); @@ -274,7 +270,13 @@ int vnodeCommit(SVnode *pVnode) { TSDB_CHECK_CODE(code, lino, _exit); } - tsdbFinishCommit(pVnode->pTsdb); + if (VND_IS_RSMA(pVnode)) { + code = smaFinishCommit(pVnode->pSma); + TSDB_CHECK_CODE(code, lino, _exit); + } else { + code = tsdbFinishCommit(pVnode->pTsdb); + TSDB_CHECK_CODE(code, lino, _exit); + } if (metaFinishCommit(pVnode->pMeta) < 0) { code = terrno; From 6bc4c36cd0d630edabb1beae555e8cf605aa9d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 19 Oct 2022 17:25:11 +0800 Subject: [PATCH 26/99] test: refine query cases --- tests/system-test/fulltest.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 39adfc9d53..eacfce5719 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -127,7 +127,7 @@ python3 ./test.py -f 2-query/leastsquares.py -R python3 ./test.py -f 2-query/length.py python3 ./test.py -f 2-query/length.py -R python3 ./test.py -f 2-query/log.py -# python3 ./test.py -f 2-query/log.py -R +python3 ./test.py -f 2-query/log.py -R python3 ./test.py -f 2-query/lower.py python3 ./test.py -f 2-query/lower.py -R python3 ./test.py -f 2-query/ltrim.py @@ -175,7 +175,7 @@ python3 ./test.py -f 2-query/sum.py -R python3 ./test.py -f 2-query/tail.py python3 ./test.py -f 2-query/tail.py -R python3 ./test.py -f 2-query/tan.py -# python3 ./test.py -f 2-query/tan.py -R +python3 ./test.py -f 2-query/tan.py -R python3 ./test.py -f 2-query/Timediff.py python3 ./test.py -f 2-query/Timediff.py -R python3 ./test.py -f 2-query/timetruncate.py @@ -221,6 +221,7 @@ python3 ./test.py -f 2-query/json_tag.py # TD-15983 subquery output duplicate name column. # Please Xiangyang Guo modify the following script # python3 ./test.py -f 2-query/nestedQuery_str.py +python3 ./test.py -f 2-query/stablity.py python3 ./test.py -f 2-query/elapsed.py python3 ./test.py -f 2-query/csum.py From 54810990aa6a180a0f0243ead76ad4bc2f51323a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Wed, 19 Oct 2022 17:25:24 +0800 Subject: [PATCH 27/99] test: refine query cases --- tests/system-test/2-query/stablity.py | 4933 +++++++++++++++++++++++++ 1 file changed, 4933 insertions(+) create mode 100755 tests/system-test/2-query/stablity.py diff --git a/tests/system-test/2-query/stablity.py b/tests/system-test/2-query/stablity.py new file mode 100755 index 0000000000..552eec643b --- /dev/null +++ b/tests/system-test/2-query/stablity.py @@ -0,0 +1,4933 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import random +import os +import time +import taos +import subprocess +from faker import Faker +from util.log import tdLog +from util.cases import tdCases +from util.sql import tdSql +from util.dnodes import tdDnodes +from util.dnodes import * + +class TDTestCase: + updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 , + "jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143, + "wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"fnDebugFlag":143} + + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + self.testcasePath = os.path.split(__file__)[0] + self.testcaseFilename = os.path.split(__file__)[-1] + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.num = 10 + self.fornum = 5 + + self.db_nest = "nest" + self.dropandcreateDB_random("%s" %self.db_nest, 1) + + # regular column select + self.q_select= ['q_int', 'q_bigint' , 'q_bigint' , 'q_smallint' , 'q_tinyint' , 'q_bool' , 'q_binary' , 'q_nchar' ,'q_float' , 'q_double' ,'q_ts ', 'q_int_null ', 'q_bigint_null ' , 'q_bigint_null ' , 'q_smallint_null ' , 'q_tinyint_null ' , 'q_bool_null ' , 'q_binary_null ' , 'q_nchar_null ' ,'q_float_null ' , 'q_double_null ' ,'q_ts_null '] + + # tag column select + self.t_select= ['loc','t_int', 't_bigint' , 't_bigint' , 't_smallint' , 't_tinyint' , 't_bool' , 't_binary' , 't_nchar' ,'t_float' , 't_double' ,'t_ts '] + + # regular and tag column select + self.qt_select= self.q_select + self.t_select + + # distinct regular column select + self.dq_select= ['distinct q_int', 'distinct q_bigint' , 'distinct q_smallint' , 'distinct q_tinyint' , + 'distinct q_bool' , 'distinct q_binary' , 'distinct q_nchar' ,'distinct q_float' , 'distinct q_double' ,'distinct q_ts '] + + # distinct tag column select + self.dt_select= ['distinct loc', 'distinct t_int', 'distinct t_bigint' , 'distinct t_smallint' , 'distinct t_tinyint' , + 'distinct t_bool' , 'distinct t_binary' , 'distinct t_nchar' ,'distinct t_float' , 'distinct t_double' ,'distinct t_ts '] + + # distinct regular and tag column select + self.dqt_select= self.dq_select + self.dt_select + + # special column select + self.s_r_select= ['_c0', '_rowts' , '_C0' ] + self.s_s_select= ['tbname' , '_rowts' , '_c0', '_C0' ] + self.unionall_or_union= [ ' union ' , ' union all ' ] + + # regular column where + self.q_where = ['ts < now +1s','q_bigint >= -9223372036854775807 and q_bigint <= 9223372036854775807', 'q_int <= 2147483647 and q_int >= -2147483647', + 'q_smallint >= -32767 and q_smallint <= 32767','q_tinyint >= -127 and q_tinyint <= 127','q_float >= -1.7E308 and q_float <= 1.7E308', + 'q_double >= -1.7E308 and q_double <= 1.7E308', 'q_binary like \'binary%\' or q_binary = \'0\' ' , 'q_nchar like \'nchar%\' or q_nchar = \'0\' ' , + 'q_bool = true or q_bool = false' , 'q_bool in (0 , 1)' , 'q_bool in ( true , false)' , 'q_bool = 0 or q_bool = 1', + 'q_bigint between -9223372036854775807 and 9223372036854775807',' q_int between -2147483647 and 2147483647','q_smallint between -32767 and 32767', + 'q_bigint not between 9223372036854775807 and -9223372036854775807','q_int not between 2147483647 and -2147483647','q_smallint not between 32767 and -32767', + 'q_tinyint between -127 and 127 ','q_float >= -3.4E38 ','q_float <= 3.4E38 ','q_double >= -1.7E308 ', + 'q_double <= 1.7E308 ','q_float between -3.4E38 and 3.4E38 ','q_double between -1.7E308 and 1.7E308 ' ,'q_float not between 3.4E38 and -3.4E38 ','q_double not between 1.7E308 and -1.7E308 ', + 'q_float is not null ' ,'q_double is not null ' ,'q_binary match \'binary\' ','q_binary nmatch \'binarynchar\' ','q_nchar match \'nchar\' ','q_nchar nmatch \'binarynchar\' ', + 'q_binary like \'binary%\' ','(q_binary like \'binary%\' or q_nchar = \'0\' or q_binary = \'binary_\' ) ','q_nchar like \'nchar%\' ','(q_nchar like \'nchar%\' or q_binary = \'0\' or q_nchar = \'nchar_\' ) ', + 'q_binary match \'[binary]\'','q_binary nmatch \'[binarynchar]\' ',] + #TD-6201 ,'q_bool between 0 and 1' + + # regular column where for test union,join + self.q_u_where = ['t1.ts < now +1s' , 't2.ts < now +1s','t1.q_bigint >= -9223372036854775807 and t1.q_bigint <= 9223372036854775807 and t2.q_bigint >= -9223372036854775807 and t2.q_bigint <= 9223372036854775807', + 't1.q_int <= 2147483647 and t1.q_int >= -2147483647 and t2.q_int <= 2147483647 and t2.q_int >= -2147483647', + 't1.q_smallint >= -32767 and t1.q_smallint <= 32767 and t2.q_smallint >= -32767 and t2.q_smallint <= 32767', + 't1.q_tinyint >= -127 and t1.q_tinyint <= 127 and t2.q_tinyint >= -127 and t2.q_tinyint <= 127', + 't1.q_float >= - 1.7E308 and t1.q_float <= 1.7E308 and t2.q_float >= - 1.7E308 and t2.q_float <= 1.7E308', + 't1.q_double >= - 1.7E308 and t1.q_double <= 1.7E308 and t2.q_double >= - 1.7E308 and t2.q_double <= 1.7E308', + 't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ' , + 't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ' , + 't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)' , 't1.q_bool in ( true , false) and t2.q_bool in ( true , false)' , + 't1.q_bigint between -9223372036854775807 and 9223372036854775807 and t2.q_bigint between -9223372036854775807 and 9223372036854775807', + 't1.q_int between -2147483647 and 2147483647 and t2.q_int between -2147483647 and 2147483647', + 't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767', + 't1.q_tinyint between -127 and 127 and t2.q_tinyint between -127 and 127 ','t1.q_float between -1.7E308 and 1.7E308 and t2.q_float between -1.7E308 and 1.7E308', + 't1.q_double between -1.7E308 and 1.7E308 and t2.q_double between -1.7E308 and 1.7E308', + 't1.q_bigint not between 9223372036854775807 and -9223372036854775807 and t2.q_bigint not between 9223372036854775807 and -9223372036854775807', + 't1.q_int not between 2147483647 and -2147483647 and t2.q_int not between 2147483647 and -2147483647', + 't1.q_smallint not between 32767 and -32767 and t2.q_smallint not between 32767 and -32767', + 't1.q_tinyint not between 127 and -127 and t2.q_tinyint not between 127 and -127 ','t1.q_float not between -1.7E308 and -1.7E308 and t2.q_float not between 1.7E308 and -1.7E308', + 't1.q_double not between 1.7E308 and -1.7E308 and t2.q_double not between 1.7E308 and -1.7E308'] + #TD-6201 ,'t1.q_bool between 0 and 1 or t2.q_bool between 0 and 1'] + #'t1.q_bool = true and t1.q_bool = false and t2.q_bool = true and t2.q_bool = false' , 't1.q_bool = 0 and t1.q_bool = 1 and t2.q_bool = 0 and t2.q_bool = 1' , + + self.q_u_or_where = ['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )' , + '(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )' , '(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)' , + '(t1.q_bool in (0 , 1) or t2.q_bool in (0 , 1))' , '(t1.q_bool in ( true , false) or t2.q_bool in ( true , false))' , '(t1.q_bool = 0 or t1.q_bool = 1 or t2.q_bool = 0 or t2.q_bool = 1)' , + '(t1.q_bigint between -9223372036854775807 and 9223372036854775807 or t2.q_bigint between -9223372036854775807 and 9223372036854775807)', + '(t1.q_int between -2147483647 and 2147483647 or t2.q_int between -2147483647 and 2147483647)', + '(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)', + '(t1.q_tinyint between -127 and 127 or t2.q_tinyint between -127 and 127 )','(t1.q_float between -1.7E308 and 1.7E308 or t2.q_float between -1.7E308 and 1.7E308)', + '(t1.q_double between -1.7E308 and 1.7E308 or t2.q_double between -1.7E308 and 1.7E308)'] + + # tag column where + self.t_where = ['ts < now +1s','t_bigint >= -9223372036854775807 and t_bigint <= 9223372036854775807','t_int <= 2147483647 and t_int >= -2147483647', + 't_smallint >= -32767 and t_smallint <= 32767','q_tinyint >= -127 and t_tinyint <= 127','t_float >= -1.7E308 and t_float <= 1.7E308', + 't_double >= -1.7E308 and t_double <= 1.7E308', 't_binary like \'binary%\' or t_binary = \'0\' ' , 't_nchar like \'nchar%\' or t_nchar = \'0\'' , + 't_bool = true or t_bool = false' , 't_bool in (0 , 1)' , 't_bool in ( true , false)' , 't_bool = 0 or t_bool = 1', + 't_bigint between -9223372036854775807 and 9223372036854775807',' t_int between -2147483647 and 2147483647','t_smallint between -32767 and 32767', + 't_tinyint between -127 and 127 ','t_float between -1.7E308 and 1.7E308','t_double between -1.7E308 and 1.7E308', + 't_binary match \'binary\' ','t_binary nmatch \'binarynchar\' ','t_nchar match \'nchar\' ','t_nchar nmatch \'binarynchar\' ', + 't_binary like \'binary%\' ','t_nchar like \'nchar%\' ','(t_binary like \'binary%\' or t_nchar = \'0\' ) ','(t_nchar like \'nchar%\' or t_binary = \'0\' ) ', + 'tbname match \'[stable]\' ','tbname nmatch \'[qwwerrwee]\' ','loc match \'[stable]\' ','loc nmatch \'[qwwerrwee]\' ', + 'tbname match \'[^stable]\' ','tbname nmatch \'[^qwwerrwee]\' ','loc match \'[^stable]\' ','loc nmatch \'[^qwwerrwee]\' ',] + + # tag column where for test union,join | this is not support + self.t_u_where = ['t1.ts < now +1s' , 't2.ts < now +1s','t1.t_bigint >= -9223372036854775807 and t1.t_bigint <= 9223372036854775807 and t2.t_bigint >= -9223372036854775807 and t2.t_bigint <= 9223372036854775807', + 't1.t_int <= 2147483647 and t1.t_int >= -2147483647 and t2.t_int <= 2147483647 and t2.t_int >= -2147483647', + 't1.t_smallint >= -32767 and t1.t_smallint <= 32767 and t2.t_smallint >= -32767 and t2.t_smallint <= 32767', + 't1.t_tinyint >= -127 and t1.t_tinyint <= 127 and t2.t_tinyint >= -127 and t2.t_tinyint <= 127', + 't1.t_float >= -1.7E308 and t1.t_float <= 1.7E308 and t2.t_float >= -1.7E308 and t2.t_float <= 1.7E308', + 't1.t_double >= -1.7E308 and t1.t_double <= 1.7E308 and t2.t_double >= -1.7E308 and t2.t_double <= 1.7E308', + '(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\') ' , + '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' , + 't1.t_bool in (0 , 1) and t2.t_bool in (0 , 1)' , 't1.t_bool in ( true , false) and t2.t_bool in ( true , false)' , '(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)', + 't1.t_bigint between -9223372036854775807 and 9223372036854775807 and t2.t_bigint between -9223372036854775807 and 9223372036854775807', + 't1.t_int between -2147483647 and 2147483647 and t2.t_int between -2147483647 and 2147483647', + 't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767', + '(t1.t_tinyint between -127 and 127 and t2.t_tinyint between -127 and 127) ','t1.t_float between -1.7E308 and 1.7E308 and t2.t_float between -1.7E308 and 1.7E308', + '(t1.t_double between -1.7E308 and 1.7E308 and t2.t_double between -1.7E308 and 1.7E308)', + '(t1.loc match \'[stable]\' and t2.loc match \'[stable]\')','(t1.loc nmatch \'[qqeqweq]\' and t2.loc nmatch \'[eqeqweq]\')', + '(t1.loc match \'[^stable]\' and t2.loc match \'[^stable]\')','(t1.loc nmatch \'[^qqeqweq]\' and t2.loc nmatch \'[^eqeqweq]\')', + '(t1.t_binary match \'[stable]\' and t2.t_binary match \'[stable]\')','(t1.t_binary nmatch \'[qqeqweq]\' and t2.t_binary nmatch \'[eqeqweq]\')', + '(t1.t_binary match \'[^stable]\' and t2.t_binary match \'[^stable]\')','(t1.t_binary nmatch \'[^qqeqweq]\' and t2.t_binary nmatch \'[^eqeqweq]\')', + '(t1.t_nchar match \'[stable]\' and t2.t_nchar match \'[stable]\')','(t1.t_nchar nmatch \'[qqeqweq]\' and t2.t_nchar nmatch \'[eqeqweq]\')', + '(t1.t_nchar match \'[^stable]\' and t2.t_nchar match \'[^stable]\')','(t1.t_nchar nmatch \'[^qqeqweq]\' and t2.t_nchar nmatch \'[^eqeqweq]\')'] + + self.t_u_or_where = ['(t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' )' , + '(t1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' )' , '(t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false)' , + '(t1.t_bool in (0 , 1) or t2.t_bool in (0 , 1))' , '(t1.t_bool in ( true , false) or t2.t_bool in ( true , false))' , '(t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1)', + '(t1.t_bigint between -9223372036854775807 and 9223372036854775807 or t2.t_bigint between -9223372036854775807 and 9223372036854775807)', + '(t1.t_int between -2147483647 and 2147483647 or t2.t_int between -2147483647 and 2147483647)', + '(t1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767)', + '(t1.t_tinyint between -127 and 127 or t2.t_tinyint between -127 and 127 )','(t1.t_float between -1.7E308 and 1.7E308 or t2.t_float between -1.7E308 and 1.7E308)', + '(t1.t_double between -1.7E308 and 1.7E308 or t2.t_double between -1.7E308 and 1.7E308)', + '(t1.loc match \'[stable]\' or t2.loc match \'[stable]\')','(t1.loc nmatch \'[qqeqweq]\' or t2.loc nmatch \'[eqeqweq]\')', + '(t1.loc match \'[^stable]\' or t2.loc match \'[^stable]\')','(t1.loc nmatch \'[^qqeqweq]\' or t2.loc nmatch \'[^eqeqweq]\')' , + '(t1.t_binary match \'[stable]\' or t2.t_binary match \'[stable]\')','(t1.t_binary nmatch \'[qqeqweq]\' or t2.t_binary nmatch \'[eqeqweq]\')', + '(t1.t_binary match \'[^stable]\' or t2.t_binary match \'[^stable]\')','(t1.t_binary nmatch \'[^qqeqweq]\' or t2.t_binary nmatch \'[^eqeqweq]\')', + '(t1.t_nchar match \'[stable]\' or t2.t_nchar match \'[stable]\')','(t1.t_nchar nmatch \'[qqeqweq]\' or t2.t_nchar nmatch \'[eqeqweq]\')', + '(t1.t_nchar match \'[^stable]\' or t2.t_nchar match \'[^stable]\')','(t1.t_nchar nmatch \'[^qqeqweq]\' or t2.t_nchar nmatch \'[^eqeqweq]\')'] + + # regular and tag column where + self.qt_where = self.q_where + self.t_where + self.qt_u_where = self.q_u_where + self.t_u_where + self.qt_u_or_where = self.q_u_or_where + self.t_u_or_where + + # tag column where for test super join | this is support , 't1.t_bool = t2.t_bool ' ??? + self.t_join_where = ['t1.t_bigint = t2.t_bigint ', 't1.t_int = t2.t_int ', 't1.t_smallint = t2.t_smallint ', 't1.t_tinyint = t2.t_tinyint ', + 't1.t_float = t2.t_float ', 't1.t_double = t2.t_double ', 't1.t_binary = t2.t_binary ' , 't1.t_nchar = t2.t_nchar ' ] + + # session && fill + self.session_where = ['session(ts,10a)' , 'session(ts,10s)', 'session(ts,10m)' , 'session(ts,10h)','session(ts,10d)' , 'session(ts,10w)'] + self.session_u_where = ['session(t1.ts,10a)' , 'session(t1.ts,10s)', 'session(t1.ts,10m)' , 'session(t1.ts,10h)','session(t1.ts,10d)' , 'session(t1.ts,10w)', + 'session(t2.ts,10a)' , 'session(t2.ts,10s)', 'session(t2.ts,10m)' , 'session(t2.ts,10h)','session(t2.ts,10d)' , 'session(t2.ts,10w)'] + + self.fill_where = ['FILL(NONE)','FILL(PREV)','FILL(NULL)','FILL(LINEAR)','FILL(NEXT)','FILL(VALUE, 1.23)'] + + self.state_window = ['STATE_WINDOW(q_tinyint)','STATE_WINDOW(q_bigint)','STATE_WINDOW(q_int)','STATE_WINDOW(q_bool)','STATE_WINDOW(q_smallint)'] + self.state_u_window = ['STATE_WINDOW(t1.q_tinyint)','STATE_WINDOW(t1.q_bigint)','STATE_WINDOW(t1.q_int)','STATE_WINDOW(t1.q_bool)','STATE_WINDOW(t1.q_smallint)', + 'STATE_WINDOW(t2.q_tinyint)','STATE_WINDOW(t2.q_bigint)','STATE_WINDOW(t2.q_int)','STATE_WINDOW(t2.q_bool)','STATE_WINDOW(t2.q_smallint)'] + + # order by where + self.order_where = ['order by ts' , 'order by ts asc'] + self.order_u_where = ['order by t1.ts' , 'order by t1.ts asc' , 'order by t2.ts' , 'order by t2.ts asc'] + self.order_desc_where = ['order by ts' , 'order by ts asc' , 'order by ts desc' ] + self.orders_desc_where = ['order by ts' , 'order by ts asc' , 'order by ts desc' , 'order by ts,loc' , 'order by ts,loc asc' , 'order by ts,loc desc'] + + self.group_where = ['group by tbname , loc' , 'group by tbname', 'group by tbname, t_bigint', 'group by tbname,t_int', 'group by tbname, t_smallint', 'group by tbname,t_tinyint', + 'group by tbname,t_float', 'group by tbname,t_double' , 'group by tbname,t_binary', 'group by tbname,t_nchar', 'group by tbname,t_bool' ,'group by tbname ,loc ,t_bigint', + 'group by tbname,t_binary ,t_nchar ,t_bool' , 'group by tbname,t_int ,t_smallint ,t_tinyint' , 'group by tbname,t_float ,t_double ' , + 'PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint', + 'PARTITION BY tbname,t_float', 'PARTITION BY tbname,t_double' , 'PARTITION BY tbname,t_binary', 'PARTITION BY tbname,t_nchar', 'PARTITION BY tbname,t_bool' ,'PARTITION BY tbname ,loc ,t_bigint', + 'PARTITION BY tbname,t_binary ,t_nchar ,t_bool' , 'PARTITION BY tbname,t_int ,t_smallint ,t_tinyint' , 'PARTITION BY tbname,t_float ,t_double '] + self.group_where_j = ['group by t1.loc' , 'group by t1.t_bigint', 'group by t1.t_int', 'group by t1.t_smallint', 'group by t1.t_tinyint', + 'group by t1.t_float', 'group by t1.t_double' , 'group by t1.t_binary', 'group by t1.t_nchar', 'group by t1.t_bool' ,'group by t1.loc ,t1.t_bigint', + 'group by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'group by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'group by t1.t_float ,t1.t_double ' , + 'PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint', + 'PARTITION by t1.t_float', 'PARTITION by t1.t_double' , 'PARTITION by t1.t_binary', 'PARTITION by t1.t_nchar', 'PARTITION by t1.t_bool' ,'PARTITION BY t1.loc ,t1.t_bigint', + 'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'PARTITION by t1.t_float ,t1.t_double ', + 'group by t2.loc' , 'group by t2.t_bigint', 'group by t2.t_int', 'group by t2.t_smallint', 'group by t2.t_tinyint', + 'group by t2.t_float', 'group by t2.t_double' , 'group by t2.t_binary', 'group by t2.t_nchar', 'group by t2.t_bool' ,'group by t2.loc ,t2.t_bigint', + 'group by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'group by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'group by t2.t_float ,t2.t_double ' , + 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint', + 'PARTITION by t2.t_float', 'PARTITION by t2.t_double' , 'PARTITION by t2.t_binary', 'PARTITION by t2.t_nchar', 'PARTITION by t2.t_bool' ,'PARTITION BY t2.loc ,t2.t_bigint', + 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double '] + + self.group_only_where = ['group by tbname , loc' , 'group by tbname', 'group by tbname, t_bigint', 'group by tbname,t_int', 'group by tbname, t_smallint', 'group by tbname,t_tinyint', + 'group by tbname,t_float', 'group by tbname,t_double' , 'group by tbname,t_binary', 'group by tbname,t_nchar', 'group by tbname,t_bool' ,'group by tbname ,loc ,t_bigint', + 'group by tbname,t_binary ,t_nchar ,t_bool' , 'group by tbname,t_int ,t_smallint ,t_tinyint' , 'group by tbname,t_float ,t_double ' ] + self.group_only_where_j = ['group by t1.loc' , 'group by t1.t_bigint', 'group by t1.t_int', 'group by t1.t_smallint', 'group by t1.t_tinyint', + 'group by t1.t_float', 'group by t1.t_double' , 'group by t1.t_binary', 'group by t1.t_nchar', 'group by t1.t_bool' ,'group by t1.loc ,t1.t_bigint', + 'group by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'group by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'group by t1.t_float ,t1.t_double ' , + 'group by t2.loc' , 'group by t2.t_bigint', 'group by t2.t_int', 'group by t2.t_smallint', 'group by t2.t_tinyint', + 'group by t2.t_float', 'group by t2.t_double' , 'group by t2.t_binary', 'group by t2.t_nchar', 'group by t2.t_bool' ,'group by t2.loc ,t2.t_bigint', + 'group by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'group by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'group by t2.t_float ,t2.t_double ' ] + + self.partiton_where = ['PARTITION BY tbname , loc' , 'PARTITION BY tbname', 'PARTITION BY tbname, t_bigint', 'PARTITION BY tbname,t_int', 'PARTITION BY tbname, t_smallint', 'PARTITION BY tbname,t_tinyint', + 'PARTITION BY tbname,t_float', 'PARTITION BY tbname,t_double' , 'PARTITION BY tbname,t_binary', 'PARTITION BY tbname,t_nchar', 'PARTITION BY tbname,t_bool' ,'PARTITION BY tbname ,loc ,t_bigint', + 'PARTITION BY tbname,t_binary ,t_nchar ,t_bool' , 'PARTITION BY tbname,t_int ,t_smallint ,t_tinyint' , 'PARTITION BY tbname,t_float ,t_double '] + self.partiton_where_j = ['PARTITION BY t1.loc' , 'PARTITION by t1.t_bigint', 'PARTITION by t1.t_int', 'PARTITION by t1.t_smallint', 'PARTITION by t1.t_tinyint', + 'PARTITION by t1.t_float', 'PARTITION by t1.t_double' , 'PARTITION by t1.t_binary', 'PARTITION by t1.t_nchar', 'PARTITION by t1.t_bool' ,'PARTITION BY t1.loc ,t1.t_bigint', + 'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool' , 'PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint' , 'PARTITION by t1.t_float ,t1.t_double ', + 'PARTITION BY t2.loc' , 'PARTITION by t2.t_bigint', 'PARTITION by t2.t_int', 'PARTITION by t2.t_smallint', 'PARTITION by t2.t_tinyint', + 'PARTITION by t2.t_float', 'PARTITION by t2.t_double' , 'PARTITION by t2.t_binary', 'PARTITION by t2.t_nchar', 'PARTITION by t2.t_bool' ,'PARTITION BY t2.loc ,t2.t_bigint', + 'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool' , 'PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint' , 'PARTITION by t2.t_float ,t2.t_double '] + + self.group_where_regular = ['group by tbname ' , 'group by tbname', 'group by tbname, q_bigint', 'group by tbname,q_int', 'group by tbname, q_smallint', 'group by tbname,q_tinyint', + 'group by tbname,q_float', 'group by tbname,q_double' , 'group by tbname,q_binary', 'group by tbname,q_nchar', 'group by tbname,q_bool' ,'group by tbname ,q_bigint', + 'group by tbname,q_binary ,q_nchar ,q_bool' , 'group by tbname,q_int ,q_smallint ,q_tinyint' , 'group by tbname,q_float ,q_double ' , + 'PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint', + 'PARTITION BY tbname,q_float', 'PARTITION BY tbname,q_double' , 'PARTITION BY tbname,q_binary', 'PARTITION BY tbname,q_nchar', 'PARTITION BY tbname,q_bool' ,'PARTITION BY tbname ,q_bigint', + 'PARTITION BY tbname,q_binary ,q_nchar ,q_bool' , 'PARTITION BY tbname,q_int ,q_smallint ,q_tinyint' , 'PARTITION BY tbname,q_float ,q_double '] + self.group_where_regular_j = ['group by t1.q_bigint', 'group by t1.q_int', 'group by t1.q_smallint', 'group by t1.q_tinyint', + 'group by t1.q_float', 'group by t1.q_double' , 'group by t1.q_binary', 'group by t1.q_nchar', 'group by t1.q_bool' ,'group by t1.q_bigint', + 'group by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'group by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'group by t1.q_float ,t1.q_double ' , + 'PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint', + 'PARTITION by t1.q_float', 'PARTITION by t1.q_double' , 'PARTITION by t1.q_binary', 'PARTITION by t1.q_nchar', 'PARTITION by t1.q_bool' ,'PARTITION BY t1.q_bigint', + 'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'PARTITION by t1.q_float ,t1.q_double ', + 'group by t2.q_bigint', 'group by t2.q_int', 'group by t2.q_smallint', 'group by t2.q_tinyint', + 'group by t2.q_float', 'group by t2.q_double' , 'group by t2.q_binary', 'group by t2.q_nchar', 'group by t2.q_bool' ,'group by t2.q_bigint', + 'group by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'group by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'group by t2.q_float ,t2.q_double ' , + 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint', + 'PARTITION by t2.q_float', 'PARTITION by t2.q_double' , 'PARTITION by t2.q_binary', 'PARTITION by t2.q_nchar', 'PARTITION by t2.q_bool' ,'PARTITION BY t2.q_bigint', + 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double '] + + self.partiton_where_regular = ['PARTITION BY tbname ' , 'PARTITION BY tbname', 'PARTITION BY tbname, q_bigint', 'PARTITION BY tbname,q_int', 'PARTITION BY tbname, q_smallint', 'PARTITION BY tbname,q_tinyint', + 'PARTITION BY tbname,q_float', 'PARTITION BY tbname,q_double' , 'PARTITION BY tbname,q_binary', 'PARTITION BY tbname,q_nchar', 'PARTITION BY tbname,q_bool' ,'PARTITION BY tbname ,q_bigint', + 'PARTITION BY tbname,q_binary ,q_nchar ,q_bool' , 'PARTITION BY tbname,q_int ,q_smallint ,q_tinyint' , 'PARTITION BY tbname,q_float ,q_double '] + self.partiton_where_regular_j = ['PARTITION by t1.q_bigint', 'PARTITION by t1.q_int', 'PARTITION by t1.q_smallint', 'PARTITION by t1.q_tinyint', + 'PARTITION by t1.q_float', 'PARTITION by t1.q_double' , 'PARTITION by t1.q_binary', 'PARTITION by t1.q_nchar', 'PARTITION by t1.q_bool' ,'PARTITION BY t1.q_bigint', + 'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool' , 'PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint' , 'PARTITION by t1.q_float ,t1.q_double ', + 'PARTITION by t2.q_bigint', 'PARTITION by t2.q_int', 'PARTITION by t2.q_smallint', 'PARTITION by t2.q_tinyint', + 'PARTITION by t2.q_float', 'PARTITION by t2.q_double' , 'PARTITION by t2.q_binary', 'PARTITION by t2.q_nchar', 'PARTITION by t2.q_bool' ,'PARTITION BY t2.q_bigint', + 'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool' , 'PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint' , 'PARTITION by t2.q_float ,t2.q_double '] + + self.having_support = ['having count(q_int) > 0','having count(q_bigint) > 0','having count(q_smallint) > 0','having count(q_tinyint) > 0','having count(q_float) > 0','having count(q_double) > 0','having count(q_bool) > 0', + 'having avg(q_int) > 0','having avg(q_bigint) > 0','having avg(q_smallint) > 0','having avg(q_tinyint) > 0','having avg(q_float) > 0','having avg(q_double) > 0', + 'having sum(q_int) > 0','having sum(q_bigint) > 0','having sum(q_smallint) > 0','having sum(q_tinyint) > 0','having sum(q_float) > 0','having sum(q_double) > 0', + 'having STDDEV(q_int) > 0','having STDDEV(q_bigint) > 0','having STDDEV(q_smallint) > 0','having STDDEV(q_tinyint) > 0','having STDDEV(q_float) > 0','having STDDEV(q_double) > 0', + 'having TWA(q_int) > 0','having TWA(q_bigint) > 0','having TWA(q_smallint) > 0','having TWA(q_tinyint) > 0','having TWA(q_float) > 0','having TWA(q_double) > 0', + 'having IRATE(q_int) > 0','having IRATE(q_bigint) > 0','having IRATE(q_smallint) > 0','having IRATE(q_tinyint) > 0','having IRATE(q_float) > 0','having IRATE(q_double) > 0', + 'having MIN(q_int) > 0','having MIN(q_bigint) > 0','having MIN(q_smallint) > 0','having MIN(q_tinyint) > 0','having MIN(q_float) > 0','having MIN(q_double) > 0', + 'having MAX(q_int) > 0','having MAX(q_bigint) > 0','having MAX(q_smallint) > 0','having MAX(q_tinyint) > 0','having MAX(q_float) > 0','having MAX(q_double) > 0', + 'having FIRST(q_int) > 0','having FIRST(q_bigint) > 0','having FIRST(q_smallint) > 0','having FIRST(q_tinyint) > 0','having FIRST(q_float) > 0','having FIRST(q_double) > 0', + 'having LAST(q_int) > 0','having LAST(q_bigint) > 0','having LAST(q_smallint) > 0','having LAST(q_tinyint) > 0','having LAST(q_float) > 0','having LAST(q_double) > 0', + 'having APERCENTILE(q_int,10) > 0','having APERCENTILE(q_bigint,10) > 0','having APERCENTILE(q_smallint,10) > 0','having APERCENTILE(q_tinyint,10) > 0','having APERCENTILE(q_float,10) > 0','having APERCENTILE(q_double,10) > 0', + 'having count(q_int_null) > 0','having count(q_bigint_null) > 0','having count(q_smallint_null) > 0','having count(q_tinyint_null) > 0','having count(q_float_null) > 0','having count(q_double_null) > 0','having count(q_bool_null) > 0', + 'having avg(q_int_null) > 0','having avg(q_bigint_null) > 0','having avg(q_smallint_null) > 0','having avg(q_tinyint_null) > 0','having avg(q_float_null) > 0','having avg(q_double_null) > 0', + 'having sum(q_int_null) > 0','having sum(q_bigint_null) > 0','having sum(q_smallint_null) > 0','having sum(q_tinyint_null) > 0','having sum(q_float_null) > 0','having sum(q_double_null) > 0', + 'having STDDEV(q_int_null) > 0','having STDDEV(q_bigint_null) > 0','having STDDEV(q_smallint_null) > 0','having STDDEV(q_tinyint_null) > 0','having STDDEV(q_float_null) > 0','having STDDEV(q_double_null) > 0', + 'having TWA(q_int_null) > 0','having TWA(q_bigint_null) > 0','having TWA(q_smallint_null) > 0','having TWA(q_tinyint_null) > 0','having TWA(q_float_null) > 0','having TWA(q_double_null) > 0', + 'having IRATE(q_int_null) > 0','having IRATE(q_bigint_null) > 0','having IRATE(q_smallint_null) > 0','having IRATE(q_tinyint_null) > 0','having IRATE(q_float_null) > 0','having IRATE(q_double_null) > 0', + 'having MIN(q_int_null) > 0','having MIN(q_bigint_null) > 0','having MIN(q_smallint_null) > 0','having MIN(q_tinyint_null) > 0','having MIN(q_float_null) > 0','having MIN(q_double_null) > 0', + 'having MAX(q_int_null) > 0','having MAX(q_bigint_null) > 0','having MAX(q_smallint_null) > 0','having MAX(q_tinyint_null) > 0','having MAX(q_float_null) > 0','having MAX(q_double_null) > 0', + 'having FIRST(q_int_null) > 0','having FIRST(q_bigint_null) > 0','having FIRST(q_smallint_null) > 0','having FIRST(q_tinyint_null) > 0','having FIRST(q_float_null) > 0','having FIRST(q_double_null) > 0', + 'having LAST(q_int_null) > 0','having LAST(q_bigint_null) > 0','having LAST(q_smallint_null) > 0','having LAST(q_tinyint_null) > 0','having LAST(q_float_null) > 0','having LAST(q_double_null) > 0', + 'having APERCENTILE(q_int_null,10) > 0','having APERCENTILE(q_bigint_null,10) > 0','having APERCENTILE(q_smallint_null,10) > 0','having APERCENTILE(q_tinyint_null,10) > 0','having APERCENTILE(q_float_null,10) > 0','having APERCENTILE(q_double_null,10) > 0'] + self.having_not_support = ['having TOP(q_int,10) > 0','having TOP(q_bigint,10) > 0','having TOP(q_smallint,10) > 0','having TOP(q_tinyint,10) > 0','having TOP(q_float,10) > 0','having TOP(q_double,10) > 0','having TOP(q_bool,10) > 0', + 'having BOTTOM(q_int,10) > 0','having BOTTOM(q_bigint,10) > 0','having BOTTOM(q_smallint,10) > 0','having BOTTOM(q_tinyint,10) > 0','having BOTTOM(q_float,10) > 0','having BOTTOM(q_double,10) > 0','having BOTTOM(q_bool,10) > 0', + 'having LEASTSQUARES(q_int) > 0','having LEASTSQUARES(q_bigint) > 0','having LEASTSQUARES(q_smallint) > 0','having LEASTSQUARES(q_tinyint) > 0','having LEASTSQUARES(q_float) > 0','having LEASTSQUARES(q_double) > 0','having LEASTSQUARES(q_bool) > 0', + 'having FIRST(q_bool) > 0','having IRATE(q_bool) > 0','having PERCENTILE(q_bool,10) > 0','having avg(q_bool) > 0','having LAST_ROW(q_bool) > 0','having sum(q_bool) > 0','having STDDEV(q_bool) > 0','having APERCENTILE(q_bool,10) > 0','having TWA(q_bool) > 0','having LAST(q_bool) > 0', + 'having PERCENTILE(q_int,10) > 0','having PERCENTILE(q_bigint,10) > 0','having PERCENTILE(q_smallint,10) > 0','having PERCENTILE(q_tinyint,10) > 0','having PERCENTILE(q_float,10) > 0','having PERCENTILE(q_double,10) > 0', + 'having TOP(q_int_null,10) > 0','having TOP(q_bigint_null,10) > 0','having TOP(q_smallint_null,10) > 0','having TOP(q_tinyint_null,10) > 0','having TOP(q_float_null,10) > 0','having TOP(q_double_null,10) > 0','having TOP(q_bool_null,10) > 0', + 'having BOTTOM(q_int_null,10) > 0','having BOTTOM(q_bigint_null,10) > 0','having BOTTOM(q_smallint_null,10) > 0','having BOTTOM(q_tinyint_null,10) > 0','having BOTTOM(q_float_null,10) > 0','having BOTTOM(q_double_null,10) > 0','having BOTTOM(q_bool_null,10) > 0', + 'having LEASTSQUARES(q_int_null) > 0','having LEASTSQUARES(q_bigint_null) > 0','having LEASTSQUARES(q_smallint_null) > 0','having LEASTSQUARES(q_tinyint_null) > 0','having LEASTSQUARES(q_float_null) > 0','having LEASTSQUARES(q_double_null) > 0','having LEASTSQUARES(q_bool_null) > 0', + 'having FIRST(q_bool_null) > 0','having IRATE(q_bool_null) > 0','having PERCENTILE(q_bool_null,10) > 0','having avg(q_bool_null) > 0','having LAST_ROW(q_bool_null) > 0','having sum(q_bool_null) > 0','having STDDEV(q_bool_null) > 0','having APERCENTILE(q_bool_null,10) > 0','having TWA(q_bool_null) > 0','having LAST(q_bool_null) > 0', + 'having PERCENTILE(q_int_null,10) > 0','having PERCENTILE(q_bigint_null,10) > 0','having PERCENTILE(q_smallint_null,10) > 0','having PERCENTILE(q_tinyint_null,10) > 0','having PERCENTILE(q_float_null,10) > 0','having PERCENTILE(q_double_null,10) > 0'] + self.having_tagnot_support = ['having LAST_ROW(q_int) > 0','having LAST_ROW(q_bigint) > 0','having LAST_ROW(q_smallint) > 0','having LAST_ROW(q_tinyint) > 0','having LAST_ROW(q_float) > 0','having LAST_ROW(q_double) > 0', + 'having LAST_ROW(q_int_null) > 0','having LAST_ROW(q_bigint_null) > 0','having LAST_ROW(q_smallint_null) > 0','having LAST_ROW(q_tinyint_null) > 0','having LAST_ROW(q_float_null) > 0','having LAST_ROW(q_double_null) > 0'] + + self.having_support_j = ['having count(t1.q_int) > 0','having count(t1.q_bigint) > 0','having count(t1.q_smallint) > 0','having count(t1.q_tinyint) > 0','having count(t1.q_float) > 0','having count(t1.q_double) > 0','having count(t1.q_bool) > 0', + 'having avg(t1.q_int) > 0','having avg(t1.q_bigint) > 0','having avg(t1.q_smallint) > 0','having avg(t1.q_tinyint) > 0','having avg(t1.q_float) > 0','having avg(t1.q_double) > 0', + 'having sum(t1.q_int) > 0','having sum(t1.q_bigint) > 0','having sum(t1.q_smallint) > 0','having sum(t1.q_tinyint) > 0','having sum(t1.q_float) > 0','having sum(t1.q_double) > 0', + 'having STDDEV(t1.q_int) > 0','having STDDEV(t1.q_bigint) > 0','having STDDEV(t1.q_smallint) > 0','having STDDEV(t1.q_tinyint) > 0','having STDDEV(t1.q_float) > 0','having STDDEV(t1.q_double) > 0', + 'having TWA(t1.q_int) > 0','having TWA(t1.q_bigint) > 0','having TWA(t1.q_smallint) > 0','having TWA(t1.q_tinyint) > 0','having TWA(t1.q_float) > 0','having TWA(t1.q_double) > 0', + 'having IRATE(t1.q_int) > 0','having IRATE(t1.q_bigint) > 0','having IRATE(t1.q_smallint) > 0','having IRATE(t1.q_tinyint) > 0','having IRATE(t1.q_float) > 0','having IRATE(t1.q_double) > 0', + 'having MIN(t1.q_int) > 0','having MIN(t1.q_bigint) > 0','having MIN(t1.q_smallint) > 0','having MIN(t1.q_tinyint) > 0','having MIN(t1.q_float) > 0','having MIN(t1.q_double) > 0', + 'having MAX(t1.q_int) > 0','having MAX(t1.q_bigint) > 0','having MAX(t1.q_smallint) > 0','having MAX(t1.q_tinyint) > 0','having MAX(t1.q_float) > 0','having MAX(t1.q_double) > 0', + 'having FIRST(t1.q_int) > 0','having FIRST(t1.q_bigint) > 0','having FIRST(t1.q_smallint) > 0','having FIRST(t1.q_tinyint) > 0','having FIRST(t1.q_float) > 0','having FIRST(t1.q_double) > 0', + 'having LAST(t1.q_int) > 0','having LAST(t1.q_bigint) > 0','having LAST(t1.q_smallint) > 0','having LAST(t1.q_tinyint) > 0','having LAST(t1.q_float) > 0','having LAST(t1.q_double) > 0', + 'having APERCENTILE(t1.q_int,10) > 0','having APERCENTILE(t1.q_bigint,10) > 0','having APERCENTILE(t1.q_smallint,10) > 0','having APERCENTILE(t1.q_tinyint,10) > 0','having APERCENTILE(t1.q_float,10) > 0','having APERCENTILE(t1.q_double,10) > 0'] + + # limit offset where + self.limit_where = ['limit 1 offset 1' , 'limit 1' , 'limit 2 offset 1' , 'limit 2', 'limit 12 offset 1' , 'limit 20', 'limit 20 offset 10' , 'limit 200'] + self.limit1_where = ['limit 1 offset 1' , 'limit 1' ] + self.limit_u_where = ['limit 100 offset 10' , 'limit 50' , 'limit 100' , 'limit 10' ] + + # slimit soffset where + self.slimit_where = ['slimit 1 soffset 1' , 'slimit 1' , 'slimit 2 soffset 1' , 'slimit 2'] + self.slimit1_where = ['slimit 2 soffset 1' , 'slimit 1' ] + + self.calc_select_all = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' , + 'top(q_int,20)' , 'top(q_bigint,20)' , 'top(q_smallint,20)' ,'top(q_tinyint,20)' ,'top(q_float,20)' ,'top(q_double,20)' , + 'first(q_int)' , 'first(q_bigint)' , 'first(q_smallint)' , 'first(q_tinyint)' , 'first(q_float)' ,'first(q_double)' ,'first(q_binary)' ,'first(q_nchar)' ,'first(q_bool)' ,'first(q_ts)' , + 'last(q_int)' , 'last(q_bigint)' , 'last(q_smallint)' , 'last(q_tinyint)' , 'last(q_float)' ,'last(q_double)' , 'last(q_binary)' ,'last(q_nchar)' ,'last(q_bool)' ,'last(q_ts)' , + 'min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' , + 'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' , + 'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)' , + 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' , + 'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)', + 'bottom(q_int_null,20)' , 'bottom(q_bigint_null,20)' , 'bottom(q_smallint_null,20)' , 'bottom(q_tinyint_null,20)' ,'bottom(q_float_null,20)' , 'bottom(q_double_null,20)' , + 'top(q_int_null,20)' , 'top(q_bigint_null,20)' , 'top(q_smallint_null,20)' ,'top(q_tinyint_null,20)' ,'top(q_float_null,20)' ,'top(q_double_null,20)' , + 'first(q_int_null)' , 'first(q_bigint_null)' , 'first(q_smallint_null)' , 'first(q_tinyint_null)' , 'first(q_float_null)' ,'first(q_double_null)' ,'first(q_binary_null)' ,'first(q_nchar_null)' ,'first(q_bool_null)' ,'first(q_ts_null)' , + 'last(q_int_null)' , 'last(q_bigint_null)' , 'last(q_smallint_null)' , 'last(q_tinyint_null)' , 'last(q_float_null)' ,'last(q_double_null)' , 'last(q_binary_null)' ,'last(q_nchar_null)' ,'last(q_bool_null)' ,'last(q_ts_null)' , + 'min(q_int_null)' , 'min(q_bigint_null)' , 'min(q_smallint_null)' , 'min(q_tinyint_null)' , 'min(q_float_null)' ,'min(q_double_null)' , + 'max(q_int_null)' , 'max(q_bigint_null)' , 'max(q_smallint_null)' , 'max(q_tinyint_null)' ,'max(q_float_null)' ,'max(q_double_null)' , + 'last_row(q_int_null)' , 'last_row(q_bigint_null)' , 'last_row(q_smallint_null)' , 'last_row(q_tinyint_null)' , 'last_row(q_float_null)' , + 'last_row(q_double_null)' , 'last_row(q_bool_null)' ,'last_row(q_binary_null)' ,'last_row(q_nchar_null)' ,'last_row(q_ts_null)', + 'apercentile(q_int_null,20)' , 'apercentile(q_bigint_null,20)' ,'apercentile(q_smallint_null,20)' ,'apercentile(q_tinyint_null,20)' ,'apercentile(q_float_null,20)' ,'apercentile(q_double_null,20)' ,] + + self.calc_select_in_ts = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' , + 'top(q_int,20)' , 'top(q_bigint,20)' , 'top(q_smallint,20)' ,'top(q_tinyint,20)' ,'top(q_float,20)' ,'top(q_double,20)' , + 'bottom(q_int_null,20)' , 'bottom(q_bigint_null,20)' , 'bottom(q_smallint_null,20)' , 'bottom(q_tinyint_null,20)' ,'bottom(q_float_null,20)' , 'bottom(q_double_null,20)' , + 'top(q_int_null,20)' , 'top(q_bigint_null,20)' , 'top(q_smallint_null,20)' ,'top(q_tinyint_null,20)' ,'top(q_float_null,20)' ,'top(q_double_null,20)' , + 'first(q_int)' , 'first(q_bigint)' , 'first(q_smallint)' , 'first(q_tinyint)' , 'first(q_float)' ,'first(q_double)' ,'first(q_binary)' ,'first(q_nchar)' ,'first(q_bool)' ,'first(q_ts)' , + 'last(q_int)' , 'last(q_bigint)' , 'last(q_smallint)' , 'last(q_tinyint)' , 'last(q_float)' ,'last(q_double)' , 'last(q_binary)' ,'last(q_nchar)' ,'last(q_bool)' ,'last(q_ts)' , + 'first(q_int_null)' , 'first(q_bigint_null)' , 'first(q_smallint_null)' , 'first(q_tinyint_null)' , 'first(q_float_null)' ,'first(q_double_null)' ,'first(q_binary_null)' ,'first(q_nchar_null)' ,'first(q_bool_null)' ,'first(q_ts_null)' , + 'last(q_int_null)' , 'last(q_bigint_null)' , 'last(q_smallint_null)' , 'last(q_tinyint_null)' , 'last(q_float_null)' ,'last(q_double_null)' , 'last(q_binary_null)' ,'last(q_nchar_null)' ,'last(q_bool_null)' ,'last(q_ts_null)' ] + + self.calc_select_in = ['min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' , + 'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' , + 'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)' , + 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' , + 'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)', + 'min(q_int_null)' , 'min(q_bigint_null)' , 'min(q_smallint_null)' , 'min(q_tinyint_null)' , 'min(q_float_null)' ,'min(q_double_null)' , + 'max(q_int_null)' , 'max(q_bigint_null)' , 'max(q_smallint_null)' , 'max(q_tinyint_null)' ,'max(q_float_null)' ,'max(q_double_null)' , + 'apercentile(q_int_null,20)' , 'apercentile(q_bigint_null,20)' ,'apercentile(q_smallint_null,20)' ,'apercentile(q_tinyint_null,20)' ,'apercentile(q_float_null,20)' ,'apercentile(q_double_null,20)' , + 'last_row(q_int_null)' , 'last_row(q_bigint_null)' , 'last_row(q_smallint_null)' , 'last_row(q_tinyint_null)' , 'last_row(q_float_null)' , + 'last_row(q_double_null)' , 'last_row(q_bool_null)' ,'last_row(q_binary_null)' ,'last_row(q_nchar_null)' ,'last_row(q_ts_null)'] + + self.calc_select_not_support_ts = ['first(q_int)' , 'first(q_bigint)' , 'first(q_smallint)' , 'first(q_tinyint)' , 'first(q_float)' ,'first(q_double)' ,'first(q_binary)' ,'first(q_nchar)' ,'first(q_bool)' ,'first(q_ts)' , + 'last(q_int)' , 'last(q_bigint)' , 'last(q_smallint)' , 'last(q_tinyint)' , 'last(q_float)' ,'last(q_double)' , 'last(q_binary)' ,'last(q_nchar)' ,'last(q_bool)' ,'last(q_ts)' , + 'last_row(q_int)' , 'last_row(q_bigint)' , 'last_row(q_smallint)' , 'last_row(q_tinyint)' , 'last_row(q_float)' , + 'last_row(q_double)' , 'last_row(q_bool)' ,'last_row(q_binary)' ,'last_row(q_nchar)' ,'last_row(q_ts)', + 'apercentile(q_int,20)' , 'apercentile(q_bigint,20)' ,'apercentile(q_smallint,20)' ,'apercentile(q_tinyint,20)' ,'apercentile(q_float,20)' ,'apercentile(q_double,20)', + 'first(q_int_null)' , 'first(q_bigint_null)' , 'first(q_smallint_null)' , 'first(q_tinyint_null)' , 'first(q_float_null)' ,'first(q_double_null)' ,'first(q_binary_null)' ,'first(q_nchar_null)' ,'first(q_bool_null)' ,'first(q_ts_null)' , + 'last(q_int_null)' , 'last(q_bigint_null)' , 'last(q_smallint_null)' , 'last(q_tinyint_null)' , 'last(q_float_null)' ,'last(q_double_null)' , 'last(q_binary_null)' ,'last(q_nchar_null)' ,'last(q_bool_null)' ,'last(q_ts_null)' , + 'last_row(q_int_null)' , 'last_row(q_bigint_null)' , 'last_row(q_smallint_null)' , 'last_row(q_tinyint_null)' , 'last_row(q_float_null)' , + 'last_row(q_double_null)' , 'last_row(q_bool_null)' ,'last_row(q_binary_null)' ,'last_row(q_nchar_null)' ,'last_row(q_ts_null)', + 'apercentile(q_int_null,20)' , 'apercentile(q_bigint_null,20)' ,'apercentile(q_smallint_null,20)' ,'apercentile(q_tinyint_null,20)' ,'apercentile(q_float_null,20)' ,'apercentile(q_double_null,20)'] + + self.calc_select_support_ts = ['bottom(q_int,20)' , 'bottom(q_bigint,20)' , 'bottom(q_smallint,20)' , 'bottom(q_tinyint,20)' ,'bottom(q_float,20)' , 'bottom(q_double,20)' , + 'top(q_int,20)' , 'top(q_bigint,20)' , 'top(q_smallint,20)' ,'top(q_tinyint,20)' ,'top(q_float,20)' ,'top(q_double,20)' , + 'bottom(q_int_null,20)' , 'bottom(q_bigint_null,20)' , 'bottom(q_smallint_null,20)' , 'bottom(q_tinyint_null,20)' ,'bottom(q_float_null,20)' , 'bottom(q_double_null,20)' , + 'top(q_int_null,20)' , 'top(q_bigint_null,20)' , 'top(q_smallint_null,20)' ,'top(q_tinyint_null,20)' ,'top(q_float_null,20)' ,'top(q_double_null,20)' , + 'min(q_int)' , 'min(q_bigint)' , 'min(q_smallint)' , 'min(q_tinyint)' , 'min(q_float)' ,'min(q_double)' , + 'max(q_int)' , 'max(q_bigint)' , 'max(q_smallint)' , 'max(q_tinyint)' ,'max(q_float)' ,'max(q_double)' , + 'min(q_int_null)' , 'min(q_bigint_null)' , 'min(q_smallint_null)' , 'min(q_tinyint_null)' , 'min(q_float_null)' ,'min(q_double_null)' , + 'max(q_int_null)' , 'max(q_bigint_null)' , 'max(q_smallint_null)' , 'max(q_tinyint_null)' ,'max(q_float_null)' ,'max(q_double_null)'] + + self.calc_select_regular = [ 'PERCENTILE(q_int,10)' ,'PERCENTILE(q_bigint,20)' , 'PERCENTILE(q_smallint,30)' ,'PERCENTILE(q_tinyint,40)' ,'PERCENTILE(q_float,50)' ,'PERCENTILE(q_double,60)', + 'PERCENTILE(q_int_null,10)' ,'PERCENTILE(q_bigint_null,20)' , 'PERCENTILE(q_smallint_null,30)' ,'PERCENTILE(q_tinyint_null,40)' ,'PERCENTILE(q_float_null,50)' ,'PERCENTILE(q_double_null,60)'] + + + self.calc_select_fill = ['INTERP(q_int)' ,'INTERP(q_bigint)' ,'INTERP(q_smallint)' ,'INTERP(q_tinyint)', 'INTERP(q_float)' ,'INTERP(q_double)'] + self.interp_where = ['ts = now' , 'ts = \'2020-09-13 20:26:40.000\'' , 'ts = \'2020-09-13 20:26:40.009\'' ,'tbname in (\'table_1\') and ts = now' ,'tbname in (\'table_0\' ,\'table_1\',\'table_2\',\'table_3\',\'table_4\',\'table_5\') and ts = \'2020-09-13 20:26:40.000\'','tbname like \'table%\' and ts = \'2020-09-13 20:26:40.002\''] + + #two table join + self.calc_select_in_ts_j = ['bottom(t1.q_int,20)' , 'bottom(t1.q_bigint,20)' , 'bottom(t1.q_smallint,20)' , 'bottom(t1.q_tinyint,20)' ,'bottom(t1.q_float,20)' , 'bottom(t1.q_double,20)' , + 'top(t1.q_int,20)' , 'top(t1.q_bigint,20)' , 'top(t1.q_smallint,20)' ,'top(t1.q_tinyint,20)' ,'top(t1.q_float,20)' ,'top(t1.q_double,20)' , + 'first(t1.q_int)' , 'first(t1.q_bigint)' , 'first(t1.q_smallint)' , 'first(t1.q_tinyint)' , 'first(t1.q_float)' ,'first(t1.q_double)' ,'first(t1.q_binary)' ,'first(t1.q_nchar)' ,'first(t1.q_bool)' ,'first(t1.q_ts)' , + 'last(t1.q_int)' , 'last(t1.q_bigint)' , 'last(t1.q_smallint)' , 'last(t1.q_tinyint)' , 'last(t1.q_float)' ,'last(t1.q_double)' , 'last(t1.q_binary)' ,'last(t1.q_nchar)' ,'last(t1.q_bool)' ,'last(t1.q_ts)' , + 'bottom(t2.q_int,20)' , 'bottom(t2.q_bigint,20)' , 'bottom(t2.q_smallint,20)' , 'bottom(t2.q_tinyint,20)' ,'bottom(t2.q_float,20)' , 'bottom(t2.q_double,20)' , + 'top(t2.q_int,20)' , 'top(t2.q_bigint,20)' , 'top(t2.q_smallint,20)' ,'top(t2.q_tinyint,20)' ,'top(t2.q_float,20)' ,'top(t2.q_double,20)' , + 'first(t2.q_int)' , 'first(t2.q_bigint)' , 'first(t2.q_smallint)' , 'first(t2.q_tinyint)' , 'first(t2.q_float)' ,'first(t2.q_double)' ,'first(t2.q_binary)' ,'first(t2.q_nchar)' ,'first(t2.q_bool)' ,'first(t2.q_ts)' , + 'last(t2.q_int)' , 'last(t2.q_bigint)' , 'last(t2.q_smallint)' , 'last(t2.q_tinyint)' , 'last(t2.q_float)' ,'last(t2.q_double)' , 'last(t2.q_binary)' ,'last(t2.q_nchar)' ,'last(t2.q_bool)' ,'last(t2.q_ts)', + 'bottom(t1.q_int_null,20)' , 'bottom(t1.q_bigint_null,20)' , 'bottom(t1.q_smallint_null,20)' , 'bottom(t1.q_tinyint_null,20)' ,'bottom(t1.q_float_null,20)' , 'bottom(t1.q_double_null,20)' , + 'top(t1.q_int_null,20)' , 'top(t1.q_bigint_null,20)' , 'top(t1.q_smallint_null,20)' ,'top(t1.q_tinyint_null,20)' ,'top(t1.q_float_null,20)' ,'top(t1.q_double_null,20)' , + 'first(t1.q_int_null)' , 'first(t1.q_bigint_null)' , 'first(t1.q_smallint_null)' , 'first(t1.q_tinyint_null)' , 'first(t1.q_float_null)' ,'first(t1.q_double_null)' ,'first(t1.q_binary_null)' ,'first(t1.q_nchar_null))' ,'first(t1.q_bool_null)' ,'first(t1.q_ts_null)' , + 'last(t1.q_int_null)' , 'last(t1.q_bigint_null)' , 'last(t1.q_smallint_null)' , 'last(t1.q_tinyint_null)' , 'last(t1.q_float_null)' ,'last(t1.q_double_null)' , 'last(t1.q_binary_null)' ,'last(t1.q_nchar_null))' ,'last(t1.q_bool_null)' ,'last(t1.q_ts_null)' , + 'bottom(t2.q_int_null,20)' , 'bottom(t2.q_bigint_null,20)' , 'bottom(t2.q_smallint_null,20)' , 'bottom(t2.q_tinyint_null,20)' ,'bottom(t2.q_float_null,20)' , 'bottom(t2.q_double_null,20)' , + 'top(t2.q_int_null,20)' , 'top(t2.q_bigint_null,20)' , 'top(t2.q_smallint_null,20)' ,'top(t2.q_tinyint_null,20)' ,'top(t2.q_float_null,20)' ,'top(t2.q_double_null,20)' , + 'first(t2.q_int_null)' , 'first(t2.q_bigint_null)' , 'first(t2.q_smallint_null)' , 'first(t2.q_tinyint_null)' , 'first(t2.q_float_null)' ,'first(t2.q_double_null)' ,'first(t2.q_binary_null)' ,'first(t2.q_nchar_null))' ,'first(t2.q_bool_null)' ,'first(t2.q_ts_null)' , + 'last(t2.q_int_null)' , 'last(t2.q_bigint_null)' , 'last(t2.q_smallint_null)' , 'last(t2.q_tinyint_null)' , 'last(t2.q_float_null)' ,'last(t2.q_double_null)' , 'last(t2.q_binary_null)' ,'last(t2.q_nchar_null))' ,'last(t2.q_bool_null)' ,'last(t2.q_ts_null)'] + + self.calc_select_in_support_ts_j = ['bottom(t1.q_int,20)' , 'bottom(t1.q_bigint,20)' , 'bottom(t1.q_smallint,20)' , 'bottom(t1.q_tinyint,20)' ,'bottom(t1.q_float,20)' , 'bottom(t1.q_double,20)' , + 'top(t1.q_int,20)' , 'top(t1.q_bigint,20)' , 'top(t1.q_smallint,20)' ,'top(t1.q_tinyint,20)' ,'top(t1.q_float,20)' ,'top(t1.q_double,20)' , + 'min(t1.q_int)' , 'min(t1.q_bigint)' , 'min(t1.q_smallint)' , 'min(t1.q_tinyint)' , 'min(t1.q_float)' ,'min(t1.q_double)' , + 'max(t1.q_int)' , 'max(t1.q_bigint)' , 'max(t1.q_smallint)' , 'max(t1.q_tinyint)' ,'max(t1.q_float)' ,'max(t1.q_double)' , + 'bottom(t2.q_int,20)' , 'bottom(t2.q_bigint,20)' , 'bottom(t2.q_smallint,20)' , 'bottom(t2.q_tinyint,20)' ,'bottom(t2.q_float,20)' , 'bottom(t2.q_double,20)' , + 'top(t2.q_int,20)' , 'top(t2.q_bigint,20)' , 'top(t2.q_smallint,20)' ,'top(t2.q_tinyint,20)' ,'top(t2.q_float,20)' ,'top(t2.q_double,20)' , + 'min(t2.q_int)' , 'min(t2.q_bigint)' , 'min(t2.q_smallint)' , 'min(t2.q_tinyint)' , 'min(t2.q_float)' ,'min(t2.q_double)' , + 'max(t2.q_int)' , 'max(t2.q_bigint)' , 'max(t2.q_smallint)' , 'max(t2.q_tinyint)' ,'max(t2.q_float)' ,'max(t2.q_double)' , + 'bottom(t1.q_int_null,20)' , 'bottom(t1.q_bigint_null,20)' , 'bottom(t1.q_smallint_null,20)' , 'bottom(t1.q_tinyint_null,20)' ,'bottom(t1.q_float_null,20)' , 'bottom(t1.q_double_null,20)' , + 'top(t1.q_int_null,20)' , 'top(t1.q_bigint_null,20)' , 'top(t1.q_smallint_null,20)' ,'top(t1.q_tinyint_null,20)' ,'top(t1.q_float_null,20)' ,'top(t1.q_double_null,20)' , + 'bottom(t2.q_int_null,20)' , 'bottom(t2.q_bigint_null,20)' , 'bottom(t2.q_smallint_null,20)' , 'bottom(t2.q_tinyint_null,20)' ,'bottom(t2.q_float_null,20)' , 'bottom(t2.q_double_null,20)' , + 'top(t2.q_int_null,20)' , 'top(t2.q_bigint_null,20)' , 'top(t2.q_smallint_null,20)' ,'top(t2.q_tinyint_null,20)' ,'top(t2.q_float_null,20)' ,'top(t2.q_double_null,20)' , + 'min(t1.q_int_null)' , 'min(t1.q_bigint_null)' , 'min(t1.q_smallint_null)' , 'min(t1.q_tinyint_null)' , 'min(t1.q_float_null)' ,'min(t1.q_double_null)' , + 'max(t1.q_int_null)' , 'max(t1.q_bigint_null)' , 'max(t1.q_smallint_null)' , 'max(t1.q_tinyint_null)' ,'max(t1.q_float_null)' ,'max(t1.q_double_null)' , + 'min(t2.q_int_null)' , 'min(t2.q_bigint_null)' , 'min(t2.q_smallint_null)' , 'min(t2.q_tinyint_null)' , 'min(t2.q_float_null)' ,'min(t2.q_double_null)' , + 'max(t2.q_int_null)' , 'max(t2.q_bigint_null)' , 'max(t2.q_smallint_null)' , 'max(t2.q_tinyint_null)' ,'max(t2.q_float_null)' ,'max(t2.q_double_null)' ] + + self.calc_select_in_not_support_ts_j = ['apercentile(t1.q_int,20)' , 'apercentile(t1.q_bigint,20)' ,'apercentile(t1.q_smallint,20)' ,'apercentile(t1.q_tinyint,20)' ,'apercentile(t1.q_float,20)' ,'apercentile(t1.q_double,20)' , + 'apercentile(t1.q_int_null,20)' , 'apercentile(t1.q_bigint_null,20)' ,'apercentile(t1.q_smallint_null,20)' ,'apercentile(t1.q_tinyint_null,20)' ,'apercentile(t1.q_float_null,20)' ,'apercentile(t1.q_double_null,20)' , + 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' , + 'last_row(t1.q_double)' , 'last_row(t1.q_bool)' ,'last_row(t1.q_binary)' ,'last_row(t1.q_nchar)' ,'last_row(t1.q_ts)' , + 'last_row(t1.q_int_null)' , 'last_row(t1.q_bigint_null)' , 'last_row(t1.q_smallint_null)' , 'last_row(t1.q_tinyint_null)' , 'last_row(t1.q_float_null)' , + 'last_row(t1.q_double_null)' , 'last_row(t1.q_bool_null)' ,'last_row(t1.q_binary_null)' ,'last_row(t1.q_nchar_null)' ,'last_row(t1.q_ts_null)' , + 'apercentile(t2.q_int,20)' , 'apercentile(t2.q_bigint,20)' ,'apercentile(t2.q_smallint,20)' ,'apercentile(t2.q_tinyint,20)' ,'apercentile(t2.q_float,20)' ,'apercentile(t2.q_double,20)' , + 'apercentile(t2.q_int_null,20)' , 'apercentile(t2.q_bigint_null,20)' ,'apercentile(t2.q_smallint_null,20)' ,'apercentile(t2.q_tinyint_null,20)' ,'apercentile(t2.q_float_null,20)' ,'apercentile(t2.q_double_null,20)' , + 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' , + 'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)', + 'last_row(t2.q_int_null)' , 'last_row(t2.q_bigint_null)' , 'last_row(t2.q_smallint_null)' , 'last_row(t2.q_tinyint_null)' , 'last_row(t2.q_float_null)' , + 'last_row(t2.q_double_null)' , 'last_row(t2.q_bool_null)' ,'last_row(t2.q_binary_null)' ,'last_row(t2.q_nchar_null)' ,'last_row(t2.q_ts_null)'] + + self.calc_select_in_j = ['min(t1.q_int)' , 'min(t1.q_bigint)' , 'min(t1.q_smallint)' , 'min(t1.q_tinyint)' , 'min(t1.q_float)' ,'min(t1.q_double)' , + 'max(t1.q_int)' , 'max(t1.q_bigint)' , 'max(t1.q_smallint)' , 'max(t1.q_tinyint)' ,'max(t1.q_float)' ,'max(t1.q_double)' , + 'apercentile(t1.q_int,20)' , 'apercentile(t1.q_bigint,20)' ,'apercentile(t1.q_smallint,20)' ,'apercentile(t1.q_tinyint,20)' ,'apercentile(t1.q_float,20)' ,'apercentile(t1.q_double,20)' , + 'min(t1.q_int_null)' , 'min(t1.q_bigint_null)' , 'min(t1.q_smallint_null)' , 'min(t1.q_tinyint_null)' , 'min(t1.q_float_null)' ,'min(t1.q_double_null)' , + 'max(t1.q_int_null)' , 'max(t1.q_bigint_null)' , 'max(t1.q_smallint_null)' , 'max(t1.q_tinyint_null)' ,'max(t1.q_float_null)' ,'max(t1.q_double_null)' , + 'apercentile(t1.q_int_null,20)' , 'apercentile(t1.q_bigint_null,20)' ,'apercentile(t1.q_smallint_null,20)' ,'apercentile(t1.q_tinyint_null,20)' ,'apercentile(t1.q_float_null,20)' ,'apercentile(t1.q_double_null,20)' , + 'last_row(t1.q_int)' , 'last_row(t1.q_bigint)' , 'last_row(t1.q_smallint)' , 'last_row(t1.q_tinyint)' , 'last_row(t1.q_float)' , + 'last_row(t1.q_double)' , 'last_row(t1.q_bool)' ,'last_row(t1.q_binary)' ,'last_row(t1.q_nchar)' ,'last_row(t1.q_ts)' , + 'min(t2.q_int)' , 'min(t2.q_bigint)' , 'min(t2.q_smallint)' , 'min(t2.q_tinyint)' , 'min(t2.q_float)' ,'min(t2.q_double)' , + 'max(t2.q_int)' , 'max(t2.q_bigint)' , 'max(t2.q_smallint)' , 'max(t2.q_tinyint)' ,'max(t2.q_float)' ,'max(t2.q_double)' , + 'last_row(t1.q_int_null)' , 'last_row(t1.q_bigint_null)' , 'last_row(t1.q_smallint_null)' , 'last_row(t1.q_tinyint_null)' , 'last_row(t1.q_float_null)' , + 'last_row(t1.q_double_null)' , 'last_row(t1.q_bool_null)' ,'last_row(t1.q_binary_null)' ,'last_row(t1.q_nchar_null)' ,'last_row(t1.q_ts_null)' , + 'min(t2.q_int_null)' , 'min(t2.q_bigint_null)' , 'min(t2.q_smallint_null)' , 'min(t2.q_tinyint_null)' , 'min(t2.q_float_null)' ,'min(t2.q_double_null)' , + 'max(t2.q_int_null)' , 'max(t2.q_bigint_null)' , 'max(t2.q_smallint_null)' , 'max(t2.q_tinyint_null)' ,'max(t2.q_float_null)' ,'max(t2.q_double_null)' , + 'apercentile(t2.q_int,20)' , 'apercentile(t2.q_bigint,20)' ,'apercentile(t2.q_smallint,20)' ,'apercentile(t2.q_tinyint,20)' ,'apercentile(t2.q_float,20)' ,'apercentile(t2.q_double,20)' , + 'apercentile(t2.q_int_null,20)' , 'apercentile(t2.q_bigint_null,20)' ,'apercentile(t2.q_smallint_null,20)' ,'apercentile(t2.q_tinyint_null,20)' ,'apercentile(t2.q_float_null,20)' ,'apercentile(t2.q_double_null,20)' , + 'last_row(t2.q_int)' , 'last_row(t2.q_bigint)' , 'last_row(t2.q_smallint)' , 'last_row(t2.q_tinyint)' , 'last_row(t2.q_float)' , + 'last_row(t2.q_double)' , 'last_row(t2.q_bool)' ,'last_row(t2.q_binary)' ,'last_row(t2.q_nchar)' ,'last_row(t2.q_ts)', + 'last_row(t2.q_int_null)' , 'last_row(t2.q_bigint_null)' , 'last_row(t2.q_smallint_null)' , 'last_row(t2.q_tinyint_null)' , 'last_row(t2.q_float_null)' , + 'last_row(t2.q_double_null)' , 'last_row(t2.q_bool_null)' ,'last_row(t2.q_binary_null)' ,'last_row(t2.q_nchar_null)' ,'last_row(t2.q_ts_null)'] + self.calc_select_all_j = self.calc_select_in_ts_j + self.calc_select_in_j + + self.calc_select_regular_j = [ 'PERCENTILE(t1.q_int,10)' ,'PERCENTILE(t1.q_bigint,20)' , 'PERCENTILE(t1.q_smallint,30)' ,'PERCENTILE(t1.q_tinyint,40)' ,'PERCENTILE(t1.q_float,50)' ,'PERCENTILE(t1.q_double,60)' , + 'PERCENTILE(t2.q_int,10)' ,'PERCENTILE(t2.q_bigint,20)' , 'PERCENTILE(t2.q_smallint,30)' ,'PERCENTILE(t2.q_tinyint,40)' ,'PERCENTILE(t2.q_float,50)' ,'PERCENTILE(t2.q_double,60)', + 'PERCENTILE(t1.q_int_null,10)' ,'PERCENTILE(t1.q_bigint_null,20)' , 'PERCENTILE(t1.q_smallint_null,30)' ,'PERCENTILE(t1.q_tinyint_null,40)' ,'PERCENTILE(t1.q_float_null,50)' ,'PERCENTILE(t1.q_double_null,60)' , + 'PERCENTILE(t2.q_int_null,10)' ,'PERCENTILE(t2.q_bigint_null,20)' , 'PERCENTILE(t2.q_smallint_null,30)' ,'PERCENTILE(t2.q_tinyint_null,40)' ,'PERCENTILE(t2.q_float_null,50)' ,'PERCENTILE(t2.q_double_null,60)'] + + + self.calc_select_fill_j = ['INTERP(t1.q_int)' ,'INTERP(t1.q_bigint)' ,'INTERP(t1.q_smallint)' ,'INTERP(t1.q_tinyint)', 'INTERP(t1.q_float)' ,'INTERP(t1.q_double)' , + 'INTERP(t2.q_int)' ,'INTERP(t2.q_bigint)' ,'INTERP(t2.q_smallint)' ,'INTERP(t2.q_tinyint)', 'INTERP(t2.q_float)' ,'INTERP(t2.q_double)'] + self.interp_where_j = ['t1.ts = now' , 't1.ts = \'2020-09-13 20:26:40.000\'' , 't1.ts = \'2020-09-13 20:26:40.009\'' ,'t2.ts = now' , 't2.ts = \'2020-09-13 20:26:40.000\'' , 't2.ts = \'2020-09-13 20:26:40.009\'' , + 't1.tbname in (\'table_1\') and t1.ts = now' ,'t1.tbname in (\'table_0\' ,\'table_1\',\'table_2\',\'table_3\',\'table_4\',\'table_5\') and t1.ts = \'2020-09-13 20:26:40.000\'','t1.tbname like \'table%\' and t1.ts = \'2020-09-13 20:26:40.002\'', + 't2.tbname in (\'table_1\') and t2.ts = now' ,'t2.tbname in (\'table_0\' ,\'table_1\',\'table_2\',\'table_3\',\'table_4\',\'table_5\') and t2.ts = \'2020-09-13 20:26:40.000\'','t2.tbname like \'table%\' and t2.ts = \'2020-09-13 20:26:40.002\''] + + self.calc_aggregate_all = ['count(*)' , 'count(q_int)' ,'count(q_bigint)' , 'count(q_smallint)' ,'count(q_tinyint)' ,'count(q_float)' , + 'count(q_double)' ,'count(q_binary)' ,'count(q_nchar)' ,'count(q_bool)' ,'count(q_ts)' , + 'avg(q_int)' ,'avg(q_bigint)' , 'avg(q_smallint)' ,'avg(q_tinyint)' ,'avg(q_float)' ,'avg(q_double)' , + 'sum(q_int)' ,'sum(q_bigint)' , 'sum(q_smallint)' ,'sum(q_tinyint)' ,'sum(q_float)' ,'sum(q_double)' , + 'STDDEV(q_int)' ,'STDDEV(q_bigint)' , 'STDDEV(q_smallint)' ,'STDDEV(q_tinyint)' ,'STDDEV(q_float)' ,'STDDEV(q_double)', + 'APERCENTILE(q_int,10)' ,'APERCENTILE(q_bigint,20)' , 'APERCENTILE(q_smallint,30)' ,'APERCENTILE(q_tinyint,40)' ,'APERCENTILE(q_float,50)' ,'APERCENTILE(q_double,60)', + 'count(q_int_null)' ,'count(q_bigint_null)' , 'count(q_smallint_null)' ,'count(q_tinyint_null)' ,'count(q_float_null)' , + 'count(q_double_null)' ,'count(q_binary_null)' ,'count(q_nchar_null)' ,'count(q_bool_null)' ,'count(q_ts_null)' , + 'avg(q_int_null)' ,'avg(q_bigint_null)' , 'avg(q_smallint_null)' ,'avg(q_tinyint_null)' ,'avg(q_float_null)' ,'avg(q_double_null)' , + 'sum(q_int_null)' ,'sum(q_bigint_null)' , 'sum(q_smallint_null)' ,'sum(q_tinyint_null)' ,'sum(q_float_null)' ,'sum(q_double_null)' , + 'STDDEV(q_int_null)' ,'STDDEV(q_bigint_null)' , 'STDDEV(q_smallint_null)' ,'STDDEV(q_tinyint_null)' ,'STDDEV(q_float_null)' ,'STDDEV(q_double_null)', + 'APERCENTILE(q_int_null,10)' ,'APERCENTILE(q_bigint_null,20)' , 'APERCENTILE(q_smallint_null,30)' ,'APERCENTILE(q_tinyint_null,40)' ,'APERCENTILE(q_float_null,50)' ,'APERCENTILE(q_double_null,60)'] + + self.calc_aggregate_regular = ['twa(q_int)' ,'twa(q_bigint)' , 'twa(q_smallint)' ,'twa(q_tinyint)' ,'twa (q_float)' ,'twa(q_double)' , + 'IRATE(q_int)' ,'IRATE(q_bigint)' , 'IRATE(q_smallint)' ,'IRATE(q_tinyint)' ,'IRATE (q_float)' ,'IRATE(q_double)' , + 'twa(q_int_null)' ,'twa(q_bigint_null)' , 'twa(q_smallint_null)' ,'twa(q_tinyint_null)' ,'twa (q_float_null)' ,'twa(q_double_null)' , + 'IRATE(q_int_null)' ,'IRATE(q_bigint_null)' , 'IRATE(q_smallint_null)' ,'IRATE(q_tinyint_null)' ,'IRATE (q_float_null)' ,'IRATE(q_double_null)' , + 'LEASTSQUARES(q_int,15,3)' , 'LEASTSQUARES(q_bigint,10,1)' , 'LEASTSQUARES(q_smallint,20,3)' ,'LEASTSQUARES(q_tinyint,10,4)' ,'LEASTSQUARES(q_float,6,4)' ,'LEASTSQUARES(q_double,3,1)' , + 'PERCENTILE(q_int,10)' ,'PERCENTILE(q_bigint,20)' , 'PERCENTILE(q_smallint,30)' ,'PERCENTILE(q_tinyint,40)' ,'PERCENTILE(q_float,50)' ,'PERCENTILE(q_double,60)', + 'LEASTSQUARES(q_int_null,15,3)' , 'LEASTSQUARES(q_bigint_null,10,1)' , 'LEASTSQUARES(q_smallint_null,20,3)' ,'LEASTSQUARES(q_tinyint_null,10,4)' ,'LEASTSQUARES(q_float_null,6,4)' ,'LEASTSQUARES(q_double_null,3,1)' , + 'PERCENTILE(q_int_null,10)' ,'PERCENTILE(q_bigint_null,20)' , 'PERCENTILE(q_smallint_null,30)' ,'PERCENTILE(q_tinyint_null,40)' ,'PERCENTILE(q_float_null,50)' ,'PERCENTILE(q_double_null,60)'] + + self.calc_aggregate_groupbytbname = ['twa(q_int)' ,'twa(q_bigint)' , 'twa(q_smallint)' ,'twa(q_tinyint)' ,'twa (q_float)' ,'twa(q_double)' , + 'IRATE(q_int)' ,'IRATE(q_bigint)' , 'IRATE(q_smallint)' ,'IRATE(q_tinyint)' ,'IRATE (q_float)' ,'IRATE(q_double)', + 'twa(q_int_null)' ,'twa(q_bigint_null)' , 'twa(q_smallint_null)' ,'twa(q_tinyint_null)' ,'twa (q_float_null)' ,'twa(q_double_null)' , + 'IRATE(q_int_null)' ,'IRATE(q_bigint_null)' , 'IRATE(q_smallint_null)' ,'IRATE(q_tinyint_null)' ,'IRATE (q_float_null)' ,'IRATE(q_double_null)'] + + #two table join + self.calc_aggregate_all_j = ['count(t1.*)' , 'count(t1.q_int)' ,'count(t1.q_bigint)' , 'count(t1.q_smallint)' ,'count(t1.q_tinyint)' ,'count(t1.q_float)' , + 'count(t1.q_double)' ,'count(t1.q_binary)' ,'count(t1.q_nchar)' ,'count(t1.q_bool)' ,'count(t1.q_ts)' , + 'avg(t1.q_int)' ,'avg(t1.q_bigint)' , 'avg(t1.q_smallint)' ,'avg(t1.q_tinyint)' ,'avg(t1.q_float)' ,'avg(t1.q_double)' , + 'sum(t1.q_int)' ,'sum(t1.q_bigint)' , 'sum(t1.q_smallint)' ,'sum(t1.q_tinyint)' ,'sum(t1.q_float)' ,'sum(t1.q_double)' , + 'STDDEV(t1.q_int)' ,'STDDEV(t1.q_bigint)' , 'STDDEV(t1.q_smallint)' ,'STDDEV(t1.q_tinyint)' ,'STDDEV(t1.q_float)' ,'STDDEV(t1.q_double)', + 'APERCENTILE(t1.q_int,10)' ,'APERCENTILE(t1.q_bigint,20)' , 'APERCENTILE(t1.q_smallint,30)' ,'APERCENTILE(t1.q_tinyint,40)' ,'APERCENTILE(t1.q_float,50)' ,'APERCENTILE(t1.q_double,60)' , + 'count(t1.q_int_null)' ,'count(t1.q_bigint_null)' , 'count(t1.q_smallint_null)' ,'count(t1.q_tinyint_null)' ,'count(t1.q_float_null)' , + 'count(t1.q_double_null)' ,'count(t1.q_binary_null)' ,'count(t1.q_nchar_null)' ,'count(t1.q_bool_null)' ,'count(t1.q_ts_null)' , + 'avg(t1.q_int_null)' ,'avg(t1.q_bigint_null)' , 'avg(t1.q_smallint_null)' ,'avg(t1.q_tinyint_null)' ,'avg(t1.q_float_null)' ,'avg(t1.q_double_null)' , + 'sum(t1.q_int_null)' ,'sum(t1.q_bigint_null)' , 'sum(t1.q_smallint_null)' ,'sum(t1.q_tinyint_null)' ,'sum(t1.q_float_null)' ,'sum(t1.q_double_null)' , + 'STDDEV(t1.q_int_null)' ,'STDDEV(t1.q_bigint_null)' , 'STDDEV(t1.q_smallint_null)' ,'STDDEV(t1.q_tinyint_null)' ,'STDDEV(t1.q_float_null)' ,'STDDEV(t1.q_double_null)', + 'APERCENTILE(t1.q_int_null,10)' ,'APERCENTILE(t1.q_bigint_null,20)' , 'APERCENTILE(t1.q_smallint_null,30)' ,'APERCENTILE(t1.q_tinyint_null,40)' ,'APERCENTILE(t1.q_float_null,50)' ,'APERCENTILE(t1.q_double,60)' , + 'count(t2.*)' , 'count(t2.q_int)' ,'count(t2.q_bigint)' , 'count(t2.q_smallint)' ,'count(t2.q_tinyint)' ,'count(t2.q_float)' , + 'count(t2.q_double)' ,'count(t2.q_binary)' ,'count(t2.q_nchar)' ,'count(t2.q_bool)' ,'count(t2.q_ts)' , + 'avg(t2.q_int)' ,'avg(t2.q_bigint)' , 'avg(t2.q_smallint)' ,'avg(t2.q_tinyint)' ,'avg(t2.q_float)' ,'avg(t2.q_double)' , + 'sum(t2.q_int)' ,'sum(t2.q_bigint)' , 'sum(t2.q_smallint)' ,'sum(t2.q_tinyint)' ,'sum(t2.q_float)' ,'sum(t2.q_double)' , + 'STDDEV(t2.q_int)' ,'STDDEV(t2.q_bigint)' , 'STDDEV(t2.q_smallint)' ,'STDDEV(t2.q_tinyint)' ,'STDDEV(t2.q_float)' ,'STDDEV(t2.q_double)', + 'APERCENTILE(t2.q_int,10)' ,'APERCENTILE(t2.q_bigint,20)' , 'APERCENTILE(t2.q_smallint,30)' ,'APERCENTILE(t2.q_tinyint,40)' ,'APERCENTILE(t2.q_float,50)' ,'APERCENTILE(t2.q_double,60)', + 'count(t2.q_int_null)' ,'count(t2.q_bigint_null)' , 'count(t2.q_smallint_null)' ,'count(t2.q_tinyint_null)' ,'count(t2.q_float_null)' , + 'count(t2.q_double_null)' ,'count(t2.q_binary_null)' ,'count(t2.q_nchar_null)' ,'count(t2.q_bool_null)' ,'count(t2.q_ts_null)' , + 'avg(t2.q_int_null)' ,'avg(t2.q_bigint_null)' , 'avg(t2.q_smallint_null)' ,'avg(t2.q_tinyint_null)' ,'avg(t2.q_float_null)' ,'avg(t2.q_double_null)' , + 'sum(t2.q_int_null)' ,'sum(t2.q_bigint_null)' , 'sum(t2.q_smallint_null)' ,'sum(t2.q_tinyint_null)' ,'sum(t2.q_float_null)' ,'sum(t2.q_double_null)' , + 'STDDEV(t2.q_int_null)' ,'STDDEV(t2.q_bigint_null)' , 'STDDEV(t2.q_smallint_null)' ,'STDDEV(t2.q_tinyint_null)' ,'STDDEV(t2.q_float_null)' ,'STDDEV(t2.q_double_null)', + 'APERCENTILE(t2.q_int_null,10)' ,'APERCENTILE(t2.q_bigint_null,20)' , 'APERCENTILE(t2.q_smallint_null,30)' ,'APERCENTILE(t2.q_tinyint_null,40)' ,'APERCENTILE(t2.q_float_null,50)' ,'APERCENTILE(t2.q_double,60)'] + + self.calc_aggregate_regular_j = ['twa(t1.q_int)' ,'twa(t1.q_bigint)' , 'twa(t1.q_smallint)' ,'twa(t1.q_tinyint)' ,'twa (t1.q_float)' ,'twa(t1.q_double)' , + 'IRATE(t1.q_int)' ,'IRATE(t1.q_bigint)' , 'IRATE(t1.q_smallint)' ,'IRATE(t1.q_tinyint)' ,'IRATE (t1.q_float)' ,'IRATE(t1.q_double)' , + 'LEASTSQUARES(t1.q_int,15,3)' , 'LEASTSQUARES(t1.q_bigint,10,1)' , 'LEASTSQUARES(t1.q_smallint,20,3)' ,'LEASTSQUARES(t1.q_tinyint,10,4)' ,'LEASTSQUARES(t1.q_float,6,4)' ,'LEASTSQUARES(t1.q_double,3,1)' , + 'twa(t2.q_int)' ,'twa(t2.q_bigint)' , 'twa(t2.q_smallint)' ,'twa(t2.q_tinyint)' ,'twa (t2.q_float)' ,'twa(t2.q_double)' , + 'IRATE(t2.q_int)' ,'IRATE(t2.q_bigint)' , 'IRATE(t2.q_smallint)' ,'IRATE(t2.q_tinyint)' ,'IRATE (t2.q_float)' ,'IRATE(t2.q_double)', + 'LEASTSQUARES(t2.q_int,15,3)' , 'LEASTSQUARES(t2.q_bigint,10,1)' , 'LEASTSQUARES(t2.q_smallint,20,3)' ,'LEASTSQUARES(t2.q_tinyint,10,4)' ,'LEASTSQUARES(t2.q_float,6,4)' ,'LEASTSQUARES(t2.q_double,3,1)' , + 'twa(t1.q_int_null)' ,'twa(t1.q_bigint_null)' , 'twa(t1.q_smallint_null)' ,'twa(t1.q_tinyint_null)' ,'twa (t1.q_float_null)' ,'twa(t1.q_double_null)' , + 'IRATE(t1.q_int_null)' ,'IRATE(t1.q_bigint_null)' , 'IRATE(t1.q_smallint_null)' ,'IRATE(t1.q_tinyint_null)' ,'IRATE (t1.q_float_null)' ,'IRATE(t1.q_double_null)' , + 'LEASTSQUARES(t1.q_int_null,15,3)' , 'LEASTSQUARES(t1.q_bigint_null,10,1)' , 'LEASTSQUARES(t1.q_smallint_null,20,3)' ,'LEASTSQUARES(t1.q_tinyint_null,10,4)' ,'LEASTSQUARES(t1.q_float_null,6,4)' ,'LEASTSQUARES(t1.q_double_null,3,1)' , + 'twa(t2.q_int_null)' ,'twa(t2.q_bigint_null)' , 'twa(t2.q_smallint_null)' ,'twa(t2.q_tinyint_null)' ,'twa (t2.q_float_null)' ,'twa(t2.q_double_null)' , + 'IRATE(t2.q_int_null)' ,'IRATE(t2.q_bigint_null)' , 'IRATE(t2.q_smallint_null)' ,'IRATE(t2.q_tinyint_null)' ,'IRATE (t2.q_float_null)' ,'IRATE(t2.q_double_null)', + 'LEASTSQUARES(t2.q_int_null,15,3)' , 'LEASTSQUARES(t2.q_bigint_null,10,1)' , 'LEASTSQUARES(t2.q_smallint_null,20,3)' ,'LEASTSQUARES(t2.q_tinyint_null,10,4)' ,'LEASTSQUARES(t2.q_float_null,6,4)' ,'LEASTSQUARES(t2.q_double_null,3,1)' ] + + self.calc_aggregate_groupbytbname_j = ['twa(t1.q_int)' ,'twa(t1.q_bigint)' , 'twa(t1.q_smallint)' ,'twa(t1.q_tinyint)' ,'twa (t1.q_float)' ,'twa(t1.q_double)' , + 'IRATE(t1.q_int)' ,'IRATE(t1.q_bigint)' , 'IRATE(t1.q_smallint)' ,'IRATE(t1.q_tinyint)' ,'IRATE (t1.q_float)' ,'IRATE(t1.q_double)' , + 'twa(t2.q_int)' ,'twa(t2.q_bigint)' , 'twa(t2.q_smallint)' ,'twa(t2.q_tinyint)' ,'twa (t2.q_float)' ,'twa(t2.q_double)' , + 'IRATE(t2.q_int)' ,'IRATE(t2.q_bigint)' , 'IRATE(t2.q_smallint)' ,'IRATE(t2.q_tinyint)' ,'IRATE (t2.q_float)' ,'IRATE(t2.q_double)' , + 'twa(t1.q_int_null)' ,'twa(t1.q_bigint_null)' , 'twa(t1.q_smallint_null)' ,'twa(t1.q_tinyint_null)' ,'twa (t1.q_float_null)' ,'twa(t1.q_double_null)' , + 'IRATE(t1.q_int_null)' ,'IRATE(t1.q_bigint_null)' , 'IRATE(t1.q_smallint_null)' ,'IRATE(t1.q_tinyint_null)' ,'IRATE (t1.q_float_null)' ,'IRATE(t1.q_double_null)' , + 'twa(t2.q_int_null)' ,'twa(t2.q_bigint_null)' , 'twa(t2.q_smallint_null)' ,'twa(t2.q_tinyint_null)' ,'twa (t2.q_float_null)' ,'twa(t2.q_double_null)' , + 'IRATE(t2.q_int_null)' ,'IRATE(t2.q_bigint_null)' , 'IRATE(t2.q_smallint_null)' ,'IRATE(t2.q_tinyint_null)' ,'IRATE (t2.q_float_null)' ,'IRATE(t2.q_double_null)' ] + + self.calc_calculate_all = ['SPREAD(ts)' , 'SPREAD(q_ts)' , 'SPREAD(q_int)' ,'SPREAD(q_bigint)' , 'SPREAD(q_smallint)' ,'SPREAD(q_tinyint)' ,'SPREAD(q_float)' ,'SPREAD(q_double)' , + '(SPREAD(q_int) + SPREAD(q_bigint))' , '(SPREAD(q_smallint) - SPREAD(q_float))', '(SPREAD(q_double) * SPREAD(q_tinyint))' , '(SPREAD(q_double) / SPREAD(q_float))', + 'SPREAD(q_ts_null)' , 'SPREAD(q_int_null)' ,'SPREAD(q_bigint_null)' , 'SPREAD(q_smallint_null)' ,'SPREAD(q_tinyint_null)' ,'SPREAD(q_float_null)' ,'SPREAD(q_double_null)' , + '(SPREAD(q_int_null) + SPREAD(q_bigint_null))' , '(SPREAD(q_smallint_null) - SPREAD(q_float_null))', '(SPREAD(q_double_null) * SPREAD(q_tinyint_null))' , '(SPREAD(q_double_null) / SPREAD(q_float_null))'] + self.calc_calculate_regular = ['DIFF(q_int)' ,'DIFF(q_bigint)' , 'DIFF(q_smallint)' ,'DIFF(q_tinyint)' ,'DIFF(q_float)' ,'DIFF(q_double)' , + 'DIFF(q_int,0)' ,'DIFF(q_bigint,0)' , 'DIFF(q_smallint,0)' ,'DIFF(q_tinyint,0)' ,'DIFF(q_float,0)' ,'DIFF(q_double,0)' , + 'DIFF(q_int,1)' ,'DIFF(q_bigint,1)' , 'DIFF(q_smallint,1)' ,'DIFF(q_tinyint,1)' ,'DIFF(q_float,1)' ,'DIFF(q_double,1)' , + 'DERIVATIVE(q_int,15s,0)' , 'DERIVATIVE(q_bigint,10s,1)' , 'DERIVATIVE(q_smallint,20s,0)' ,'DERIVATIVE(q_tinyint,10s,1)' ,'DERIVATIVE(q_float,6s,0)' ,'DERIVATIVE(q_double,3s,1)', + 'DIFF(q_int_null)' ,'DIFF(q_bigint_null)' , 'DIFF(q_smallint_null)' ,'DIFF(q_tinyint_null)' ,'DIFF(q_float_null)' ,'DIFF(q_double_null)' , + 'DIFF(q_int_null,0)' ,'DIFF(q_bigint_null,0)' , 'DIFF(q_smallint_null,0)' ,'DIFF(q_tinyint_null,0)' ,'DIFF(q_float_null,0)' ,'DIFF(q_double_null,0)' , + 'DIFF(q_int_null,1)' ,'DIFF(q_bigint_null,1)' , 'DIFF(q_smallint_null,1)' ,'DIFF(q_tinyint_null,1)' ,'DIFF(q_float_null,1)' ,'DIFF(q_double_null,1)' , + 'DERIVATIVE(q_int_null,15s,0)' , 'DERIVATIVE(q_bigint_null,10s,1)' , 'DERIVATIVE(q_smallint_null,20s,0)' ,'DERIVATIVE(q_tinyint_null,10s,1)' ,'DERIVATIVE(q_float_null,6s,0)' ,'DERIVATIVE(q_double_null,3s,1)'] + self.calc_calculate_groupbytbname = self.calc_calculate_regular + + #two table join + self.calc_calculate_all_j = ['SPREAD(t1.ts)' , 'SPREAD(t1.q_ts)' , 'SPREAD(t1.q_int)' ,'SPREAD(t1.q_bigint)' , 'SPREAD(t1.q_smallint)' ,'SPREAD(t1.q_tinyint)' ,'SPREAD(t1.q_float)' ,'SPREAD(t1.q_double)' , + 'SPREAD(t2.ts)' , 'SPREAD(t2.q_ts)' , 'SPREAD(t2.q_int)' ,'SPREAD(t2.q_bigint)' , 'SPREAD(t2.q_smallint)' ,'SPREAD(t2.q_tinyint)' ,'SPREAD(t2.q_float)' ,'SPREAD(t2.q_double)' , + '(SPREAD(t1.q_int) + SPREAD(t1.q_bigint))' , '(SPREAD(t1.q_tinyint) - SPREAD(t1.q_float))', '(SPREAD(t1.q_double) * SPREAD(t1.q_tinyint))' , '(SPREAD(t1.q_double) / SPREAD(t1.q_tinyint))', + '(SPREAD(t2.q_int) + SPREAD(t2.q_bigint))' , '(SPREAD(t2.q_smallint) - SPREAD(t2.q_float))', '(SPREAD(t2.q_double) * SPREAD(t2.q_tinyint))' , '(SPREAD(t2.q_double) / SPREAD(t2.q_tinyint))', + '(SPREAD(t1.q_int) + SPREAD(t1.q_smallint))' , '(SPREAD(t2.q_smallint) - SPREAD(t2.q_float))', '(SPREAD(t1.q_double) * SPREAD(t1.q_tinyint))' , '(SPREAD(t1.q_double) / SPREAD(t1.q_float))', + 'SPREAD(t1.q_ts_null)' , 'SPREAD(t1.q_int_null)' ,'SPREAD(t1.q_bigint_null)' , 'SPREAD(t1.q_smallint_null)' ,'SPREAD(t1.q_tinyint_null)' ,'SPREAD(t1.q_float_null)' ,'SPREAD(t1.q_double_null)' , + 'SPREAD(t2.q_ts_null)' , 'SPREAD(t2.q_int_null)' ,'SPREAD(t2.q_bigint_null)' , 'SPREAD(t2.q_smallint_null)' ,'SPREAD(t2.q_tinyint_null)' ,'SPREAD(t2.q_float_null)' ,'SPREAD(t2.q_double_null)' , + '(SPREAD(t1.q_int_null) + SPREAD(t1.q_bigint_null))' , '(SPREAD(t1.q_tinyint_null) - SPREAD(t1.q_float_null))', '(SPREAD(t1.q_double_null) * SPREAD(t1.q_tinyint_null))' , '(SPREAD(t1.q_double_null) / SPREAD(t1.q_tinyint_null))', + '(SPREAD(t2.q_int_null) + SPREAD(t2.q_bigint_null))' , '(SPREAD(t2.q_smallint_null) - SPREAD(t2.q_float_null))', '(SPREAD(t2.q_double_null) * SPREAD(t2.q_tinyint_null))' , '(SPREAD(t2.q_double_null) / SPREAD(t2.q_tinyint_null))', + '(SPREAD(t1.q_int_null) + SPREAD(t1.q_smallint_null))' , '(SPREAD(t2.q_smallint_null) - SPREAD(t2.q_float_null))', '(SPREAD(t1.q_double_null) * SPREAD(t1.q_tinyint_null))' , '(SPREAD(t1.q_double_null) / SPREAD(t1.q_float_null))'] + self.calc_calculate_regular_j = ['DIFF(t1.q_int)' ,'DIFF(t1.q_bigint)' , 'DIFF(t1.q_smallint)' ,'DIFF(t1.q_tinyint)' ,'DIFF(t1.q_float)' ,'DIFF(t1.q_double)' , + 'DIFF(t1.q_int,0)' ,'DIFF(t1.q_bigint,0)' , 'DIFF(t1.q_smallint,0)' ,'DIFF(t1.q_tinyint,0)' ,'DIFF(t1.q_float,0)' ,'DIFF(t1.q_double,0)' , + 'DIFF(t1.q_int,1)' ,'DIFF(t1.q_bigint,1)' , 'DIFF(t1.q_smallint,1)' ,'DIFF(t1.q_tinyint,1)' ,'DIFF(t1.q_float,1)' ,'DIFF(t1.q_double,1)' , + 'DERIVATIVE(t1.q_int,15s,0)' , 'DERIVATIVE(t1.q_bigint,10s,1)' , 'DERIVATIVE(t1.q_smallint,20s,0)' ,'DERIVATIVE(t1.q_tinyint,10s,1)' ,'DERIVATIVE(t1.q_float,6s,0)' ,'DERIVATIVE(t1.q_double,3s,1)' , + 'DIFF(t2.q_int)' ,'DIFF(t2.q_bigint)' , 'DIFF(t2.q_smallint)' ,'DIFF(t2.q_tinyint)' ,'DIFF(t2.q_float)' ,'DIFF(t2.q_double)' , + 'DIFF(t2.q_int,0)' ,'DIFF(t2.q_bigint,0)' , 'DIFF(t2.q_smallint,0)' ,'DIFF(t2.q_tinyint,0)' ,'DIFF(t2.q_float,0)' ,'DIFF(t2.q_double,0)' , + 'DIFF(t2.q_int,1)' ,'DIFF(t2.q_bigint,1)' , 'DIFF(t2.q_smallint,1)' ,'DIFF(t2.q_tinyint,1)' ,'DIFF(t2.q_float,1)' ,'DIFF(t2.q_double,1)' , + 'DERIVATIVE(t2.q_int,15s,0)' , 'DERIVATIVE(t2.q_bigint,10s,1)' , 'DERIVATIVE(t2.q_smallint,20s,0)' ,'DERIVATIVE(t2.q_tinyint,10s,1)' ,'DERIVATIVE(t2.q_float,6s,0)' ,'DERIVATIVE(t2.q_double,3s,1)' , + 'DIFF(t1.q_int_null)' ,'DIFF(t1.q_bigint_null)' , 'DIFF(t1.q_smallint_null)' ,'DIFF(t1.q_tinyint_null)' ,'DIFF(t1.q_float_null)' ,'DIFF(t1.q_double_null)' , + 'DIFF(t1.q_int_null,0)' ,'DIFF(t1.q_bigint_null,0)' , 'DIFF(t1.q_smallint_null,0)' ,'DIFF(t1.q_tinyint_null,0)' ,'DIFF(t1.q_float_null,0)' ,'DIFF(t1.q_double_null,0)' , + 'DIFF(t1.q_int_null,1)' ,'DIFF(t1.q_bigint_null,1)' , 'DIFF(t1.q_smallint_null,1)' ,'DIFF(t1.q_tinyint_null,1)' ,'DIFF(t1.q_float_null,1)' ,'DIFF(t1.q_double_null,1)' , + 'DERIVATIVE(t1.q_int_null,15s,0)' , 'DERIVATIVE(t1.q_bigint_null,10s,1)' , 'DERIVATIVE(t1.q_smallint_null,20s,0)' ,'DERIVATIVE(t1.q_tinyint_null,10s,1)' ,'DERIVATIVE(t1.q_float_null,6s,0)' ,'DERIVATIVE(t1.q_double_null,3s,1)' , + 'DIFF(t2.q_int_null)' ,'DIFF(t2.q_bigint_null)' , 'DIFF(t2.q_smallint_null)' ,'DIFF(t2.q_tinyint_null)' ,'DIFF(t2.q_float_null)' ,'DIFF(t2.q_double_null)' , + 'DIFF(t2.q_int_null,0)' ,'DIFF(t2.q_bigint_null,0)' , 'DIFF(t2.q_smallint_null,0)' ,'DIFF(t2.q_tinyint_null,0)' ,'DIFF(t2.q_float_null,0)' ,'DIFF(t2.q_double_null,0)' , + 'DIFF(t2.q_int_null,1)' ,'DIFF(t2.q_bigint_null,1)' , 'DIFF(t2.q_smallint_null,1)' ,'DIFF(t2.q_tinyint_null,1)' ,'DIFF(t2.q_float_null,1)' ,'DIFF(t2.q_double_null,1)' , + 'DERIVATIVE(t2.q_int_null,15s,0)' , 'DERIVATIVE(t2.q_bigint_null,10s,1)' , 'DERIVATIVE(t2.q_smallint_null,20s,0)' ,'DERIVATIVE(t2.q_tinyint_null,10s,1)' ,'DERIVATIVE(t2.q_float_null,6s,0)' ,'DERIVATIVE(t2.q_double_null,3s,1)'] + self.calc_calculate_groupbytbname_j = self.calc_calculate_regular_j + + self.interval_sliding = ['interval(4w) sliding(1w) ','interval(1w) sliding(1d) ','interval(1d) sliding(1h) ' , + 'interval(1h) sliding(1m) ','interval(1m) sliding(1s) ','interval(1s) sliding(10a) ', + 'interval(1y) ','interval(1n) ','interval(1w) ','interval(1d) ','interval(1h) ','interval(1m) ','interval(1s) ' ,'interval(10a)', + 'interval(1y,1n) ','interval(1n,1w) ','interval(1w,1d) ','interval(1d,1h) ','interval(1h,1m) ','interval(1m,1s) ','interval(1s,10a) ' ,'interval(100a,30a)'] + + self.conn1 = taos.connect(host="127.0.0.1", user="root", password="taosdata", config="/etc/taos/") + self.cur1 = self.conn1.cursor() + self.cur1.execute("use %s ;" %self.db_nest) + sql = 'select * from stable_1 limit 5;' + self.cur1.execute(sql) + + + def dropandcreateDB_random(self,database,n): + ts = 1630000000000 + num_random = 100 + fake = Faker('zh_CN') + tdSql.execute('''drop database if exists %s ;''' %database) + tdSql.execute('''create database %s keep 36500;'''%database) + tdSql.execute('''use %s;'''%database) + + tdSql.execute('''create stable stable_1 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''') + tdSql.execute('''create stable stable_2 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''') + + tdSql.execute('''create stable stable_null_data (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''') + + tdSql.execute('''create stable stable_null_childtable (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) \ + tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);''') + + tdSql.execute('''create table stable_1_1 using stable_1 tags('stable_1_1', '%d' , '%d', '%d' , '%d' , 0 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;''' + %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1))) + tdSql.execute('''create table stable_1_2 using stable_1 tags('stable_1_2', '2147483647' , '9223372036854775807' , '32767' , '127' , 1 , 'binary2' , 'nchar2' , '2' , '22' , \'1999-09-09 09:09:09.090\') ;''') + tdSql.execute('''create table stable_1_3 using stable_1 tags('stable_1_3', '-2147483647' , '-9223372036854775807' , '-32767' , '-127' , false , 'binary3' , 'nchar3nchar3' , '-3.3' , '-33.33' , \'2099-09-09 09:09:09.090\') ;''') + tdSql.execute('''create table stable_1_4 using stable_1 tags('stable_1_4', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;''' + %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1))) + + tdSql.execute('''create table stable_2_1 using stable_2 tags('stable_2_1' , '0' , '0' , '0' , '0' , 0 , 'binary21' , 'nchar21' , '0' , '0' ,\'2099-09-09 09:09:09.090\') ;''') + tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '%d' , '%d', '%d' , '%d' , 0 , 'binary2.%s' , 'nchar2.%s' , '%f', '%f' ,'%d') ;''' + %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1))) + + tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;''' + %(fake.random_int(min=-2147483647, max=2147483647, step=1), fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1))) + + #regular table + tdSql.execute('''create table regular_table_1 \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''') + tdSql.execute('''create table regular_table_2 \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''') + tdSql.execute('''create table regular_table_3 \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''') + + tdSql.execute('''create table regular_table_null \ + (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp , \ + q_binary1 binary(100) , q_nchar1 nchar(100) ,q_binary2 binary(100) , q_nchar2 nchar(100) ,q_binary3 binary(100) , q_nchar3 nchar(100) ,q_binary4 binary(100) , q_nchar4 nchar(100) ,\ + q_binary5 binary(100) , q_nchar5 nchar(100) ,q_binary6 binary(100) , q_nchar6 nchar(100) ,q_binary7 binary(100) , q_nchar7 nchar(100) ,q_binary8 binary(100) , q_nchar8 nchar(100) ,\ + q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp) ;''') + + + for i in range(num_random*n): + tdSql.execute('''insert into stable_1_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1), + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1), + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + tdSql.execute('''insert into regular_table_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000, fake.random_int(min=-2147483647, max=2147483647, step=1) , + fake.random_int(min=-9223372036854775807, max=9223372036854775807, step=1) , + fake.random_int(min=-32767, max=32767, step=1) , fake.random_int(min=-127, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)\ + values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1), + fake.random_int(min=0, max=9223372036854775807, step=1), + fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000, fake.random_int(min=0, max=2147483647, step=1), + fake.random_int(min=0, max=9223372036854775807, step=1), + fake.random_int(min=0, max=32767, step=1) , fake.random_int(min=0, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into stable_1_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1), + fake.random_int(min=-9223372036854775807, max=0, step=1), + fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i +1, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + tdSql.execute('''insert into regular_table_2 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000 +1, fake.random_int(min=-2147483647, max=0, step=1), + fake.random_int(min=-9223372036854775807, max=0, step=1), + fake.random_int(min=-32767, max=0, step=1) , fake.random_int(min=-127, max=0, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i +1, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000, fake.random_int(min=-0, max=2147483647, step=1), + fake.random_int(min=-0, max=9223372036854775807, step=1), + fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000 +1, fake.random_int(min=-0, max=2147483647, step=1), + fake.random_int(min=-0, max=9223372036854775807, step=1), + fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + + tdSql.execute('''insert into stable_2_1 (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts,\ + q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8) \ + values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s', \ + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000 +10, fake.random_int(min=-0, max=2147483647, step=1), + fake.random_int(min=-0, max=9223372036854775807, step=1), + fake.random_int(min=-0, max=32767, step=1) , fake.random_int(min=-0, max=127, step=1) , + fake.pyfloat() , fake.pyfloat() , fake.pystr() , fake.pystr() , ts + i, fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , + fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr() , fake.pystr())) + + tdSql.query("select count(*) from stable_1;") + tdSql.checkData(0,0,3*num_random*n) + tdSql.query("select count(*) from regular_table_1;") + tdSql.checkData(0,0,num_random*n) + + def explain_sql(self,sql): + # #执行sql解析 + sql = "explain " + sql + tdLog.info(sql) + tdSql.query(sql) + + def data_check(self,sql,mark='mark') : + tdLog.info("========mark==%s==="% mark); + try: + tdSql.query(sql,queryTimes=1) + except: + tdLog.info("sql is not support :=====%s; " %sql) + tdSql.error(sql) + + + def math_nest(self,mathlist): + + print("==========%s===start=============" %mathlist) + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.dropandcreateDB_random("%s" %self.db_nest, 1) + + if (mathlist == ['ABS','SQRT']) or (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['FLOOR','CEIL','ROUND']) \ + or (mathlist == ['CSUM']) : + math_functions = mathlist + fun_fix_column = ['(q_bigint)','(q_smallint)','(q_tinyint)','(q_int)','(q_float)','(q_double)','(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)'] + fun_column_1 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_2 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_fix_column_j = ['(t1.q_bigint)','(t1.q_smallint)','(t1.q_tinyint)','(t1.q_int)','(t1.q_float)','(t1.q_double)','(t1.q_bigint_null)','(t1.q_smallint_null)','(t1.q_tinyint_null)','(t1.q_int_null)','(t1.q_float_null)','(t1.q_double_null)', + '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)'] + fun_column_join_1 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_join_2 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + elif (mathlist == ['UNIQUE']) or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['MODE']) : + math_functions = mathlist + fun_fix_column = ['(q_bigint)','(q_smallint)','(q_tinyint)','(q_int)','(q_float)','(q_double)','(q_binary)','(q_nchar)','(q_bool)','(q_ts)', + '(q_bigint_null)','(q_smallint_null)','(q_tinyint_null)','(q_int_null)','(q_float_null)','(q_double_null)','(q_binary_null)','(q_nchar_null)','(q_bool_null)','(q_ts_null)'] + fun_column_1 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_2 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_fix_column_j = ['(t1.q_bigint)','(t1.q_smallint)','(t1.q_tinyint)','(t1.q_int)','(t1.q_float)','(t1.q_double)','(t1.q_bigint_null)','(t1.q_smallint_null)','(t1.q_tinyint_null)','(t1.q_int_null)','(t1.q_float_null)','(t1.q_double_null)','(t1.q_ts)','(t1.q_ts_null)', + '(t2.q_bigint)','(t2.q_smallint)','(t2.q_tinyint)','(t2.q_int)','(t2.q_float)','(t2.q_double)','(t2.q_bigint_null)','(t2.q_smallint_null)','(t2.q_tinyint_null)','(t2.q_int_null)','(t2.q_float_null)','(t2.q_double_null)','(t2.q_ts)','(t2.q_ts_null)'] + fun_column_join_1 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_join_2 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + elif (mathlist == ['TAIL']): + math_functions = mathlist + num = random.randint(1, 100) + offset_rows = random.randint(0, 100) + fun_fix_column = ['(q_bigint,num)','(q_smallint,num)','(q_tinyint,num)','(q_int,num)','(q_float,num)','(q_double,num)','(q_binary,num)','(q_nchar,num)','(q_bool,num)','(q_ts,num)', + '(q_bigint_null,num)','(q_smallint_null,num)','(q_tinyint_null,num)','(q_int_null,num)','(q_float_null,num)','(q_double_null,num)','(q_binary_null,num)','(q_nchar_null,num)','(q_bool_null,num)','(q_ts_null,num)', + '(q_bigint,num,offset_rows)','(q_smallint,num,offset_rows)','(q_tinyint,num,offset_rows)','(q_int,num,offset_rows)','(q_float,num,offset_rows)','(q_double,num,offset_rows)','(q_binary,num,offset_rows)','(q_nchar,num,offset_rows)','(q_bool,num,offset_rows)','(q_ts,num,offset_rows)', + '(q_bigint_null,num,offset_rows)','(q_smallint_null,num,offset_rows)','(q_tinyint_null,num,offset_rows)','(q_int_null,num,offset_rows)','(q_float_null,num,offset_rows)','(q_double_null,num,offset_rows)','(q_binary_null,num,offset_rows)','(q_nchar_null,num,offset_rows)','(q_bool_null,num,offset_rows)','(q_ts_null,num,offset_rows)'] + fun_column_1 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)).replace("offset_rows",str(offset_rows)) + fun_column_2 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)).replace("offset_rows",str(offset_rows)) + + fun_fix_column_j = ['(t1.q_bigint,num)','(t1.q_smallint,num)','(t1.q_tinyint,num)','(t1.q_int,num)','(t1.q_float,num)','(t1.q_double,num)','(t1.q_binary,num)','(t1.q_nchar,num)','(t1.q_bool,num)','(t1.q_ts,num)', + '(t1.q_bigint_null,num)','(t1.q_smallint_null,num)','(t1.q_tinyint_null,num)','(t1.q_int_null,num)','(t1.q_float_null,num)','(t1.q_double_null,num)','(t1.q_binary_null,num)','(t1.q_nchar_null,num)','(t1.q_bool_null,num)','(t1.q_ts_null,num)', + '(t2.q_bigint,num)','(t2.q_smallint,num)','(t2.q_tinyint,num)','(t2.q_int,num)','(t2.q_float,num)','(t2.q_double,num)','(t2.q_binary,num)','(t2.q_nchar,num)','(t2.q_bool,num)','(t2.q_ts,num)', + '(t2.q_bigint_null,num)','(t2.q_smallint_null,num)','(t2.q_tinyint_null,num)','(t2.q_int_null,num)','(t2.q_float_null,num)','(t2.q_double_null,num)','(t2.q_binary_null,num)','(t2.q_nchar_null,num)','(t2.q_bool_null,num)','(t2.q_ts_null,num)', + '(t1.q_bigint,num,offset_rows)','(t1.q_smallint,num,offset_rows)','(t1.q_tinyint,num,offset_rows)','(t1.q_int,num,offset_rows)','(t1.q_float,num,offset_rows)','(t1.q_double,num,offset_rows)','(t1.q_binary,num,offset_rows)','(t1.q_nchar,num,offset_rows)','(t1.q_bool,num,offset_rows)','(t1.q_ts,num,offset_rows)', + '(t1.q_bigint_null,num,offset_rows)','(t1.q_smallint_null,num,offset_rows)','(t1.q_tinyint_null,num,offset_rows)','(t1.q_int_null,num,offset_rows)','(t1.q_float_null,num,offset_rows)','(t1.q_double_null,num,offset_rows)','(t1.q_binary_null,num,offset_rows)','(t1.q_nchar_null,num,offset_rows)','(t1.q_bool_null,num,offset_rows)','(t1.q_ts_null,num,offset_rows)', + '(t2.q_bigint,num,offset_rows)','(t2.q_smallint,num,offset_rows)','(t2.q_tinyint,num,offset_rows)','(t2.q_int,num,offset_rows)','(t2.q_float,num,offset_rows)','(t2.q_double,num,offset_rows)','(t2.q_binary,num,offset_rows)','(t2.q_nchar,num,offset_rows)','(t2.q_bool,num,offset_rows)','(t2.q_ts,num,offset_rows)', + '(t2.q_bigint_null,num,offset_rows)','(t2.q_smallint_null,num,offset_rows)','(t2.q_tinyint_null,num,offset_rows)','(t2.q_int_null,num,offset_rows)','(t2.q_float_null,num,offset_rows)','(t2.q_double_null,num,offset_rows)','(t2.q_binary_null,num,offset_rows)','(t2.q_nchar_null,num,offset_rows)','(t2.q_bool_null,num,offset_rows)','(t2.q_ts_null,num,offset_rows)'] + fun_column_join_1 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)).replace("offset_rows",str(offset_rows)) + fun_column_join_2 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)).replace("offset_rows",str(offset_rows)) + + elif (mathlist == ['POW','LOG']) or (mathlist == ['MAVG']) or (mathlist == ['SAMPLE']) : + math_functions = mathlist + num = random.randint(0, 1000) + fun_fix_column = ['(q_bigint,num)','(q_smallint,num)','(q_tinyint,num)','(q_int,num)','(q_float,num)','(q_double,num)', + '(q_bigint_null,num)','(q_smallint_null,num)','(q_tinyint_null,num)','(q_int_null,num)','(q_float_null,num)','(q_double_null,num)'] + fun_column_1 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)) + fun_column_2 = random.sample(math_functions,1)+random.sample(fun_fix_column,1) + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)) + + fun_fix_column_j = ['(t1.q_bigint,num)','(t1.q_smallint,num)','(t1.q_tinyint,num)','(t1.q_int,num)','(t1.q_float,num)','(t1.q_double,num)', + '(t1.q_bigint_null,num)','(t1.q_smallint_null,num)','(t1.q_tinyint_null,num)','(t1.q_int_null,num)','(t1.q_float_null,num)','(t1.q_double_null,num)', + '(t2.q_bigint,num)','(t2.q_smallint,num)','(t2.q_tinyint,num)','(t2.q_int,num)','(t2.q_float,num)','(t2.q_double,num)', + '(t2.q_bigint_null,num)','(t2.q_smallint_null,num)','(t2.q_tinyint_null,num)','(t2.q_int_null,num)','(t2.q_float_null,num)','(t2.q_double_null,num)'] + fun_column_join_1 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)) + fun_column_join_2 = random.sample(math_functions,1)+random.sample(fun_fix_column_j,1) + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",str(num)) + + elif (mathlist == ['statecount','stateduration']): + math_functions = mathlist + num = random.randint(-1000, 1000) + + operator = ['LT' , 'GT' ,'GE','NE','EQ'] + oper = str(random.sample(operator,1)).replace("[","").replace("]","")#.replace("'","") + + fun_fix_column = ['(q_bigint,oper,num,time)','(q_smallint,oper,num,time)','(q_tinyint,oper,num,time)','(q_int,oper,num,time)','(q_float,oper,num,time)','(q_double,oper,num,time)', + '(q_bigint_null,oper,num,time)','(q_smallint_null,oper,num,time)','(q_tinyint_null,oper,num,time)','(q_int_null,oper,num,time)','(q_float_null,oper,num,time)','(q_double_null,oper,num,time)'] + + hanshu_select1 = random.sample(math_functions,1) + fun_column_1 = random.sample(hanshu_select1,1)+random.sample(fun_fix_column,1) + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","") + + if str(hanshu_select1).replace("[","").replace("]","").replace("'","") == 'statecount': + math_fun_1 = math_fun_1.replace("oper","%s" %oper).replace(",time","").replace("num",str(num)) + elif str(hanshu_select1).replace("[","").replace("]","").replace("'","") == 'stateduration': + timeunit = ['1s' , '1m' ,'1h'] + time = str(random.sample(timeunit,1)).replace("[","").replace("]","").replace("'","") + math_fun_1 = math_fun_1.replace("oper","%s" %oper).replace("time","%s" %time).replace("num",str(num)) + + hanshu_select2 = random.sample(math_functions,1) + fun_column_2 = random.sample(hanshu_select2,1)+random.sample(fun_fix_column,1) + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + if str(hanshu_select2).replace("[","").replace("]","").replace("'","") == 'statecount': + math_fun_2 = math_fun_2.replace("oper","%s" %oper).replace(",time","").replace("num",str(num)) + elif str(hanshu_select2).replace("[","").replace("]","").replace("'","") == 'stateduration': + timeunit = ['1s' , '1m' ,'1h'] + time = str(random.sample(timeunit,1)).replace("[","").replace("]","").replace("'","") + math_fun_2 = math_fun_2.replace("oper","%s" %oper).replace("time","%s" %time).replace("num",str(num)) + + fun_fix_column_j = ['(t1.q_bigint,oper,num,time)','(t1.q_smallint,oper,num,time)','(t1.q_tinyint,oper,num,time)','(t1.q_int,oper,num,time)','(t1.q_float,oper,num,time)','(t1.q_double,oper,num,time)', + '(t1.q_bigint_null,oper,num,time)','(t1.q_smallint_null,oper,num,time)','(t1.q_tinyint_null,oper,num,time)','(t1.q_int_null,oper,num,time)','(t1.q_float_null,oper,num,time)','(t1.q_double_null,oper,num,time)', + '(t2.q_bigint,oper,num,time)','(t2.q_smallint,oper,num,time)','(t2.q_tinyint,oper,num,time)','(t2.q_int,oper,num,time)','(t2.q_float,oper,num,time)','(t2.q_double,oper,num,time)', + '(t2.q_bigint_null,oper,num,time)','(t2.q_smallint_null,oper,num,time)','(t2.q_tinyint_null,oper,num,time)','(t2.q_int_null,oper,num,time)','(t2.q_float_null,oper,num,time)','(t2.q_double_null,oper,num,time)'] + + hanshu_select_join_1 = random.sample(math_functions,1) + fun_column_join_1 = random.sample(hanshu_select_join_1,1)+random.sample(fun_fix_column_j,1) + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") + + if str(hanshu_select_join_1).replace("[","").replace("]","").replace("'","") == 'statecount': + math_fun_join_1 = math_fun_join_1.replace("oper","%s" %oper).replace(",time","").replace("num",str(num)) + elif str(hanshu_select_join_1).replace("[","").replace("]","").replace("'","") == 'stateduration': + timeunit = ['1s' , '1m' ,'1h'] + time = str(random.sample(timeunit,1)).replace("[","").replace("]","").replace("'","") + math_fun_join_1 = math_fun_join_1.replace("oper","%s" %oper).replace("time","%s" %time).replace("num",str(num)) + + hanshu_select_join_2 = random.sample(math_functions,1) + fun_column_join_2 = random.sample(hanshu_select_join_2,1)+random.sample(fun_fix_column_j,1) + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + if str(hanshu_select_join_2).replace("[","").replace("]","").replace("'","") == 'statecount': + math_fun_join_2 = math_fun_join_2.replace("oper","%s" %oper).replace(",time","").replace("num",str(num)) + elif str(hanshu_select_join_2).replace("[","").replace("]","").replace("'","") == 'stateduration': + timeunit = ['1s' , '1m' ,'1h'] + time = str(random.sample(timeunit,1)).replace("[","").replace("]","").replace("'","") + math_fun_join_2 = math_fun_join_2.replace("oper","%s" %oper).replace("time","%s" %time).replace("num",str(num)) + + elif(mathlist == ['HISTOGRAM']) : + math_functions = mathlist + fun_fix_column = ['(q_bigint','(q_smallint','(q_tinyint','(q_int','(q_float','(q_double','(q_bigint_null','(q_smallint_null','(q_tinyint_null','(q_int_null','(q_float_null','(q_double_null'] + + fun_fix_column_j = ['(t1.q_bigint','(t1.q_smallint','(t1.q_tinyint','(t1.q_int','(t1.q_float','(t1.q_double','(t1.q_bigint_null','(t1.q_smallint_null','(t1.q_tinyint_null','(t1.q_int_null','(t1.q_float_null','(t1.q_double_null', + '(t2.q_bigint','(t2.q_smallint','(t2.q_tinyint','(t2.q_int','(t2.q_float','(t2.q_double','(t2.q_bigint_null','(t2.q_smallint_null','(t2.q_tinyint_null','(t2.q_int_null','(t2.q_float_null','(t2.q_double_null'] + + normalized = random.randint(0, 1) + + i = random.randint(1,3) + if i == 1: + bin_type = 'user_input' + bin_description = {-11111119395555977777} #9一会转译成, + fun_column_1 = [math_functions , random.sample(fun_fix_column,1), ',',"'%s'" %bin_type, ',',"'%s'" % bin_description, ',', "%d" %normalized,')'] + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("{","[").replace("}","]").replace("9",",") + + fun_column_2 = [math_functions , random.sample(fun_fix_column,1), ',',"'%s'" %bin_type, ',',"'%s'" % bin_description, ',', "%d" %normalized,')'] + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("{","[").replace("}","]").replace("9",",") + + fun_column_join_1 = [math_functions , random.sample(fun_fix_column_j,1), ',',"'%s'" %bin_type, ',',"'%s'" % bin_description, ',', "%d" %normalized,')'] + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("{","[").replace("}","]").replace("9",",") + + fun_column_join_2 = [math_functions , random.sample(fun_fix_column_j,1), ',',"'%s'" %bin_type, ',',"'%s'" % bin_description, ',', "%d" %normalized,')'] + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("{","[").replace("}","]").replace("9",",") + + elif i == 2: + bin_type = 'linear_bin' + true_false = random.randint(10, 11) + bin_description = {"ZstartZ": -333339, "ZwidthZ":559, "ZcountZ":59, "ZinfinityZ":'%d' %true_false} #Z一会转译成" ,9一会转译成 , + fun_column_1 = [math_functions , random.sample(fun_fix_column,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + fun_column_2 = [math_functions , random.sample(fun_fix_column,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + fun_column_join_1 = [math_functions , random.sample(fun_fix_column_j,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + fun_column_join_2 = [math_functions , random.sample(fun_fix_column_j,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + elif i == 3: + bin_type = 'log_bin' + true_false = random.randint(10, 11) + bin_description = {"ZstartZ": -333339, "ZfactorZ":559, "ZcountZ":59, "ZinfinityZ":'%d' %true_false} #Z一会转译成" ,9一会转译成 , + fun_column_1 = [math_functions , random.sample(fun_fix_column,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + fun_column_2 = [math_functions , random.sample(fun_fix_column,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + fun_column_join_1 = [math_functions , random.sample(fun_fix_column_j,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + fun_column_join_2 = [math_functions , random.sample(fun_fix_column_j,1), ',',"'%s'" %bin_type, ',','%s' % bin_description, ',', "%d" %normalized,')'] + math_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("9",",").replace("Z","\"").replace("10","false").replace("11","true").replace("\"{","'{").replace("}\"","}'") + + tdSql.query("select 1-1 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']): + sql = "select %s as asct1, " % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts1 from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE']) or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select %s as asct1 " % math_fun_1 + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-2 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "(select %s as asct1, " % math_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s )" % random.choice(self.order_where) + sql += "%s " % random.choice(self.unionall_or_union) + sql += "(select %s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE']) or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']): + sql = "(select %s as asct1 " % math_fun_1 + sql += "from regular_table_1 where " + sql += "%s )" % random.choice(self.q_where) + sql += "%s " % random.choice(self.unionall_or_union) + sql += "(select %s as asct2 " % math_fun_2 + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-3 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "(select %s as asct1, ts ," % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s " % random.choice(self.q_select) + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ") %s (select " % random.choice(self.unionall_or_union) + sql += "%s as asct2, ts ," % math_fun_2 + sql += "%s as asct1, " % math_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s " % random.choice(self.q_select) + sql += " from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MODE']) : + sql = "(select %s as asct1," % math_fun_1 + sql += "%s as asct2 " % math_fun_2 + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ") %s (select " % random.choice(self.unionall_or_union) + sql += "%s as asct2 ," % math_fun_2 + sql += "%s as asct1 " % math_fun_1 + sql += " from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['statecount','stateduration']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['TAIL']) or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['SAMPLE']): + sql = "(select %s as asct1 " % math_fun_1 + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ") %s (select " % random.choice(self.unionall_or_union) + sql += "%s as asct1 " % math_fun_2 + sql += " from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += " order by asct1 asc " + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-4 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select ts1,ts2 ,timediff(ts1,ts2), asct1 from ( select t1.ts as ts1," + sql += "%s as asct0, " % math_fun_join_1 + sql += "%s as asct1, " % math_fun_join_2 + sql += "%s as asct2, " % math_fun_join_1 + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct22, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select count(asct1) from ( select " + sql += "%s as asct1 " % math_fun_join_2 + sql += "from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-5 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select ts ," + sql += "%s, " % math_fun_1 + sql += "%s as asct1, " % random.choice(self.q_select) + sql += "%s as asct2, " % random.choice(self.q_select) + sql += "%s " % math_fun_2 + sql += " from regular_table_1" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select " + sql += "%s " % math_fun_2 + sql += " from regular_table_1" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-6 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select ts1 ,timediff(ts1,ts2), max(asct1) from ( select t1.ts,t1.ts as ts1," + sql += "%s as asct0, " % math_fun_join_1 + sql += "%s as asct1, " % math_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t2.%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % math_fun_join_1 + sql += "t2.ts as ts2 from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s )" % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select count(asct1) from ( select " + sql += "%s as asct1 " % math_fun_join_2 + sql += "from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s )" % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-7 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select ts1,ts2 , abs(asct1) from ( select " + sql += "%s as asct1, ts as ts1," % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts as ts2 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE']) or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select count(asct1) from ( select " + sql += "%s as asct1 " % math_fun_1 + sql += "from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-8 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select %s, " % random.choice(self.s_s_select) + sql += "%s as asct1, ts as ts1," % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts as ts2 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select %s as asct1 " % math_fun_1 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-9 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select %s, " % math_fun_join_1 + sql += "%s as asct1, " % math_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct21, " % random.choice(self.q_select) + sql += "t2.%s as asct22, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "and %s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select %s as asct1 " % math_fun_join_2 + sql += "from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "and %s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-10 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "(select %s as asct1 ," % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") %s " % random.choice(self.unionall_or_union) + sql += "(select " + sql += "%s as asct1 ," % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "(select %s as asct1 " % math_fun_1 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ") %s " % random.choice(self.unionall_or_union) + sql += "(select " + sql += "%s as asct2 " % math_fun_2 + sql += "from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #3 inter union not support + tdSql.query("select 1-11 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "(select %s as asct1, ts ," % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as t2ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " ) %s (" % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s as asct1, ts as t1ts," % math_fun_1 + sql += "%s as asct2, " % math_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as t2ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select %s as asct1 " % math_fun_1 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " %s " % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s as asct2 " % math_fun_2 + sql += " from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-12 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select ts1,ts2 ,timediff(ts1,ts2), max(asct1) from ( select t1.ts as ts1," + sql += "%s, " % math_fun_join_1 + sql += "%s as asct1, " % math_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct21, " % random.choice(self.q_select) + sql += "t2.%s as asct111, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select count(asct1) from ( select " + sql += "%s as asct1 " % math_fun_join_2 + sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-13 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select ts ," + sql += "%s as asct11, " % math_fun_1 + sql += "%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % random.choice(self.q_select) + sql += "%s as asct14, " % math_fun_2 + sql += "%s as asct15 " % random.choice(self.t_select) + sql += " from stable_1 " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select " + sql += "%s " % math_fun_2 + sql += "%s " % random.choice(self.t_select) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-14 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select avg(asct1),count(asct2) from ( select " + sql += "%s as asct1, " % math_fun_1 + sql += "%s as asct2" % math_fun_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ) ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE'])or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select count(asct1) from ( select " + sql += "%s as asct1 " % math_fun_1 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ) ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-15 as math_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (mathlist == ['SIN','COS','TAN','ASIN','ACOS','ATAN']) or (mathlist == ['ABS','SQRT']) \ + or (mathlist == ['POW','LOG']) or (mathlist == ['FLOOR','CEIL','ROUND']) : + sql = "select ts1,ts ,timediff(ts1,ts), max(asct1) from ( select t1.ts as ts1," + sql += "%s, " % math_fun_join_1 + sql += "%s as asct1, " % math_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (mathlist == ['MAVG']) or (mathlist == ['SAMPLE']) or (mathlist == ['TAIL']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ + or (mathlist == ['HYPERLOGLOG']) or (mathlist == ['UNIQUE']) or (mathlist == ['MODE']) or (mathlist == ['statecount','stateduration']) : + sql = "select count(asct1) from ( select " + sql += "%s as asct1 " % math_fun_join_2 + sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #taos -f sql + # startTime_taosf = time.time() + print("taos -f %s sql start!" %mathlist) + # taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename) + # _ = subprocess.check_output(taos_cmd1, shell=True) + print("taos -f %s sql over!" %mathlist) + + print("=========%s====over=============" %mathlist) + + + def str_nest(self,strlist): + + print("==========%s===start=============" %strlist) + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.dropandcreateDB_random("%s" %self.db_nest, 1) + + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['LENGTH','CHAR_LENGTH']) \ + or (strlist == ['']): + str_functions = strlist + fun_fix_column = ['(q_nchar)','(q_binary)','(q_nchar_null)','(q_binary_null)'] + fun_column_1 = random.sample(str_functions,1)+random.sample(fun_fix_column,1) + str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_2 = random.sample(str_functions,1)+random.sample(fun_fix_column,1) + str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_fix_column_j = ['(t1.q_nchar)','(t1.q_binary)','(t1.q_nchar_null)','(t1.q_binary_null)', + '(t2.q_nchar)','(t2.q_binary)','(t2.q_nchar_null)','(t2.q_binary_null)'] + fun_column_join_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1) + str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_join_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1) + str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_fix_column_s = ['(q_nchar)','(q_binary)','(q_nchar_null)','(q_binary_null)','(loc)','(tbname)'] + fun_column_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1) + str_fun_s_1 = str(fun_column_s_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1) + str_fun_s_2 = str(fun_column_s_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_fix_column_s_j = ['(t1.q_nchar)','(t1.q_binary)','(t1.q_nchar_null)','(t1.q_binary_null)','(t1.loc)','(t1.tbname)', + '(t2.q_nchar)','(t2.q_binary)','(t2.q_nchar_null)','(t2.q_binary_null)','(t2.loc)','(t2.tbname)'] + fun_column_join_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1) + str_fun_join_s_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_join_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1) + str_fun_join_s_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + elif (strlist == ['SUBSTR']) : + str_functions = strlist + pos = random.randint(1, 20) + sub_len = random.randint(1, 10) + fun_fix_column = ['(q_nchar,pos)','(q_binary,pos)','(q_nchar_null,pos)','(q_binary_null,pos)', + '(q_nchar,pos,sub_len)','(q_binary,pos,sub_len)','(q_nchar_null,pos,sub_len)','(q_binary_null,pos,sub_len)',] + fun_column_1 = random.sample(str_functions,1)+random.sample(fun_fix_column,1) + str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + fun_column_2 = random.sample(str_functions,1)+random.sample(fun_fix_column,1) + str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + + fun_fix_column_j = ['(t1.q_nchar,pos)','(t1.q_binary,pos)','(t1.q_nchar_null,pos)','(t1.q_binary_null,pos)', + '(t1.q_nchar,pos,sub_len)','(t1.q_binary,pos,sub_len)','(t1.q_nchar_null,pos,sub_len)','(t1.q_binary_null,pos,sub_len)', + '(t2.q_nchar,pos)','(t2.q_binary,pos)','(t2.q_nchar_null,pos)','(t2.q_binary_null,pos)', + '(t2.q_nchar,pos,sub_len)','(t2.q_binary,pos,sub_len)','(t2.q_nchar_null,pos,sub_len)','(t2.q_binary_null,pos,sub_len)'] + fun_column_join_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1) + str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + fun_column_join_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_j,1) + str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + + fun_fix_column_s = ['(q_nchar,pos)','(q_binary,pos)','(q_nchar_null,pos)','(q_binary_null,pos)','(loc,pos)', + '(q_nchar,pos,sub_len)','(q_binary,pos,sub_len)','(q_nchar_null,pos,sub_len)','(q_binary_null,pos,sub_len)','(loc,pos,sub_len)',] + fun_column_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1) + str_fun_s_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + fun_column_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_s,1) + str_fun_s_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + + fun_fix_column_s_j = ['(t1.q_nchar,pos)','(t1.q_binary,pos)','(t1.q_nchar_null,pos)','(t1.q_binary_null,pos)','(t1.loc,pos)', + '(t1.q_nchar,pos,sub_len)','(t1.q_binary,pos,sub_len)','(t1.q_nchar_null,pos,sub_len)','(t1.q_binary_null,pos,sub_len)','(t1.loc,pos,sub_len)', + '(t2.q_nchar,pos)','(t2.q_binary,pos)','(t2.q_nchar_null,pos)','(t2.q_binary_null,pos)','(t2.loc,pos)', + '(t2.q_nchar,pos,sub_len)','(t2.q_binary,pos,sub_len)','(t2.q_nchar_null,pos,sub_len)','(t2.q_binary_null,pos,sub_len)','(t2.loc,pos,sub_len)'] + fun_column_join_s_1 = random.sample(str_functions,1)+random.sample(fun_fix_column_s_j,1) + str_fun_join_s_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + fun_column_join_s_2 = random.sample(str_functions,1)+random.sample(fun_fix_column_s_j,1) + str_fun_join_s_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("pos",str(pos)).replace("sub_len",str(sub_len)) + + elif (strlist == ['CONCAT']) : + str_functions = strlist + i = random.randint(2,4) + fun_fix_column = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','q_nchar_null', + 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null'] + + column1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+column1+')' + str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","") + + column2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+column2+')' + str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)', + '(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)', + '(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)', + '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)'] + + column_j1 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+column_j1+')' + str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","") + + column_j2 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+column_j2+')' + str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_s = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','loc','q_nchar_null', + 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null'] + + column_s1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_s_1 = str(random.sample(str_functions,1))+'('+column_s1+')' + str_fun_s_1 = str(fun_column_s_1).replace("[","").replace("]","").replace("'","") + + column_s2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_s_2 = str(random.sample(str_functions,1))+'('+column_s2+')' + str_fun_s_2 = str(fun_column_s_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_s_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)','(t1.loc)', + '(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)','(t2.loc)', + '(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)', + '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)'] + + column_j_s1 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_s_1 = str(random.sample(str_functions,1))+'('+column_j_s1+')' + str_fun_join_s_1 = str(fun_column_join_s_1).replace("[","").replace("]","").replace("'","") + + column_j_s2 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_s_2 = str(random.sample(str_functions,1))+'('+column_j_s2+')' + str_fun_join_s_2 = str(fun_column_join_s_2).replace("[","").replace("]","").replace("'","") + + elif (strlist == ['CONCAT_WS']): + str_functions = strlist + i = random.randint(2,4) + fun_fix_column = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','q_nchar_null', + 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null'] + + separators = ['',' ','abc','123','!','@','#','$','%','^','&','*','(',')','-','_','+','=','{', + '[','}',']','|',';',':',',','.','<','>','?','/','~','`','taos','涛思'] + separator = str(random.sample(separators,i)).replace("[","").replace("]","") + + column1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column1+')' + str_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","") + + column2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column2+')' + str_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)', + '(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)', + '(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)', + '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)'] + + column_j1 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j1+')' + str_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","") + + column_j2 = str(random.sample(fun_fix_column_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j2+')' + str_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_s = ['q_nchar','q_nchar1','q_nchar2','q_nchar3','q_nchar4','q_nchar5','q_nchar6','q_nchar7','q_nchar8','loc','q_nchar_null', + 'q_binary','q_binary1','q_binary2','q_binary3','q_binary4','q_binary5','q_binary6','q_binary7','q_binary8','q_binary_null'] + + column_s1 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_s_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_s1+')' + str_fun_s_1 = str(fun_column_s_1).replace("[","").replace("]","").replace("'","") + + column_s2 = str(random.sample(fun_fix_column,i)).replace("[","").replace("]","").replace("'","") + fun_column_s_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_s2+')' + str_fun_s_2 = str(fun_column_s_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_s_j = ['(t1.q_nchar)','(t1.q_nchar1)','(t1.q_nchar2)','(t1.q_nchar3)','(t1.q_nchar4)','(t1.q_nchar5)','(t1.q_nchar6)','(t1.q_nchar7)','(t1.q_nchar8)','(t1.q_nchar_null)','(t1.loc)', + '(t2.q_nchar)','(t2.q_nchar1)','(t2.q_nchar2)','(t2.q_nchar3)','(t2.q_nchar4)','(t2.q_nchar5)','(t2.q_nchar6)','(t2.q_nchar7)','(t2.q_nchar8)','(t2.q_nchar_null)','(t2.loc)', + '(t1.q_binary)','(t1.q_binary1)','(t1.q_binary2)','(t1.q_binary3)','(t1.q_binary4)','(t1.q_binary5)','(t1.q_binary6)','(t1.q_binary7)','(t1.q_binary8)','(t1.q_binary_null)', + '(t2.q_binary)','(t2.q_binary1)','(t2.q_binary2)','(t2.q_binary3)','(t2.q_binary4)','(t2.q_binary5)','(t2.q_binary6)','(t2.q_binary7)','(t2.q_binary8)','(t2.q_binary_null)'] + + column_j_s1 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_s_1 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j_s1+')' + str_fun_join_s_1 = str(fun_column_join_s_1).replace("[","").replace("]","").replace("'","") + + column_j_s2 = str(random.sample(fun_fix_column_s_j,i)).replace("[","").replace("]","").replace("'","") + fun_column_join_s_2 = str(random.sample(str_functions,1))+'('+'\"'+separator+'\",'+column_j_s2+')' + str_fun_join_s_2 = str(fun_column_join_s_2).replace("[","").replace("]","").replace("'","") + + + tdSql.query("select 1-1 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']) : + sql = "select t1s , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select " + sql += "%s as asct1, " % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as t1s from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select " + sql += "%s as asct1, " % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-2 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']) : + sql = "select ts , asct1 from ( select " + sql += "%s as asct1, " % str_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s )" % random.choice(self.order_where) + sql += "%s " % random.choice(self.unionall_or_union) + sql += "select ts , asct2 from ( select " + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1) from ( select " + sql += "%s as asct1, " % str_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s )" % random.choice(self.order_where) + sql += "%s " % random.choice(self.unionall_or_union) + sql += "select sum(asct2), min(asct2) from ( select " + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-3 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select " + sql += "%s as asct1 ," % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s select " % random.choice(self.unionall_or_union) + sql += "%s as asct2 ," % str_fun_2 + sql += "%s as asct1, " % str_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select " + sql += "%s as asct1 ," % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s select " % random.choice(self.unionall_or_union) + sql += "%s as asct2 ," % str_fun_2 + sql += "%s as asct1, " % str_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-4 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_1 + sql += "%s as asct1, " % str_fun_join_2 + sql += "%s, " % str_fun_join_1 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t2.%s as asct12, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_1 + sql += "%s as asct1, " % str_fun_join_2 + sql += "%s, " % str_fun_join_1 + sql += "t1.%s as asct21, " % random.choice(self.q_select) + sql += "t2.%s as asct22, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-5 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts ," + sql += "%s, " % str_fun_1 + sql += "%s as asct21, " % random.choice(self.q_select) + sql += "%s as asct22, " % random.choice(self.q_select) + sql += "%s " % str_fun_2 + sql += " from ( select * from regular_table_1 ) where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select ts ," + sql += "%s, " % str_fun_1 + sql += "%s as asct22, " % random.choice(self.q_select) + sql += "%s as asct21, " % random.choice(self.q_select) + sql += "%s " % str_fun_2 + sql += " from ( select * from regular_table_1 ) where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-6 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts1,ts ,timediff(ts1,ts), LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_1 + sql += "%s as asct1, " % str_fun_join_2 + sql += "t1.%s as asct22, " % random.choice(self.q_select) + sql += "t2.%s as asct21, " % random.choice(self.q_select) + sql += "%s, " % str_fun_join_1 + sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s )" % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_1 + sql += "%s as asct1, " % str_fun_join_2 + sql += "t1.%s as asct22, " % random.choice(self.q_select) + sql += "t2.%s as asct21, " % random.choice(self.q_select) + sql += "%s, " % str_fun_join_1 + sql += "t2.ts as ts2 from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s )" % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-7 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select t1s ,ts1, LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select " + sql += "%s as asct1, ts as t1s," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts as ts1 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select " + sql += "%s as asct1, ts as ts1," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts as t1s from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-8 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts1,st1, LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) " + sql += "from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s as asct1, ts as st1," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts as ts1 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) " + sql += "from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s as asct1, ts as ts1," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts as st1 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-9 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_s_1 + sql += "%s as asct1, " % str_fun_join_s_2 + sql += "t1.%s as asct21, " % random.choice(self.q_select) + sql += "t1.%s as asct22, " % random.choice(self.q_select) + sql += "t2.%s as asct23, " % random.choice(self.q_select) + sql += "t2.%s as asct24, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "and %s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_s_1 + sql += "%s as asct1, " % str_fun_join_s_2 + sql += "t1.%s as asct21, " % random.choice(self.q_select) + sql += "t1.%s as asct22, " % random.choice(self.q_select) + sql += "t2.%s as asct23, " % random.choice(self.q_select) + sql += "t2.%s as asct24, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "and %s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + + tdSql.query("select 1-10 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select " + sql += "%s as asct1 ," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") %s " % random.choice(self.unionall_or_union) + sql += "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select " + sql += "%s as asct1 ," % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select " + sql += "%s as asct1 ," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") %s " % random.choice(self.unionall_or_union) + sql += "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select " + sql += "%s as asct1 ," % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #3 inter union not support + tdSql.query("select 1-11 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts , LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select " + sql += "%s as asct1, ts ," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s " % random.choice(self.q_select) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " %s " % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s as asct1, ts ," % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s " % random.choice(self.q_select) + sql += " from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select " + sql += "%s as asct1 ," % str_fun_s_1 + sql += "%s as asct2, " % str_fun_s_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " %s " % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s as asct1 ," % str_fun_1 + sql += "%s as asct2, " % str_fun_2 + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-12 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_s_1 + sql += "%s as asct1, " % str_fun_join_s_2 + sql += "t1.%s as asct21, " % random.choice(self.q_select) + sql += "t1.%s as asct22, " % random.choice(self.q_select) + sql += "t2.%s as asct23, " % random.choice(self.q_select) + sql += "t2.%s as asct24, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_s_1 + sql += "%s as asct1, " % str_fun_join_s_2 + sql += "t1.%s as asct21, " % random.choice(self.q_select) + sql += "t1.%s as asct22, " % random.choice(self.q_select) + sql += "t2.%s as asct23, " % random.choice(self.q_select) + sql += "t2.%s as asct24, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-13 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts ," + sql += "%s as asct10, " % str_fun_1 + sql += "%s as asct1, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % str_fun_2 + sql += "%s as asct14 " % random.choice(self.t_select) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select ts ," + sql += "%s as asct1, " % str_fun_1 + sql += "%s as asct11, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % str_fun_2 + sql += "%s as asct14 " % random.choice(self.t_select) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-14 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select " + sql += "%s as asct1, " % str_fun_s_1 + sql += "%s as asct2" % str_fun_s_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ) ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select " + sql += "%s as asct1, " % str_fun_s_1 + sql += "%s as asct2" % str_fun_s_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ) ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-15 as str_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (strlist == ['LTRIM','RTRIM','LOWER','UPPER']) or (strlist == ['SUBSTR']) or (strlist == ['CONCAT']) or (strlist == ['CONCAT_WS']): + sql = "select ts,ts2 ,timediff(ts,ts2), LTRIM(asct1), LOWER(asct1), RTRIM(asct2), UPPER(asct2) from ( select t1.ts ," + sql += "%s as asct2, " % str_fun_join_s_1 + sql += "%s as asct1, " % str_fun_join_s_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (strlist == ['LENGTH','CHAR_LENGTH']): + sql = "select sum(asct1), min(asct1), max(asct2), avg(asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % str_fun_join_s_1 + sql += "%s as asct1, " % str_fun_join_s_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14 " % random.choice(self.q_select) + sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #taos -f sql + startTime_taos_f = time.time() + print("taos -f %s sql start!" %strlist) + # taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename) + # _ = subprocess.check_output(taos_cmd1, shell=True) + print("taos -f %s sql over!" %strlist) + endTime_taos_f = time.time() + print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) + + print("=========%s====over=============" %strlist) + + def time_nest(self,timelist): + + print("==========%s===start=============" %timelist) + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.dropandcreateDB_random("%s" %self.db_nest, 1) + + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMEZONE']): + time_functions = timelist + fun_fix_column = ['()'] + fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_fix_column_j = ['()'] + fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") + fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + elif (timelist == ['TIMETRUNCATE']): + time_functions = timelist + + t = time.time() + t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)) + fun_fix_column = ['q_ts','ts','_c0','_C0','_rowts','1600000000000','1600000000000000','1600000000000000000', + '%d' %t, '%d000' %t, '%d000000' %t,'t_to_s'] + + timeunits = ['1a' ,'1s', '1m' ,'1h', '1d'] + timeunit = str(random.sample(timeunits,1)).replace("[","").replace("]","").replace("'","") + + column_1 = ['(%s,timeutil)'%(random.sample(fun_fix_column,1))] + fun_column_1 = random.sample(time_functions,1)+random.sample(column_1,1) + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_1 = str(time_fun_1).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s) + + column_2 = ['(%s,timeutil)'%(random.sample(fun_fix_column,1))] + fun_column_2 = random.sample(time_functions,1)+random.sample(column_2,1) + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_2 = str(time_fun_2).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s) + + + fun_fix_column_j = ['(t1.q_ts)','(t1.ts)', '(t2.q_ts)','(t2.ts)','(1600000000000)','(1600000000000000)','(1600000000000000000)', + '(%d)' %t, '(%d000)' %t, '(%d000000)' %t,'t_to_s'] + + column_j1 = ['(%s,timeutil)'%(random.sample(fun_fix_column_j,1))] + fun_column_join_1 = random.sample(time_functions,1)+random.sample(column_j1,1) + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_join_1 = str(time_fun_join_1).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s) + + column_j2 = ['(%s,timeutil)'%(random.sample(fun_fix_column_j,1))] + fun_column_join_2 = random.sample(time_functions,1)+random.sample(column_j2,1) + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_join_2 = str(time_fun_join_2).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s) + + elif (timelist == ['TO_ISO8601']): + time_functions = timelist + + t = time.time() + fun_fix_column = ['(now())','(ts)','(q_ts)','(_rowts)','(_c0)','(_C0)', + '(1600000000000)','(1600000000000000)','(1600000000000000000)', + '(%d)' %t, '(%d000)' %t, '(%d000000)' %t] + + fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_fix_column_j = ['(t1.q_ts)','(t1.ts)', '(t2.q_ts)','(t2.ts)','(1600000000000)','(1600000000000000)','(1600000000000000000)','(now())', + '(%d)' %t, '(%d000)' %t, '(%d000000)' %t] + + fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") + + fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") + + elif (timelist == ['TO_UNIXTIMESTAMP']): + time_functions = timelist + + t = time.time() + t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)) + fun_fix_column = ['(q_nchar)','(q_nchar1)','(q_nchar2)','(q_nchar3)','(q_nchar4)','(q_nchar_null)','(q_binary)','(q_binary5)','(q_binary6)','(q_binary7)','(q_binary8)','(q_binary_null)','(t_to_s)'] + + fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'") + time_fun_1 = str(time_fun_1).replace("t_to_s","%s" %t_to_s) + + fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'") + time_fun_2 = str(time_fun_2).replace("t_to_s","%s" %t_to_s) + + fun_fix_column_j = ['(t1.q_nchar)','(t1.q_binary)', '(t2.q_nchar)','(t2.q_binary)','(t_to_s)'] + + fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'") + time_fun_join_1 = str(time_fun_join_1).replace("t_to_s","%s" %t_to_s) + + fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("t_to_s","'t_to_s'") + time_fun_join_2 = str(time_fun_join_2).replace("t_to_s","%s" %t_to_s) + + elif (timelist == ['TIMEDIFF_1']): + time_functions = timelist + + t = time.time() + t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)) + timeunits = [ '1a' ,'1s', '1m' ,'1h', '1d'] + timeunit = str(random.sample(timeunits,1)).replace("[","").replace("]","").replace("'","") + + fun_fix_column = ['q_ts','ts','_c0','_C0','_rowts','1600000000000','1600000000000000','1600000000000000000', + '%d' %t, '%d000' %t, '%d000000' %t,'t_to_s'] + + column_1,column_2 = random.sample(fun_fix_column,1),random.sample(fun_fix_column,1) + column_12 = ['(%s,%s,timeutil)'%(column_1,column_2)] + fun_column_1 = random.sample(time_functions,1)+random.sample(column_12,1) + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_1 = str(time_fun_1).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s).replace("_1","") + + column_3,column_4 = random.sample(fun_fix_column,1),random.sample(fun_fix_column,1) + column_34 = ['(%s,%s,timeutil)'%(column_3,column_4)] + fun_column_2 = random.sample(time_functions,1)+random.sample(column_34,1) + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_2 = str(time_fun_2).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s).replace("_1","") + + fun_fix_column_j = ['(t1.q_ts)','(t1.ts)', '(t2.q_ts)','(t2.ts)','1600000000000','1600000000000000','1600000000000000000', + '%d' %t, '%d000' %t, '%d000000' %t,'t_to_s'] + + column_j1,column_j2 = random.sample(fun_fix_column_j,1),random.sample(fun_fix_column_j,1) + column_j12 = ['(%s,%s,timeutil)'%(column_j1,column_j2)] + fun_column_join_1 = random.sample(time_functions,1)+random.sample(column_j12,1) + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_join_1 = str(time_fun_join_1).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s).replace("_1","") + + column_j3,column_j4 = random.sample(fun_fix_column_j,1),random.sample(fun_fix_column_j,1) + column_j34 = ['(%s,%s,timeutil)'%(column_j3,column_j4)] + fun_column_join_2 = random.sample(time_functions,1)+random.sample(column_j34,1) + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_join_2 = str(time_fun_join_2).replace("timeutil","%s" %timeunit).replace("t_to_s","%s" %t_to_s).replace("_1","") + + elif (timelist == ['TIMEDIFF_2']): + time_functions = timelist + + t = time.time() + t_to_s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)) + + fun_fix_column = ['q_ts','ts','_c0','_C0','_rowts','1600000000000','1600000000000000','1600000000000000000', + '%d' %t, '%d000' %t, '%d000000' %t,'t_to_s'] + + column_1,column_2 = random.sample(fun_fix_column,1),random.sample(fun_fix_column,1) + column_12 = ['(%s,%s)'%(column_1,column_2)] + fun_column_1 = random.sample(time_functions,1)+random.sample(column_12,1) + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_1 = str(time_fun_1).replace("t_to_s","%s" %t_to_s).replace("_2","") + + column_3,column_4 = random.sample(fun_fix_column,1),random.sample(fun_fix_column,1) + column_34 = ['(%s,%s)'%(column_3,column_4)] + fun_column_2 = random.sample(time_functions,1)+random.sample(column_34,1) + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_2 = str(time_fun_2).replace("t_to_s","%s" %t_to_s).replace("_2","") + + fun_fix_column_j = ['(t1.q_ts)','(t1.ts)', '(t2.q_ts)','(t2.ts)','1600000000000','1600000000000000','1600000000000000000', + '%d' %t, '%d000' %t, '%d000000' %t,'t_to_s'] + + column_j1,column_j2 = random.sample(fun_fix_column_j,1),random.sample(fun_fix_column_j,1) + column_j12 = ['(%s,%s)'%(column_j1,column_j2)] + fun_column_join_1 = random.sample(time_functions,1)+random.sample(column_j12,1) + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_join_1 = str(time_fun_join_1).replace("t_to_s","%s" %t_to_s).replace("_2","") + + column_j3,column_j4 = random.sample(fun_fix_column_j,1),random.sample(fun_fix_column_j,1) + column_j34 = ['(%s,%s)'%(column_j3,column_j4)] + fun_column_join_2 = random.sample(time_functions,1)+random.sample(column_j34,1) + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("\"","").replace("t_to_s","'t_to_s'") + time_fun_join_2 = str(time_fun_join_2).replace("t_to_s","%s" %t_to_s).replace("_2","") + + elif (timelist == ['ELAPSED']): + time_functions = timelist + + fun_fix_column = ['(ts)','(_c0)','(_C0)','(_rowts)','(ts,time_unit)','(_c0,time_unit)','(_C0,time_unit)','(_rowts,time_unit)'] + + time_units = ['1s','1m','1h','1d','1a'] + time_unit1 = str(random.sample(time_units,1)).replace("[","").replace("]","").replace("'","") + time_unit2 = str(random.sample(time_units,1)).replace("[","").replace("]","").replace("'","") + + fun_column_1 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit1) + + fun_column_2 = random.sample(time_functions,1)+random.sample(fun_fix_column,1) + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit2) + + + fun_fix_column_j = ['(t1.ts)', '(t2.ts)','(t1.ts,time_unit)','(t1.ts,time_unit)','(t2.ts,time_unit)','(t2.ts,time_unit)'] + + fun_column_join_1 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit1) + + fun_column_join_2 = random.sample(time_functions,1)+random.sample(fun_fix_column_j,1) + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("time_unit","%s" %time_unit2) + + + elif (timelist == ['CAST']) : + str_functions = timelist + #下面的4个是全的,这个只是1个 + i = random.randint(1,4) + if i ==1: + print('===========cast_1===========') + fun_fix_column = ['q_bool','q_bool_null','q_bigint','q_bigint_null','q_smallint','q_smallint_null', + 'q_tinyint','q_tinyint_null','q_int','q_int_null','q_float','q_float_null','q_double','q_double_null'] + type_names = ['BIGINT','BINARY(100)','TIMESTAMP','NCHAR(100)','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_j = ['t1.q_bool','t1.q_bool_null','t1.q_bigint','t1.q_bigint_null','t1.q_smallint','t1.q_smallint_null', + 't1.q_tinyint','t1.q_tinyint_null','t1.q_int','t1.q_int_null','t1.q_float','t1.q_float_null','t1.q_double','t1.q_double_null', + 't2.q_bool','t2.q_bool_null','t2.q_bigint','t2.q_bigint_null','t2.q_smallint','t2.q_smallint_null', + 't2.q_tinyint','t2.q_tinyint_null','t2.q_int','t2.q_int_null','t2.q_float','t2.q_float_null','t2.q_double','t2.q_double_null'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + + elif i==2: + print('===========cast_2===========') + fun_fix_column = ['q_binary','q_binary_null','q_binary1','q_binary2','q_binary3','q_binary4'] + type_names = ['BIGINT','BINARY(100)','NCHAR(100)','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_j = ['t1.q_binary','t1.q_binary_null','t1.q_binary1','t1.q_binary2','t1.q_binary3','t1.q_binary4', + 't2.q_binary','t2.q_binary_null','t2.q_binary1','t2.q_binary2','t2.q_binary3','t2.q_binary4'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + + elif i==3: + print('===========cast_3===========') + fun_fix_column = ['q_nchar','q_nchar_null','q_nchar5','q_nchar6','q_nchar7','q_nchar8'] + type_names = ['BIGINT','NCHAR(100)','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_j = ['t1.q_nchar','t1.q_nchar_null','t1.q_nchar5','t1.q_nchar6','t1.q_nchar7','t1.q_nchar8', + 't2.q_nchar','t2.q_nchar_null','t2.q_nchar5','t2.q_nchar6','t2.q_nchar7','t2.q_nchar8'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + + elif i==4: + print('===========cast_4===========') + fun_fix_column = ['q_ts','q_ts_null','_C0','_c0','ts','_rowts'] + type_names = ['BIGINT','TIMESTAMP','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","") + + fun_fix_column_j = ['t1.q_ts','t1.q_ts_null','t1.ts','t2.q_ts','t2.q_ts_null','t2.ts'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + + elif (timelist == ['CAST_1']) : + str_functions = timelist + + print('===========cast_1===========') + fun_fix_column = ['q_bool','q_bool_null','q_bigint','q_bigint_null','q_smallint','q_smallint_null', + 'q_tinyint','q_tinyint_null','q_int','q_int_null','q_float','q_float_null','q_double','q_double_null'] + type_names = ['BIGINT','BINARY(100)','TIMESTAMP','NCHAR(100)','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_1","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_1","") + + fun_fix_column_j = ['t1.q_bool','t1.q_bool_null','t1.q_bigint','t1.q_bigint_null','t1.q_smallint','t1.q_smallint_null', + 't1.q_tinyint','t1.q_tinyint_null','t1.q_int','t1.q_int_null','t1.q_float','t1.q_float_null','t1.q_double','t1.q_double_null', + 't2.q_bool','t2.q_bool_null','t2.q_bigint','t2.q_bigint_null','t2.q_smallint','t2.q_smallint_null', + 't2.q_tinyint','t2.q_tinyint_null','t2.q_int','t2.q_int_null','t2.q_float','t2.q_float_null','t2.q_double','t2.q_double_null'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_1","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_1","") + + elif (timelist == ['CAST_2']) : + str_functions = timelist + print('===========cast_2===========') + fun_fix_column = ['q_binary','q_binary_null','q_binary1','q_binary2','q_binary3','q_binary4'] + type_names = ['BIGINT','BINARY(100)','NCHAR(100)','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_2","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_2","") + + fun_fix_column_j = ['t1.q_binary','t1.q_binary_null','t1.q_binary1','t1.q_binary2','t1.q_binary3','t1.q_binary4', + 't2.q_binary','t2.q_binary_null','t2.q_binary1','t2.q_binary2','t2.q_binary3','t2.q_binary4'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_2","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_2","") + + elif (timelist == ['CAST_3']) : + str_functions = timelist + print('===========cast_3===========') + fun_fix_column = ['q_nchar','q_nchar_null','q_nchar5','q_nchar6','q_nchar7','q_nchar8'] + type_names = ['BIGINT','NCHAR(100)','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_3","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_3","") + + fun_fix_column_j = ['t1.q_nchar','t1.q_nchar_null','t1.q_nchar5','t1.q_nchar6','t1.q_nchar7','t1.q_nchar8', + 't2.q_nchar','t2.q_nchar_null','t2.q_nchar5','t2.q_nchar6','t2.q_nchar7','t2.q_nchar8'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_3","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_3","") + + elif (timelist == ['CAST_4']) : + str_functions = timelist + print('===========cast_4===========') + fun_fix_column = ['q_ts','q_ts_null','_C0','_c0','ts','_rowts'] + type_names = ['BIGINT','TIMESTAMP','BIGINT UNSIGNED'] + + type_name1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name1+')' + time_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace("_4","") + + type_name2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column,1))+' AS '+type_name2+')' + time_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace("_4","") + + fun_fix_column_j = ['t1.q_ts','t1.q_ts_null','t1.ts','t2.q_ts','t2.q_ts_null','t2.ts'] + + type_name_j1 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_1 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j1+')' + time_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace("_4","") + + type_name_j2 = str(random.sample(type_names,1)).replace("[","").replace("]","").replace("'","") + fun_column_join_2 = str(random.sample(str_functions,1))+'('+str(random.sample(fun_fix_column_j,1))+' AS '+type_name_j2+')' + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_4","") + + tdSql.query("select 1-1 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts1 , timediff(asct1,now) from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts1 from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) \ + or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts2 , asct1,now(),today(),timezone() from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts2 from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select max(asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += "from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-2 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts , timediff(asct1,now),now(),today(),timezone() from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s )" % random.choice(self.order_where) + sql += "%s " % random.choice(self.unionall_or_union) + sql += "select ts , timediff(asct2,now),now(),today(),timezone() from ( select " + sql += "%s as asct2, " % time_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts , (asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s )" % random.choice(self.order_where) + sql += "%s " % random.choice(self.unionall_or_union) + sql += "select ts , asct2,now(),today(),timezone() from ( select " + sql += "%s as asct2, " % time_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select min(asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1 " % time_fun_1 + sql += " from regular_table_1 where " + sql += "%s )" % random.choice(self.q_where) + sql += "%s " % random.choice(self.unionall_or_union) + sql += "select avg(asct2),now(),today(),timezone() from ( select " + sql += "%s as asct2 " % time_fun_2 + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-3 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts , timediff(asct1,now) from ( select " + sql += "%s as asct1, ts ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s " % random.choice(self.q_select) + sql += "from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s select " % random.choice(self.unionall_or_union) + sql += "%s as asct2, ts ," % time_fun_2 + sql += "%s as asct1, " % time_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s " % random.choice(self.q_select) + sql += "from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += " order by asct1 desc " + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts , (asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1, ts ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s " % random.choice(self.q_select) + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s select " % random.choice(self.unionall_or_union) + sql += "%s as asct2, ts ," % time_fun_2 + sql += "%s as asct1, " % time_fun_1 + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s " % random.choice(self.q_select) + sql += "from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += " order by asct1 desc " + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select abs(asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1," % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += "from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s select " % random.choice(self.unionall_or_union) + sql += "%s as asct2," % time_fun_2 + sql += "%s as asct1 " % time_fun_1 + sql += "from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += " order by asct1 asc " + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-4 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), timediff(asct1,now) from ( select t1.ts as ts1," + sql += "%s as asct11, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "%s as asct12, " % time_fun_join_1 + sql += "t1.%s as asct111, " % random.choice(self.q_select) + sql += "t2.%s as asct121, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), (asct1) from ( select t1.ts as ts1," + sql += "%s as asct10, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "%s as asct11, " % time_fun_join_1 + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select floor(asct1) from ( select " + sql += "%s as asct10, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "%s as asct11" % time_fun_join_1 + sql += " from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-5 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['ELAPSED']) : + sql = "select now(),today(),timezone(), " + sql += "%s, " % time_fun_1 + sql += "%s " % time_fun_2 + sql += " from ( select * from regular_table_1 ) where " + sql += "%s " % random.choice(self.q_where) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + else: + sql = "select ts ,now(),today(),timezone(), " + sql += "%s as asct11, " % time_fun_1 + sql += "%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % random.choice(self.q_select) + sql += "%s as asct14 " % time_fun_2 + sql += " from ( select * from regular_table_1 ) where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-6 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts1,ts ,timediff(ts1,ts), timediff(asct1,now) from ( select t1.ts as ts1," + sql += "%s as asct121, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t2.%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % time_fun_join_1 + sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s )" % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts1,ts ,timediff(ts1,ts), (asct1) from ( select t1.ts as ts1," + sql += "%s as asct121, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t2.%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % time_fun_join_1 + sql += "t2.ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s )" % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select (asct1)*111 from ( select " + sql += "%s as asct121, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "%s as asct122 " % time_fun_join_1 + sql += " from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s )" % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-7 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts1,m1 , timediff(asct1,now) from ( select " + sql += "%s as asct1, ts as m1," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct11, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.t_select) + sql += "ts as ts1 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select tm1,tm2 , (asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1, ts as tm1," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct11, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.t_select) + sql += "ts as tm2 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select (asct1)/asct2 ,now(),today(),timezone() from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += "from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-8 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select tm1,tm2 , timediff(asct1,now) " + sql += "from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s as asct1, ts as tm1," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct11, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.t_select) + sql += "ts as tm2 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts1,ts2 , (asct1),now(),today(),timezone() " + sql += "from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s as asct1, ts as ts1," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct11, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.t_select) + sql += "ts as ts2 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select floor(abs(asct1)),now(),today(),timezone() " + sql += "from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += "from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-9 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), timediff(asct1,now) from ( select t1.ts as ts1," + sql += "%s as asct121, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "and %s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), asct1 from ( select t1.ts as ts1," + sql += "%s as asct121, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "and %s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select min(asct1*110) from ( select " + sql += "%s as asct121, " % time_fun_join_1 + sql += "%s as asct1 " % time_fun_join_2 + sql += "from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "and %s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + + tdSql.query("select 1-10 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts , timediff(asct1,now) from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") %s " % random.choice(self.unionall_or_union) + sql += "select ts , timediff(asct1,now) from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts , (asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") %s " % random.choice(self.unionall_or_union) + sql += "select ts , (asct2),now(),today(),timezone() from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select abs(asct1),now(),today(),timezone() from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ") %s " % random.choice(self.unionall_or_union) + sql += "select max(asct2),now(),today(),timezone() from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += "from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #3 inter union not support + tdSql.query("select 1-11 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts , timediff(asct1,now), timediff(now,asct2) from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " %s " % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts , asct1,now(),now(),asct2 from ( select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " %s " % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2, " % time_fun_2 + sql += "%s as asct121, " % random.choice(self.s_r_select) + sql += "%s as asct122, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select asct1+asct2,now(),today(),timezone() from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " %s " % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s as asct1 ," % time_fun_1 + sql += "%s as asct2 " % time_fun_2 + sql += " from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "order by asct1 " + sql += "%s " % random.choice(self.limit1_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-12 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), timediff(asct1,now) from ( select t1.ts as ts1," + sql += "%s, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts1,ts2 ,timediff(ts1,ts2), asct1,now() from ( select t1.ts as ts1," + sql += "%s, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts as ts2 from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select min(floor(asct1)),now() from ( select " + sql += "%s as asct121, " % time_fun_join_1 + sql += "%s as asct1 " % time_fun_join_2 + sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "and %s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-13 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts , timediff(%s,now)," % time_fun_2 + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct11, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % time_fun_2 + sql += "%s as asct122 " % random.choice(self.t_select) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts ,now(),today(),timezone(), " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct11, " % random.choice(self.q_select) + sql += "%s as asct12, " % random.choice(self.q_select) + sql += "%s as asct13, " % time_fun_2 + sql += "%s as asct122 " % random.choice(self.t_select) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select now(),today(),timezone(), " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct12 " % time_fun_2 + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-14 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts , timediff(asct1,now),timediff(now,asct2) from ( select ts ts ," + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2" % time_fun_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ) ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts , (asct1),now(),(now()),asct2 from ( select ts ts ," + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2" % time_fun_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ) ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select (asct1)*asct2,now(),(now()) from ( select " + sql += "%s as asct1, " % time_fun_1 + sql += "%s as asct2" % time_fun_2 + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ) ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-15 as time_nest from stable_1 limit 1;") + for i in range(self.fornum): + if (timelist == ['NOW','TODAY']) or (timelist == ['TIMETRUNCATE']) or (timelist == ['TO_ISO8601'])\ + or (timelist == ['TO_UNIXTIMESTAMP']) or (timelist == ['TIMEDIFF_1']) or (timelist == ['TIMEDIFF_2']): + sql = "select ts1,ts ,timediff(ts1,ts), timediff(asct1,now),timediff(now,asct2) from ( select t1.ts as ts1," + sql += "%s as asct2, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['TIMEZONE']) or (timelist == ['CAST']) or (timelist == ['CAST_1']) or (timelist == ['CAST_2']) or (timelist == ['CAST_3']) or (timelist == ['CAST_4']): + sql = "select ts1,ts ,timediff(ts1,ts), asct1,(now()),(now()),asct2 ,now(),today(),timezone() from ( select t1.ts as ts1," + sql += "%s as asct2, " % time_fun_join_1 + sql += "%s as asct1, " % time_fun_join_2 + sql += "t1.%s as asct11, " % random.choice(self.q_select) + sql += "t1.%s as asct12, " % random.choice(self.q_select) + sql += "t2.%s as asct13, " % random.choice(self.q_select) + sql += "t2.%s as asct14, " % random.choice(self.q_select) + sql += "t2.ts from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + elif (timelist == ['ELAPSED']) : + sql = "select asct1,(now()),(now()),asct2 ,now(),today(),timezone() from ( select " + sql += "%s as asct2, " % time_fun_join_1 + sql += "%s as asct1 " % time_fun_join_2 + sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #taos -f sql + startTime_taos_f = time.time() + print("taos -f %s sql start!" %timelist) + # taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename) + # _ = subprocess.check_output(taos_cmd1, shell=True) + print("taos -f %s sql over!" %timelist) + endTime_taos_f = time.time() + print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) + + print("=========%s====over=============" %timelist) + + def function_before_26(self): + + print('=====================2.6 old function start ===========') + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + + self.dropandcreateDB_random("%s" %self.db_nest, 1) + + #1 select * from (select column form regular_table where <\>\in\and\or order by) + tdSql.query("select 1-1 from stable_1;") + for i in range(self.fornum): + sql = "select tas from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as tas from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql,queryTimes=1) + self.explain_sql(sql) + + #1 outer union not support + tdSql.query("select 1-2 from stable_1;") + for i in range(self.fornum): + sql = "select t1s from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as t1s from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") union " + sql += "select t2s from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as t2s from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #self.dropandcreateDB_random("%s" %db, 1) + tdSql.query("select 1-2 from stable_1;") + for i in range(self.fornum): + sql = "select ts from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") union all " + sql += "select ts from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #1 inter union not support + tdSql.query("select 1-3 from stable_1;") + for i in range(self.fornum): + #sql = "select ts , * from ( select " + sql = "select ts from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "" + sql += " union all select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 1-3 from stable_1;") + for i in range(self.fornum): + sql = "select ts from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " union all select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from regular_table_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #join:select * from (select column form regular_table1,regular_table2 where t1.ts=t2.ts and <\>\in\and\or order by) + tdSql.query("select 1-4 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select t1.ts as t1ts," + sql += "t1.%s as t11, " % random.choice(self.q_select) + sql += "t1.%s as t12, " % random.choice(self.q_select) + sql += "t2.%s as t21, " % random.choice(self.q_select) + sql += "t2.%s as t22, " % random.choice(self.q_select) + sql += "t2.ts as t2ts from regular_table_1 t1 , regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "and %s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #2 select column from (select * form regular_table ) where <\>\in\and\or order by + tdSql.query("select 2-1 from stable_1;") + for i in range(self.fornum): + sql = "select ts ," + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s " % random.choice(self.q_select) + sql += " from ( select * from regular_table_1 ) where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #3 select * from (select column\tag form stable where <\>\in\and\or order by ) + #self.dropandcreateDB_random("%s" %db, 1) + tdSql.query("select 3-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) + self.explain_sql(sql) + tdSql.query("select 3-1 from stable_1;") + for i in range(self.fornum): + sql = "select ts, " + sql += "%s " % random.choice(self.s_r_select) + sql += "from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.q_select) + sql += "%s, " % random.choice(self.t_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) + self.explain_sql(sql) + + # select ts,* from (select column\tag form stable1,stable2 where t1.ts = t2.ts and <\>\in\and\or order by ) + #self.dropandcreateDB_random("%s" %db, 1) + tdSql.query("select 3-2 from stable_1;") + for i in range(self.fornum): + #sql = "select ts , * from ( select t1.ts as t1ts , " + sql = "select t1ts , t2ts from ( select t1.ts as t1ts , " + sql += "t1.%s as t11, " % random.choice(self.t_select) + sql += "t1.%s as t12, " % random.choice(self.q_select) + sql += "t2.%s as t13, " % random.choice(self.t_select) + sql += "t2.%s as t14, " % random.choice(self.q_select) + sql += "t2.ts as t2ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #3 outer union not support + + tdSql.query("select 3-3 from stable_1;") + for i in range(self.fornum): + #sql = "select ts , * from ( select " + sql = "select ts1 from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts1 from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") union " + sql += "select ts2 from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts2 from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + for i in range(self.fornum): + sql = "select ts1 from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts1 from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ") union all " + sql += "select ts2 from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts2 from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #3 inter union not support + tdSql.query("select 3-4 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += " %s " % random.choice(self.unionall_or_union) + sql += " select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts from stable_2 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += ")" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #join:select * from (select column form stable1,stable2 where t1.ts=t2.ts and <\>\in\and\or order by) + tdSql.query("select 3-5 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select t1.ts as t1ts," + sql += "t1.%s as t11, " % random.choice(self.q_select) + sql += "t1.%s as t12, " % random.choice(self.q_select) + sql += "t2.%s as t21, " % random.choice(self.q_select) + sql += "t2.%s as t22, " % random.choice(self.q_select) + sql += "t2.ts as t2ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 3-6 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select t1.ts as t1ts ," + sql += "t1.%s as t11, " % random.choice(self.q_select) + sql += "t1.%s as t12, " % random.choice(self.q_select) + sql += "t2.%s as t21, " % random.choice(self.q_select) + sql += "t2.%s as t22, " % random.choice(self.q_select) + sql += "t2.ts as t2ts from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += ");" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #4 select column from (select * form stable where <\>\in\and\or order by ) + tdSql.query("select 4-1 from stable_1;") + for i in range(self.fornum): + sql = "select ts , " + sql += "%s as t11, " % random.choice(self.q_select) + sql += "%s as t12, " % random.choice(self.q_select) + sql += "%s " % random.choice(self.t_select) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #5 select distinct column\tag from (select * form stable where <\>\in\and\or order by limit offset ) + tdSql.query("select 5-1 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.dqt_select) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #5-1 select distinct column\tag from (select calc form stable where <\>\in\and\or order by limit offset ) + tdSql.query("select 5-2 from stable_1;") + for i in range(self.fornum): + sql = "select distinct c5_1 " + sql += " from ( select " + sql += "%s " % random.choice(self.calc_select_in_ts) + sql += " as c5_1 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #6 select * from (select distinct(tag) form stable where <\>\in\and\or order by limit ) + tdSql.query("select 6-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.dt_select) + sql += " from stable_1 where " + sql += "%s ) ;" % random.choice(self.qt_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #7 select * from (select distinct(tag) form stable where <\>\in\and\or order by limit ) + tdSql.query("select 7-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.dq_select) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice([self.limit_where[0] , self.limit_where[1]] ) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #calc_select,TWA/Diff/Derivative/Irate are not allowed to apply to super table directly + #8 select * from (select ts,calc form ragular_table where <\>\in\and\or order by ) + tdSql.query("select 8-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select ts ," + sql += "%s " % random.choice(self.calc_select_support_ts) + sql += "from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + tdSql.query("select 8-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_select_not_support_ts) + sql += "from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_select_in_ts) + sql += "from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 8-2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select t1.ts, " + sql += "%s " % random.choice(self.calc_select_in_support_ts_j) + sql += "from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_select_in_not_support_ts_j) + sql += "from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #9 select * from (select ts,calc form stable where <\>\in\and\or order by ) + # self.dropandcreateDB_random("%s" %db, 1) + tdSql.query("select 9-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_select_not_support_ts) + sql += "from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + tdSql.query("select 9-2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select ts ," + sql += "%s " % random.choice(self.calc_select_support_ts) + sql += "from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 9-3 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_select_in_not_support_ts_j) + sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + tdSql.query("select 9-4 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select t1.ts," + sql += "%s " % random.choice(self.calc_select_in_support_ts_j) + sql += "from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += " and %s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #10 select calc from (select * form regualr_table where <\>\in\and\or order by ) + tdSql.query("select 10-1 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.calc_select_in_ts) + sql += "as calc10_1 from ( select * from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #10-1 select calc from (select * form regualr_table where <\>\in\and\or order by ) + tdSql.query("select 10-2 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.calc_select_all) + sql += "as calc10_2 from ( select * from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #10-2 select calc from (select * form regualr_tables where <\>\in\and\or order by ) + tdSql.query("select 10-3 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "count(*) as calc10_3 " + sql += " from ( select t1.ts as t11, t2.ts as t22 from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += " and %s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.order_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #11 select calc from (select * form stable where <\>\in\and\or order by limit ) + tdSql.query("select 11-1 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.calc_select_in_ts) + sql += "as calc11_1 from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #11-1 select calc from (select * form stable where <\>\in\and\or order by limit ) + tdSql.query("select 11-2 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.calc_select_all) + sql += "as calc11_1 from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #12 select calc-diff from (select * form regualr_table where <\>\in\and\or order by limit ) + tdSql.query("select 12-1 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.calc_calculate_regular) + sql += " from ( select * from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.order_desc_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #12-1 select calc-diff from (select * form stable where <\>\in\and\or order by limit ) + tdSql.query("select 12-3 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_calculate_regular) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += ") " + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 12-4 from stable_1;") + #join query does not support group by + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_calculate_regular_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += ") " + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 12-5 from stable_1;") + #join query does not support group by + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_calculate_regular_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += ") " + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += " ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #13 select calc-diff as diffns from (select * form stable where <\>\in\and\or order by limit ) + tdSql.query("select 13-1 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.calc_calculate_regular) + sql += " as calc13_1 from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.orders_desc_where) + sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #14 select * from (select calc_aggregate_alls as agg from stable where <\>\in\and\or group by order by slimit soffset ) + tdSql.query("select 14-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all) + sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all) + sql += "%s " % random.choice(self.calc_aggregate_all) + sql += " as calc14_3 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.group_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + # error group by in out query + tdSql.query("select 14-2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all) + sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all) + sql += "%s " % random.choice(self.calc_aggregate_all) + sql += " as calc14_3 from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.partiton_where_regular) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #14-2 select * from (select calc_aggregate_all_js as agg from stables where <\>\in\and\or group by order by slimit soffset ) + tdSql.query("select 14-3 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all_j) + sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all_j) + sql += "%s " % random.choice(self.calc_aggregate_all_j) + sql += " as calc14_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 14-4 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc14_1, " % random.choice(self.calc_aggregate_all_j) + sql += "%s as calc14_2, " % random.choice(self.calc_aggregate_all_j) + sql += "%s " % random.choice(self.calc_aggregate_all_j) + sql += " as calc14_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.partiton_where_j) + sql += "%s " % random.choice(self.slimit1_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #15 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by slimit soffset ) + tdSql.query("select 15-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular) + sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular) + sql += "%s " % random.choice(self.calc_aggregate_regular) + sql += " as calc15_3 from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.group_where_regular) + sql += ") ;" + tdLog.info(sql) + self.data_check(sql,mark='15-1') + + tdSql.query("select 15-2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc15_2 " % random.choice(self.calc_aggregate_regular_j) + sql += "from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.group_where_regular_j) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 15-2.2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_regular_j) + sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_regular_j) + sql += "%s " % random.choice(self.calc_aggregate_regular_j) + sql += " as calc15_3 from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.group_where_regular_j) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + sql += "%s ;" % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 15-3 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname) + sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname) + sql += "%s " % random.choice(self.calc_aggregate_groupbytbname) + sql += " as calc15_3 from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.group_only_where) + sql += "%s " % random.choice(self.having_support) + sql += ") " + sql += "order by calc15_1 " + sql += "%s " % random.choice(self.limit_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 15-4 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname_j) + sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname_j) + sql += "%s " % random.choice(self.calc_aggregate_groupbytbname_j) + sql += " as calc15_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "%s " % random.choice(self.group_only_where_j) + sql += "%s " % random.choice(self.having_support_j) + sql += ") " + sql += "order by calc15_1 " + sql += "%s " % random.choice(self.limit_u_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 15-5 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc15_1, " % random.choice(self.calc_aggregate_groupbytbname) + sql += "%s as calc15_2, " % random.choice(self.calc_aggregate_groupbytbname) + sql += "%s " % random.choice(self.calc_aggregate_groupbytbname) + sql += " as calc15_3 from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.group_where) + sql += ") " + sql += "order by calc15_1 " + sql += "%s " % random.choice(self.limit_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #16 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by limit offset ) + tdSql.query("select 16-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_0 , " % random.choice(self.calc_calculate_all) + sql += "%s as calc16_1 , " % random.choice(self.calc_aggregate_all) + sql += "%s as calc16_2 " % random.choice(self.calc_select_in) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.group_where) + sql += ") " + sql += "order by calc16_0 " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_0 " % random.choice(self.calc_calculate_all_j) + sql += ", %s as calc16_1 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += ") " + sql += "order by calc16_0 " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-2.2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_0 " % random.choice(self.calc_calculate_all_j) + sql += ", %s as calc16_1 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += ") " + sql += "order by calc16_0 " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-3 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular) + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "limit 2 ) " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-4 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "limit 2 ) " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-4.2 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_1 " % random.choice(self.calc_calculate_regular_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "limit 2 ) " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-5 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_1 , " % random.choice(self.calc_calculate_all) + sql += "%s as calc16_2 , " % random.choice(self.calc_calculate_all) + sql += "%s as calc16_3 " % random.choice(self.calc_calculate_all) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.group_where) + sql += ") " + sql += "order by calc16_1 " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-6 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "limit 2 ) " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-7 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "limit 2 ) " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 16-8 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s as calc16_1 " % random.choice(self.calc_calculate_groupbytbname_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += "limit 2 ) " + sql += "%s " % random.choice(self.limit1_where) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #17 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or interval_sliding group by having order by limit offset )interval_sliding + tdSql.query("select 17-1 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_0 , " % random.choice(self.calc_calculate_all) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-2 from stable_1;") + for i in range(self.fornum): + #this is having_support , but tag-select cannot mix with last_row,other select can + sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_0 , " % random.choice(self.calc_calculate_all_j) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-2.2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_0, %d)/10 ,apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_0 , " % random.choice(self.calc_calculate_all_j) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-3 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-4 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-4.2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-5 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.partiton_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-6 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-7 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-7.2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-8 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all) + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-9 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 17-10 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal17_1, %d)/1000 ,apercentile(cal17_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.interval_sliding) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-1 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all) + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.session_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.session_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-2.2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.session_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-3 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all) + sql += " from stable_1_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.session_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-4 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.session_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-4.2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.session_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-5 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all) + sql += " from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.session_where) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-6 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.t_join_where) + sql += "%s " % random.choice(self.session_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 18-7 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal18_1, %d)/1000 ,apercentile(cal18_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal18_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal18_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.session_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #19 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or session order by limit )interval_sliding + tdSql.query("select 19-1 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all) + sql += " from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.state_window) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 19-2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.state_u_window) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 19-2.2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.state_u_window) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 19-3 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all) + sql += " from stable_1_1 where " + sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.state_window) + sql += "%s " % random.choice(self.limit1_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 19-4 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 19-4.2 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1_1 t1, stable_1_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_or_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 19-6 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.q_u_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + tdSql.query("select 19-7 from stable_1;") + for i in range(self.fornum): + sql = "select apercentile(cal19_1, %d)/1000 ,apercentile(cal19_2, %d)*10+%d from ( select " %(random.randint(0,100) , random.randint(0,100) ,random.randint(-1000,1000)) + sql += "%s as cal19_1 ," % random.choice(self.calc_aggregate_all_j) + sql += "%s as cal19_2 " % random.choice(self.calc_aggregate_all_j) + sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " + sql += "%s " % random.choice(self.qt_u_or_where) + sql += "%s " % random.choice(self.limit_u_where) + sql += ") " + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #1 select * from (select * from (select * form regular_table where <\>\in\and\or order by limit )) + tdSql.query("select 1-1 from stable_1;") + for i in range(self.fornum): + for_num = random.randint(1, 15); + sql = "select * from (" * for_num + sql += "select * from ( select * from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ttt from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ")) " + sql += ")" * for_num + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + sql2 = "select * from ( select * from ( select " + sql2 += "%s, " % random.choice(self.s_r_select) + sql2 += "%s, " % random.choice(self.q_select) + sql2 += "ts as tin from regular_table_1 where " + sql2 += "%s " % random.choice(self.q_where) + sql2 += ")) " + tdLog.info(sql2) + tdSql.query(sql2) + self.cur1.execute(sql2) + self.explain_sql(sql2) + + tdLog.info("=====1-1==over=========") + + for i in range(self.fornum): + for_num = random.randint(1, 15); + sql = "select ts2 from (" * for_num + sql += "select * from ( select * from ( select " + sql += "%s, " % random.choice(self.s_r_select) + sql += "%s, " % random.choice(self.q_select) + sql += "ts as ts2 from regular_table_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ")) " + sql += ")" * for_num + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + sql2 = "select * from ( select * from ( select " + sql2 += "%s, " % random.choice(self.s_r_select) + sql2 += "%s, " % random.choice(self.q_select) + sql2 += "ts as tt from regular_table_1 where " + sql2 += "%s " % random.choice(self.q_where) + sql2 += ")) " + tdLog.info(sql2) + tdSql.query(sql2) + self.explain_sql(sql2) + tdLog.info("=====1-2==over=========") + + #2 select * from (select * from (select * form stable where <\>\in\and\or order by limit )) + tdSql.query("select 2-1 from stable_1;") + for i in range(self.fornum): + for_num = random.randint(1, 15); + sql = "select * from (" * for_num + sql += "select * from ( select * from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.qt_select) + sql += "ts as tss from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ")) " + sql += ")" * for_num + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + sql2 = "select * from ( select * from ( select " + sql2 += "%s, " % random.choice(self.s_s_select) + sql2 += "%s, " % random.choice(self.qt_select) + sql2 += "ts as tst from stable_1 where " + sql2 += "%s " % random.choice(self.q_where) + sql2 += ")) " + tdLog.info(sql2) + tdSql.query(sql2) + self.explain_sql(sql2) + + tdLog.info("=====2-1==over=========") + + for i in range(self.fornum): + for_num = random.randint(1, 15); + sql = "select tsn from (" * for_num + sql += "select * from ( select * from ( select " + sql += "%s, " % random.choice(self.s_s_select) + sql += "%s, " % random.choice(self.qt_select) + sql += "ts as tsn from stable_1 where " + sql += "%s " % random.choice(self.q_where) + sql += ")) " + sql += ")" * for_num + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + sql2 = "select ts1 from ( select * from ( select " + sql2 += "%s, " % random.choice(self.s_s_select) + sql2 += "%s, " % random.choice(self.qt_select) + sql2 += "ts as ts1 from stable_1 where " + sql2 += "%s " % random.choice(self.q_where) + sql2 += ")) " + tdLog.info(sql2) + tdSql.query(sql2) + self.cur1.execute(sql2) + self.explain_sql(sql2) + tdLog.info("=====2-2==over=========") + + #3 select ts ,calc from (select * form stable where <\>\in\and\or order by limit ) + tdSql.query("select 3-1 from stable_1;") + for i in range(self.fornum): + sql = "select " + sql += "%s " % random.choice(self.calc_calculate_regular) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.orders_desc_where) + sql += "%s " % random.choice(self.limit_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #4 select * from (select calc form stable where <\>\in\and\or order by limit ) + tdSql.query("select 4-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select " + sql += "%s " % random.choice(self.calc_select_in_ts) + sql += "from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.limit_where) + sql += ") ;" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #5 select ts ,tbname from (select * form stable where <\>\in\and\or order by limit ) + tdSql.query("select 5-1 from stable_1;") + for i in range(self.fornum): + sql = "select ts , tbname , " + sql += "%s ," % random.choice(self.calc_calculate_regular) + sql += "%s ," % random.choice(self.dqt_select) + sql += "%s " % random.choice(self.qt_select) + sql += " from ( select * from stable_1 where " + sql += "%s " % random.choice(self.qt_where) + sql += "%s " % random.choice(self.orders_desc_where) + sql += "%s " % random.choice(self.limit_where) + sql += ") ;" + tdLog.info(sql) + tdSql.error(sql) + + #special sql + tdSql.query("select 6-1 from stable_1;") + for i in range(self.fornum): + sql = "select * from ( select _block_dist() from stable_1);" + tdSql.error(sql) + sql = "select _block_dist() from (select * from stable_1);" + tdSql.error(sql) + sql = "select * from (select database());" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + sql = "select * from (select client_version());" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + sql = "select * from (select client_version() as version);" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + sql = "select * from (select server_version());" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + sql = "select * from (select server_version() as version);" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + sql = "select * from (select server_status());" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + sql = "select * from (select server_status() as status);" + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) + + #taos -f sql + startTime_taos_f = time.time() + print("taos -f sql start!") + taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename) + _ = subprocess.check_output(taos_cmd1, shell=True) + print("taos -f sql over!") + endTime_taos_f = time.time() + print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) + + print('=====================2.6 old function end ===========') + + + def run(self): + tdSql.prepare() + + startTime = time.time() + + self.function_before_26() + + self.math_nest(['UNIQUE']) + self.math_nest(['MODE']) + self.math_nest(['SAMPLE']) + + self.math_nest(['ABS','SQRT']) + self.math_nest(['SIN','COS','TAN','ASIN','ACOS','ATAN']) + self.math_nest(['POW','LOG']) + self.math_nest(['FLOOR','CEIL','ROUND']) + self.math_nest(['MAVG']) + self.math_nest(['HYPERLOGLOG']) + self.math_nest(['TAIL']) + self.math_nest(['CSUM']) + self.math_nest(['statecount','stateduration']) + self.math_nest(['HISTOGRAM']) + + self.str_nest(['LTRIM','RTRIM','LOWER','UPPER']) + self.str_nest(['LENGTH','CHAR_LENGTH']) + self.str_nest(['SUBSTR']) + self.str_nest(['CONCAT']) + self.str_nest(['CONCAT_WS']) + self.time_nest(['CAST']) + self.time_nest(['CAST_1']) + self.time_nest(['CAST_2']) + self.time_nest(['CAST_3']) + self.time_nest(['CAST_4']) + + self.time_nest(['NOW','TODAY']) + self.time_nest(['TIMEZONE']) + self.time_nest(['TIMETRUNCATE']) + self.time_nest(['TO_ISO8601']) + self.time_nest(['TO_UNIXTIMESTAMP']) + self.time_nest(['ELAPSED']) + self.time_nest(['TIMEDIFF_1']) + self.time_nest(['TIMEDIFF_2']) + + endTime = time.time() + print("total time %ds" % (endTime - startTime)) + + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) From b20e2ed5afe9fc7f37fdf03686f8ca2c723b4122 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 19 Oct 2022 17:43:23 +0800 Subject: [PATCH 28/99] fix(query): set correct last value. --- source/dnode/vnode/src/tsdb/tsdbCacheRead.c | 30 ++++++++++++-------- source/libs/executor/src/cachescanoperator.c | 17 ++++++----- tests/system-test/2-query/last_row.py | 2 +- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 99c314fa45..1437811521 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -162,7 +162,7 @@ static int32_t doExtractCacheRow(SCacheRowsReader* pr, SLRUCache* lruCache, uint int32_t code = TSDB_CODE_SUCCESS; *pRow = NULL; - if ((pr->type & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW) { + if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST_ROW)) { code = tsdbCacheGetLastrowH(lruCache, uid, pr->pVnode->pTsdb, h); } else { code = tsdbCacheGetLastH(lruCache, uid, pr->pVnode->pTsdb, h); @@ -231,7 +231,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 } // retrieve the only one last row of all tables in the uid list. - if ((pr->type & CACHESCAN_RETRIEVE_TYPE_SINGLE) == CACHESCAN_RETRIEVE_TYPE_SINGLE) { + if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_TYPE_SINGLE)) { for (int32_t i = 0; i < numOfTables; ++i) { STableKeyInfo* pKeyInfo = taosArrayGet(pr->pTableList, i); @@ -255,6 +255,15 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 hasRes = true; p->ts = pCol->ts; p->colVal = pCol->colVal; + + // only set value for last row query + if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_LAST_ROW)) { + if (taosArrayGetSize(pTableUidList) == 0) { + taosArrayPush(pTableUidList, &pKeyInfo->uid); + } else { + taosArraySet(pTableUidList, 0, &pKeyInfo->uid); + } + } } } else { SLastCol* p = taosArrayGet(pLastCols, slotId); @@ -268,15 +277,12 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 hasRes = true; p->ts = pColVal->ts; - if (COL_VAL_IS_VALUE(&pColVal->colVal)) { - if (IS_VAR_DATA_TYPE(pColVal->colVal.type)) { - uint8_t* px = p->colVal.value.pData; - p->colVal = pColVal->colVal; - p->colVal.value.pData = px; - memcpy(px, pColVal->colVal.value.pData, pColVal->colVal.value.nData); - } else { - p->colVal = pColVal->colVal; - } + uint8_t* px = p->colVal.value.pData; + p->colVal = pColVal->colVal; + + if (COL_VAL_IS_VALUE(&pColVal->colVal) && IS_VAR_DATA_TYPE(pColVal->colVal.type)) { + p->colVal.value.pData = px; + memcpy(px, pColVal->colVal.value.pData, pColVal->colVal.value.nData); } } } @@ -290,7 +296,7 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 saveOneRow(pLastCols, pResBlock, pr, slotIds, pRes); } - } else if ((pr->type & CACHESCAN_RETRIEVE_TYPE_ALL) == CACHESCAN_RETRIEVE_TYPE_ALL) { + } else if (HASTYPE(pr->type, CACHESCAN_RETRIEVE_TYPE_ALL)) { for (int32_t i = pr->tableIndex; i < numOfTables; ++i) { STableKeyInfo* pKeyInfo = taosArrayGet(pr->pTableList, i); code = doExtractCacheRow(pr, lruCache, pKeyInfo->uid, &pRow, &h); diff --git a/source/libs/executor/src/cachescanoperator.c b/source/libs/executor/src/cachescanoperator.c index 5d63892b7b..814f3871db 100644 --- a/source/libs/executor/src/cachescanoperator.c +++ b/source/libs/executor/src/cachescanoperator.c @@ -193,20 +193,23 @@ SSDataBlock* doScanCache(SOperatorInfo* pOperator) { pInfo->currentGroupIndex += 1; // check for tag values - // TODO NOTE: The uid of pInfo->pRes is required. if (pInfo->pRes->info.rows > 0) { if (pInfo->pseudoExprSup.numOfExprs > 0) { SExprSupp* pSup = &pInfo->pseudoExprSup; - pInfo->pRes->info.uid = *(tb_uid_t*)taosArrayGet(pInfo->pUidList, 0); STableKeyInfo* pKeyInfo = taosArrayGet(pGroupTableList, 0); pInfo->pRes->info.groupId = pKeyInfo->groupId; - code = addTagPseudoColumnData(&pInfo->readHandle, pSup->pExprInfo, pSup->numOfExprs, pInfo->pRes, - GET_TASKID(pTaskInfo)); - if (code != TSDB_CODE_SUCCESS) { - pTaskInfo->code = code; - return NULL; + if (taosArrayGetSize(pInfo->pUidList) > 0) { + ASSERT((pInfo->retrieveType & CACHESCAN_RETRIEVE_LAST_ROW) == CACHESCAN_RETRIEVE_LAST_ROW); + + pInfo->pRes->info.uid = *(tb_uid_t*)taosArrayGet(pInfo->pUidList, 0); + code = addTagPseudoColumnData(&pInfo->readHandle, pSup->pExprInfo, pSup->numOfExprs, pInfo->pRes, + GET_TASKID(pTaskInfo)); + if (code != TSDB_CODE_SUCCESS) { + pTaskInfo->code = code; + return NULL; + } } } diff --git a/tests/system-test/2-query/last_row.py b/tests/system-test/2-query/last_row.py index 5d435b068f..6286852641 100644 --- a/tests/system-test/2-query/last_row.py +++ b/tests/system-test/2-query/last_row.py @@ -13,7 +13,7 @@ class TDTestCase: def init(self, conn, logSql): tdLog.debug(f"start to excute {__file__}") - tdSql.init(conn.cursor(), False) + tdSql.init(conn.cursor(), True) self.tb_nums = 10 self.row_nums = 20 self.ts = 1434938400000 From 8573fb56c88dd32f8a6102ec2f6fce8044f45767 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 17:48:56 +0800 Subject: [PATCH 29/99] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 21 ++++++++++++--------- source/dnode/vnode/src/vnd/vnodeCommit.c | 14 +------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index d1717f9a1e..08b326c659 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -89,6 +89,7 @@ int32_t smaBegin(SSma *pSma) { return TSDB_CODE_SUCCESS; } + SVnode *pVnode = pSma->pVnode; SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); int8_t rsmaTriggerStat = @@ -109,6 +110,17 @@ int32_t smaBegin(SSma *pSma) { break; } } + + if (VND_RSMA1(pVnode) && tsdbBegin(VND_RSMA1(pVnode)) < 0) { + smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(terrno)); + return TSDB_CODE_FAILED; + } + + if (VND_RSMA2(pVnode) && tsdbBegin(VND_RSMA2(pVnode)) < 0) { + smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(terrno)); + return TSDB_CODE_FAILED; + } + return TSDB_CODE_SUCCESS; } @@ -333,15 +345,6 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma) { * 1) This is high cost task and should not put in asyncPreCommit originally. * 2) But, if put in asyncCommit, would trigger taskInfo cloning frequently. */ - nLoops = 0; - while (atomic_load_64(&pRSmaStat->nBufItems) > 0) { - ++nLoops; - if (nLoops > 1000) { - sched_yield(); - nLoops = 0; - } - } - smaInfo("vgId:%d, rsma commit, wait for all items to be consumed, TID:%p", SMA_VID(pSma), (void *)taosGetSelfPthreadId()); nLoops = 0; diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 0bc1623d8b..2ca59ef45a 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -51,20 +51,8 @@ int vnodeBegin(SVnode *pVnode) { return -1; } - if (pVnode->pSma) { - if (VND_RSMA1(pVnode) && tsdbBegin(VND_RSMA1(pVnode)) < 0) { - vError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } - - if (VND_RSMA2(pVnode) && tsdbBegin(VND_RSMA2(pVnode)) < 0) { - vError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } - } - // begin sma - smaBegin(pVnode->pSma); // TODO: refactor to include the rsma1/rsma2 tsdbBegin() after tsdb_refact branch merged + smaBegin(pVnode->pSma); return 0; } From 78828d4d47ea3603ff8e972877b59befb54e8c64 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 17:58:39 +0800 Subject: [PATCH 30/99] enh: add more check --- source/dnode/vnode/src/sma/smaCommit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 08b326c659..8849bcc047 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -131,15 +131,15 @@ int32_t smaFinishCommit(SSma *pSma) { if (!pSmaEnv) { goto _exit; } - if ((code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { + if (VND_RSMA0(pVnode) && (code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; } - if ((code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { + if (VND_RSMA1(pVnode) && (code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; } - if ((code = tsdbFinishCommit(VND_RSMA2(pVnode))) < 0) { + if (VND_RSMA2(pVnode) && (code = tsdbFinishCommit(VND_RSMA2(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma2 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; } From 60b85028afe7ca9b609d47f2afafd1d24c2f7bb7 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 19 Oct 2022 18:53:51 +0800 Subject: [PATCH 31/99] fix: do not copy binary when nData is 0 --- source/dnode/vnode/src/tsdb/tsdbCache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 96504f343a..bb394e8acc 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -61,7 +61,7 @@ static void deleteTableCacheLast(const void *key, size_t keyLen, void *value) { int16_t nCol = taosArrayGetSize(pLastArray); for (int16_t iCol = 0; iCol < nCol; ++iCol) { SLastCol *pLastCol = (SLastCol *)taosArrayGet(pLastArray, iCol); - if (IS_VAR_DATA_TYPE(pLastCol->colVal.type)) { + if (IS_VAR_DATA_TYPE(pLastCol->colVal.type) && pLastCol->colVal.value.nData > 0) { taosMemoryFree(pLastCol->colVal.value.pData); } } @@ -1160,7 +1160,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal}; - if (IS_VAR_DATA_TYPE(pColVal->type)) { + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); if (lastCol.colVal.value.pData == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -1202,7 +1202,7 @@ static int32_t mergeLastRow(tb_uid_t uid, STsdb *pTsdb, bool *dup, SArray **ppCo tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); if (COL_VAL_IS_NONE(tColVal) && !COL_VAL_IS_NONE(pColVal)) { SLastCol lastCol = {.ts = rowTs, .colVal = *pColVal}; - if (IS_VAR_DATA_TYPE(pColVal->type)) { + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { SLastCol *pLastCol = (SLastCol *)taosArrayGet(pColArray, iCol); taosMemoryFree(pLastCol->colVal.value.pData); @@ -1283,7 +1283,7 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); SLastCol lastCol = {.ts = lastRowTs, .colVal = *pColVal}; - if (IS_VAR_DATA_TYPE(pColVal->type)) { + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { lastCol.colVal.value.pData = taosMemoryMalloc(lastCol.colVal.value.nData); if (lastCol.colVal.value.pData == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; @@ -1321,7 +1321,7 @@ static int32_t mergeLast(tb_uid_t uid, STsdb *pTsdb, SArray **ppLastArray) { tsdbRowGetColVal(pRow, pTSchema, iCol, pColVal); if (!COL_VAL_IS_VALUE(tColVal) && COL_VAL_IS_VALUE(pColVal)) { SLastCol lastCol = {.ts = rowTs, .colVal = *pColVal}; - if (IS_VAR_DATA_TYPE(pColVal->type)) { + if (IS_VAR_DATA_TYPE(pColVal->type) && pColVal->value.nData > 0) { SLastCol *pLastCol = (SLastCol *)taosArrayGet(pColArray, iCol); taosMemoryFree(pLastCol->colVal.value.pData); From 8cc57a6bcd911e892c345b502d620f4a6f54bca5 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 19 Oct 2022 11:09:44 +0000 Subject: [PATCH 32/99] test:temp test --- tests/parallel_test/run_container.sh | 2 +- tests/script/jenkins/basic.txt | 846 +++++++++---------- tests/system-test/fulltest.sh | 1162 +++++++++++++------------- 3 files changed, 1005 insertions(+), 1005 deletions(-) diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index bb57f238f0..0de777e6f1 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -109,7 +109,7 @@ docker run \ -v ${TMP_DIR}/thread_volume/$thread_no/coredump:$coredump_dir \ -v $WORKDIR/taos-connector-python/taos:/usr/local/lib/python3.8/site-packages/taos:ro \ -v $WORKDIR/taos-connector-python/taosrest:/usr/local/lib/python3.8/site-packages/taosrest:ro \ - --rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" $extra_param + --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" $extra_param ret=$? exit $ret diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index d8f4a36261..e87ede67ae 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -1,458 +1,458 @@ -#======================b1-start=============== +# #======================b1-start=============== -# ---- user ---- -./test.sh -f tsim/user/basic.sim -./test.sh -f tsim/user/password.sim -./test.sh -f tsim/user/privilege_db.sim -./test.sh -f tsim/user/privilege_sysinfo.sim +# # ---- user ---- +# ./test.sh -f tsim/user/basic.sim +# ./test.sh -f tsim/user/password.sim +# ./test.sh -f tsim/user/privilege_db.sim +# ./test.sh -f tsim/user/privilege_sysinfo.sim -# ---- db ---- -./test.sh -f tsim/db/alter_option.sim -# unsupport ./test.sh -f tsim/db/alter_replica_13.sim -# unsupport ./test.sh -f tsim/db/alter_replica_31.sim -./test.sh -f tsim/db/basic1.sim -./test.sh -f tsim/db/basic2.sim -./test.sh -f tsim/db/basic3.sim -./test.sh -f tsim/db/basic4.sim -./test.sh -f tsim/db/basic5.sim -./test.sh -f tsim/db/basic6.sim -./test.sh -f tsim/db/commit.sim -./test.sh -f tsim/db/create_all_options.sim -./test.sh -f tsim/db/delete_reuse1.sim -./test.sh -f tsim/db/delete_reuse2.sim -./test.sh -f tsim/db/delete_reusevnode.sim -./test.sh -f tsim/db/delete_reusevnode2.sim -./test.sh -f tsim/db/delete_writing1.sim -./test.sh -f tsim/db/delete_writing2.sim -# unsupport ./test.sh -f tsim/db/dropdnodes.sim -./test.sh -f tsim/db/error1.sim -./test.sh -f tsim/db/keep.sim -./test.sh -f tsim/db/len.sim -./test.sh -f tsim/db/repeat.sim -./test.sh -f tsim/db/show_create_db.sim -./test.sh -f tsim/db/show_create_table.sim -./test.sh -f tsim/db/tables.sim -./test.sh -f tsim/db/taosdlog.sim +# # ---- db ---- +# ./test.sh -f tsim/db/alter_option.sim +# # unsupport ./test.sh -f tsim/db/alter_replica_13.sim +# # unsupport ./test.sh -f tsim/db/alter_replica_31.sim +# ./test.sh -f tsim/db/basic1.sim +# ./test.sh -f tsim/db/basic2.sim +# ./test.sh -f tsim/db/basic3.sim +# ./test.sh -f tsim/db/basic4.sim +# ./test.sh -f tsim/db/basic5.sim +# ./test.sh -f tsim/db/basic6.sim +# ./test.sh -f tsim/db/commit.sim +# ./test.sh -f tsim/db/create_all_options.sim +# ./test.sh -f tsim/db/delete_reuse1.sim +# ./test.sh -f tsim/db/delete_reuse2.sim +# ./test.sh -f tsim/db/delete_reusevnode.sim +# ./test.sh -f tsim/db/delete_reusevnode2.sim +# ./test.sh -f tsim/db/delete_writing1.sim +# ./test.sh -f tsim/db/delete_writing2.sim +# # unsupport ./test.sh -f tsim/db/dropdnodes.sim +# ./test.sh -f tsim/db/error1.sim +# ./test.sh -f tsim/db/keep.sim +# ./test.sh -f tsim/db/len.sim +# ./test.sh -f tsim/db/repeat.sim +# ./test.sh -f tsim/db/show_create_db.sim +# ./test.sh -f tsim/db/show_create_table.sim +# ./test.sh -f tsim/db/tables.sim +# ./test.sh -f tsim/db/taosdlog.sim -# ---- dnode -# unsupport ./test.sh -f tsim/dnode/balance_replica1.sim -# unsupport ./test.sh -f tsim/dnode/balance_replica3.sim -# unsupport ./test.sh -f tsim/dnode/balance1.sim -# unsupport ./test.sh -f tsim/dnode/balance2.sim -# unsupport ./test.sh -f tsim/dnode/balance3.sim -# unsupport ./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 -# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim -# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica1.sim -# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim -# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim -# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim -./test.sh -f tsim/dnode/offline_reason.sim -# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim -# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim -# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim -# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v2.sim -# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v3.sim -# unsupport ./test.sh -f tsim/dnode/vnode_clean.sim -./test.sh -f tsim/dnode/use_dropped_dnode.sim +# # ---- dnode +# # unsupport ./test.sh -f tsim/dnode/balance_replica1.sim +# # unsupport ./test.sh -f tsim/dnode/balance_replica3.sim +# # unsupport ./test.sh -f tsim/dnode/balance1.sim +# # unsupport ./test.sh -f tsim/dnode/balance2.sim +# # unsupport ./test.sh -f tsim/dnode/balance3.sim +# # unsupport ./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 +# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim +# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica1.sim +# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim +# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim +# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim +# ./test.sh -f tsim/dnode/offline_reason.sim +# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim +# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim +# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v2.sim +# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v3.sim +# # unsupport ./test.sh -f tsim/dnode/vnode_clean.sim +# ./test.sh -f tsim/dnode/use_dropped_dnode.sim -# ---- import ---- -./test.sh -f tsim/import/basic.sim -./test.sh -f tsim/import/commit.sim -./test.sh -f tsim/import/large.sim -./test.sh -f tsim/import/replica1.sim +# # ---- import ---- +# ./test.sh -f tsim/import/basic.sim +# ./test.sh -f tsim/import/commit.sim +# ./test.sh -f tsim/import/large.sim +# ./test.sh -f tsim/import/replica1.sim -# ---- insert ---- -./test.sh -f tsim/insert/backquote.sim -./test.sh -f tsim/insert/basic.sim -./test.sh -f tsim/insert/basic0.sim -./test.sh -f tsim/insert/basic1.sim -./test.sh -f tsim/insert/basic2.sim -./test.sh -f tsim/insert/commit-merge0.sim -./test.sh -f tsim/insert/insert_drop.sim -./test.sh -f tsim/insert/insert_select.sim -./test.sh -f tsim/insert/null.sim -./test.sh -f tsim/insert/query_block1_file.sim -./test.sh -f tsim/insert/query_block1_memory.sim -./test.sh -f tsim/insert/query_block2_file.sim -./test.sh -f tsim/insert/query_block2_memory.sim -./test.sh -f tsim/insert/query_file_memory.sim -./test.sh -f tsim/insert/query_multi_file.sim -./test.sh -f tsim/insert/tcp.sim -./test.sh -f tsim/insert/update0.sim -./test.sh -f tsim/insert/update1_sort_merge.sim +# # ---- insert ---- +# ./test.sh -f tsim/insert/backquote.sim +# ./test.sh -f tsim/insert/basic.sim +# ./test.sh -f tsim/insert/basic0.sim +# ./test.sh -f tsim/insert/basic1.sim +# ./test.sh -f tsim/insert/basic2.sim +# ./test.sh -f tsim/insert/commit-merge0.sim +# ./test.sh -f tsim/insert/insert_drop.sim +# ./test.sh -f tsim/insert/insert_select.sim +# ./test.sh -f tsim/insert/null.sim +# ./test.sh -f tsim/insert/query_block1_file.sim +# ./test.sh -f tsim/insert/query_block1_memory.sim +# ./test.sh -f tsim/insert/query_block2_file.sim +# ./test.sh -f tsim/insert/query_block2_memory.sim +# ./test.sh -f tsim/insert/query_file_memory.sim +# ./test.sh -f tsim/insert/query_multi_file.sim +# ./test.sh -f tsim/insert/tcp.sim +# ./test.sh -f tsim/insert/update0.sim +# ./test.sh -f tsim/insert/update1_sort_merge.sim -# ---- parser ---- -./test.sh -f tsim/parser/alter__for_community_version.sim -./test.sh -f tsim/parser/alter_column.sim -./test.sh -f tsim/parser/alter_stable.sim -./test.sh -f tsim/parser/alter.sim -./test.sh -f tsim/parser/alter1.sim -./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim -./test.sh -f tsim/parser/auto_create_tb.sim -./test.sh -f tsim/parser/between_and.sim -./test.sh -f tsim/parser/binary_escapeCharacter.sim -./test.sh -f tsim/parser/col_arithmetic_operation.sim -./test.sh -f tsim/parser/columnValue_bigint.sim -./test.sh -f tsim/parser/columnValue_bool.sim -./test.sh -f tsim/parser/columnValue_double.sim -./test.sh -f tsim/parser/columnValue_float.sim -./test.sh -f tsim/parser/columnValue_int.sim -./test.sh -f tsim/parser/columnValue_smallint.sim -./test.sh -f tsim/parser/columnValue_tinyint.sim -./test.sh -f tsim/parser/columnValue_unsign.sim -./test.sh -f tsim/parser/commit.sim -./test.sh -f tsim/parser/condition.sim -./test.sh -f tsim/parser/constCol.sim -./test.sh -f tsim/parser/create_db.sim -./test.sh -f tsim/parser/create_mt.sim -./test.sh -f tsim/parser/create_tb_with_tag_name.sim -./test.sh -f tsim/parser/create_tb.sim -./test.sh -f tsim/parser/dbtbnameValidate.sim -./test.sh -f tsim/parser/distinct.sim -# TD-17623 ./test.sh -f tsim/parser/fill_stb.sim -./test.sh -f tsim/parser/fill_us.sim -./test.sh -f tsim/parser/fill.sim -./test.sh -f tsim/parser/first_last.sim -./test.sh -f tsim/parser/fourArithmetic-basic.sim -./test.sh -f tsim/parser/function.sim -./test.sh -f tsim/parser/groupby-basic.sim -./test.sh -f tsim/parser/groupby.sim -./test.sh -f tsim/parser/having_child.sim -./test.sh -f tsim/parser/having.sim -./test.sh -f tsim/parser/import_commit1.sim -./test.sh -f tsim/parser/import_commit2.sim -./test.sh -f tsim/parser/import_commit3.sim -./test.sh -f tsim/parser/import_file.sim -./test.sh -f tsim/parser/import.sim -./test.sh -f tsim/parser/insert_multiTbl.sim -./test.sh -f tsim/parser/insert_tb.sim -# TD-18293 ./test.sh -f tsim/parser/interp.sim -./test.sh -f tsim/parser/join_manyblocks.sim -./test.sh -f tsim/parser/join_multitables.sim -./test.sh -f tsim/parser/join_multivnode.sim -./test.sh -f tsim/parser/join.sim -./test.sh -f tsim/parser/last_cache.sim -./test.sh -f tsim/parser/last_groupby.sim -./test.sh -f tsim/parser/lastrow.sim -./test.sh -f tsim/parser/lastrow2.sim -./test.sh -f tsim/parser/like.sim -./test.sh -f tsim/parser/limit.sim -./test.sh -f tsim/parser/limit1.sim -# TD-17623 ./test.sh -f tsim/parser/limit2.sim -./test.sh -f tsim/parser/mixed_blocks.sim -./test.sh -f tsim/parser/nchar.sim -./test.sh -f tsim/parser/nestquery.sim -./test.sh -f tsim/parser/null_char.sim -./test.sh -f tsim/parser/precision_ns.sim -./test.sh -f tsim/parser/projection_limit_offset.sim -./test.sh -f tsim/parser/regex.sim -./test.sh -f tsim/parser/select_across_vnodes.sim -./test.sh -f tsim/parser/select_distinct_tag.sim -./test.sh -f tsim/parser/select_from_cache_disk.sim -./test.sh -f tsim/parser/select_with_tags.sim -./test.sh -f tsim/parser/selectResNum.sim -./test.sh -f tsim/parser/set_tag_vals.sim -# TD-19572 ./test.sh -f tsim/parser/single_row_in_tb.sim -./test.sh -f tsim/parser/sliding.sim -./test.sh -f tsim/parser/slimit_alter_tags.sim -./test.sh -f tsim/parser/slimit.sim -./test.sh -f tsim/parser/slimit1.sim -./test.sh -f tsim/parser/stableOp.sim -./test.sh -f tsim/parser/tags_dynamically_specifiy.sim -./test.sh -f tsim/parser/tags_filter.sim -./test.sh -f tsim/parser/tbnameIn.sim -./test.sh -f tsim/parser/timestamp.sim -./test.sh -f tsim/parser/top_groupby.sim -./test.sh -f tsim/parser/topbot.sim -./test.sh -f tsim/parser/union.sim -./test.sh -f tsim/parser/union_sysinfo.sim -./test.sh -f tsim/parser/where.sim +# # ---- parser ---- +# ./test.sh -f tsim/parser/alter__for_community_version.sim +# ./test.sh -f tsim/parser/alter_column.sim +# ./test.sh -f tsim/parser/alter_stable.sim +# ./test.sh -f tsim/parser/alter.sim +# ./test.sh -f tsim/parser/alter1.sim +# ./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim +# ./test.sh -f tsim/parser/auto_create_tb.sim +# ./test.sh -f tsim/parser/between_and.sim +# ./test.sh -f tsim/parser/binary_escapeCharacter.sim +# ./test.sh -f tsim/parser/col_arithmetic_operation.sim +# ./test.sh -f tsim/parser/columnValue_bigint.sim +# ./test.sh -f tsim/parser/columnValue_bool.sim +# ./test.sh -f tsim/parser/columnValue_double.sim +# ./test.sh -f tsim/parser/columnValue_float.sim +# ./test.sh -f tsim/parser/columnValue_int.sim +# ./test.sh -f tsim/parser/columnValue_smallint.sim +# ./test.sh -f tsim/parser/columnValue_tinyint.sim +# ./test.sh -f tsim/parser/columnValue_unsign.sim +# ./test.sh -f tsim/parser/commit.sim +# ./test.sh -f tsim/parser/condition.sim +# ./test.sh -f tsim/parser/constCol.sim +# ./test.sh -f tsim/parser/create_db.sim +# ./test.sh -f tsim/parser/create_mt.sim +# ./test.sh -f tsim/parser/create_tb_with_tag_name.sim +# ./test.sh -f tsim/parser/create_tb.sim +# ./test.sh -f tsim/parser/dbtbnameValidate.sim +# ./test.sh -f tsim/parser/distinct.sim +# # TD-17623 ./test.sh -f tsim/parser/fill_stb.sim +# ./test.sh -f tsim/parser/fill_us.sim +# ./test.sh -f tsim/parser/fill.sim +# ./test.sh -f tsim/parser/first_last.sim +# ./test.sh -f tsim/parser/fourArithmetic-basic.sim +# ./test.sh -f tsim/parser/function.sim +# ./test.sh -f tsim/parser/groupby-basic.sim +# ./test.sh -f tsim/parser/groupby.sim +# ./test.sh -f tsim/parser/having_child.sim +# ./test.sh -f tsim/parser/having.sim +# ./test.sh -f tsim/parser/import_commit1.sim +# ./test.sh -f tsim/parser/import_commit2.sim +# ./test.sh -f tsim/parser/import_commit3.sim +# ./test.sh -f tsim/parser/import_file.sim +# ./test.sh -f tsim/parser/import.sim +# ./test.sh -f tsim/parser/insert_multiTbl.sim +# ./test.sh -f tsim/parser/insert_tb.sim +# # TD-18293 ./test.sh -f tsim/parser/interp.sim +# ./test.sh -f tsim/parser/join_manyblocks.sim +# ./test.sh -f tsim/parser/join_multitables.sim +# ./test.sh -f tsim/parser/join_multivnode.sim +# ./test.sh -f tsim/parser/join.sim +# ./test.sh -f tsim/parser/last_cache.sim +# ./test.sh -f tsim/parser/last_groupby.sim +# ./test.sh -f tsim/parser/lastrow.sim +# ./test.sh -f tsim/parser/lastrow2.sim +# ./test.sh -f tsim/parser/like.sim +# ./test.sh -f tsim/parser/limit.sim +# ./test.sh -f tsim/parser/limit1.sim +# # TD-17623 ./test.sh -f tsim/parser/limit2.sim +# ./test.sh -f tsim/parser/mixed_blocks.sim +# ./test.sh -f tsim/parser/nchar.sim +# ./test.sh -f tsim/parser/nestquery.sim +# ./test.sh -f tsim/parser/null_char.sim +# ./test.sh -f tsim/parser/precision_ns.sim +# ./test.sh -f tsim/parser/projection_limit_offset.sim +# ./test.sh -f tsim/parser/regex.sim +# ./test.sh -f tsim/parser/select_across_vnodes.sim +# ./test.sh -f tsim/parser/select_distinct_tag.sim +# ./test.sh -f tsim/parser/select_from_cache_disk.sim +# ./test.sh -f tsim/parser/select_with_tags.sim +# ./test.sh -f tsim/parser/selectResNum.sim +# ./test.sh -f tsim/parser/set_tag_vals.sim +# # TD-19572 ./test.sh -f tsim/parser/single_row_in_tb.sim +# ./test.sh -f tsim/parser/sliding.sim +# ./test.sh -f tsim/parser/slimit_alter_tags.sim +# ./test.sh -f tsim/parser/slimit.sim +# ./test.sh -f tsim/parser/slimit1.sim +# ./test.sh -f tsim/parser/stableOp.sim +# ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim +# ./test.sh -f tsim/parser/tags_filter.sim +# ./test.sh -f tsim/parser/tbnameIn.sim +# ./test.sh -f tsim/parser/timestamp.sim +# ./test.sh -f tsim/parser/top_groupby.sim +# ./test.sh -f tsim/parser/topbot.sim +# ./test.sh -f tsim/parser/union.sim +# ./test.sh -f tsim/parser/union_sysinfo.sim +# ./test.sh -f tsim/parser/where.sim -# ---- query ---- -./test.sh -f tsim/query/charScalarFunction.sim -./test.sh -f tsim/query/explain.sim -./test.sh -f tsim/query/interval-offset.sim -./test.sh -f tsim/query/interval.sim -./test.sh -f tsim/query/scalarFunction.sim -./test.sh -f tsim/query/scalarNull.sim -./test.sh -f tsim/query/session.sim -./test.sh -f tsim/query/udf.sim +# # ---- query ---- +# ./test.sh -f tsim/query/charScalarFunction.sim +# ./test.sh -f tsim/query/explain.sim +# ./test.sh -f tsim/query/interval-offset.sim +# ./test.sh -f tsim/query/interval.sim +# ./test.sh -f tsim/query/scalarFunction.sim +# ./test.sh -f tsim/query/scalarNull.sim +# ./test.sh -f tsim/query/session.sim +# ./test.sh -f tsim/query/udf.sim -# ---- qnode -./test.sh -f tsim/qnode/basic1.sim +# # ---- qnode +# ./test.sh -f tsim/qnode/basic1.sim -# ---- snode ---- -# unsupport ./test.sh -f tsim/snode/basic1.sim +# # ---- snode ---- +# # unsupport ./test.sh -f tsim/snode/basic1.sim -# ---- bnode -./test.sh -f tsim/bnode/basic1.sim +# # ---- bnode +# ./test.sh -f tsim/bnode/basic1.sim -# ---- mnode -./test.sh -f tsim/mnode/basic1.sim -./test.sh -f tsim/mnode/basic2.sim -./test.sh -f tsim/mnode/basic3.sim -./test.sh -f tsim/mnode/basic4.sim -./test.sh -f tsim/mnode/basic5.sim +# # ---- mnode +# ./test.sh -f tsim/mnode/basic1.sim +# ./test.sh -f tsim/mnode/basic2.sim +# ./test.sh -f tsim/mnode/basic3.sim +# ./test.sh -f tsim/mnode/basic4.sim +# ./test.sh -f tsim/mnode/basic5.sim -# ---- show ---- -./test.sh -f tsim/show/basic.sim +# # ---- show ---- +# ./test.sh -f tsim/show/basic.sim -# ---- table ---- -./test.sh -f tsim/table/autocreate.sim -./test.sh -f tsim/table/basic1.sim -./test.sh -f tsim/table/basic2.sim -./test.sh -f tsim/table/basic3.sim -./test.sh -f tsim/table/bigint.sim -./test.sh -f tsim/table/binary.sim -./test.sh -f tsim/table/bool.sim -./test.sh -f tsim/table/column_name.sim -./test.sh -f tsim/table/column_num.sim -./test.sh -f tsim/table/column_value.sim -./test.sh -f tsim/table/column2.sim -./test.sh -f tsim/table/createmulti.sim -./test.sh -f tsim/table/date.sim -./test.sh -f tsim/table/db.table.sim -./test.sh -f tsim/table/delete_reuse1.sim -./test.sh -f tsim/table/delete_reuse2.sim -./test.sh -f tsim/table/delete_writing.sim -./test.sh -f tsim/table/describe.sim -./test.sh -f tsim/table/double.sim -./test.sh -f tsim/table/float.sim -./test.sh -f tsim/table/hash.sim -./test.sh -f tsim/table/int.sim -./test.sh -f tsim/table/limit.sim -./test.sh -f tsim/table/smallint.sim -./test.sh -f tsim/table/table_len.sim -./test.sh -f tsim/table/table.sim -./test.sh -f tsim/table/tinyint.sim -./test.sh -f tsim/table/vgroup.sim +# # ---- table ---- +# ./test.sh -f tsim/table/autocreate.sim +# ./test.sh -f tsim/table/basic1.sim +# ./test.sh -f tsim/table/basic2.sim +# ./test.sh -f tsim/table/basic3.sim +# ./test.sh -f tsim/table/bigint.sim +# ./test.sh -f tsim/table/binary.sim +# ./test.sh -f tsim/table/bool.sim +# ./test.sh -f tsim/table/column_name.sim +# ./test.sh -f tsim/table/column_num.sim +# ./test.sh -f tsim/table/column_value.sim +# ./test.sh -f tsim/table/column2.sim +# ./test.sh -f tsim/table/createmulti.sim +# ./test.sh -f tsim/table/date.sim +# ./test.sh -f tsim/table/db.table.sim +# ./test.sh -f tsim/table/delete_reuse1.sim +# ./test.sh -f tsim/table/delete_reuse2.sim +# ./test.sh -f tsim/table/delete_writing.sim +# ./test.sh -f tsim/table/describe.sim +# ./test.sh -f tsim/table/double.sim +# ./test.sh -f tsim/table/float.sim +# ./test.sh -f tsim/table/hash.sim +# ./test.sh -f tsim/table/int.sim +# ./test.sh -f tsim/table/limit.sim +# ./test.sh -f tsim/table/smallint.sim +# ./test.sh -f tsim/table/table_len.sim +# ./test.sh -f tsim/table/table.sim +# ./test.sh -f tsim/table/tinyint.sim +# ./test.sh -f tsim/table/vgroup.sim -# ---- stream -./test.sh -f tsim/stream/basic0.sim -./test.sh -f tsim/stream/basic1.sim -./test.sh -f tsim/stream/basic2.sim -./test.sh -f tsim/stream/drop_stream.sim -./test.sh -f tsim/stream/distributeInterval0.sim -./test.sh -f tsim/stream/distributeIntervalRetrive0.sim -./test.sh -f tsim/stream/distributeSession0.sim -./test.sh -f tsim/stream/session0.sim -./test.sh -f tsim/stream/session1.sim -./test.sh -f tsim/stream/state0.sim -./test.sh -f tsim/stream/triggerInterval0.sim -./test.sh -f tsim/stream/triggerSession0.sim -./test.sh -f tsim/stream/partitionby.sim -./test.sh -f tsim/stream/partitionby1.sim -# unsupport ./test.sh -f tsim/stream/schedSnode.sim -./test.sh -f tsim/stream/windowClose.sim -./test.sh -f tsim/stream/ignoreExpiredData.sim -./test.sh -f tsim/stream/sliding.sim -#./test.sh -f tsim/stream/partitionbyColumnInterval.sim -#./test.sh -f tsim/stream/partitionbyColumnSession.sim -#./test.sh -f tsim/stream/partitionbyColumnState.sim -#./test.sh -f tsim/stream/deleteInterval.sim -#./test.sh -f tsim/stream/deleteSession.sim -#./test.sh -f tsim/stream/deleteState.sim +# # ---- stream +# ./test.sh -f tsim/stream/basic0.sim +# ./test.sh -f tsim/stream/basic1.sim +# ./test.sh -f tsim/stream/basic2.sim +# ./test.sh -f tsim/stream/drop_stream.sim +# ./test.sh -f tsim/stream/distributeInterval0.sim +# ./test.sh -f tsim/stream/distributeIntervalRetrive0.sim +# ./test.sh -f tsim/stream/distributeSession0.sim +# ./test.sh -f tsim/stream/session0.sim +# ./test.sh -f tsim/stream/session1.sim +# ./test.sh -f tsim/stream/state0.sim +# ./test.sh -f tsim/stream/triggerInterval0.sim +# ./test.sh -f tsim/stream/triggerSession0.sim +# ./test.sh -f tsim/stream/partitionby.sim +# ./test.sh -f tsim/stream/partitionby1.sim +# # unsupport ./test.sh -f tsim/stream/schedSnode.sim +# ./test.sh -f tsim/stream/windowClose.sim +# ./test.sh -f tsim/stream/ignoreExpiredData.sim +# ./test.sh -f tsim/stream/sliding.sim +# #./test.sh -f tsim/stream/partitionbyColumnInterval.sim +# #./test.sh -f tsim/stream/partitionbyColumnSession.sim +# #./test.sh -f tsim/stream/partitionbyColumnState.sim +# #./test.sh -f tsim/stream/deleteInterval.sim +# #./test.sh -f tsim/stream/deleteSession.sim +# #./test.sh -f tsim/stream/deleteState.sim -# ---- transaction ---- -./test.sh -f tsim/trans/lossdata1.sim -./test.sh -f tsim/trans/create_db.sim +# # ---- transaction ---- +# ./test.sh -f tsim/trans/lossdata1.sim +# ./test.sh -f tsim/trans/create_db.sim -# ---- tmq -./test.sh -f tsim/tmq/basic1.sim -./test.sh -f tsim/tmq/basic2.sim -./test.sh -f tsim/tmq/basic3.sim -./test.sh -f tsim/tmq/basic4.sim -./test.sh -f tsim/tmq/basic1Of2Cons.sim -./test.sh -f tsim/tmq/basic2Of2Cons.sim -./test.sh -f tsim/tmq/basic3Of2Cons.sim -./test.sh -f tsim/tmq/basic4Of2Cons.sim -./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim -./test.sh -f tsim/tmq/topic.sim -./test.sh -f tsim/tmq/snapshot.sim -./test.sh -f tsim/tmq/snapshot1.sim +# # ---- tmq +# ./test.sh -f tsim/tmq/basic1.sim +# ./test.sh -f tsim/tmq/basic2.sim +# ./test.sh -f tsim/tmq/basic3.sim +# ./test.sh -f tsim/tmq/basic4.sim +# ./test.sh -f tsim/tmq/basic1Of2Cons.sim +# ./test.sh -f tsim/tmq/basic2Of2Cons.sim +# ./test.sh -f tsim/tmq/basic3Of2Cons.sim +# ./test.sh -f tsim/tmq/basic4Of2Cons.sim +# ./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim +# ./test.sh -f tsim/tmq/topic.sim +# ./test.sh -f tsim/tmq/snapshot.sim +# ./test.sh -f tsim/tmq/snapshot1.sim -# --- stable ---- -./test.sh -f tsim/stable/alter_comment.sim -./test.sh -f tsim/stable/alter_count.sim -./test.sh -f tsim/stable/alter_import.sim -./test.sh -f tsim/stable/alter_insert1.sim -./test.sh -f tsim/stable/alter_insert2.sim -./test.sh -f tsim/stable/alter_metrics.sim -./test.sh -f tsim/stable/column_add.sim -./test.sh -f tsim/stable/column_drop.sim -./test.sh -f tsim/stable/column_modify.sim -./test.sh -f tsim/stable/disk.sim -./test.sh -f tsim/stable/dnode3.sim -./test.sh -f tsim/stable/metrics.sim -./test.sh -f tsim/stable/refcount.sim -./test.sh -f tsim/stable/tag_add.sim -./test.sh -f tsim/stable/tag_drop.sim -./test.sh -f tsim/stable/tag_filter.sim -./test.sh -f tsim/stable/tag_modify.sim -./test.sh -f tsim/stable/tag_rename.sim -./test.sh -f tsim/stable/values.sim -./test.sh -f tsim/stable/vnode3.sim +# # --- stable ---- +# ./test.sh -f tsim/stable/alter_comment.sim +# ./test.sh -f tsim/stable/alter_count.sim +# ./test.sh -f tsim/stable/alter_import.sim +# ./test.sh -f tsim/stable/alter_insert1.sim +# ./test.sh -f tsim/stable/alter_insert2.sim +# ./test.sh -f tsim/stable/alter_metrics.sim +# ./test.sh -f tsim/stable/column_add.sim +# ./test.sh -f tsim/stable/column_drop.sim +# ./test.sh -f tsim/stable/column_modify.sim +# ./test.sh -f tsim/stable/disk.sim +# ./test.sh -f tsim/stable/dnode3.sim +# ./test.sh -f tsim/stable/metrics.sim +# ./test.sh -f tsim/stable/refcount.sim +# ./test.sh -f tsim/stable/tag_add.sim +# ./test.sh -f tsim/stable/tag_drop.sim +# ./test.sh -f tsim/stable/tag_filter.sim +# ./test.sh -f tsim/stable/tag_modify.sim +# ./test.sh -f tsim/stable/tag_rename.sim +# ./test.sh -f tsim/stable/values.sim +# ./test.sh -f tsim/stable/vnode3.sim -# --- for multi process mode -./test.sh -f tsim/user/basic.sim -m -./test.sh -f tsim/db/basic3.sim -m -./test.sh -f tsim/db/error1.sim -m -./test.sh -f tsim/insert/backquote.sim -m -# unsupport ./test.sh -f tsim/parser/fourArithmetic-basic.sim -m -./test.sh -f tsim/query/interval-offset.sim -m -# unsupport ./test.sh -f tsim/tmq/basic3.sim -m -./test.sh -f tsim/stable/vnode3.sim -m -./test.sh -f tsim/qnode/basic1.sim -m -# unsupport ./test.sh -f tsim/mnode/basic1.sim -m +# # --- for multi process mode +# ./test.sh -f tsim/user/basic.sim -m +# ./test.sh -f tsim/db/basic3.sim -m +# ./test.sh -f tsim/db/error1.sim -m +# ./test.sh -f tsim/insert/backquote.sim -m +# # unsupport ./test.sh -f tsim/parser/fourArithmetic-basic.sim -m +# ./test.sh -f tsim/query/interval-offset.sim -m +# # unsupport ./test.sh -f tsim/tmq/basic3.sim -m +# ./test.sh -f tsim/stable/vnode3.sim -m +# ./test.sh -f tsim/qnode/basic1.sim -m +# # unsupport ./test.sh -f tsim/mnode/basic1.sim -m -# --- sma -./test.sh -f tsim/sma/drop_sma.sim -./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim -# temp disable -./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim -./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim +# # --- sma +# ./test.sh -f tsim/sma/drop_sma.sim +# ./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim +# # temp disable +# ./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim +# ./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim -# --- valgrind ---- -./test.sh -f tsim/valgrind/checkError1.sim -./test.sh -f tsim/valgrind/checkError2.sim -./test.sh -f tsim/valgrind/checkError3.sim -./test.sh -f tsim/valgrind/checkError4.sim -./test.sh -f tsim/valgrind/checkError5.sim -./test.sh -f tsim/valgrind/checkError6.sim -./test.sh -f tsim/valgrind/checkError7.sim -./test.sh -f tsim/valgrind/checkError8.sim -./test.sh -f tsim/valgrind/checkUdf.sim +# # --- valgrind ---- +# ./test.sh -f tsim/valgrind/checkError1.sim +# ./test.sh -f tsim/valgrind/checkError2.sim +# ./test.sh -f tsim/valgrind/checkError3.sim +# ./test.sh -f tsim/valgrind/checkError4.sim +# ./test.sh -f tsim/valgrind/checkError5.sim +# ./test.sh -f tsim/valgrind/checkError6.sim +# ./test.sh -f tsim/valgrind/checkError7.sim +# ./test.sh -f tsim/valgrind/checkError8.sim +# ./test.sh -f tsim/valgrind/checkUdf.sim -# --- vnode ---- -# unsupport ./test.sh -f tsim/vnode/replica3_basic.sim -# unsupport ./test.sh -f tsim/vnode/replica3_repeat.sim -# unsupport ./test.sh -f tsim/vnode/replica3_vgroup.sim -# unsupport ./test.sh -f tsim/vnode/replica3_many.sim -# unsupport ./test.sh -f tsim/vnode/replica3_import.sim -# unsupport ./test.sh -f tsim/vnode/stable_balance_replica1.sim -# unsupport ./test.sh -f tsim/vnode/stable_dnode2_stop.sim -./test.sh -f tsim/vnode/stable_dnode2.sim -./test.sh -f tsim/vnode/stable_dnode3.sim -./test.sh -f tsim/vnode/stable_replica3_dnode6.sim -./test.sh -f tsim/vnode/stable_replica3_vnode3.sim +# # --- vnode ---- +# # unsupport ./test.sh -f tsim/vnode/replica3_basic.sim +# # unsupport ./test.sh -f tsim/vnode/replica3_repeat.sim +# # unsupport ./test.sh -f tsim/vnode/replica3_vgroup.sim +# # unsupport ./test.sh -f tsim/vnode/replica3_many.sim +# # unsupport ./test.sh -f tsim/vnode/replica3_import.sim +# # unsupport ./test.sh -f tsim/vnode/stable_balance_replica1.sim +# # unsupport ./test.sh -f tsim/vnode/stable_dnode2_stop.sim +# ./test.sh -f tsim/vnode/stable_dnode2.sim +# ./test.sh -f tsim/vnode/stable_dnode3.sim +# ./test.sh -f tsim/vnode/stable_replica3_dnode6.sim +# ./test.sh -f tsim/vnode/stable_replica3_vnode3.sim -# --- sync -./test.sh -f tsim/sync/3Replica1VgElect.sim -./test.sh -f tsim/sync/3Replica5VgElect.sim -./test.sh -f tsim/sync/oneReplica1VgElect.sim -./test.sh -f tsim/sync/oneReplica5VgElect.sim +# # --- sync +# ./test.sh -f tsim/sync/3Replica1VgElect.sim +# ./test.sh -f tsim/sync/3Replica5VgElect.sim +# ./test.sh -f tsim/sync/oneReplica1VgElect.sim +# ./test.sh -f tsim/sync/oneReplica5VgElect.sim -# --- catalog ---- -./test.sh -f tsim/catalog/alterInCurrent.sim +# # --- catalog ---- +# ./test.sh -f tsim/catalog/alterInCurrent.sim -# --- scalar ---- -./test.sh -f tsim/scalar/in.sim -./test.sh -f tsim/scalar/scalar.sim -./test.sh -f tsim/scalar/filter.sim -./test.sh -f tsim/scalar/caseWhen.sim +# # --- scalar ---- +# ./test.sh -f tsim/scalar/in.sim +# ./test.sh -f tsim/scalar/scalar.sim +# ./test.sh -f tsim/scalar/filter.sim +# ./test.sh -f tsim/scalar/caseWhen.sim -# ---- alter ---- -./test.sh -f tsim/alter/cached_schema_after_alter.sim -./test.sh -f tsim/alter/dnode.sim -./test.sh -f tsim/alter/table.sim +# # ---- alter ---- +# ./test.sh -f tsim/alter/cached_schema_after_alter.sim +# ./test.sh -f tsim/alter/dnode.sim +# ./test.sh -f tsim/alter/table.sim -# ---- cache ---- -./test.sh -f tsim/cache/new_metrics.sim -./test.sh -f tsim/cache/restart_table.sim -./test.sh -f tsim/cache/restart_metrics.sim +# # ---- cache ---- +# ./test.sh -f tsim/cache/new_metrics.sim +# ./test.sh -f tsim/cache/restart_table.sim +# ./test.sh -f tsim/cache/restart_metrics.sim -# ---- column ---- -./test.sh -f tsim/column/commit.sim -./test.sh -f tsim/column/metrics.sim -./test.sh -f tsim/column/table.sim +# # ---- column ---- +# ./test.sh -f tsim/column/commit.sim +# ./test.sh -f tsim/column/metrics.sim +# ./test.sh -f tsim/column/table.sim -# ---- compress ---- -./test.sh -f tsim/compress/commitlog.sim -./test.sh -f tsim/compress/compress2.sim -./test.sh -f tsim/compress/compress.sim -./test.sh -f tsim/compress/uncompress.sim +# # ---- compress ---- +# ./test.sh -f tsim/compress/commitlog.sim +# ./test.sh -f tsim/compress/compress2.sim +# ./test.sh -f tsim/compress/compress.sim +# ./test.sh -f tsim/compress/uncompress.sim -# ---- compute ---- -./test.sh -f tsim/compute/avg.sim -./test.sh -f tsim/compute/block_dist.sim -./test.sh -f tsim/compute/bottom.sim -./test.sh -f tsim/compute/count.sim -./test.sh -f tsim/compute/diff.sim -./test.sh -f tsim/compute/diff2.sim -./test.sh -f tsim/compute/first.sim -./test.sh -f tsim/compute/interval.sim -./test.sh -f tsim/compute/last_row.sim -./test.sh -f tsim/compute/last.sim -./test.sh -f tsim/compute/leastsquare.sim -./test.sh -f tsim/compute/max.sim -./test.sh -f tsim/compute/min.sim -./test.sh -f tsim/compute/null.sim -./test.sh -f tsim/compute/percentile.sim -./test.sh -f tsim/compute/stddev.sim -./test.sh -f tsim/compute/sum.sim -./test.sh -f tsim/compute/top.sim +# # ---- compute ---- +# ./test.sh -f tsim/compute/avg.sim +# ./test.sh -f tsim/compute/block_dist.sim +# ./test.sh -f tsim/compute/bottom.sim +# ./test.sh -f tsim/compute/count.sim +# ./test.sh -f tsim/compute/diff.sim +# ./test.sh -f tsim/compute/diff2.sim +# ./test.sh -f tsim/compute/first.sim +# ./test.sh -f tsim/compute/interval.sim +# ./test.sh -f tsim/compute/last_row.sim +# ./test.sh -f tsim/compute/last.sim +# ./test.sh -f tsim/compute/leastsquare.sim +# ./test.sh -f tsim/compute/max.sim +# ./test.sh -f tsim/compute/min.sim +# ./test.sh -f tsim/compute/null.sim +# ./test.sh -f tsim/compute/percentile.sim +# ./test.sh -f tsim/compute/stddev.sim +# ./test.sh -f tsim/compute/sum.sim +# ./test.sh -f tsim/compute/top.sim -# ---- field ---- -./test.sh -f tsim/field/2.sim -./test.sh -f tsim/field/3.sim -./test.sh -f tsim/field/4.sim -./test.sh -f tsim/field/5.sim -./test.sh -f tsim/field/6.sim -./test.sh -f tsim/field/binary.sim -./test.sh -f tsim/field/bigint.sim -./test.sh -f tsim/field/bool.sim -./test.sh -f tsim/field/double.sim -./test.sh -f tsim/field/float.sim -./test.sh -f tsim/field/int.sim -./test.sh -f tsim/field/single.sim -./test.sh -f tsim/field/smallint.sim -./test.sh -f tsim/field/tinyint.sim -./test.sh -f tsim/field/unsigined_bigint.sim +# # ---- field ---- +# ./test.sh -f tsim/field/2.sim +# ./test.sh -f tsim/field/3.sim +# ./test.sh -f tsim/field/4.sim +# ./test.sh -f tsim/field/5.sim +# ./test.sh -f tsim/field/6.sim +# ./test.sh -f tsim/field/binary.sim +# ./test.sh -f tsim/field/bigint.sim +# ./test.sh -f tsim/field/bool.sim +# ./test.sh -f tsim/field/double.sim +# ./test.sh -f tsim/field/float.sim +# ./test.sh -f tsim/field/int.sim +# ./test.sh -f tsim/field/single.sim +# ./test.sh -f tsim/field/smallint.sim +# ./test.sh -f tsim/field/tinyint.sim +# ./test.sh -f tsim/field/unsigined_bigint.sim -# ---- vector ---- -./test.sh -f tsim/vector/metrics_field.sim -./test.sh -f tsim/vector/metrics_mix.sim -./test.sh -f tsim/vector/metrics_query.sim -./test.sh -f tsim/vector/metrics_tag.sim -./test.sh -f tsim/vector/metrics_time.sim -./test.sh -f tsim/vector/multi.sim -./test.sh -f tsim/vector/single.sim -./test.sh -f tsim/vector/table_field.sim -./test.sh -f tsim/vector/table_mix.sim -./test.sh -f tsim/vector/table_query.sim -./test.sh -f tsim/vector/table_time.sim +# # ---- vector ---- +# ./test.sh -f tsim/vector/metrics_field.sim +# ./test.sh -f tsim/vector/metrics_mix.sim +# ./test.sh -f tsim/vector/metrics_query.sim +# ./test.sh -f tsim/vector/metrics_tag.sim +# ./test.sh -f tsim/vector/metrics_time.sim +# ./test.sh -f tsim/vector/multi.sim +# ./test.sh -f tsim/vector/single.sim +# ./test.sh -f tsim/vector/table_field.sim +# ./test.sh -f tsim/vector/table_mix.sim +# ./test.sh -f tsim/vector/table_query.sim +# ./test.sh -f tsim/vector/table_time.sim -# ---- wal ---- -./test.sh -f tsim/wal/kill.sim +# # ---- wal ---- +# ./test.sh -f tsim/wal/kill.sim -# ---- tag ---- -./test.sh -f tsim/tag/3.sim -./test.sh -f tsim/tag/4.sim -./test.sh -f tsim/tag/5.sim -./test.sh -f tsim/tag/6.sim -./test.sh -f tsim/tag/add.sim -./test.sh -f tsim/tag/bigint.sim -./test.sh -f tsim/tag/binary_binary.sim -./test.sh -f tsim/tag/binary.sim -./test.sh -f tsim/tag/bool_binary.sim -./test.sh -f tsim/tag/bool_int.sim -./test.sh -f tsim/tag/bool.sim -./test.sh -f tsim/tag/change.sim -./test.sh -f tsim/tag/column.sim -./test.sh -f tsim/tag/commit.sim -./test.sh -f tsim/tag/create.sim -./test.sh -f tsim/tag/delete.sim -./test.sh -f tsim/tag/double.sim -./test.sh -f tsim/tag/filter.sim -./test.sh -f tsim/tag/float.sim -./test.sh -f tsim/tag/int_binary.sim -./test.sh -f tsim/tag/int_float.sim -./test.sh -f tsim/tag/int.sim -./test.sh -f tsim/tag/set.sim -./test.sh -f tsim/tag/smallint.sim -./test.sh -f tsim/tag/tinyint.sim +# # ---- tag ---- +# ./test.sh -f tsim/tag/3.sim +# ./test.sh -f tsim/tag/4.sim +# ./test.sh -f tsim/tag/5.sim +# ./test.sh -f tsim/tag/6.sim +# ./test.sh -f tsim/tag/add.sim +# ./test.sh -f tsim/tag/bigint.sim +# ./test.sh -f tsim/tag/binary_binary.sim +# ./test.sh -f tsim/tag/binary.sim +# ./test.sh -f tsim/tag/bool_binary.sim +# ./test.sh -f tsim/tag/bool_int.sim +# ./test.sh -f tsim/tag/bool.sim +# ./test.sh -f tsim/tag/change.sim +# ./test.sh -f tsim/tag/column.sim +# ./test.sh -f tsim/tag/commit.sim +# ./test.sh -f tsim/tag/create.sim +# ./test.sh -f tsim/tag/delete.sim +# ./test.sh -f tsim/tag/double.sim +# ./test.sh -f tsim/tag/filter.sim +# ./test.sh -f tsim/tag/float.sim +# ./test.sh -f tsim/tag/int_binary.sim +# ./test.sh -f tsim/tag/int_float.sim +# ./test.sh -f tsim/tag/int.sim +# ./test.sh -f tsim/tag/set.sim +# ./test.sh -f tsim/tag/smallint.sim +# ./test.sh -f tsim/tag/tinyint.sim -#======================b1-end=============== +# #======================b1-end=============== diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 4c0ef5a527..7831e86f76 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -2,611 +2,611 @@ set -e set -x -python3 ./test.py -f 0-others/taosShell.py -python3 ./test.py -f 0-others/taosShellError.py -python3 ./test.py -f 0-others/taosShellNetChk.py -python3 ./test.py -f 0-others/telemetry.py -python3 ./test.py -f 0-others/taosdMonitor.py -python3 ./test.py -f 0-others/udfTest.py -python3 ./test.py -f 0-others/udf_create.py -python3 ./test.py -f 0-others/udf_restart_taosd.py -python3 ./test.py -f 0-others/cachemodel.py -python3 ./test.py -f 0-others/udf_cfg1.py -python3 ./test.py -f 0-others/udf_cfg2.py +# python3 ./test.py -f 0-others/taosShell.py +# python3 ./test.py -f 0-others/taosShellError.py +# python3 ./test.py -f 0-others/taosShellNetChk.py +# python3 ./test.py -f 0-others/telemetry.py +# python3 ./test.py -f 0-others/taosdMonitor.py +# python3 ./test.py -f 0-others/udfTest.py +# python3 ./test.py -f 0-others/udf_create.py +# python3 ./test.py -f 0-others/udf_restart_taosd.py +# python3 ./test.py -f 0-others/cachemodel.py +# python3 ./test.py -f 0-others/udf_cfg1.py +# python3 ./test.py -f 0-others/udf_cfg2.py -python3 ./test.py -f 0-others/sysinfo.py -python3 ./test.py -f 0-others/user_control.py -python3 ./test.py -f 0-others/fsync.py +# python3 ./test.py -f 0-others/sysinfo.py +# python3 ./test.py -f 0-others/user_control.py +# python3 ./test.py -f 0-others/fsync.py python3 ./test.py -f 0-others/compatibility.py -python3 ./test.py -f 1-insert/alter_database.py -python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py -python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py -python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py -python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py -python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py -python3 ./test.py -f 1-insert/alter_stable.py -python3 ./test.py -f 1-insert/alter_table.py -python3 ./test.py -f 1-insert/insertWithMoreVgroup.py -python3 ./test.py -f 1-insert/table_comment.py -python3 ./test.py -f 1-insert/time_range_wise.py -python3 ./test.py -f 1-insert/block_wise.py -python3 ./test.py -f 1-insert/create_retentions.py -python3 ./test.py -f 1-insert/table_param_ttl.py -python3 ./test.py -f 1-insert/mutil_stage.py -python3 ./test.py -f 1-insert/table_param_ttl.py -R -python3 ./test.py -f 1-insert/update_data_muti_rows.py -python3 ./test.py -f 1-insert/db_tb_name_check.py -python3 ./test.py -f 1-insert/database_pre_suf.py -python3 ./test.py -f 0-others/show.py -python3 ./test.py -f 2-query/abs.py -python3 ./test.py -f 2-query/abs.py -R -python3 ./test.py -f 2-query/and_or_for_byte.py -python3 ./test.py -f 2-query/and_or_for_byte.py -R -python3 ./test.py -f 2-query/apercentile.py -python3 ./test.py -f 2-query/apercentile.py -R -python3 ./test.py -f 2-query/arccos.py -python3 ./test.py -f 2-query/arccos.py -R -python3 ./test.py -f 2-query/arcsin.py -python3 ./test.py -f 2-query/arcsin.py -R -python3 ./test.py -f 2-query/arctan.py -python3 ./test.py -f 2-query/arctan.py -R -python3 ./test.py -f 2-query/avg.py -python3 ./test.py -f 2-query/avg.py -R -python3 ./test.py -f 2-query/between.py -python3 ./test.py -f 2-query/between.py -R -python3 ./test.py -f 2-query/bottom.py -python3 ./test.py -f 2-query/bottom.py -R -python3 ./test.py -f 2-query/cast.py -python3 ./test.py -f 2-query/cast.py -R -python3 ./test.py -f 2-query/ceil.py -python3 ./test.py -f 2-query/ceil.py -R -python3 ./test.py -f 2-query/char_length.py -python3 ./test.py -f 2-query/char_length.py -R -python3 ./test.py -f 2-query/check_tsdb.py -python3 ./test.py -f 2-query/check_tsdb.py -R -python3 ./test.py -f 2-query/concat.py -python3 ./test.py -f 2-query/concat.py -R -python3 ./test.py -f 2-query/concat_ws.py -python3 ./test.py -f 2-query/concat_ws.py -R -python3 ./test.py -f 2-query/concat_ws2.py -python3 ./test.py -f 2-query/concat_ws2.py -R -python3 ./test.py -f 2-query/cos.py -python3 ./test.py -f 2-query/cos.py -R -python3 ./test.py -f 2-query/count_partition.py -python3 ./test.py -f 2-query/count_partition.py -R -python3 ./test.py -f 2-query/count.py -python3 ./test.py -f 2-query/count.py -R -python3 ./test.py -f 2-query/db.py -python3 ./test.py -f 2-query/db.py -R -python3 ./test.py -f 2-query/diff.py -python3 ./test.py -f 2-query/diff.py -R -python3 ./test.py -f 2-query/distinct.py -python3 ./test.py -f 2-query/distinct.py -R -python3 ./test.py -f 2-query/distribute_agg_apercentile.py -python3 ./test.py -f 2-query/distribute_agg_apercentile.py -R -python3 ./test.py -f 2-query/distribute_agg_avg.py -python3 ./test.py -f 2-query/distribute_agg_avg.py -R -python3 ./test.py -f 2-query/distribute_agg_count.py -python3 ./test.py -f 2-query/distribute_agg_count.py -R -python3 ./test.py -f 2-query/distribute_agg_max.py -python3 ./test.py -f 2-query/distribute_agg_max.py -R -python3 ./test.py -f 2-query/distribute_agg_min.py -python3 ./test.py -f 2-query/distribute_agg_min.py -R -python3 ./test.py -f 2-query/distribute_agg_spread.py -python3 ./test.py -f 2-query/distribute_agg_spread.py -R -python3 ./test.py -f 2-query/distribute_agg_stddev.py -python3 ./test.py -f 2-query/distribute_agg_stddev.py -R -python3 ./test.py -f 2-query/distribute_agg_sum.py -python3 ./test.py -f 2-query/distribute_agg_sum.py -R -python3 ./test.py -f 2-query/explain.py -python3 ./test.py -f 2-query/explain.py -R -python3 ./test.py -f 2-query/first.py -python3 ./test.py -f 2-query/first.py -R -python3 ./test.py -f 2-query/floor.py -python3 ./test.py -f 2-query/floor.py -R -python3 ./test.py -f 2-query/function_null.py -python3 ./test.py -f 2-query/function_null.py -R -python3 ./test.py -f 2-query/function_stateduration.py -python3 ./test.py -f 2-query/function_stateduration.py -R -python3 ./test.py -f 2-query/histogram.py -python3 ./test.py -f 2-query/histogram.py -R -python3 ./test.py -f 2-query/hyperloglog.py -python3 ./test.py -f 2-query/hyperloglog.py -R -python3 ./test.py -f 2-query/interp.py -python3 ./test.py -f 2-query/interp.py -R -python3 ./test.py -f 2-query/irate.py -python3 ./test.py -f 2-query/irate.py -R -python3 ./test.py -f 2-query/join.py -python3 ./test.py -f 2-query/join.py -R -python3 ./test.py -f 2-query/last_row.py -python3 ./test.py -f 2-query/last_row.py -R -python3 ./test.py -f 2-query/last.py -python3 ./test.py -f 2-query/last.py -R -python3 ./test.py -f 2-query/leastsquares.py -python3 ./test.py -f 2-query/leastsquares.py -R -python3 ./test.py -f 2-query/length.py -python3 ./test.py -f 2-query/length.py -R -python3 ./test.py -f 2-query/log.py -# python3 ./test.py -f 2-query/log.py -R -python3 ./test.py -f 2-query/lower.py -python3 ./test.py -f 2-query/lower.py -R -python3 ./test.py -f 2-query/ltrim.py -python3 ./test.py -f 2-query/ltrim.py -R -python3 ./test.py -f 2-query/mavg.py -python3 ./test.py -f 2-query/mavg.py -R -python3 ./test.py -f 2-query/max_partition.py -python3 ./test.py -f 2-query/max_partition.py -R -python3 ./test.py -f 2-query/max.py -python3 ./test.py -f 2-query/max.py -R -python3 ./test.py -f 2-query/min.py -python3 ./test.py -f 2-query/min.py -R -python3 ./test.py -f 2-query/Now.py -python3 ./test.py -f 2-query/Now.py -R -python3 ./test.py -f 2-query/percentile.py -python3 ./test.py -f 2-query/percentile.py -R -python3 ./test.py -f 2-query/pow.py -python3 ./test.py -f 2-query/pow.py -R -python3 ./test.py -f 2-query/query_cols_tags_and_or.py -python3 ./test.py -f 2-query/query_cols_tags_and_or.py -R -python3 ./test.py -f 2-query/round.py -python3 ./test.py -f 2-query/round.py -R -python3 ./test.py -f 2-query/rtrim.py -python3 ./test.py -f 2-query/rtrim.py -R -python3 ./test.py -f 2-query/sample.py -python3 ./test.py -f 2-query/sample.py -R -python3 ./test.py -f 2-query/sin.py -python3 ./test.py -f 2-query/sin.py -R -python3 ./test.py -f 2-query/smaTest.py -python3 ./test.py -f 2-query/smaTest.py -R -python3 ./test.py -f 2-query/sml.py -python3 ./test.py -f 2-query/sml.py -R -python3 ./test.py -f 2-query/spread.py -python3 ./test.py -f 2-query/spread.py -R -python3 ./test.py -f 2-query/sqrt.py -python3 ./test.py -f 2-query/sqrt.py -R -python3 ./test.py -f 2-query/statecount.py -python3 ./test.py -f 2-query/statecount.py -R -python3 ./test.py -f 2-query/stateduration.py -python3 ./test.py -f 2-query/stateduration.py -R -python3 ./test.py -f 2-query/substr.py -python3 ./test.py -f 2-query/substr.py -R -python3 ./test.py -f 2-query/sum.py -python3 ./test.py -f 2-query/sum.py -R -python3 ./test.py -f 2-query/tail.py -python3 ./test.py -f 2-query/tail.py -R -python3 ./test.py -f 2-query/tan.py -# python3 ./test.py -f 2-query/tan.py -R -python3 ./test.py -f 2-query/Timediff.py -python3 ./test.py -f 2-query/Timediff.py -R -python3 ./test.py -f 2-query/timetruncate.py -# python3 ./test.py -f 2-query/timetruncate.py -R -python3 ./test.py -f 2-query/timezone.py -python3 ./test.py -f 2-query/timezone.py -R -python3 ./test.py -f 2-query/To_iso8601.py -python3 ./test.py -f 2-query/To_iso8601.py -R -python3 ./test.py -f 2-query/To_unixtimestamp.py -python3 ./test.py -f 2-query/To_unixtimestamp.py -R -python3 ./test.py -f 2-query/Today.py -# python3 ./test.py -f 2-query/Today.py -R -python3 ./test.py -f 2-query/top.py -python3 ./test.py -f 2-query/top.py -R -python3 ./test.py -f 2-query/tsbsQuery.py -python3 ./test.py -f 2-query/tsbsQuery.py -R -python3 ./test.py -f 2-query/ttl_comment.py -python3 ./test.py -f 2-query/ttl_comment.py -R -python3 ./test.py -f 2-query/twa.py -python3 ./test.py -f 2-query/twa.py -R -python3 ./test.py -f 2-query/union.py -python3 ./test.py -f 2-query/union.py -R -python3 ./test.py -f 2-query/unique.py -python3 ./test.py -f 2-query/unique.py -R -python3 ./test.py -f 2-query/upper.py -python3 ./test.py -f 2-query/upper.py -R -python3 ./test.py -f 2-query/varchar.py -python3 ./test.py -f 2-query/varchar.py -R +# python3 ./test.py -f 1-insert/alter_database.py +# python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py +# python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py +# python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py +# python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py +# python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py +# python3 ./test.py -f 1-insert/alter_stable.py +# python3 ./test.py -f 1-insert/alter_table.py +# python3 ./test.py -f 1-insert/insertWithMoreVgroup.py +# python3 ./test.py -f 1-insert/table_comment.py +# python3 ./test.py -f 1-insert/time_range_wise.py +# python3 ./test.py -f 1-insert/block_wise.py +# python3 ./test.py -f 1-insert/create_retentions.py +# python3 ./test.py -f 1-insert/table_param_ttl.py +# python3 ./test.py -f 1-insert/mutil_stage.py +# python3 ./test.py -f 1-insert/table_param_ttl.py -R +# python3 ./test.py -f 1-insert/update_data_muti_rows.py +# python3 ./test.py -f 1-insert/db_tb_name_check.py +# python3 ./test.py -f 1-insert/database_pre_suf.py +# python3 ./test.py -f 0-others/show.py +# python3 ./test.py -f 2-query/abs.py +# python3 ./test.py -f 2-query/abs.py -R +# python3 ./test.py -f 2-query/and_or_for_byte.py +# python3 ./test.py -f 2-query/and_or_for_byte.py -R +# python3 ./test.py -f 2-query/apercentile.py +# python3 ./test.py -f 2-query/apercentile.py -R +# python3 ./test.py -f 2-query/arccos.py +# python3 ./test.py -f 2-query/arccos.py -R +# python3 ./test.py -f 2-query/arcsin.py +# python3 ./test.py -f 2-query/arcsin.py -R +# python3 ./test.py -f 2-query/arctan.py +# python3 ./test.py -f 2-query/arctan.py -R +# python3 ./test.py -f 2-query/avg.py +# python3 ./test.py -f 2-query/avg.py -R +# python3 ./test.py -f 2-query/between.py +# python3 ./test.py -f 2-query/between.py -R +# python3 ./test.py -f 2-query/bottom.py +# python3 ./test.py -f 2-query/bottom.py -R +# python3 ./test.py -f 2-query/cast.py +# python3 ./test.py -f 2-query/cast.py -R +# python3 ./test.py -f 2-query/ceil.py +# python3 ./test.py -f 2-query/ceil.py -R +# python3 ./test.py -f 2-query/char_length.py +# python3 ./test.py -f 2-query/char_length.py -R +# python3 ./test.py -f 2-query/check_tsdb.py +# python3 ./test.py -f 2-query/check_tsdb.py -R +# python3 ./test.py -f 2-query/concat.py +# python3 ./test.py -f 2-query/concat.py -R +# python3 ./test.py -f 2-query/concat_ws.py +# python3 ./test.py -f 2-query/concat_ws.py -R +# python3 ./test.py -f 2-query/concat_ws2.py +# python3 ./test.py -f 2-query/concat_ws2.py -R +# python3 ./test.py -f 2-query/cos.py +# python3 ./test.py -f 2-query/cos.py -R +# python3 ./test.py -f 2-query/count_partition.py +# python3 ./test.py -f 2-query/count_partition.py -R +# python3 ./test.py -f 2-query/count.py +# python3 ./test.py -f 2-query/count.py -R +# python3 ./test.py -f 2-query/db.py +# python3 ./test.py -f 2-query/db.py -R +# python3 ./test.py -f 2-query/diff.py +# python3 ./test.py -f 2-query/diff.py -R +# python3 ./test.py -f 2-query/distinct.py +# python3 ./test.py -f 2-query/distinct.py -R +# python3 ./test.py -f 2-query/distribute_agg_apercentile.py +# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -R +# python3 ./test.py -f 2-query/distribute_agg_avg.py +# python3 ./test.py -f 2-query/distribute_agg_avg.py -R +# python3 ./test.py -f 2-query/distribute_agg_count.py +# python3 ./test.py -f 2-query/distribute_agg_count.py -R +# python3 ./test.py -f 2-query/distribute_agg_max.py +# python3 ./test.py -f 2-query/distribute_agg_max.py -R +# python3 ./test.py -f 2-query/distribute_agg_min.py +# python3 ./test.py -f 2-query/distribute_agg_min.py -R +# python3 ./test.py -f 2-query/distribute_agg_spread.py +# python3 ./test.py -f 2-query/distribute_agg_spread.py -R +# python3 ./test.py -f 2-query/distribute_agg_stddev.py +# python3 ./test.py -f 2-query/distribute_agg_stddev.py -R +# python3 ./test.py -f 2-query/distribute_agg_sum.py +# python3 ./test.py -f 2-query/distribute_agg_sum.py -R +# python3 ./test.py -f 2-query/explain.py +# python3 ./test.py -f 2-query/explain.py -R +# python3 ./test.py -f 2-query/first.py +# python3 ./test.py -f 2-query/first.py -R +# python3 ./test.py -f 2-query/floor.py +# python3 ./test.py -f 2-query/floor.py -R +# python3 ./test.py -f 2-query/function_null.py +# python3 ./test.py -f 2-query/function_null.py -R +# python3 ./test.py -f 2-query/function_stateduration.py +# python3 ./test.py -f 2-query/function_stateduration.py -R +# python3 ./test.py -f 2-query/histogram.py +# python3 ./test.py -f 2-query/histogram.py -R +# python3 ./test.py -f 2-query/hyperloglog.py +# python3 ./test.py -f 2-query/hyperloglog.py -R +# python3 ./test.py -f 2-query/interp.py +# python3 ./test.py -f 2-query/interp.py -R +# python3 ./test.py -f 2-query/irate.py +# python3 ./test.py -f 2-query/irate.py -R +# python3 ./test.py -f 2-query/join.py +# python3 ./test.py -f 2-query/join.py -R +# python3 ./test.py -f 2-query/last_row.py +# python3 ./test.py -f 2-query/last_row.py -R +# python3 ./test.py -f 2-query/last.py +# python3 ./test.py -f 2-query/last.py -R +# python3 ./test.py -f 2-query/leastsquares.py +# python3 ./test.py -f 2-query/leastsquares.py -R +# python3 ./test.py -f 2-query/length.py +# python3 ./test.py -f 2-query/length.py -R +# python3 ./test.py -f 2-query/log.py +# # python3 ./test.py -f 2-query/log.py -R +# python3 ./test.py -f 2-query/lower.py +# python3 ./test.py -f 2-query/lower.py -R +# python3 ./test.py -f 2-query/ltrim.py +# python3 ./test.py -f 2-query/ltrim.py -R +# python3 ./test.py -f 2-query/mavg.py +# python3 ./test.py -f 2-query/mavg.py -R +# python3 ./test.py -f 2-query/max_partition.py +# python3 ./test.py -f 2-query/max_partition.py -R +# python3 ./test.py -f 2-query/max.py +# python3 ./test.py -f 2-query/max.py -R +# python3 ./test.py -f 2-query/min.py +# python3 ./test.py -f 2-query/min.py -R +# python3 ./test.py -f 2-query/Now.py +# python3 ./test.py -f 2-query/Now.py -R +# python3 ./test.py -f 2-query/percentile.py +# python3 ./test.py -f 2-query/percentile.py -R +# python3 ./test.py -f 2-query/pow.py +# python3 ./test.py -f 2-query/pow.py -R +# python3 ./test.py -f 2-query/query_cols_tags_and_or.py +# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -R +# python3 ./test.py -f 2-query/round.py +# python3 ./test.py -f 2-query/round.py -R +# python3 ./test.py -f 2-query/rtrim.py +# python3 ./test.py -f 2-query/rtrim.py -R +# python3 ./test.py -f 2-query/sample.py +# python3 ./test.py -f 2-query/sample.py -R +# python3 ./test.py -f 2-query/sin.py +# python3 ./test.py -f 2-query/sin.py -R +# python3 ./test.py -f 2-query/smaTest.py +# python3 ./test.py -f 2-query/smaTest.py -R +# python3 ./test.py -f 2-query/sml.py +# python3 ./test.py -f 2-query/sml.py -R +# python3 ./test.py -f 2-query/spread.py +# python3 ./test.py -f 2-query/spread.py -R +# python3 ./test.py -f 2-query/sqrt.py +# python3 ./test.py -f 2-query/sqrt.py -R +# python3 ./test.py -f 2-query/statecount.py +# python3 ./test.py -f 2-query/statecount.py -R +# python3 ./test.py -f 2-query/stateduration.py +# python3 ./test.py -f 2-query/stateduration.py -R +# python3 ./test.py -f 2-query/substr.py +# python3 ./test.py -f 2-query/substr.py -R +# python3 ./test.py -f 2-query/sum.py +# python3 ./test.py -f 2-query/sum.py -R +# python3 ./test.py -f 2-query/tail.py +# python3 ./test.py -f 2-query/tail.py -R +# python3 ./test.py -f 2-query/tan.py +# # python3 ./test.py -f 2-query/tan.py -R +# python3 ./test.py -f 2-query/Timediff.py +# python3 ./test.py -f 2-query/Timediff.py -R +# python3 ./test.py -f 2-query/timetruncate.py +# # python3 ./test.py -f 2-query/timetruncate.py -R +# python3 ./test.py -f 2-query/timezone.py +# python3 ./test.py -f 2-query/timezone.py -R +# python3 ./test.py -f 2-query/To_iso8601.py +# python3 ./test.py -f 2-query/To_iso8601.py -R +# python3 ./test.py -f 2-query/To_unixtimestamp.py +# python3 ./test.py -f 2-query/To_unixtimestamp.py -R +# python3 ./test.py -f 2-query/Today.py +# # python3 ./test.py -f 2-query/Today.py -R +# python3 ./test.py -f 2-query/top.py +# python3 ./test.py -f 2-query/top.py -R +# python3 ./test.py -f 2-query/tsbsQuery.py +# python3 ./test.py -f 2-query/tsbsQuery.py -R +# python3 ./test.py -f 2-query/ttl_comment.py +# python3 ./test.py -f 2-query/ttl_comment.py -R +# python3 ./test.py -f 2-query/twa.py +# python3 ./test.py -f 2-query/twa.py -R +# python3 ./test.py -f 2-query/union.py +# python3 ./test.py -f 2-query/union.py -R +# python3 ./test.py -f 2-query/unique.py +# python3 ./test.py -f 2-query/unique.py -R +# python3 ./test.py -f 2-query/upper.py +# python3 ./test.py -f 2-query/upper.py -R +# python3 ./test.py -f 2-query/varchar.py +# python3 ./test.py -f 2-query/varchar.py -R -python3 ./test.py -f 1-insert/update_data.py +# python3 ./test.py -f 1-insert/update_data.py -python3 ./test.py -f 1-insert/delete_data.py +# python3 ./test.py -f 1-insert/delete_data.py -python3 ./test.py -f 2-query/join2.py -python3 ./test.py -f 2-query/union1.py -python3 ./test.py -f 2-query/concat2.py +# python3 ./test.py -f 2-query/join2.py +# python3 ./test.py -f 2-query/union1.py +# python3 ./test.py -f 2-query/concat2.py -python3 ./test.py -f 2-query/json_tag.py +# python3 ./test.py -f 2-query/json_tag.py -# python3 ./test.py -f 2-query/nestedQuery.py -# TD-15983 subquery output duplicate name column. -# Please Xiangyang Guo modify the following script -# python3 ./test.py -f 2-query/nestedQuery_str.py +# # python3 ./test.py -f 2-query/nestedQuery.py +# # TD-15983 subquery output duplicate name column. +# # Please Xiangyang Guo modify the following script +# # python3 ./test.py -f 2-query/nestedQuery_str.py -python3 ./test.py -f 2-query/elapsed.py -python3 ./test.py -f 2-query/csum.py -python3 ./test.py -f 2-query/function_diff.py -python3 ./test.py -f 2-query/queryQnode.py +# python3 ./test.py -f 2-query/elapsed.py +# python3 ./test.py -f 2-query/csum.py +# python3 ./test.py -f 2-query/function_diff.py +# python3 ./test.py -f 2-query/queryQnode.py -python3 ./test.py -f 6-cluster/5dnode1mnode.py -python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode1mnode.py +# python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartMnodeInsertData.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartVnodeInsertData.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 5 -M 3 +# # python3 ./test.py -f 6-cluster/5dnode3mnodeRestartMnodeInsertData.py -N 5 -M 3 +# # python3 ./test.py -f 6-cluster/5dnode3mnodeRestartVnodeInsertData.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 6 -M 3 -C 5 -# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py -# python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 -python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 6 -M 3 -C 5 +# # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py +# # python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 +# python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 -python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -# vnode case -python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1 -python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1 -python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_force_stop_all_dnodes.py -N 4 -M 1 -python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_all_vnode.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_follower.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_leader.py -N 4 -M 1 -python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_all_dnodes.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync_force_stop.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader_forece_stop.py -N 4 -M 1 -python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_mnode3_insertdatas_querys.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower_force_stop.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader_force_stop.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader.py -N 4 -M 1 -python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups_stopOne.py -N 4 -M 1 +# # vnode case +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_force_stop_all_dnodes.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_all_vnode.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_follower.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_leader.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_all_dnodes.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync_force_stop.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader_forece_stop.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_mnode3_insertdatas_querys.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower_force_stop.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader_force_stop.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1 +# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups_stopOne.py -N 4 -M 1 -python3 ./test.py -f 7-tmq/create_wrong_topic.py -python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3 -python3 ./test.py -f 7-tmq/basic5.py -python3 ./test.py -f 7-tmq/subscribeDb.py -python3 ./test.py -f 7-tmq/subscribeDb0.py -python3 ./test.py -f 7-tmq/subscribeDb1.py -python3 ./test.py -f 7-tmq/subscribeDb2.py -python3 ./test.py -f 7-tmq/subscribeDb3.py -#python3 ./test.py -f 7-tmq/subscribeDb4.py -python3 ./test.py -f 7-tmq/subscribeStb.py -python3 ./test.py -f 7-tmq/subscribeStb0.py -python3 ./test.py -f 7-tmq/subscribeStb1.py -python3 ./test.py -f 7-tmq/subscribeStb2.py -python3 ./test.py -f 7-tmq/subscribeStb3.py -python3 ./test.py -f 7-tmq/subscribeStb4.py -python3 ./test.py -f 7-tmq/db.py -python3 ./test.py -f 7-tmq/tmqError.py -python3 ./test.py -f 7-tmq/schema.py -python3 ./test.py -f 7-tmq/stbFilter.py -python3 ./test.py -f 7-tmq/tmqCheckData.py -python3 ./test.py -f 7-tmq/tmqCheckData1.py -#python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 5 -python3 ./test.py -f 7-tmq/tmqConsumerGroup.py -#python3 ./test.py -f 7-tmq/tmqShow.py -python3 ./test.py -f 7-tmq/tmqAlterSchema.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb1.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py -python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py -python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py -python3 ./test.py -f 7-tmq/tmqDnodeRestart.py -python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py -python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py -python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py -python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py -python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py -python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py -python3 ./test.py -f 7-tmq/tmqDropStb.py -python3 ./test.py -f 7-tmq/tmqDropStbCtb.py -python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot0.py -python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot1.py -python3 ./test.py -f 7-tmq/tmqUdf.py -python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot0.py -python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot1.py -python3 ./test.py -f 7-tmq/stbTagFilter-1ctb.py -python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py -python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py -python3 ./test.py -f 7-tmq/tmq_taosx.py -python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py +# python3 ./test.py -f 7-tmq/create_wrong_topic.py +# python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3 +# python3 ./test.py -f 7-tmq/basic5.py +# python3 ./test.py -f 7-tmq/subscribeDb.py +# python3 ./test.py -f 7-tmq/subscribeDb0.py +# python3 ./test.py -f 7-tmq/subscribeDb1.py +# python3 ./test.py -f 7-tmq/subscribeDb2.py +# python3 ./test.py -f 7-tmq/subscribeDb3.py +# #python3 ./test.py -f 7-tmq/subscribeDb4.py +# python3 ./test.py -f 7-tmq/subscribeStb.py +# python3 ./test.py -f 7-tmq/subscribeStb0.py +# python3 ./test.py -f 7-tmq/subscribeStb1.py +# python3 ./test.py -f 7-tmq/subscribeStb2.py +# python3 ./test.py -f 7-tmq/subscribeStb3.py +# python3 ./test.py -f 7-tmq/subscribeStb4.py +# python3 ./test.py -f 7-tmq/db.py +# python3 ./test.py -f 7-tmq/tmqError.py +# python3 ./test.py -f 7-tmq/schema.py +# python3 ./test.py -f 7-tmq/stbFilter.py +# python3 ./test.py -f 7-tmq/tmqCheckData.py +# python3 ./test.py -f 7-tmq/tmqCheckData1.py +# #python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 5 +# python3 ./test.py -f 7-tmq/tmqConsumerGroup.py +# #python3 ./test.py -f 7-tmq/tmqShow.py +# python3 ./test.py -f 7-tmq/tmqAlterSchema.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py +# # python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py +# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py +# python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py +# python3 ./test.py -f 7-tmq/tmqDnodeRestart.py +# python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py +# python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py +# python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py +# python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py +# python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py +# python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py +# python3 ./test.py -f 7-tmq/tmqDropStb.py +# python3 ./test.py -f 7-tmq/tmqDropStbCtb.py +# python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot0.py +# python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot1.py +# python3 ./test.py -f 7-tmq/tmqUdf.py +# python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot0.py +# python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot1.py +# python3 ./test.py -f 7-tmq/stbTagFilter-1ctb.py +# python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py +# python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py +# python3 ./test.py -f 7-tmq/tmq_taosx.py +# python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py -python3 ./test.py -f 99-TDcase/TD-19201.py +# python3 ./test.py -f 99-TDcase/TD-19201.py -#------------querPolicy 2----------- +# #------------querPolicy 2----------- -python3 ./test.py -f 2-query/between.py -Q 2 -python3 ./test.py -f 2-query/distinct.py -Q 2 -python3 ./test.py -f 2-query/varchar.py -Q 2 -python3 ./test.py -f 2-query/ltrim.py -Q 2 -python3 ./test.py -f 2-query/rtrim.py -Q 2 -python3 ./test.py -f 2-query/length.py -Q 2 -python3 ./test.py -f 2-query/char_length.py -Q 2 -python3 ./test.py -f 2-query/upper.py -Q 2 -python3 ./test.py -f 2-query/lower.py -Q 2 -python3 ./test.py -f 2-query/join.py -Q 2 -python3 ./test.py -f 2-query/join2.py -Q 2 -python3 ./test.py -f 2-query/cast.py -Q 2 -python3 ./test.py -f 2-query/substr.py -Q 2 -python3 ./test.py -f 2-query/union.py -Q 2 -python3 ./test.py -f 2-query/union1.py -Q 2 -python3 ./test.py -f 2-query/concat.py -Q 2 -python3 ./test.py -f 2-query/concat2.py -Q 2 -python3 ./test.py -f 2-query/concat_ws.py -Q 2 -python3 ./test.py -f 2-query/concat_ws2.py -Q 2 -#python3 ./test.py -f 2-query/check_tsdb.py -Q 2 -python3 ./test.py -f 2-query/spread.py -Q 2 -python3 ./test.py -f 2-query/hyperloglog.py -Q 2 -python3 ./test.py -f 2-query/explain.py -Q 2 -python3 ./test.py -f 2-query/leastsquares.py -Q 2 -python3 ./test.py -f 2-query/timezone.py -Q 2 -python3 ./test.py -f 2-query/Now.py -Q 2 -python3 ./test.py -f 2-query/Today.py -Q 2 -python3 ./test.py -f 2-query/max.py -Q 2 -python3 ./test.py -f 2-query/min.py -Q 2 -python3 ./test.py -f 2-query/count.py -Q 2 -python3 ./test.py -f 2-query/last.py -Q 2 -python3 ./test.py -f 2-query/first.py -Q 2 -python3 ./test.py -f 2-query/To_iso8601.py -Q 2 -python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 2 -python3 ./test.py -f 2-query/timetruncate.py -Q 2 -python3 ./test.py -f 2-query/diff.py -Q 2 -python3 ./test.py -f 2-query/Timediff.py -Q 2 -python3 ./test.py -f 2-query/json_tag.py -Q 2 -python3 ./test.py -f 2-query/top.py -Q 2 -python3 ./test.py -f 2-query/bottom.py -Q 2 -python3 ./test.py -f 2-query/percentile.py -Q 2 -python3 ./test.py -f 2-query/apercentile.py -Q 2 -python3 ./test.py -f 2-query/abs.py -Q 2 -python3 ./test.py -f 2-query/ceil.py -Q 2 -python3 ./test.py -f 2-query/floor.py -Q 2 -python3 ./test.py -f 2-query/round.py -Q 2 -python3 ./test.py -f 2-query/log.py -Q 2 -python3 ./test.py -f 2-query/pow.py -Q 2 -python3 ./test.py -f 2-query/sqrt.py -Q 2 -python3 ./test.py -f 2-query/sin.py -Q 2 -python3 ./test.py -f 2-query/cos.py -Q 2 -python3 ./test.py -f 2-query/tan.py -Q 2 -python3 ./test.py -f 2-query/arcsin.py -Q 2 -python3 ./test.py -f 2-query/arccos.py -Q 2 -python3 ./test.py -f 2-query/arctan.py -Q 2 -python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 2 -python3 ./test.py -f 2-query/interp.py -Q 2 +# python3 ./test.py -f 2-query/between.py -Q 2 +# python3 ./test.py -f 2-query/distinct.py -Q 2 +# python3 ./test.py -f 2-query/varchar.py -Q 2 +# python3 ./test.py -f 2-query/ltrim.py -Q 2 +# python3 ./test.py -f 2-query/rtrim.py -Q 2 +# python3 ./test.py -f 2-query/length.py -Q 2 +# python3 ./test.py -f 2-query/char_length.py -Q 2 +# python3 ./test.py -f 2-query/upper.py -Q 2 +# python3 ./test.py -f 2-query/lower.py -Q 2 +# python3 ./test.py -f 2-query/join.py -Q 2 +# python3 ./test.py -f 2-query/join2.py -Q 2 +# python3 ./test.py -f 2-query/cast.py -Q 2 +# python3 ./test.py -f 2-query/substr.py -Q 2 +# python3 ./test.py -f 2-query/union.py -Q 2 +# python3 ./test.py -f 2-query/union1.py -Q 2 +# python3 ./test.py -f 2-query/concat.py -Q 2 +# python3 ./test.py -f 2-query/concat2.py -Q 2 +# python3 ./test.py -f 2-query/concat_ws.py -Q 2 +# python3 ./test.py -f 2-query/concat_ws2.py -Q 2 +# #python3 ./test.py -f 2-query/check_tsdb.py -Q 2 +# python3 ./test.py -f 2-query/spread.py -Q 2 +# python3 ./test.py -f 2-query/hyperloglog.py -Q 2 +# python3 ./test.py -f 2-query/explain.py -Q 2 +# python3 ./test.py -f 2-query/leastsquares.py -Q 2 +# python3 ./test.py -f 2-query/timezone.py -Q 2 +# python3 ./test.py -f 2-query/Now.py -Q 2 +# python3 ./test.py -f 2-query/Today.py -Q 2 +# python3 ./test.py -f 2-query/max.py -Q 2 +# python3 ./test.py -f 2-query/min.py -Q 2 +# python3 ./test.py -f 2-query/count.py -Q 2 +# python3 ./test.py -f 2-query/last.py -Q 2 +# python3 ./test.py -f 2-query/first.py -Q 2 +# python3 ./test.py -f 2-query/To_iso8601.py -Q 2 +# python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 2 +# python3 ./test.py -f 2-query/timetruncate.py -Q 2 +# python3 ./test.py -f 2-query/diff.py -Q 2 +# python3 ./test.py -f 2-query/Timediff.py -Q 2 +# python3 ./test.py -f 2-query/json_tag.py -Q 2 +# python3 ./test.py -f 2-query/top.py -Q 2 +# python3 ./test.py -f 2-query/bottom.py -Q 2 +# python3 ./test.py -f 2-query/percentile.py -Q 2 +# python3 ./test.py -f 2-query/apercentile.py -Q 2 +# python3 ./test.py -f 2-query/abs.py -Q 2 +# python3 ./test.py -f 2-query/ceil.py -Q 2 +# python3 ./test.py -f 2-query/floor.py -Q 2 +# python3 ./test.py -f 2-query/round.py -Q 2 +# python3 ./test.py -f 2-query/log.py -Q 2 +# python3 ./test.py -f 2-query/pow.py -Q 2 +# python3 ./test.py -f 2-query/sqrt.py -Q 2 +# python3 ./test.py -f 2-query/sin.py -Q 2 +# python3 ./test.py -f 2-query/cos.py -Q 2 +# python3 ./test.py -f 2-query/tan.py -Q 2 +# python3 ./test.py -f 2-query/arcsin.py -Q 2 +# python3 ./test.py -f 2-query/arccos.py -Q 2 +# python3 ./test.py -f 2-query/arctan.py -Q 2 +# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 2 +# python3 ./test.py -f 2-query/interp.py -Q 2 -# python3 ./test.py -f 2-query/nestedQuery.py -Q 2 -# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2 +# # python3 ./test.py -f 2-query/nestedQuery.py -Q 2 +# # python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2 -python3 ./test.py -f 2-query/avg.py -Q 2 -# python3 ./test.py -f 2-query/elapsed.py -Q 2 -python3 ./test.py -f 2-query/csum.py -Q 2 -#python3 ./test.py -f 2-query/mavg.py -Q 2 -python3 ./test.py -f 2-query/sample.py -Q 2 -python3 ./test.py -f 2-query/function_diff.py -Q 2 -python3 ./test.py -f 2-query/unique.py -Q 2 -python3 ./test.py -f 2-query/stateduration.py -Q 2 -python3 ./test.py -f 2-query/function_stateduration.py -Q 2 -python3 ./test.py -f 2-query/statecount.py -Q 2 -python3 ./test.py -f 2-query/tail.py -Q 2 -python3 ./test.py -f 2-query/ttl_comment.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_count.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_max.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_min.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 2 -python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 2 -python3 ./test.py -f 2-query/twa.py -Q 2 -python3 ./test.py -f 2-query/irate.py -Q 2 -python3 ./test.py -f 2-query/function_null.py -Q 2 -python3 ./test.py -f 2-query/count_partition.py -Q 2 -python3 ./test.py -f 2-query/max_partition.py -Q 2 -python3 ./test.py -f 2-query/last_row.py -Q 2 -python3 ./test.py -f 2-query/tsbsQuery.py -Q 2 -#------------querPolicy 3----------- +# python3 ./test.py -f 2-query/avg.py -Q 2 +# # python3 ./test.py -f 2-query/elapsed.py -Q 2 +# python3 ./test.py -f 2-query/csum.py -Q 2 +# #python3 ./test.py -f 2-query/mavg.py -Q 2 +# python3 ./test.py -f 2-query/sample.py -Q 2 +# python3 ./test.py -f 2-query/function_diff.py -Q 2 +# python3 ./test.py -f 2-query/unique.py -Q 2 +# python3 ./test.py -f 2-query/stateduration.py -Q 2 +# python3 ./test.py -f 2-query/function_stateduration.py -Q 2 +# python3 ./test.py -f 2-query/statecount.py -Q 2 +# python3 ./test.py -f 2-query/tail.py -Q 2 +# python3 ./test.py -f 2-query/ttl_comment.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_count.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_max.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_min.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 2 +# python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 2 +# python3 ./test.py -f 2-query/twa.py -Q 2 +# python3 ./test.py -f 2-query/irate.py -Q 2 +# python3 ./test.py -f 2-query/function_null.py -Q 2 +# python3 ./test.py -f 2-query/count_partition.py -Q 2 +# python3 ./test.py -f 2-query/max_partition.py -Q 2 +# python3 ./test.py -f 2-query/last_row.py -Q 2 +# python3 ./test.py -f 2-query/tsbsQuery.py -Q 2 +# #------------querPolicy 3----------- -python3 ./test.py -f 2-query/between.py -Q 3 -python3 ./test.py -f 2-query/distinct.py -Q 3 -python3 ./test.py -f 2-query/varchar.py -Q 3 -python3 ./test.py -f 2-query/ltrim.py -Q 3 -python3 ./test.py -f 2-query/rtrim.py -Q 3 -python3 ./test.py -f 2-query/length.py -Q 3 -python3 ./test.py -f 2-query/char_length.py -Q 3 -python3 ./test.py -f 2-query/upper.py -Q 3 -python3 ./test.py -f 2-query/lower.py -Q 3 -python3 ./test.py -f 2-query/join.py -Q 3 -python3 ./test.py -f 2-query/join2.py -Q 3 -python3 ./test.py -f 2-query/cast.py -Q 3 -python3 ./test.py -f 2-query/substr.py -Q 3 -python3 ./test.py -f 2-query/union.py -Q 3 -python3 ./test.py -f 2-query/union1.py -Q 3 -python3 ./test.py -f 2-query/concat.py -Q 3 -python3 ./test.py -f 2-query/concat2.py -Q 3 -python3 ./test.py -f 2-query/concat_ws.py -Q 3 -python3 ./test.py -f 2-query/concat_ws2.py -Q 3 -#python3 ./test.py -f 2-query/check_tsdb.py -Q 3 -python3 ./test.py -f 2-query/spread.py -Q 3 -python3 ./test.py -f 2-query/hyperloglog.py -Q 3 -python3 ./test.py -f 2-query/explain.py -Q 3 -python3 ./test.py -f 2-query/leastsquares.py -Q 3 -python3 ./test.py -f 2-query/timezone.py -Q 3 -python3 ./test.py -f 2-query/Now.py -Q 3 -python3 ./test.py -f 2-query/Today.py -Q 3 -python3 ./test.py -f 2-query/max.py -Q 3 -python3 ./test.py -f 2-query/min.py -Q 3 -python3 ./test.py -f 2-query/count.py -Q 3 -#python3 ./test.py -f 2-query/last.py -Q 3 -python3 ./test.py -f 2-query/first.py -Q 3 -python3 ./test.py -f 2-query/To_iso8601.py -Q 3 -python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 3 -python3 ./test.py -f 2-query/timetruncate.py -Q 3 -python3 ./test.py -f 2-query/diff.py -Q 3 -python3 ./test.py -f 2-query/Timediff.py -Q 3 -python3 ./test.py -f 2-query/json_tag.py -Q 3 -python3 ./test.py -f 2-query/top.py -Q 3 -python3 ./test.py -f 2-query/bottom.py -Q 3 -python3 ./test.py -f 2-query/percentile.py -Q 3 -python3 ./test.py -f 2-query/apercentile.py -Q 3 -python3 ./test.py -f 2-query/abs.py -Q 3 -python3 ./test.py -f 2-query/ceil.py -Q 3 -python3 ./test.py -f 2-query/floor.py -Q 3 -python3 ./test.py -f 2-query/round.py -Q 3 -python3 ./test.py -f 2-query/log.py -Q 3 -python3 ./test.py -f 2-query/pow.py -Q 3 -python3 ./test.py -f 2-query/sqrt.py -Q 3 -python3 ./test.py -f 2-query/sin.py -Q 3 -python3 ./test.py -f 2-query/cos.py -Q 3 -python3 ./test.py -f 2-query/tan.py -Q 3 -python3 ./test.py -f 2-query/arcsin.py -Q 3 -python3 ./test.py -f 2-query/arccos.py -Q 3 -python3 ./test.py -f 2-query/arctan.py -Q 3 -python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 3 -# python3 ./test.py -f 2-query/nestedQuery.py -Q 3 -# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 3 -# python3 ./test.py -f 2-query/avg.py -Q 3 -# python3 ./test.py -f 2-query/elapsed.py -Q 3 -python3 ./test.py -f 2-query/csum.py -Q 3 -#python3 ./test.py -f 2-query/mavg.py -Q 3 -python3 ./test.py -f 2-query/sample.py -Q 3 -python3 ./test.py -f 2-query/function_diff.py -Q 3 -python3 ./test.py -f 2-query/unique.py -Q 3 -python3 ./test.py -f 2-query/stateduration.py -Q 3 -python3 ./test.py -f 2-query/function_stateduration.py -Q 3 -python3 ./test.py -f 2-query/statecount.py -Q 3 -python3 ./test.py -f 2-query/tail.py -Q 3 -python3 ./test.py -f 2-query/ttl_comment.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_count.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_max.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_min.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 3 -python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 3 -python3 ./test.py -f 2-query/twa.py -Q 3 -python3 ./test.py -f 2-query/irate.py -Q 3 -python3 ./test.py -f 2-query/function_null.py -Q 3 -python3 ./test.py -f 2-query/count_partition.py -Q 3 -python3 ./test.py -f 2-query/max_partition.py -Q 3 -python3 ./test.py -f 2-query/last_row.py -Q 3 -python3 ./test.py -f 2-query/tsbsQuery.py -Q 3 -python3 ./test.py -f 2-query/sml.py -Q 3 -python3 ./test.py -f 2-query/interp.py -Q 3 +# python3 ./test.py -f 2-query/between.py -Q 3 +# python3 ./test.py -f 2-query/distinct.py -Q 3 +# python3 ./test.py -f 2-query/varchar.py -Q 3 +# python3 ./test.py -f 2-query/ltrim.py -Q 3 +# python3 ./test.py -f 2-query/rtrim.py -Q 3 +# python3 ./test.py -f 2-query/length.py -Q 3 +# python3 ./test.py -f 2-query/char_length.py -Q 3 +# python3 ./test.py -f 2-query/upper.py -Q 3 +# python3 ./test.py -f 2-query/lower.py -Q 3 +# python3 ./test.py -f 2-query/join.py -Q 3 +# python3 ./test.py -f 2-query/join2.py -Q 3 +# python3 ./test.py -f 2-query/cast.py -Q 3 +# python3 ./test.py -f 2-query/substr.py -Q 3 +# python3 ./test.py -f 2-query/union.py -Q 3 +# python3 ./test.py -f 2-query/union1.py -Q 3 +# python3 ./test.py -f 2-query/concat.py -Q 3 +# python3 ./test.py -f 2-query/concat2.py -Q 3 +# python3 ./test.py -f 2-query/concat_ws.py -Q 3 +# python3 ./test.py -f 2-query/concat_ws2.py -Q 3 +# #python3 ./test.py -f 2-query/check_tsdb.py -Q 3 +# python3 ./test.py -f 2-query/spread.py -Q 3 +# python3 ./test.py -f 2-query/hyperloglog.py -Q 3 +# python3 ./test.py -f 2-query/explain.py -Q 3 +# python3 ./test.py -f 2-query/leastsquares.py -Q 3 +# python3 ./test.py -f 2-query/timezone.py -Q 3 +# python3 ./test.py -f 2-query/Now.py -Q 3 +# python3 ./test.py -f 2-query/Today.py -Q 3 +# python3 ./test.py -f 2-query/max.py -Q 3 +# python3 ./test.py -f 2-query/min.py -Q 3 +# python3 ./test.py -f 2-query/count.py -Q 3 +# #python3 ./test.py -f 2-query/last.py -Q 3 +# python3 ./test.py -f 2-query/first.py -Q 3 +# python3 ./test.py -f 2-query/To_iso8601.py -Q 3 +# python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 3 +# python3 ./test.py -f 2-query/timetruncate.py -Q 3 +# python3 ./test.py -f 2-query/diff.py -Q 3 +# python3 ./test.py -f 2-query/Timediff.py -Q 3 +# python3 ./test.py -f 2-query/json_tag.py -Q 3 +# python3 ./test.py -f 2-query/top.py -Q 3 +# python3 ./test.py -f 2-query/bottom.py -Q 3 +# python3 ./test.py -f 2-query/percentile.py -Q 3 +# python3 ./test.py -f 2-query/apercentile.py -Q 3 +# python3 ./test.py -f 2-query/abs.py -Q 3 +# python3 ./test.py -f 2-query/ceil.py -Q 3 +# python3 ./test.py -f 2-query/floor.py -Q 3 +# python3 ./test.py -f 2-query/round.py -Q 3 +# python3 ./test.py -f 2-query/log.py -Q 3 +# python3 ./test.py -f 2-query/pow.py -Q 3 +# python3 ./test.py -f 2-query/sqrt.py -Q 3 +# python3 ./test.py -f 2-query/sin.py -Q 3 +# python3 ./test.py -f 2-query/cos.py -Q 3 +# python3 ./test.py -f 2-query/tan.py -Q 3 +# python3 ./test.py -f 2-query/arcsin.py -Q 3 +# python3 ./test.py -f 2-query/arccos.py -Q 3 +# python3 ./test.py -f 2-query/arctan.py -Q 3 +# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 3 +# # python3 ./test.py -f 2-query/nestedQuery.py -Q 3 +# # python3 ./test.py -f 2-query/nestedQuery_str.py -Q 3 +# # python3 ./test.py -f 2-query/avg.py -Q 3 +# # python3 ./test.py -f 2-query/elapsed.py -Q 3 +# python3 ./test.py -f 2-query/csum.py -Q 3 +# #python3 ./test.py -f 2-query/mavg.py -Q 3 +# python3 ./test.py -f 2-query/sample.py -Q 3 +# python3 ./test.py -f 2-query/function_diff.py -Q 3 +# python3 ./test.py -f 2-query/unique.py -Q 3 +# python3 ./test.py -f 2-query/stateduration.py -Q 3 +# python3 ./test.py -f 2-query/function_stateduration.py -Q 3 +# python3 ./test.py -f 2-query/statecount.py -Q 3 +# python3 ./test.py -f 2-query/tail.py -Q 3 +# python3 ./test.py -f 2-query/ttl_comment.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_count.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_max.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_min.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 3 +# python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 3 +# python3 ./test.py -f 2-query/twa.py -Q 3 +# python3 ./test.py -f 2-query/irate.py -Q 3 +# python3 ./test.py -f 2-query/function_null.py -Q 3 +# python3 ./test.py -f 2-query/count_partition.py -Q 3 +# python3 ./test.py -f 2-query/max_partition.py -Q 3 +# python3 ./test.py -f 2-query/last_row.py -Q 3 +# python3 ./test.py -f 2-query/tsbsQuery.py -Q 3 +# python3 ./test.py -f 2-query/sml.py -Q 3 +# python3 ./test.py -f 2-query/interp.py -Q 3 -#------------querPolicy 4----------- +# #------------querPolicy 4----------- -python3 ./test.py -f 2-query/between.py -Q 4 -python3 ./test.py -f 2-query/distinct.py -Q 4 -python3 ./test.py -f 2-query/varchar.py -Q 4 -python3 ./test.py -f 2-query/ltrim.py -Q 4 -python3 ./test.py -f 2-query/rtrim.py -Q 4 -python3 ./test.py -f 2-query/length.py -Q 4 -python3 ./test.py -f 2-query/char_length.py -Q 4 -python3 ./test.py -f 2-query/upper.py -Q 4 -python3 ./test.py -f 2-query/lower.py -Q 4 -python3 ./test.py -f 2-query/join.py -Q 4 -python3 ./test.py -f 2-query/join2.py -Q 4 -python3 ./test.py -f 2-query/cast.py -Q 4 -python3 ./test.py -f 2-query/substr.py -Q 4 -python3 ./test.py -f 2-query/union.py -Q 4 -python3 ./test.py -f 2-query/union1.py -Q 4 -python3 ./test.py -f 2-query/concat.py -Q 4 -python3 ./test.py -f 2-query/concat2.py -Q 4 -python3 ./test.py -f 2-query/concat_ws.py -Q 4 -python3 ./test.py -f 2-query/concat_ws2.py -Q 4 -#python3 ./test.py -f 2-query/check_tsdb.py -Q 4 -python3 ./test.py -f 2-query/spread.py -Q 4 -python3 ./test.py -f 2-query/hyperloglog.py -Q 4 -python3 ./test.py -f 2-query/explain.py -Q 4 -python3 ./test.py -f 2-query/leastsquares.py -Q 4 -python3 ./test.py -f 2-query/timezone.py -Q 4 -python3 ./test.py -f 2-query/Now.py -Q 4 -python3 ./test.py -f 2-query/Today.py -Q 4 -python3 ./test.py -f 2-query/max.py -Q 4 -python3 ./test.py -f 2-query/min.py -Q 4 -python3 ./test.py -f 2-query/count.py -Q 4 -#python3 ./test.py -f 2-query/last.py -Q 4 -python3 ./test.py -f 2-query/first.py -Q 4 -python3 ./test.py -f 2-query/To_iso8601.py -Q 4 -python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 4 -python3 ./test.py -f 2-query/timetruncate.py -Q 4 -python3 ./test.py -f 2-query/diff.py -Q 4 -python3 ./test.py -f 2-query/Timediff.py -Q 4 -python3 ./test.py -f 2-query/json_tag.py -Q 4 -python3 ./test.py -f 2-query/top.py -Q 4 -python3 ./test.py -f 2-query/bottom.py -Q 4 -python3 ./test.py -f 2-query/percentile.py -Q 4 -python3 ./test.py -f 2-query/apercentile.py -Q 4 -python3 ./test.py -f 2-query/abs.py -Q 4 -python3 ./test.py -f 2-query/ceil.py -Q 4 -python3 ./test.py -f 2-query/floor.py -Q 4 -python3 ./test.py -f 2-query/round.py -Q 4 -python3 ./test.py -f 2-query/log.py -Q 4 -python3 ./test.py -f 2-query/pow.py -Q 4 -python3 ./test.py -f 2-query/sqrt.py -Q 4 -python3 ./test.py -f 2-query/sin.py -Q 4 -python3 ./test.py -f 2-query/cos.py -Q 4 -python3 ./test.py -f 2-query/tan.py -Q 4 -python3 ./test.py -f 2-query/arcsin.py -Q 4 -python3 ./test.py -f 2-query/arccos.py -Q 4 -python3 ./test.py -f 2-query/arctan.py -Q 4 -python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4 -# python3 ./test.py -f 2-query/nestedQuery.py -Q 4 -# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4 -# python3 ./test.py -f 2-query/avg.py -Q 4 -# python3 ./test.py -f 2-query/elapsed.py -Q 4 -python3 ./test.py -f 2-query/csum.py -Q 4 -#python3 ./test.py -f 2-query/mavg.py -Q 4 -python3 ./test.py -f 2-query/sample.py -Q 4 -python3 ./test.py -f 2-query/function_diff.py -Q 4 -python3 ./test.py -f 2-query/unique.py -Q 4 -python3 ./test.py -f 2-query/stateduration.py -Q 4 -python3 ./test.py -f 2-query/function_stateduration.py -Q 4 -python3 ./test.py -f 2-query/statecount.py -Q 4 -python3 ./test.py -f 2-query/tail.py -Q 4 -python3 ./test.py -f 2-query/ttl_comment.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_max.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_min.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 4 -python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 4 -python3 ./test.py -f 2-query/twa.py -Q 4 -python3 ./test.py -f 2-query/irate.py -Q 4 -python3 ./test.py -f 2-query/function_null.py -Q 4 -python3 ./test.py -f 2-query/count_partition.py -Q 4 -python3 ./test.py -f 2-query/max_partition.py -Q 4 -python3 ./test.py -f 2-query/last_row.py -Q 4 -python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 -#python3 ./test.py -f 2-query/sml.py -Q 4 -python3 ./test.py -f 2-query/interp.py -Q 4 +# python3 ./test.py -f 2-query/between.py -Q 4 +# python3 ./test.py -f 2-query/distinct.py -Q 4 +# python3 ./test.py -f 2-query/varchar.py -Q 4 +# python3 ./test.py -f 2-query/ltrim.py -Q 4 +# python3 ./test.py -f 2-query/rtrim.py -Q 4 +# python3 ./test.py -f 2-query/length.py -Q 4 +# python3 ./test.py -f 2-query/char_length.py -Q 4 +# python3 ./test.py -f 2-query/upper.py -Q 4 +# python3 ./test.py -f 2-query/lower.py -Q 4 +# python3 ./test.py -f 2-query/join.py -Q 4 +# python3 ./test.py -f 2-query/join2.py -Q 4 +# python3 ./test.py -f 2-query/cast.py -Q 4 +# python3 ./test.py -f 2-query/substr.py -Q 4 +# python3 ./test.py -f 2-query/union.py -Q 4 +# python3 ./test.py -f 2-query/union1.py -Q 4 +# python3 ./test.py -f 2-query/concat.py -Q 4 +# python3 ./test.py -f 2-query/concat2.py -Q 4 +# python3 ./test.py -f 2-query/concat_ws.py -Q 4 +# python3 ./test.py -f 2-query/concat_ws2.py -Q 4 +# #python3 ./test.py -f 2-query/check_tsdb.py -Q 4 +# python3 ./test.py -f 2-query/spread.py -Q 4 +# python3 ./test.py -f 2-query/hyperloglog.py -Q 4 +# python3 ./test.py -f 2-query/explain.py -Q 4 +# python3 ./test.py -f 2-query/leastsquares.py -Q 4 +# python3 ./test.py -f 2-query/timezone.py -Q 4 +# python3 ./test.py -f 2-query/Now.py -Q 4 +# python3 ./test.py -f 2-query/Today.py -Q 4 +# python3 ./test.py -f 2-query/max.py -Q 4 +# python3 ./test.py -f 2-query/min.py -Q 4 +# python3 ./test.py -f 2-query/count.py -Q 4 +# #python3 ./test.py -f 2-query/last.py -Q 4 +# python3 ./test.py -f 2-query/first.py -Q 4 +# python3 ./test.py -f 2-query/To_iso8601.py -Q 4 +# python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 4 +# python3 ./test.py -f 2-query/timetruncate.py -Q 4 +# python3 ./test.py -f 2-query/diff.py -Q 4 +# python3 ./test.py -f 2-query/Timediff.py -Q 4 +# python3 ./test.py -f 2-query/json_tag.py -Q 4 +# python3 ./test.py -f 2-query/top.py -Q 4 +# python3 ./test.py -f 2-query/bottom.py -Q 4 +# python3 ./test.py -f 2-query/percentile.py -Q 4 +# python3 ./test.py -f 2-query/apercentile.py -Q 4 +# python3 ./test.py -f 2-query/abs.py -Q 4 +# python3 ./test.py -f 2-query/ceil.py -Q 4 +# python3 ./test.py -f 2-query/floor.py -Q 4 +# python3 ./test.py -f 2-query/round.py -Q 4 +# python3 ./test.py -f 2-query/log.py -Q 4 +# python3 ./test.py -f 2-query/pow.py -Q 4 +# python3 ./test.py -f 2-query/sqrt.py -Q 4 +# python3 ./test.py -f 2-query/sin.py -Q 4 +# python3 ./test.py -f 2-query/cos.py -Q 4 +# python3 ./test.py -f 2-query/tan.py -Q 4 +# python3 ./test.py -f 2-query/arcsin.py -Q 4 +# python3 ./test.py -f 2-query/arccos.py -Q 4 +# python3 ./test.py -f 2-query/arctan.py -Q 4 +# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4 +# # python3 ./test.py -f 2-query/nestedQuery.py -Q 4 +# # python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4 +# # python3 ./test.py -f 2-query/avg.py -Q 4 +# # python3 ./test.py -f 2-query/elapsed.py -Q 4 +# python3 ./test.py -f 2-query/csum.py -Q 4 +# #python3 ./test.py -f 2-query/mavg.py -Q 4 +# python3 ./test.py -f 2-query/sample.py -Q 4 +# python3 ./test.py -f 2-query/function_diff.py -Q 4 +# python3 ./test.py -f 2-query/unique.py -Q 4 +# python3 ./test.py -f 2-query/stateduration.py -Q 4 +# python3 ./test.py -f 2-query/function_stateduration.py -Q 4 +# python3 ./test.py -f 2-query/statecount.py -Q 4 +# python3 ./test.py -f 2-query/tail.py -Q 4 +# python3 ./test.py -f 2-query/ttl_comment.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_max.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_min.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 4 +# python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 4 +# python3 ./test.py -f 2-query/twa.py -Q 4 +# python3 ./test.py -f 2-query/irate.py -Q 4 +# python3 ./test.py -f 2-query/function_null.py -Q 4 +# python3 ./test.py -f 2-query/count_partition.py -Q 4 +# python3 ./test.py -f 2-query/max_partition.py -Q 4 +# python3 ./test.py -f 2-query/last_row.py -Q 4 +# python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 +# #python3 ./test.py -f 2-query/sml.py -Q 4 +# python3 ./test.py -f 2-query/interp.py -Q 4 From 723110c44943ec7d7c07d727f262c39bd7d1d80d Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 19 Oct 2022 19:25:02 +0800 Subject: [PATCH 33/99] feat: add retrieve db and table route info API --- include/client/taos.h | 19 ++++++ include/libs/catalog/catalog.h | 2 +- source/client/src/clientImpl.c | 2 +- source/client/src/clientMain.c | 52 ++++++++++++++++ source/libs/catalog/src/catalog.c | 62 ++++++++++++++++++- source/libs/catalog/test/catalogTests.cpp | 4 +- source/libs/parser/src/parTranslater.c | 4 +- source/libs/parser/test/mockCatalog.cpp | 6 +- .../libs/parser/test/mockCatalogService.cpp | 6 +- 9 files changed, 144 insertions(+), 13 deletions(-) diff --git a/include/client/taos.h b/include/client/taos.h index 1182a9c2f7..211864c0b8 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -126,6 +126,22 @@ typedef struct setConfRet { char retMsg[RET_MSG_LENGTH]; } setConfRet; +typedef struct TAOS_VGROUP_HASH_INFO { + int32_t vgId; + uint32_t hashBegin; + uint32_t hashEnd; +} TAOS_VGROUP_HASH_INFO ; + +typedef struct TAOS_DB_ROUTE_INFO { + int32_t routeVersion; + int16_t hashPrefix; + int16_t hashSuffix; + int8_t hashMethod; + int32_t vgNum; + TAOS_VGROUP_HASH_INFO *vgHash; +} TAOS_DB_ROUTE_INFO ; + + DLL_EXPORT void taos_cleanup(void); DLL_EXPORT int taos_options(TSDB_OPTION option, const void *arg, ...); DLL_EXPORT setConfRet taos_set_config(const char *config); @@ -196,6 +212,9 @@ DLL_EXPORT void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, vo DLL_EXPORT void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param); DLL_EXPORT const void *taos_get_raw_block(TAOS_RES *res); +DLL_EXPORT int taos_get_db_route_info(TAOS* taos, const char* db, TAOS_DB_ROUTE_INFO* dbInfo); +DLL_EXPORT int taos_get_table_vgId(TAOS* taos, const char* table, TAOS_DB_ROUTE_INFO* dbInfo, int* vgId); + DLL_EXPORT int taos_load_table_info(TAOS *taos, const char *tableNameList); DLL_EXPORT TAOS_RES *taos_schemaless_insert(TAOS *taos, char *lines[], int numLines, int protocol, int precision); DLL_EXPORT TAOS_RES *taos_schemaless_insert_raw(TAOS* taos, char* lines, int len, int32_t *totalRows, int protocol, int precision); diff --git a/include/libs/catalog/catalog.h b/include/libs/catalog/catalog.h index d66c8c5949..49cb86fd7d 100644 --- a/include/libs/catalog/catalog.h +++ b/include/libs/catalog/catalog.h @@ -163,7 +163,7 @@ int32_t catalogGetDBVgVersion(SCatalog* pCtg, const char* dbFName, int32_t* vers * @param pVgroupList (output, vgroup info list, element is SVgroupInfo, NEED to simply free the array by caller) * @return error code */ -int32_t catalogGetDBVgInfo(SCatalog* pCatalog, SRequestConnInfo* pConn, const char* pDBName, SArray** pVgroupList); +int32_t catalogGetDBVgList(SCatalog* pCatalog, SRequestConnInfo* pConn, const char* pDBName, SArray** pVgroupList); int32_t catalogUpdateDBVgInfo(SCatalog* pCatalog, const char* dbName, uint64_t dbId, SDBVgInfo* dbInfo); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 7b9009c34b..0bce7d5535 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -643,7 +643,7 @@ int32_t buildSyncExecNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* .requestObjRefId = pRequest->self, .mgmtEps = getEpSet_s(&pInst->mgmtEp)}; - code = catalogGetDBVgInfo(pCtg, &conn, dbFName, &pVgList); + code = catalogGetDBVgList(pCtg, &conn, dbFName, &pVgList); if (code) { goto _return; } diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 286fb85373..995ab8de44 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -989,6 +989,58 @@ const void *taos_get_raw_block(TAOS_RES *res) { return pRequest->body.resInfo.pData; } +int taos_get_db_route_info(TAOS* taos, const char* db, TAOS_DB_ROUTE_INFO* dbInfo) { + if (NULL == taos) { + terrno = TSDB_CODE_TSC_DISCONNECTED; + return terrno; + } + + if (NULL == db || NULL == dbInfo) { + tscError("invalid input param, db:%p, dbInfo:%p", db, dbInfo); + terrno = TSDB_CODE_TSC_INVALID_INPUT; + return terrno; + } + + int64_t connId = *(int64_t *)taos; + SRequestObj *pRequest = NULL; + char *sql = "taos_get_db_route_info"; + int32_t code = buildRequest(connId, sql, strlen(sql), NULL, false, &pRequest); + if (code != TSDB_CODE_SUCCESS) { + return terrno; + } + + STscObj *pTscObj = pRequest->pTscObj; + SCatalog *pCtg = NULL; + code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCtg); + if (code != TSDB_CODE_SUCCESS) { + goto _return; + } + + SRequestConnInfo conn = { + .pTrans = pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self}; + + conn.mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp); + + char dbFName[TSDB_DB_FNAME_LEN] = {0}; + snprintf(dbFName, sizeof(dbFName), "%d.%s", pTscObj->acctId, db); + + code = catalogGetDBVgInfo(pCtg, &conn, dbFName, dbInfo); + if (code) { + goto _return; + } + +_return: + + terrno = code; + + destroyRequest(pRequest); + return code; +} + +int taos_get_table_vgId(TAOS* taos, const char* table, TAOS_DB_ROUTE_INFO* dbInfo, int* vgId) { + +} + int taos_load_table_info(TAOS *taos, const char *tableNameList) { if (NULL == taos) { terrno = TSDB_CODE_TSC_DISCONNECTED; diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index 218a86ed5c..272987b81d 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -725,7 +725,7 @@ _return: CTG_API_LEAVE(code); } -int32_t catalogGetDBVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbFName, SArray** vgroupList) { +int32_t catalogGetDBVgList(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbFName, SArray** vgroupList) { CTG_API_ENTER(); if (NULL == pCtg || NULL == dbFName || NULL == pConn || NULL == vgroupList) { @@ -764,6 +764,66 @@ _return: CTG_API_LEAVE(code); } +int32_t catalogGetDBVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbFName, TAOS_DB_ROUTE_INFO* pInfo) { + CTG_API_ENTER(); + + if (NULL == pCtg || NULL == dbFName || NULL == pConn || NULL == pInfo) { + CTG_API_LEAVE(TSDB_CODE_CTG_INVALID_INPUT); + } + + SCtgDBCache* dbCache = NULL; + int32_t code = 0; + SDBVgInfo* dbInfo = NULL; + CTG_ERR_JRET(ctgGetDBVgInfo(pCtg, pConn, dbFName, &dbCache, &dbInfo)); + if (dbCache) { + dbInfo = dbCache->vgCache.vgInfo; + } + + pInfo->routeVersion = dbInfo->vgVersion; + pInfo->hashPrefix = dbInfo->hashPrefix; + pInfo->hashSuffix = dbInfo->hashSuffix; + pInfo->hashMethod = dbInfo->hashMethod; + pInfo->vgNum = taosHashGetSize(dbInfo->vgHash); + if (pInfo->vgNum <= 0) { + ctgError("invalid vgNum %d in db %s's vgHash", pInfo->vgNum, dbFName); + CTG_ERR_JRET(TSDB_CODE_CTG_INTERNAL_ERROR); + } + + pInfo->vgHash = taosMemoryCalloc(pInfo->vgNum, sizeof(TAOS_VGROUP_HASH_INFO)); + if (NULL == pInfo->vgHash) { + CTG_ERR_JRET(TSDB_CODE_OUT_OF_MEMORY); + } + + SVgroupInfo* vgInfo = NULL; + int32_t i = 0; + void* pIter = taosHashIterate(dbInfo->vgHash, NULL); + while (pIter) { + vgInfo = pIter; + + pInfo->vgHash[i].vgId = vgInfo->vgId; + pInfo->vgHash[i].hashBegin = vgInfo->hashBegin; + pInfo->vgHash[i].hashEnd = vgInfo->hashEnd; + + pIter = taosHashIterate(dbInfo->vgHash, pIter); + vgInfo = NULL; + ++i; + } + +_return: + + if (dbCache) { + ctgRUnlockVgInfo(dbCache); + ctgReleaseDBCache(pCtg, dbCache); + } + + if (dbInfo) { + taosHashCleanup(dbInfo->vgHash); + taosMemoryFreeClear(dbInfo); + } + + CTG_API_LEAVE(code); +} + int32_t catalogUpdateDBVgInfo(SCatalog* pCtg, const char* dbFName, uint64_t dbId, SDBVgInfo* dbInfo) { CTG_API_ENTER(); diff --git a/source/libs/catalog/test/catalogTests.cpp b/source/libs/catalog/test/catalogTests.cpp index bb4fd04aac..065c6234f6 100644 --- a/source/libs/catalog/test/catalogTests.cpp +++ b/source/libs/catalog/test/catalogTests.cpp @@ -778,7 +778,7 @@ void *ctgTestGetDbVgroupThread(void *param) { int32_t n = 0; while (!ctgTestStop) { - code = catalogGetDBVgInfo(pCtg, mockPointer, ctgTestDbname, &vgList); + code = catalogGetDBVgList(pCtg, mockPointer, ctgTestDbname, &vgList); if (code) { assert(0); } @@ -2063,7 +2063,7 @@ TEST(dbVgroup, getSetDbVgroupCase) { strcpy(n.dbname, "db1"); strcpy(n.tname, ctgTestTablename); - code = catalogGetDBVgInfo(pCtg, mockPointer, ctgTestDbname, &vgList); + code = catalogGetDBVgList(pCtg, mockPointer, ctgTestDbname, &vgList); ASSERT_EQ(code, 0); ASSERT_EQ(taosArrayGetSize((const SArray *)vgList), ctgTestVgNum); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 5a05440c73..8dd4577a96 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -417,11 +417,11 @@ static int32_t getDBVgInfoImpl(STranslateContext* pCxt, const SName* pName, SArr .requestId = pParCxt->requestId, .requestObjRefId = pParCxt->requestRid, .mgmtEps = pParCxt->mgmtEpSet}; - code = catalogGetDBVgInfo(pParCxt->pCatalog, &conn, fullDbName, pVgInfo); + code = catalogGetDBVgList(pParCxt->pCatalog, &conn, fullDbName, pVgInfo); } } if (TSDB_CODE_SUCCESS != code) { - parserError("0x%" PRIx64 " catalogGetDBVgInfo error, code:%s, dbFName:%s", pCxt->pParseCxt->requestId, + parserError("0x%" PRIx64 " catalogGetDBVgList error, code:%s, dbFName:%s", pCxt->pParseCxt->requestId, tstrerror(code), fullDbName); } return code; diff --git a/source/libs/parser/test/mockCatalog.cpp b/source/libs/parser/test/mockCatalog.cpp index a40d0f81fc..7f18a7b282 100644 --- a/source/libs/parser/test/mockCatalog.cpp +++ b/source/libs/parser/test/mockCatalog.cpp @@ -243,8 +243,8 @@ int32_t __catalogGetDBVgVersion(SCatalog* pCtg, const char* dbFName, int32_t* ve return 0; } -int32_t __catalogGetDBVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbFName, SArray** pVgList) { - return g_mockCatalogService->catalogGetDBVgInfo(dbFName, pVgList); +int32_t __catalogGetDBVgList(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbFName, SArray** pVgList) { + return g_mockCatalogService->catalogGetDBVgList(dbFName, pVgList); } int32_t __catalogGetDBCfg(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbFName, SDbCfgInfo* pDbCfg) { @@ -293,7 +293,7 @@ void initMetaDataEnv() { stub.set(catalogGetTableHashVgroup, __catalogGetTableHashVgroup); stub.set(catalogGetTableDistVgInfo, __catalogGetTableDistVgInfo); stub.set(catalogGetDBVgVersion, __catalogGetDBVgVersion); - stub.set(catalogGetDBVgInfo, __catalogGetDBVgInfo); + stub.set(catalogGetDBVgList, __catalogGetDBVgList); stub.set(catalogGetDBCfg, __catalogGetDBCfg); stub.set(catalogChkAuth, __catalogChkAuth); stub.set(catalogGetUdfInfo, __catalogGetUdfInfo); diff --git a/source/libs/parser/test/mockCatalogService.cpp b/source/libs/parser/test/mockCatalogService.cpp index 6717a1fdf1..f2cebcb08d 100644 --- a/source/libs/parser/test/mockCatalogService.cpp +++ b/source/libs/parser/test/mockCatalogService.cpp @@ -132,7 +132,7 @@ class MockCatalogServiceImpl { return copyTableVgroup(db, tNameGetTableName(pTableName), vgList); } - int32_t catalogGetDBVgInfo(const char* pDbFName, SArray** pVgList) const { + int32_t catalogGetDBVgList(const char* pDbFName, SArray** pVgList) const { std::string dbFName(pDbFName); DbMetaCache::const_iterator it = meta_.find(dbFName.substr(std::string(pDbFName).find_last_of('.') + 1)); if (meta_.end() == it) { @@ -663,8 +663,8 @@ int32_t MockCatalogService::catalogGetTableDistVgInfo(const SName* pTableName, S return impl_->catalogGetTableDistVgInfo(pTableName, pVgList); } -int32_t MockCatalogService::catalogGetDBVgInfo(const char* pDbFName, SArray** pVgList) const { - return impl_->catalogGetDBVgInfo(pDbFName, pVgList); +int32_t MockCatalogService::catalogGetDBVgList(const char* pDbFName, SArray** pVgList) const { + return impl_->catalogGetDBVgList(pDbFName, pVgList); } int32_t MockCatalogService::catalogGetDBCfg(const char* pDbFName, SDbCfgInfo* pDbCfg) const { From c5b5699c88084dd94407ac8b8d777b3568e7f297 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:41:15 +0800 Subject: [PATCH 34/99] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 8849bcc047..cb14604731 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -78,49 +78,49 @@ int32_t smaCommit(SSma *pSma) { return tdProcessRSmaAsyncCommitImpl(pSma); } int32_t smaPostCommit(SSma *pSma) { return tdProcessRSmaAsyncPostCommitImpl(pSma); } /** - * @brief set rsma trigger stat active + * @brief prepare rsma1/2, and set rsma trigger stat active * * @param pSma * @return int32_t */ int32_t smaBegin(SSma *pSma) { + int32_t code = 0; + SVnode *pVnode = pSma->pVnode; + + if ((code = tsdbBegin(VND_RSMA1(pVnode))) < 0) { + smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(code)); + return TSDB_CODE_FAILED; + } + + if ((code = tsdbBegin(VND_RSMA2(pVnode))) < 0) { + smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(code)); + return TSDB_CODE_FAILED; + } + + // set trigger stat SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); if (!pSmaEnv) { return TSDB_CODE_SUCCESS; } - - SVnode *pVnode = pSma->pVnode; SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); - - int8_t rsmaTriggerStat = + int8_t rsmaTriggerStat = atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_PAUSED, TASK_TRIGGER_STAT_ACTIVE); switch (rsmaTriggerStat) { case TASK_TRIGGER_STAT_PAUSED: { - smaDebug("vgId:%d, rsma trigger stat from paused to active", SMA_VID(pSma)); + smaDebug("vgId:%d, rsma trigger stat from paused to active", TD_VID(pVnode)); break; } case TASK_TRIGGER_STAT_INIT: { atomic_store_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_ACTIVE); - smaDebug("vgId:%d, rsma trigger stat from init to active", SMA_VID(pSma)); + smaDebug("vgId:%d, rsma trigger stat from init to active", TD_VID(pVnode)); break; } default: { atomic_store_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_ACTIVE); - smaError("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", SMA_VID(pSma), rsmaTriggerStat); + smaError("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", TD_VID(pVnode), rsmaTriggerStat); break; } } - - if (VND_RSMA1(pVnode) && tsdbBegin(VND_RSMA1(pVnode)) < 0) { - smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(terrno)); - return TSDB_CODE_FAILED; - } - - if (VND_RSMA2(pVnode) && tsdbBegin(VND_RSMA2(pVnode)) < 0) { - smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(terrno)); - return TSDB_CODE_FAILED; - } - return TSDB_CODE_SUCCESS; } From 20d812fdaadc5a67da1d05563d45890afc17b3eb Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:43:59 +0800 Subject: [PATCH 35/99] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index cb14604731..f0a0f80ca1 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -89,18 +89,18 @@ int32_t smaBegin(SSma *pSma) { if ((code = tsdbBegin(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(code)); - return TSDB_CODE_FAILED; + return code; } if ((code = tsdbBegin(VND_RSMA2(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(code)); - return TSDB_CODE_FAILED; + return code; } // set trigger stat SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); if (!pSmaEnv) { - return TSDB_CODE_SUCCESS; + return code; } SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); int8_t rsmaTriggerStat = @@ -121,7 +121,7 @@ int32_t smaBegin(SSma *pSma) { break; } } - return TSDB_CODE_SUCCESS; + return code; } int32_t smaFinishCommit(SSma *pSma) { From e9977800440a23049ce5b73e0eaab5c696c5d422 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:52:09 +0800 Subject: [PATCH 36/99] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 10 ++-------- source/dnode/vnode/src/vnd/vnodeCommit.c | 12 ++++++------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index f0a0f80ca1..90ee786188 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -131,10 +131,7 @@ int32_t smaFinishCommit(SSma *pSma) { if (!pSmaEnv) { goto _exit; } - if (VND_RSMA0(pVnode) && (code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { - smaError("vgId:%d, failed to finish commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); - goto _exit; - } + if (VND_RSMA1(pVnode) && (code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; @@ -407,10 +404,7 @@ static int32_t tdProcessRSmaAsyncCommitImpl(SSma *pSma) { return TSDB_CODE_FAILED; } #endif - if ((code = tsdbCommit(VND_RSMA0(pVnode))) < 0) { - smaError("vgId:%d, failed to commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); - goto _exit; - } + if ((code = tsdbCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 2ca59ef45a..7e471ddfe5 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -239,12 +239,12 @@ int vnodeCommit(SVnode *pVnode) { TSDB_CHECK_CODE(code, lino, _exit); } + code = tsdbCommit(pVnode->pTsdb); + TSDB_CHECK_CODE(code, lino, _exit); + if (VND_IS_RSMA(pVnode)) { code = smaCommit(pVnode->pSma); TSDB_CHECK_CODE(code, lino, _exit); - } else { - code = tsdbCommit(pVnode->pTsdb); - TSDB_CHECK_CODE(code, lino, _exit); } if (tqCommit(pVnode->pTq) < 0) { @@ -258,12 +258,12 @@ int vnodeCommit(SVnode *pVnode) { TSDB_CHECK_CODE(code, lino, _exit); } + code = tsdbFinishCommit(pVnode->pTsdb); + TSDB_CHECK_CODE(code, lino, _exit); + if (VND_IS_RSMA(pVnode)) { code = smaFinishCommit(pVnode->pSma); TSDB_CHECK_CODE(code, lino, _exit); - } else { - code = tsdbFinishCommit(pVnode->pTsdb); - TSDB_CHECK_CODE(code, lino, _exit); } if (metaFinishCommit(pVnode->pMeta) < 0) { From 706aa1da1ed91215469b3a993144798c2adcf760 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:59:35 +0800 Subject: [PATCH 37/99] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 10 ++++++---- source/dnode/vnode/src/vnd/vnodeCommit.c | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 90ee786188..57b8623e4b 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -89,18 +89,18 @@ int32_t smaBegin(SSma *pSma) { if ((code = tsdbBegin(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(code)); - return code; + goto _exit; } if ((code = tsdbBegin(VND_RSMA2(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(code)); - return code; + goto _exit; } // set trigger stat SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); if (!pSmaEnv) { - return code; + goto _exit; } SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); int8_t rsmaTriggerStat = @@ -117,10 +117,12 @@ int32_t smaBegin(SSma *pSma) { } default: { atomic_store_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_ACTIVE); - smaError("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", TD_VID(pVnode), rsmaTriggerStat); + smaWarn("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", TD_VID(pVnode), rsmaTriggerStat); break; } } +_exit: + terrno = code; return code; } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 7e471ddfe5..c88c095bb5 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -52,7 +52,10 @@ int vnodeBegin(SVnode *pVnode) { } // begin sma - smaBegin(pVnode->pSma); + if (smaBegin(pVnode->pSma) < 0) { + vError("vgId:%d, failed to begin sma since %s", TD_VID(pVnode), tstrerror(terrno)); + return -1; + } return 0; } From 5abfeb47ca81b24dac7412b9e7b8a663ea50121a Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 20:25:42 +0800 Subject: [PATCH 38/99] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 57b8623e4b..ac41b6c00a 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -129,10 +129,6 @@ _exit: int32_t smaFinishCommit(SSma *pSma) { int32_t code = 0; SVnode *pVnode = pSma->pVnode; - SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); - if (!pSmaEnv) { - goto _exit; - } if (VND_RSMA1(pVnode) && (code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); From 360445488dc52d97bdebe51f4b30beb672fd6bb2 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Wed, 19 Oct 2022 20:49:02 +0800 Subject: [PATCH 39/99] Update run_case.sh --- tests/parallel_test/run_case.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index e0b905375a..2a828eaad0 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -81,3 +81,5 @@ fi exit $RET +sleep 1800 + From 8ae44a23649453187350516b940e57a47669dad3 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Wed, 19 Oct 2022 20:50:20 +0800 Subject: [PATCH 40/99] Update fulltest.sh --- tests/develop-test/fulltest.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/develop-test/fulltest.sh b/tests/develop-test/fulltest.sh index 69cade3855..4e782b3e02 100644 --- a/tests/develop-test/fulltest.sh +++ b/tests/develop-test/fulltest.sh @@ -2,19 +2,19 @@ set -e set -x -python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py -#python3 ./test.py -f 5-taos-tools/taosbenchmark/commandline.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py -#python3 ./test.py -f 5-taos-tools/taosbenchmark/limit_offset_json.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py -#python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_interlace.py -python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py -#python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_telnet_alltypes.py -#python3 ./test.py -f 5-taos-tools/taosbenchmark/taosadapter_json.py -#python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py +# #python3 ./test.py -f 5-taos-tools/taosbenchmark/commandline.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py +# #python3 ./test.py -f 5-taos-tools/taosbenchmark/limit_offset_json.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py +# #python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_interlace.py +# python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py +# #python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_telnet_alltypes.py +# #python3 ./test.py -f 5-taos-tools/taosbenchmark/taosadapter_json.py +# #python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py From 17e1d400aa2f9f1b72d10b2a49b1f7da57d1a1a0 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Wed, 19 Oct 2022 22:38:13 +0800 Subject: [PATCH 41/99] Update run_case.sh --- tests/parallel_test/run_case.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 2a828eaad0..9ace923d64 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -79,7 +79,8 @@ if [ $RET -ne 0 ]; then pwd fi -exit $RET - sleep 1800 +exit $RET + + From 573c6e5814f7e717622329a671ba9a670fc9002d Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 11:45:07 +0800 Subject: [PATCH 42/99] Update compatibility.py --- tests/system-test/0-others/compatibility.py | 128 ++++++++++---------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index 25b023bb76..f2f2e5ca4c 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -78,77 +78,77 @@ class TDTestCase: def run(self): bPath=self.getBuildPath() cPath=self.getCfgPath() - dbname = "test" - stb = f"{dbname}.meters" - self.installTaosd(bPath,cPath) - tableNumbers=100 - recordNumbers1=100 - recordNumbers2=1000 - tdsqlF=tdCom.newTdSql() - print(tdsqlF) - tdsqlF.query(f"SELECT SERVER_VERSION();") - print(tdsqlF.query(f"SELECT SERVER_VERSION();")) - oldServerVersion=tdsqlF.queryResult[0][0] - tdLog.info(f"Base server version is {oldServerVersion}") - tdsqlF.query(f"SELECT CLIENT_VERSION();") - # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison - oldClientVersion=tdsqlF.queryResult[0][0] - tdLog.info(f"Base client version is {oldClientVersion}") +# dbname = "test" +# stb = f"{dbname}.meters" +# self.installTaosd(bPath,cPath) +# tableNumbers=100 +# recordNumbers1=100 +# recordNumbers2=1000 +# tdsqlF=tdCom.newTdSql() +# print(tdsqlF) +# tdsqlF.query(f"SELECT SERVER_VERSION();") +# print(tdsqlF.query(f"SELECT SERVER_VERSION();")) +# oldServerVersion=tdsqlF.queryResult[0][0] +# tdLog.info(f"Base server version is {oldServerVersion}") +# tdsqlF.query(f"SELECT CLIENT_VERSION();") +# # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison +# oldClientVersion=tdsqlF.queryResult[0][0] +# tdLog.info(f"Base client version is {oldClientVersion}") - tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") - tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") - os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") - sleep(3) +# tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") +# tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") +# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") +# sleep(3) - # tdsqlF.query(f"select count(*) from {stb}") - # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) - os.system("pkill taosd") - sleep(1) +# # tdsqlF.query(f"select count(*) from {stb}") +# # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) +# os.system("pkill taosd") +# sleep(1) - tdLog.printNoPrefix("==========step2:update new version ") - self.buildTaosd(bPath) - tdDnodes.start(1) - sleep(1) - tdsql=tdCom.newTdSql() - print(tdsql) +# tdLog.printNoPrefix("==========step2:update new version ") +# self.buildTaosd(bPath) +# tdDnodes.start(1) +# sleep(1) +# tdsql=tdCom.newTdSql() +# print(tdsql) - tdsql.query(f"SELECT SERVER_VERSION();") - nowServerVersion=tdsql.queryResult[0][0] - tdLog.info(f"New server version is {nowServerVersion}") - tdsql.query(f"SELECT CLIENT_VERSION();") - nowClientVersion=tdsql.queryResult[0][0] - tdLog.info(f"New client version is {nowClientVersion}") +# tdsql.query(f"SELECT SERVER_VERSION();") +# nowServerVersion=tdsql.queryResult[0][0] +# tdLog.info(f"New server version is {nowServerVersion}") +# tdsql.query(f"SELECT CLIENT_VERSION();") +# nowClientVersion=tdsql.queryResult[0][0] +# tdLog.info(f"New client version is {nowClientVersion}") - tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") - tdsql.query(f"select count(*) from {stb}") - tdsql.checkData(0,0,tableNumbers*recordNumbers1) - os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") - tdsql.query(f"select count(*) from {stb}") - tdsql.checkData(0,0,tableNumbers*recordNumbers2) +# tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") +# tdsql.query(f"select count(*) from {stb}") +# tdsql.checkData(0,0,tableNumbers*recordNumbers1) +# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") +# tdsql.query(f"select count(*) from {stb}") +# tdsql.checkData(0,0,tableNumbers*recordNumbers2) - tdsql=tdCom.newTdSql() - tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") - tdsql.execute("drop database if exists db") - tdsql.execute("create database db") - tdsql.execute("use db") - tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") - tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") - tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") - tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") - tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") - tdsql.query("select * from db.ct3") - tdsql.checkData(0,1,13) - tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") - tdsql.query("select * from db.ct4") - tdsql.checkData(0,1,14) - tdsql.query("describe information_schema.ins_databases;") - qRows=tdsql.queryRows - for i in range(qRows) : - if tdsql.queryResult[i][0]=="retentions" : - return True - else: - return False +# tdsql=tdCom.newTdSql() +# tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") +# tdsql.execute("drop database if exists db") +# tdsql.execute("create database db") +# tdsql.execute("use db") +# tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") +# tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") +# tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") +# tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") +# tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") +# tdsql.query("select * from db.ct3") +# tdsql.checkData(0,1,13) +# tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") +# tdsql.query("select * from db.ct4") +# tdsql.checkData(0,1,14) +# tdsql.query("describe information_schema.ins_databases;") +# qRows=tdsql.queryRows +# for i in range(qRows) : +# if tdsql.queryResult[i][0]=="retentions" : +# return True +# else: +# return False def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") From 204ebfc1ac9ef1ec0fe8d779aa89f3777e1b5883 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 13:20:00 +0800 Subject: [PATCH 43/99] Update run_container.sh --- tests/parallel_test/run_container.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index 47a918f8d1..92ab8493a0 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -68,7 +68,7 @@ if [ $ent -ne 0 ]; then CONTAINER_TESTDIR=/home/TDinternal/community SIM_DIR=/home/TDinternal/sim REP_MOUNT_PARAM="$INTERNAL_REPDIR:/home/TDinternal" - REP_MOUNT_LIB="$INTERNAL_REPDIR/debug/build/lib:/home/TDinternal/debug/build/lib:ro" + REP_MOUNT_LIB="$INTERNAL_REPDIR/debug/build/lib:/home/TDinternal/debug/build/lib" else # community edition @@ -76,7 +76,7 @@ else CONTAINER_TESTDIR=/home/TDengine SIM_DIR=/home/TDengine/sim REP_MOUNT_PARAM="$REPDIR:/home/TDengine" - REP_MOUNT_LIB="$REPDIR/debug/build/lib:/home/TDengine/debug/build/lib:ro" + REP_MOUNT_LIB="$REPDIR/debug/build/lib:/home/TDengine/debug/build/lib" fi From 659a5ab384cfa1a9791a1a0f6623b06250741a20 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Thu, 20 Oct 2022 14:18:21 +0800 Subject: [PATCH 44/99] fix: resolve a format issue of printf in hashTest.cpp --- source/util/test/hashTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/util/test/hashTest.cpp b/source/util/test/hashTest.cpp index 7c9283464e..76fb9c7067 100644 --- a/source/util/test/hashTest.cpp +++ b/source/util/test/hashTest.cpp @@ -216,7 +216,7 @@ void perfTest() { char* name = (char*)taosMemoryCalloc(50000000, 9); for (int64_t i = 0; i < 50000000; ++i) { - sprintf(name + i * 9, "t%08d", i); + sprintf(name + i * 9, "t%08" PRId64, i); } for (int64_t i = 0; i < 50; ++i) { From b3658f983f4ceecb7f789c49c823039fa2b21217 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 20 Oct 2022 14:35:34 +0800 Subject: [PATCH 45/99] fix: last constant error --- source/libs/planner/src/planOptimizer.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 2e2e4e6dcf..3171bb531b 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -2139,20 +2139,28 @@ static int32_t rewriteUniqueOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLog return rewriteUniqueOptimizeImpl(pCxt, pLogicSubplan, pIndef); } -static EDealRes lastRowScanOptHasTagImpl(SNode* pNode, void* pContext) { +typedef struct SLastRowScanOptLastParaCkCxt { + bool hasTag; + bool hasCol; +} SLastRowScanOptLastParaCkCxt; + +static EDealRes lastRowScanOptLastParaCheckImpl(SNode* pNode, void* pContext) { if (QUERY_NODE_COLUMN == nodeType(pNode)) { + SLastRowScanOptLastParaCkCxt* pCxt = pContext; if (COLUMN_TYPE_TAG == ((SColumnNode*)pNode)->colType || COLUMN_TYPE_TBNAME == ((SColumnNode*)pNode)->colType) { - *(bool*)pContext = true; - return DEAL_RES_END; + pCxt->hasTag = true; + } else { + pCxt->hasCol = true; } + return DEAL_RES_END; } return DEAL_RES_CONTINUE; } -static bool lastRowScanOptHasTag(SNode* pExpr) { - bool hasTag = false; - nodesWalkExpr(pExpr, lastRowScanOptHasTagImpl, &hasTag); - return hasTag; +static bool lastRowScanOptLastParaCheck(SNode* pExpr) { + SLastRowScanOptLastParaCkCxt cxt = {.hasTag = false, .hasCol = false}; + nodesWalkExpr(pExpr, lastRowScanOptLastParaCheckImpl, &cxt); + return !cxt.hasTag && cxt.hasCol; } static bool hasSuitableCache(int8_t cacheLastMode, bool hasLastRow, bool hasLast) { @@ -2192,7 +2200,7 @@ static bool lastRowScanOptMayBeOptimized(SLogicNode* pNode) { FOREACH(pFunc, ((SAggLogicNode*)pNode)->pAggFuncs) { SFunctionNode* pAggFunc = (SFunctionNode*)pFunc; if (FUNCTION_TYPE_LAST == pAggFunc->funcType) { - if (hasSelectFunc || lastRowScanOptHasTag(nodesListGetNode(pAggFunc->pParameterList, 0))) { + if (hasSelectFunc || !lastRowScanOptLastParaCheck(nodesListGetNode(pAggFunc->pParameterList, 0))) { return false; } hasLastFunc = true; From 858d13a7c09740050ca43edb60bf0b77f6192304 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 15:01:14 +0800 Subject: [PATCH 46/99] Update compatibility.py --- tests/system-test/0-others/compatibility.py | 128 ++++++++++---------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index f2f2e5ca4c..25b023bb76 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -78,77 +78,77 @@ class TDTestCase: def run(self): bPath=self.getBuildPath() cPath=self.getCfgPath() -# dbname = "test" -# stb = f"{dbname}.meters" -# self.installTaosd(bPath,cPath) -# tableNumbers=100 -# recordNumbers1=100 -# recordNumbers2=1000 -# tdsqlF=tdCom.newTdSql() -# print(tdsqlF) -# tdsqlF.query(f"SELECT SERVER_VERSION();") -# print(tdsqlF.query(f"SELECT SERVER_VERSION();")) -# oldServerVersion=tdsqlF.queryResult[0][0] -# tdLog.info(f"Base server version is {oldServerVersion}") -# tdsqlF.query(f"SELECT CLIENT_VERSION();") -# # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison -# oldClientVersion=tdsqlF.queryResult[0][0] -# tdLog.info(f"Base client version is {oldClientVersion}") + dbname = "test" + stb = f"{dbname}.meters" + self.installTaosd(bPath,cPath) + tableNumbers=100 + recordNumbers1=100 + recordNumbers2=1000 + tdsqlF=tdCom.newTdSql() + print(tdsqlF) + tdsqlF.query(f"SELECT SERVER_VERSION();") + print(tdsqlF.query(f"SELECT SERVER_VERSION();")) + oldServerVersion=tdsqlF.queryResult[0][0] + tdLog.info(f"Base server version is {oldServerVersion}") + tdsqlF.query(f"SELECT CLIENT_VERSION();") + # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison + oldClientVersion=tdsqlF.queryResult[0][0] + tdLog.info(f"Base client version is {oldClientVersion}") -# tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") -# tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") -# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") -# sleep(3) + tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") + tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") + os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") + sleep(3) -# # tdsqlF.query(f"select count(*) from {stb}") -# # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) -# os.system("pkill taosd") -# sleep(1) + # tdsqlF.query(f"select count(*) from {stb}") + # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) + os.system("pkill taosd") + sleep(1) -# tdLog.printNoPrefix("==========step2:update new version ") -# self.buildTaosd(bPath) -# tdDnodes.start(1) -# sleep(1) -# tdsql=tdCom.newTdSql() -# print(tdsql) + tdLog.printNoPrefix("==========step2:update new version ") + self.buildTaosd(bPath) + tdDnodes.start(1) + sleep(1) + tdsql=tdCom.newTdSql() + print(tdsql) -# tdsql.query(f"SELECT SERVER_VERSION();") -# nowServerVersion=tdsql.queryResult[0][0] -# tdLog.info(f"New server version is {nowServerVersion}") -# tdsql.query(f"SELECT CLIENT_VERSION();") -# nowClientVersion=tdsql.queryResult[0][0] -# tdLog.info(f"New client version is {nowClientVersion}") + tdsql.query(f"SELECT SERVER_VERSION();") + nowServerVersion=tdsql.queryResult[0][0] + tdLog.info(f"New server version is {nowServerVersion}") + tdsql.query(f"SELECT CLIENT_VERSION();") + nowClientVersion=tdsql.queryResult[0][0] + tdLog.info(f"New client version is {nowClientVersion}") -# tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") -# tdsql.query(f"select count(*) from {stb}") -# tdsql.checkData(0,0,tableNumbers*recordNumbers1) -# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") -# tdsql.query(f"select count(*) from {stb}") -# tdsql.checkData(0,0,tableNumbers*recordNumbers2) + tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") + tdsql.query(f"select count(*) from {stb}") + tdsql.checkData(0,0,tableNumbers*recordNumbers1) + os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") + tdsql.query(f"select count(*) from {stb}") + tdsql.checkData(0,0,tableNumbers*recordNumbers2) -# tdsql=tdCom.newTdSql() -# tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") -# tdsql.execute("drop database if exists db") -# tdsql.execute("create database db") -# tdsql.execute("use db") -# tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") -# tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") -# tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") -# tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") -# tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") -# tdsql.query("select * from db.ct3") -# tdsql.checkData(0,1,13) -# tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") -# tdsql.query("select * from db.ct4") -# tdsql.checkData(0,1,14) -# tdsql.query("describe information_schema.ins_databases;") -# qRows=tdsql.queryRows -# for i in range(qRows) : -# if tdsql.queryResult[i][0]=="retentions" : -# return True -# else: -# return False + tdsql=tdCom.newTdSql() + tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") + tdsql.execute("drop database if exists db") + tdsql.execute("create database db") + tdsql.execute("use db") + tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") + tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") + tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") + tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") + tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") + tdsql.query("select * from db.ct3") + tdsql.checkData(0,1,13) + tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") + tdsql.query("select * from db.ct4") + tdsql.checkData(0,1,14) + tdsql.query("describe information_schema.ins_databases;") + qRows=tdsql.queryRows + for i in range(qRows) : + if tdsql.queryResult[i][0]=="retentions" : + return True + else: + return False def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") From b42960cbfa8fab492db878b4a120fd4bfb7d3920 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 15:01:44 +0800 Subject: [PATCH 47/99] Update run_case.sh --- tests/parallel_test/run_case.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 9ace923d64..0da68ad618 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -79,7 +79,7 @@ if [ $RET -ne 0 ]; then pwd fi -sleep 1800 +sleep 3600 exit $RET From 7c133359ce7baf5595dd10c42e491546db2201a2 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 20 Oct 2022 15:13:39 +0800 Subject: [PATCH 48/99] feat: add retrieve db and table route info api --- include/client/taos.h | 2 +- include/libs/catalog/catalog.h | 2 + source/client/src/clientMain.c | 50 +++++++- source/libs/catalog/src/catalog.c | 4 +- tests/script/api/dbTableRoute.c | 195 ++++++++++++++++++++++++++++++ tests/script/api/makefile | 1 + 6 files changed, 249 insertions(+), 5 deletions(-) create mode 100644 tests/script/api/dbTableRoute.c diff --git a/include/client/taos.h b/include/client/taos.h index 211864c0b8..44443752c5 100644 --- a/include/client/taos.h +++ b/include/client/taos.h @@ -213,7 +213,7 @@ DLL_EXPORT void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t f DLL_EXPORT const void *taos_get_raw_block(TAOS_RES *res); DLL_EXPORT int taos_get_db_route_info(TAOS* taos, const char* db, TAOS_DB_ROUTE_INFO* dbInfo); -DLL_EXPORT int taos_get_table_vgId(TAOS* taos, const char* table, TAOS_DB_ROUTE_INFO* dbInfo, int* vgId); +DLL_EXPORT int taos_get_table_vgId(TAOS* taos, const char* db, const char* table, int* vgId); DLL_EXPORT int taos_load_table_info(TAOS *taos, const char *tableNameList); DLL_EXPORT TAOS_RES *taos_schemaless_insert(TAOS *taos, char *lines[], int numLines, int protocol, int precision); diff --git a/include/libs/catalog/catalog.h b/include/libs/catalog/catalog.h index 49cb86fd7d..9f1513d100 100644 --- a/include/libs/catalog/catalog.h +++ b/include/libs/catalog/catalog.h @@ -165,6 +165,8 @@ int32_t catalogGetDBVgVersion(SCatalog* pCtg, const char* dbFName, int32_t* vers */ int32_t catalogGetDBVgList(SCatalog* pCatalog, SRequestConnInfo* pConn, const char* pDBName, SArray** pVgroupList); +int32_t catalogGetDBVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char* dbFName, TAOS_DB_ROUTE_INFO* pInfo); + int32_t catalogUpdateDBVgInfo(SCatalog* pCatalog, const char* dbName, uint64_t dbId, SDBVgInfo* dbInfo); int32_t catalogRemoveDB(SCatalog* pCatalog, const char* dbName, uint64_t dbId); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 995ab8de44..8036e50545 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -1006,6 +1006,7 @@ int taos_get_db_route_info(TAOS* taos, const char* db, TAOS_DB_ROUTE_INFO* dbInf char *sql = "taos_get_db_route_info"; int32_t code = buildRequest(connId, sql, strlen(sql), NULL, false, &pRequest); if (code != TSDB_CODE_SUCCESS) { + terrno = code; return terrno; } @@ -1037,8 +1038,55 @@ _return: return code; } -int taos_get_table_vgId(TAOS* taos, const char* table, TAOS_DB_ROUTE_INFO* dbInfo, int* vgId) { +int taos_get_table_vgId(TAOS* taos, const char* db, const char* table, int* vgId) { + if (NULL == taos) { + terrno = TSDB_CODE_TSC_DISCONNECTED; + return terrno; + } + if (NULL == db || NULL == table || NULL == vgId) { + tscError("invalid input param, db:%p, table:%p, vgId:%p", db, table, vgId); + terrno = TSDB_CODE_TSC_INVALID_INPUT; + return terrno; + } + + int64_t connId = *(int64_t *)taos; + SRequestObj *pRequest = NULL; + char *sql = "taos_get_table_vgId"; + int32_t code = buildRequest(connId, sql, strlen(sql), NULL, false, &pRequest); + if (code != TSDB_CODE_SUCCESS) { + return terrno; + } + + STscObj *pTscObj = pRequest->pTscObj; + SCatalog *pCtg = NULL; + code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCtg); + if (code != TSDB_CODE_SUCCESS) { + goto _return; + } + + SRequestConnInfo conn = { + .pTrans = pTscObj->pAppInfo->pTransporter, .requestId = pRequest->requestId, .requestObjRefId = pRequest->self}; + + conn.mgmtEps = getEpSet_s(&pTscObj->pAppInfo->mgmtEp); + + SName tableName; + toName(pTscObj->acctId, db, table, &tableName); + + SVgroupInfo vgInfo; + code = catalogGetTableHashVgroup(pCtg, &conn, &tableName, &vgInfo); + if (code) { + goto _return; + } + + *vgId = vgInfo.vgId; + +_return: + + terrno = code; + + destroyRequest(pRequest); + return code; } int taos_load_table_info(TAOS *taos, const char *tableNameList) { diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index 272987b81d..598e24cd06 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -814,9 +814,7 @@ _return: if (dbCache) { ctgRUnlockVgInfo(dbCache); ctgReleaseDBCache(pCtg, dbCache); - } - - if (dbInfo) { + } else if (dbInfo) { taosHashCleanup(dbInfo->vgHash); taosMemoryFreeClear(dbInfo); } diff --git a/tests/script/api/dbTableRoute.c b/tests/script/api/dbTableRoute.c new file mode 100644 index 0000000000..2cf721875a --- /dev/null +++ b/tests/script/api/dbTableRoute.c @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +// TAOS asynchronous API example +// this example opens multiple tables, insert/retrieve multiple tables +// it is used by TAOS internally for one performance testing +// to compiple: gcc -o asyncdemo asyncdemo.c -ltaos + +#include +#include +#include +#include +#include +#include +#include "taos.h" + +int rtTables = 20; +char hostName[128]; + +static void rtExecSQL(TAOS *taos, char *command) { + int i; + int32_t code = -1; + + TAOS_RES *pSql = taos_query(taos, command); + code = taos_errno(pSql); + if (code != 0) { + fprintf(stderr, "Failed to run %s, reason: %s\n", command, taos_errstr(pSql)); + taos_free_result(pSql); + taos_close(taos); + taos_cleanup(); + exit(EXIT_FAILURE); + } + + taos_free_result(pSql); +} + +static void rtFetchVgId(TAOS *taos, char *sql, int *vgId) { + int i; + int32_t code = -1; + + TAOS_RES *pSql = taos_query(taos, sql); + code = taos_errno(pSql); + if (code != 0) { + fprintf(stderr, "Failed to run %s, reason: %s\n", sql, taos_errstr(pSql)); + taos_free_result(pSql); + taos_close(taos); + taos_cleanup(); + exit(EXIT_FAILURE); + } + + TAOS_ROW row = taos_fetch_row(pSql); + + *vgId = *(int*)row[0]; + + taos_free_result(pSql); +} + +void rtError(char* prefix, const char* errMsg) { + fprintf(stderr, "%s error: %s\n", prefix, errMsg); +} + +void rtExit(char* prefix, const char* errMsg) { + rtError(prefix, errMsg); + exit(1); +} + +int rtPrepare(TAOS ** p, int prefix, int suffix) { + char sql[1024] = {0}; + int32_t code = 0; + TAOS *taos = taos_connect(hostName, "root", "taosdata", NULL, 0); + if (taos == NULL) rtExit("taos_connect", taos_errstr(NULL)); + + strcpy(sql, "drop database if exists db1"); + rtExecSQL(taos, sql); + + sprintf(sql, "create database db1 vgroups 10 table_prefix %d table_suffix %d", prefix, suffix); + rtExecSQL(taos, sql); + + strcpy(sql, "use db1"); + rtExecSQL(taos, sql); + + for (int32_t i = 0; i < rtTables; ++i) { + sprintf(sql, "create table tb%d (ts timestamp, f1 int)", i); + rtExecSQL(taos, sql); + } + + *p = taos; + + return 0; +} + +int rtGetDbRouteInfo(TAOS * taos) { + TAOS_DB_ROUTE_INFO dbInfo; + int code = taos_get_db_route_info(taos, "db1", &dbInfo); + if (code) { + rtExit("taos_get_db_route_info", taos_errstr(NULL)); + } + + printf("db db1 routeVersion:%d hashPrefix:%d hashSuffix:%d hashMethod:%d vgNum %d\n", + dbInfo.routeVersion, dbInfo.hashPrefix, dbInfo.hashSuffix, dbInfo.hashMethod, dbInfo.vgNum); + + for (int32_t i = 0; i < dbInfo.vgNum; ++i) { + printf("%dth vg, id:%d hashBegin:%u hashEnd:%u\n", + i, dbInfo.vgHash[i].vgId, dbInfo.vgHash[i].hashBegin, dbInfo.vgHash[i].hashEnd); + } + + return 0; +} + +int rtGetTableRouteInfo(TAOS * taos) { + char table[64] = {0}; + int vgId1 = 0; + int vgId2 = 0; + char sql[1024] = {0}; + for (int32_t i = 0; i < rtTables; ++i) { + sprintf(table, "tb%d", i); + int code = taos_get_table_vgId(taos, "db1", table, &vgId1); + if (code) { + rtExit("taos_get_table_vgId", taos_errstr(NULL)); + } + + sprintf(sql, "select vgroup_id from information_schema.ins_tables where table_name=\"tb%d\"", i); + + rtFetchVgId(taos, sql, &vgId2); + if (vgId1 != vgId2) { + fprintf(stderr, "!!!! table tb%d vgId mis-match, vgId(api):%d, vgId(sys):%d\n", i, vgId1, vgId2); + exit(1); + } else { + printf("table tb%d vgId %d\n", i, vgId1); + } + } + + return 0; +} + +void rtClose(TAOS * taos) { + taos_close(taos); +} + + +int rtRunCase1(void) { + TAOS *taos = NULL; + rtPrepare(&taos, 0, 0); + rtGetDbRouteInfo(taos); + rtGetTableRouteInfo(taos); + rtClose(taos); + + return 0; +} + +int rtRunCase2(void) { + TAOS *taos = NULL; + rtPrepare(&taos, 2, 0); + rtGetTableRouteInfo(taos); + rtGetDbRouteInfo(taos); + rtClose(taos); + + return 0; +} + +int main(int argc, char *argv[]) { + if (argc != 2) { + printf("usage: %s server-ip\n", argv[0]); + exit(0); + } + + srand((unsigned int)time(NULL)); + + strcpy(hostName, argv[1]); + + rtRunCase1(); + rtRunCase2(); + + int32_t l = 5; + while (l) { + printf("%d\n", l--); + sleep(1); + } + + return 0; +} + + diff --git a/tests/script/api/makefile b/tests/script/api/makefile index 1f725f17c9..52c9fcbdf8 100644 --- a/tests/script/api/makefile +++ b/tests/script/api/makefile @@ -13,6 +13,7 @@ all: $(TARGET) exe: gcc $(CFLAGS) ./batchprepare.c -o $(ROOT)batchprepare $(LFLAGS) gcc $(CFLAGS) ./stopquery.c -o $(ROOT)stopquery $(LFLAGS) + gcc $(CFLAGS) ./dbTableRoute.c -o $(ROOT)dbTableRoute $(LFLAGS) clean: rm $(ROOT)batchprepare From 06f5d91d217021e89aa2a86169a51294978bb4e6 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Thu, 20 Oct 2022 15:17:28 +0800 Subject: [PATCH 49/99] enh: provide more info on misalignment detection of idx entries after appending --- source/libs/wal/src/walWrite.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 3354308c49..6469228452 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -424,7 +424,12 @@ static int32_t walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) { return -1; } - ASSERT(taosLSeekFile(pWal->pIdxFile, 0, SEEK_END) == idxOffset + sizeof(SWalIdxEntry) && "Offset of idx entries misaligned"); + // check alignment of idx entries + int64_t endOffset = taosLSeekFile(pWal->pIdxFile, 0, SEEK_END); + if (endOffset < 0) { + wFatal("vgId:%d, failed to seek end of idxfile due to %s. ver:%" PRId64 "", pWal->cfg.vgId, strerror(errno), ver); + } + ASSERT(endOffset == idxOffset + sizeof(SWalIdxEntry) && "Offset of idx entries misaligned"); return 0; } From ace84638b8e0f01a0c5c54fb2f5a9bf135a132f0 Mon Sep 17 00:00:00 2001 From: slzhou Date: Thu, 20 Oct 2022 15:30:13 +0800 Subject: [PATCH 50/99] fix: add udf call and uv synchronization with uv_mutex --- source/libs/function/src/tudf.c | 65 ++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index 69e58829a0..f3a724d4da 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -339,10 +339,11 @@ typedef struct SUdfcProxy { uv_mutex_t udfStubsMutex; SArray *udfStubs; // SUdfcFuncStub + uv_mutex_t udfcUvMutex; int8_t initialized; } SUdfcProxy; -SUdfcProxy gUdfdProxy = {0}; +SUdfcProxy gUdfcProxy = {0}; typedef struct SUdfcUvSession { SUdfcProxy *udfc; @@ -896,23 +897,23 @@ int compareUdfcFuncSub(const void *elem1, const void *elem2) { int32_t acquireUdfFuncHandle(char *udfName, UdfcFuncHandle *pHandle) { int32_t code = 0; - uv_mutex_lock(&gUdfdProxy.udfStubsMutex); + uv_mutex_lock(&gUdfcProxy.udfStubsMutex); SUdfcFuncStub key = {0}; strncpy(key.udfName, udfName, TSDB_FUNC_NAME_LEN); - int32_t stubIndex = taosArraySearchIdx(gUdfdProxy.udfStubs, &key, compareUdfcFuncSub, TD_EQ); + int32_t stubIndex = taosArraySearchIdx(gUdfcProxy.udfStubs, &key, compareUdfcFuncSub, TD_EQ); if (stubIndex != -1) { - SUdfcFuncStub *foundStub = taosArrayGet(gUdfdProxy.udfStubs, stubIndex); + SUdfcFuncStub *foundStub = taosArrayGet(gUdfcProxy.udfStubs, stubIndex); UdfcFuncHandle handle = foundStub->handle; if (handle != NULL && ((SUdfcUvSession *)handle)->udfUvPipe != NULL) { *pHandle = foundStub->handle; ++foundStub->refCount; foundStub->lastRefTime = taosGetTimestampUs(); - uv_mutex_unlock(&gUdfdProxy.udfStubsMutex); + uv_mutex_unlock(&gUdfcProxy.udfStubsMutex); return 0; } else { fnInfo("invalid handle for %s, refCount: %d, last ref time: %" PRId64 ". remove it from cache", udfName, foundStub->refCount, foundStub->lastRefTime); - taosArrayRemove(gUdfdProxy.udfStubs, stubIndex); + taosArrayRemove(gUdfcProxy.udfStubs, stubIndex); } } *pHandle = NULL; @@ -923,46 +924,46 @@ int32_t acquireUdfFuncHandle(char *udfName, UdfcFuncHandle *pHandle) { stub.handle = *pHandle; ++stub.refCount; stub.lastRefTime = taosGetTimestampUs(); - taosArrayPush(gUdfdProxy.udfStubs, &stub); - taosArraySort(gUdfdProxy.udfStubs, compareUdfcFuncSub); + taosArrayPush(gUdfcProxy.udfStubs, &stub); + taosArraySort(gUdfcProxy.udfStubs, compareUdfcFuncSub); } else { *pHandle = NULL; } - uv_mutex_unlock(&gUdfdProxy.udfStubsMutex); + uv_mutex_unlock(&gUdfcProxy.udfStubsMutex); return code; } void releaseUdfFuncHandle(char *udfName) { - uv_mutex_lock(&gUdfdProxy.udfStubsMutex); + uv_mutex_lock(&gUdfcProxy.udfStubsMutex); SUdfcFuncStub key = {0}; strncpy(key.udfName, udfName, TSDB_FUNC_NAME_LEN); - SUdfcFuncStub *foundStub = taosArraySearch(gUdfdProxy.udfStubs, &key, compareUdfcFuncSub, TD_EQ); + SUdfcFuncStub *foundStub = taosArraySearch(gUdfcProxy.udfStubs, &key, compareUdfcFuncSub, TD_EQ); if (!foundStub) { - uv_mutex_unlock(&gUdfdProxy.udfStubsMutex); + uv_mutex_unlock(&gUdfcProxy.udfStubsMutex); return; } if (foundStub->refCount > 0) { --foundStub->refCount; } - uv_mutex_unlock(&gUdfdProxy.udfStubsMutex); + uv_mutex_unlock(&gUdfcProxy.udfStubsMutex); } int32_t cleanUpUdfs() { - int8_t initialized = atomic_load_8(&gUdfdProxy.initialized); + int8_t initialized = atomic_load_8(&gUdfcProxy.initialized); if (!initialized) { return TSDB_CODE_SUCCESS; } - uv_mutex_lock(&gUdfdProxy.udfStubsMutex); - if (gUdfdProxy.udfStubs == NULL || taosArrayGetSize(gUdfdProxy.udfStubs) == 0) { - uv_mutex_unlock(&gUdfdProxy.udfStubsMutex); + uv_mutex_lock(&gUdfcProxy.udfStubsMutex); + if (gUdfcProxy.udfStubs == NULL || taosArrayGetSize(gUdfcProxy.udfStubs) == 0) { + uv_mutex_unlock(&gUdfcProxy.udfStubsMutex); return TSDB_CODE_SUCCESS; } SArray *udfStubs = taosArrayInit(16, sizeof(SUdfcFuncStub)); int32_t i = 0; - while (i < taosArrayGetSize(gUdfdProxy.udfStubs)) { - SUdfcFuncStub *stub = taosArrayGet(gUdfdProxy.udfStubs, i); + while (i < taosArrayGetSize(gUdfcProxy.udfStubs)) { + SUdfcFuncStub *stub = taosArrayGet(gUdfcProxy.udfStubs, i); if (stub->refCount == 0) { fnInfo("tear down udf. udf name: %s, handle: %p, ref count: %d", stub->udfName, stub->handle, stub->refCount); doTeardownUdf(stub->handle); @@ -979,9 +980,9 @@ int32_t cleanUpUdfs() { } ++i; } - taosArrayDestroy(gUdfdProxy.udfStubs); - gUdfdProxy.udfStubs = udfStubs; - uv_mutex_unlock(&gUdfdProxy.udfStubsMutex); + taosArrayDestroy(gUdfcProxy.udfStubs); + gUdfcProxy.udfStubs = udfStubs; + uv_mutex_unlock(&gUdfcProxy.udfStubsMutex); return 0; } @@ -1157,9 +1158,11 @@ void onUdfcPipeClose(uv_handle_t *handle) { QUEUE_REMOVE(&task->procTaskQueue); uv_sem_post(&task->taskSem); } + uv_mutex_lock(&gUdfcProxy.udfcUvMutex); if (conn->session != NULL) { conn->session->udfUvPipe = NULL; } + uv_mutex_unlock(&gUdfcProxy.udfcUvMutex); taosMemoryFree(conn->readBuf.buf); taosMemoryFree(conn); taosMemoryFree((uv_pipe_t *)handle); @@ -1553,11 +1556,11 @@ void constructUdfService(void *argsThread) { } int32_t udfcOpen() { - int8_t old = atomic_val_compare_exchange_8(&gUdfdProxy.initialized, 0, 1); + int8_t old = atomic_val_compare_exchange_8(&gUdfcProxy.initialized, 0, 1); if (old == 1) { return 0; } - SUdfcProxy *proxy = &gUdfdProxy; + SUdfcProxy *proxy = &gUdfcProxy; getUdfdPipeName(proxy->udfdPipeName, sizeof(proxy->udfdPipeName)); proxy->udfcState = UDFC_STATE_STARTNG; uv_barrier_init(&proxy->initBarrier, 2); @@ -1567,16 +1570,17 @@ int32_t udfcOpen() { uv_barrier_wait(&proxy->initBarrier); uv_mutex_init(&proxy->udfStubsMutex); proxy->udfStubs = taosArrayInit(8, sizeof(SUdfcFuncStub)); + uv_mutex_init(&proxy->udfcUvMutex); fnInfo("udfc initialized") return 0; } int32_t udfcClose() { - int8_t old = atomic_val_compare_exchange_8(&gUdfdProxy.initialized, 1, 0); + int8_t old = atomic_val_compare_exchange_8(&gUdfcProxy.initialized, 1, 0); if (old == 0) { return 0; } - SUdfcProxy *udfc = &gUdfdProxy; + SUdfcProxy *udfc = &gUdfcProxy; udfc->udfcState = UDFC_STATE_STOPPING; uv_async_send(&udfc->loopStopAsync); uv_thread_join(&udfc->loopThread); @@ -1584,6 +1588,7 @@ int32_t udfcClose() { uv_barrier_destroy(&udfc->initBarrier); taosArrayDestroy(udfc->udfStubs); uv_mutex_destroy(&udfc->udfStubsMutex); + uv_mutex_destroy(&udfc->udfcUvMutex); udfc->udfcState = UDFC_STATE_INITAL; fnInfo("udfc is cleaned up"); return 0; @@ -1611,13 +1616,13 @@ int32_t udfcRunUdfUvTask(SClientUdfTask *task, int8_t uvTaskType) { } int32_t doSetupUdf(char udfName[], UdfcFuncHandle *funcHandle) { - if (gUdfdProxy.udfcState != UDFC_STATE_READY) { + if (gUdfcProxy.udfcState != UDFC_STATE_READY) { return TSDB_CODE_UDF_INVALID_STATE; } SClientUdfTask *task = taosMemoryCalloc(1, sizeof(SClientUdfTask)); task->errCode = 0; task->session = taosMemoryCalloc(1, sizeof(SUdfcUvSession)); - task->session->udfc = &gUdfdProxy; + task->session->udfc = &gUdfcProxy; task->type = UDF_TASK_SETUP; SUdfSetupRequest *req = &task->_setup.req; @@ -1625,7 +1630,7 @@ int32_t doSetupUdf(char udfName[], UdfcFuncHandle *funcHandle) { int32_t errCode = udfcRunUdfUvTask(task, UV_TASK_CONNECT); if (errCode != 0) { - fnError("failed to connect to pipe. udfName: %s, pipe: %s", udfName, (&gUdfdProxy)->udfdPipeName); + fnError("failed to connect to pipe. udfName: %s, pipe: %s", udfName, (&gUdfcProxy)->udfdPipeName); taosMemoryFree(task->session); taosMemoryFree(task); return TSDB_CODE_UDF_PIPE_CONNECT_ERR; @@ -1799,10 +1804,12 @@ int32_t doTeardownUdf(UdfcFuncHandle handle) { fnInfo("tear down udf. udf name: %s, udf func handle: %p", session->udfName, handle); // TODO: synchronization refactor between libuv event loop and request thread + uv_mutex_lock(&gUdfcProxy.udfcUvMutex); if (session->udfUvPipe != NULL && session->udfUvPipe->data != NULL) { SClientUvConn *conn = session->udfUvPipe->data; conn->session = NULL; } + uv_mutex_unlock(&gUdfcProxy.udfcUvMutex); taosMemoryFree(session); taosMemoryFree(task); From 16275caa8d05c5a8d74a5690677d7907e793fa93 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 20 Oct 2022 15:39:37 +0800 Subject: [PATCH 51/99] fix(tdb): typo casues large page crash --- source/libs/tdb/src/db/tdbBtree.c | 4 ++-- source/libs/tdb/src/db/tdbPage.c | 2 +- source/libs/tdb/src/db/tdbPager.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/libs/tdb/src/db/tdbBtree.c b/source/libs/tdb/src/db/tdbBtree.c index ba0b3dbcf8..3f36a058e5 100644 --- a/source/libs/tdb/src/db/tdbBtree.c +++ b/source/libs/tdb/src/db/tdbBtree.c @@ -371,7 +371,7 @@ static int tdbDefaultKeyCmprFn(const void *pKey1, int keyLen1, const void *pKey2 } return cret; } - +/* static int tdbBtreeOpenImpl(SBTree *pBt) { // Try to get the root page of the an existing btree SPgno pgno; @@ -400,7 +400,7 @@ static int tdbBtreeOpenImpl(SBTree *pBt) { pBt->root = pgno; return 0; } - +*/ int tdbBtreeInitPage(SPage *pPage, void *arg, int init) { SBTree *pBt; u8 flags; diff --git a/source/libs/tdb/src/db/tdbPage.c b/source/libs/tdb/src/db/tdbPage.c index f4878ea861..016ad65cf3 100644 --- a/source/libs/tdb/src/db/tdbPage.c +++ b/source/libs/tdb/src/db/tdbPage.c @@ -586,7 +586,7 @@ static inline void setLPageNFree(SPage *pPage, int nFree) { // cell offset static inline int getLPageCellOffset(SPage *pPage, int idx) { - ASSERT(idx >= 0 && idx < getPageCellNum(pPage)); + ASSERT(idx >= 0 && idx < getLPageCellNum(pPage)); return TDB_GET_U24(pPage->pCellIdx + 3 * idx); } diff --git a/source/libs/tdb/src/db/tdbPager.c b/source/libs/tdb/src/db/tdbPager.c index 88729f0b69..cee54c1a73 100644 --- a/source/libs/tdb/src/db/tdbPager.c +++ b/source/libs/tdb/src/db/tdbPager.c @@ -116,7 +116,7 @@ int tdbPagerClose(SPager *pPager) { } return 0; } - +/* int tdbPagerOpenDB(SPager *pPager, SPgno *ppgno, bool toCreate, SBTree *pBt) { SPgno pgno; SPage *pPage; @@ -167,7 +167,7 @@ int tdbPagerOpenDB(SPager *pPager, SPgno *ppgno, bool toCreate, SBTree *pBt) { *ppgno = pgno; return 0; } - +*/ int tdbPagerWrite(SPager *pPager, SPage *pPage) { int ret; SPage **ppPage; From b2b61bab9633b833c440f710d752f24dc856a981 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 20 Oct 2022 15:53:47 +0800 Subject: [PATCH 52/99] fix: commit txn for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index ac41b6c00a..a79ae35d79 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -390,10 +390,6 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma) { static int32_t tdProcessRSmaAsyncCommitImpl(SSma *pSma) { int32_t code = 0; SVnode *pVnode = pSma->pVnode; - SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); - if (!pSmaEnv) { - goto _exit; - } #if 0 SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); From af4957f6721b481e9e0ea917a4b6cf94bf1bd495 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 20 Oct 2022 16:02:51 +0800 Subject: [PATCH 53/99] chore: code optimization for rsma --- source/dnode/vnode/src/vnd/vnodeCommit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index c88c095bb5..318e16a04d 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -52,7 +52,7 @@ int vnodeBegin(SVnode *pVnode) { } // begin sma - if (smaBegin(pVnode->pSma) < 0) { + if (VND_IS_RSMA(pVnode) && smaBegin(pVnode->pSma) < 0) { vError("vgId:%d, failed to begin sma since %s", TD_VID(pVnode), tstrerror(terrno)); return -1; } From 175aa665e1bb9536feec55b296360c93f64ce98f Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 16:41:18 +0800 Subject: [PATCH 54/99] Update compatibility.py --- tests/system-test/0-others/compatibility.py | 116 ++++++++++---------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index 25b023bb76..988dc9414c 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -84,71 +84,71 @@ class TDTestCase: tableNumbers=100 recordNumbers1=100 recordNumbers2=1000 - tdsqlF=tdCom.newTdSql() - print(tdsqlF) - tdsqlF.query(f"SELECT SERVER_VERSION();") - print(tdsqlF.query(f"SELECT SERVER_VERSION();")) - oldServerVersion=tdsqlF.queryResult[0][0] - tdLog.info(f"Base server version is {oldServerVersion}") - tdsqlF.query(f"SELECT CLIENT_VERSION();") - # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison - oldClientVersion=tdsqlF.queryResult[0][0] - tdLog.info(f"Base client version is {oldClientVersion}") +# tdsqlF=tdCom.newTdSql() +# print(tdsqlF) +# tdsqlF.query(f"SELECT SERVER_VERSION();") +# print(tdsqlF.query(f"SELECT SERVER_VERSION();")) +# oldServerVersion=tdsqlF.queryResult[0][0] +# tdLog.info(f"Base server version is {oldServerVersion}") +# tdsqlF.query(f"SELECT CLIENT_VERSION();") +# # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison +# oldClientVersion=tdsqlF.queryResult[0][0] +# tdLog.info(f"Base client version is {oldClientVersion}") - tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") - tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") - os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") - sleep(3) +# tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") +# tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") +# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") +# sleep(3) - # tdsqlF.query(f"select count(*) from {stb}") - # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) - os.system("pkill taosd") - sleep(1) +# # tdsqlF.query(f"select count(*) from {stb}") +# # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) +# os.system("pkill taosd") +# sleep(1) - tdLog.printNoPrefix("==========step2:update new version ") - self.buildTaosd(bPath) - tdDnodes.start(1) - sleep(1) - tdsql=tdCom.newTdSql() - print(tdsql) +# tdLog.printNoPrefix("==========step2:update new version ") +# self.buildTaosd(bPath) +# tdDnodes.start(1) +# sleep(1) +# tdsql=tdCom.newTdSql() +# print(tdsql) - tdsql.query(f"SELECT SERVER_VERSION();") - nowServerVersion=tdsql.queryResult[0][0] - tdLog.info(f"New server version is {nowServerVersion}") - tdsql.query(f"SELECT CLIENT_VERSION();") - nowClientVersion=tdsql.queryResult[0][0] - tdLog.info(f"New client version is {nowClientVersion}") +# tdsql.query(f"SELECT SERVER_VERSION();") +# nowServerVersion=tdsql.queryResult[0][0] +# tdLog.info(f"New server version is {nowServerVersion}") +# tdsql.query(f"SELECT CLIENT_VERSION();") +# nowClientVersion=tdsql.queryResult[0][0] +# tdLog.info(f"New client version is {nowClientVersion}") - tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") - tdsql.query(f"select count(*) from {stb}") - tdsql.checkData(0,0,tableNumbers*recordNumbers1) - os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") - tdsql.query(f"select count(*) from {stb}") - tdsql.checkData(0,0,tableNumbers*recordNumbers2) +# tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") +# tdsql.query(f"select count(*) from {stb}") +# tdsql.checkData(0,0,tableNumbers*recordNumbers1) +# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") +# tdsql.query(f"select count(*) from {stb}") +# tdsql.checkData(0,0,tableNumbers*recordNumbers2) - tdsql=tdCom.newTdSql() - tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") - tdsql.execute("drop database if exists db") - tdsql.execute("create database db") - tdsql.execute("use db") - tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") - tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") - tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") - tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") - tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") - tdsql.query("select * from db.ct3") - tdsql.checkData(0,1,13) - tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") - tdsql.query("select * from db.ct4") - tdsql.checkData(0,1,14) - tdsql.query("describe information_schema.ins_databases;") - qRows=tdsql.queryRows - for i in range(qRows) : - if tdsql.queryResult[i][0]=="retentions" : - return True - else: - return False +# tdsql=tdCom.newTdSql() +# tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") +# tdsql.execute("drop database if exists db") +# tdsql.execute("create database db") +# tdsql.execute("use db") +# tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") +# tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") +# tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") +# tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") +# tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") +# tdsql.query("select * from db.ct3") +# tdsql.checkData(0,1,13) +# tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") +# tdsql.query("select * from db.ct4") +# tdsql.checkData(0,1,14) +# tdsql.query("describe information_schema.ins_databases;") +# qRows=tdsql.queryRows +# for i in range(qRows) : +# if tdsql.queryResult[i][0]=="retentions" : +# return True +# else: +# return False def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") From 4d318b32da6358064eb891d15026c0ee8fbfb4a3 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 20 Oct 2022 16:47:03 +0800 Subject: [PATCH 55/99] refact: alter db replica --- include/common/tmsg.h | 28 ++-- include/common/tmsgdef.h | 4 +- source/common/src/tmsg.c | 100 +++++++----- source/dnode/mgmt/mgmt_mnode/src/mmHandle.c | 4 - source/dnode/mgmt/mgmt_vnode/inc/vmInt.h | 1 + source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 42 ++++- source/dnode/mgmt/mgmt_vnode/src/vmWorker.c | 3 + source/dnode/mgmt/test/vnode/vnode.cpp | 2 +- source/dnode/mnode/impl/inc/mndVgroup.h | 5 +- source/dnode/mnode/impl/src/mndDb.c | 2 +- source/dnode/mnode/impl/src/mndMain.c | 8 - source/dnode/mnode/impl/src/mndMnode.c | 2 - source/dnode/mnode/impl/src/mndSma.c | 2 +- source/dnode/mnode/impl/src/mndVgroup.c | 162 ++++++++------------ source/dnode/vnode/inc/vnode.h | 1 + source/dnode/vnode/src/vnd/vnodeOpen.c | 60 ++++++-- source/dnode/vnode/src/vnd/vnodeSvr.c | 12 +- source/dnode/vnode/src/vnd/vnodeSync.c | 122 +-------------- 18 files changed, 251 insertions(+), 309 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 3409071932..0409decaf8 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1191,7 +1191,6 @@ typedef struct { int8_t strict; int8_t cacheLast; int8_t isTsma; - int8_t standby; int8_t replica; int8_t selfIndex; SReplica replicas[TSDB_MAX_REPLICA]; @@ -1206,6 +1205,7 @@ typedef struct { int16_t hashPrefix; int16_t hashSuffix; int32_t tsdbPageSize; + int64_t reserved[8]; } SCreateVnodeReq; int32_t tSerializeSCreateVnodeReq(void* buf, int32_t bufLen, SCreateVnodeReq* pReq); @@ -1217,6 +1217,7 @@ typedef struct { int32_t dnodeId; int64_t dbUid; char db[TSDB_DB_FNAME_LEN]; + int64_t reserved[8]; } SDropVnodeReq; int32_t tSerializeSDropVnodeReq(void* buf, int32_t bufLen, SDropVnodeReq* pReq); @@ -1225,6 +1226,7 @@ int32_t tDeserializeSDropVnodeReq(void* buf, int32_t bufLen, SDropVnodeReq* pReq typedef struct { int64_t dbUid; char db[TSDB_DB_FNAME_LEN]; + int64_t reserved[8]; } SCompactVnodeReq; int32_t tSerializeSCompactVnodeReq(void* buf, int32_t bufLen, SCompactVnodeReq* pReq); @@ -1244,13 +1246,23 @@ typedef struct { int8_t walLevel; int8_t strict; int8_t cacheLast; + int64_t reserved[8]; +} SAlterVnodeConfigReq; + +int32_t tSerializeSAlterVnodeConfigReq(void* buf, int32_t bufLen, SAlterVnodeConfigReq* pReq); +int32_t tDeserializeSAlterVnodeConfigReq(void* buf, int32_t bufLen, SAlterVnodeConfigReq* pReq); + +typedef struct { + int32_t vgId; + int8_t strict; int8_t selfIndex; int8_t replica; SReplica replicas[TSDB_MAX_REPLICA]; -} SAlterVnodeReq; + int64_t reserved[8]; +} SAlterVnodeReplicaReq; -int32_t tSerializeSAlterVnodeReq(void* buf, int32_t bufLen, SAlterVnodeReq* pReq); -int32_t tDeserializeSAlterVnodeReq(void* buf, int32_t bufLen, SAlterVnodeReq* pReq); +int32_t tSerializeSAlterVnodeReplicaReq(void* buf, int32_t bufLen, SAlterVnodeReplicaReq* pReq); +int32_t tDeserializeSAlterVnodeReplicaReq(void* buf, int32_t bufLen, SAlterVnodeReplicaReq* pReq); typedef struct { SMsgHead header; @@ -1503,14 +1515,6 @@ typedef struct { int32_t tSerializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); int32_t tDeserializeSDCreateMnodeReq(void* buf, int32_t bufLen, SDCreateMnodeReq* pReq); -typedef struct { - int32_t dnodeId; - int8_t standby; -} SSetStandbyReq; - -int32_t tSerializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq); -int32_t tDeserializeSSetStandbyReq(void* buf, int32_t bufLen, SSetStandbyReq* pReq); - typedef struct { char queryStrId[TSDB_QUERY_ID_LEN]; } SKillQueryReq; diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 7b4e930485..1cd02e2a28 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -262,8 +262,8 @@ enum { TD_DEF_MSG_TYPE(TDMT_SYNC_SNAPSHOT_SEND, "sync-snapshot-send", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_SNAPSHOT_RSP, "sync-snapshot-rsp", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_LEADER_TRANSFER, "sync-leader-transfer", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_SYNC_SET_MNODE_STANDBY, "set-mnode-standby", NULL, NULL) - TD_DEF_MSG_TYPE(TDMT_SYNC_SET_VNODE_STANDBY, "set-vnode-standby", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_SYNC_SET_MNODE_STANDBY, "set-mnode-standby", NULL, NULL) // no longer used + TD_DEF_MSG_TYPE(TDMT_SYNC_SET_VNODE_STANDBY, "set-vnode-standby", NULL, NULL) // no longer used TD_DEF_MSG_TYPE(TDMT_SYNC_HEARTBEAT, "sync-heartbeat", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_HEARTBEAT_REPLY, "sync-heartbeat-reply", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_SYNC_MAX_MSG, "sync-max", NULL, NULL) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 65541ca9cc..81cdd0e5e0 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -3766,7 +3766,6 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR if (tEncodeI8(&encoder, pReq->compression) < 0) return -1; if (tEncodeI8(&encoder, pReq->strict) < 0) return -1; if (tEncodeI8(&encoder, pReq->cacheLast) < 0) return -1; - if (tEncodeI8(&encoder, pReq->standby) < 0) return -1; if (tEncodeI8(&encoder, pReq->replica) < 0) return -1; if (tEncodeI8(&encoder, pReq->selfIndex) < 0) return -1; for (int32_t i = 0; i < TSDB_MAX_REPLICA; ++i) { @@ -3795,6 +3794,9 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR if (tEncodeI16(&encoder, pReq->hashPrefix) < 0) return -1; if (tEncodeI16(&encoder, pReq->hashSuffix) < 0) return -1; if (tEncodeI32(&encoder, pReq->tsdbPageSize) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tEncodeI64(&encoder, pReq->reserved[i]) < 0) return -1; + } tEndEncode(&encoder); @@ -3832,7 +3834,6 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq * if (tDecodeI8(&decoder, &pReq->compression) < 0) return -1; if (tDecodeI8(&decoder, &pReq->strict) < 0) return -1; if (tDecodeI8(&decoder, &pReq->cacheLast) < 0) return -1; - if (tDecodeI8(&decoder, &pReq->standby) < 0) return -1; if (tDecodeI8(&decoder, &pReq->replica) < 0) return -1; if (tDecodeI8(&decoder, &pReq->selfIndex) < 0) return -1; for (int32_t i = 0; i < TSDB_MAX_REPLICA; ++i) { @@ -3871,6 +3872,9 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq * if (tDecodeI16(&decoder, &pReq->hashPrefix) < 0) return -1; if (tDecodeI16(&decoder, &pReq->hashSuffix) < 0) return -1; if (tDecodeI32(&decoder, &pReq->tsdbPageSize) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tDecodeI64(&decoder, &pReq->reserved[i]) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); @@ -3892,6 +3896,9 @@ int32_t tSerializeSDropVnodeReq(void *buf, int32_t bufLen, SDropVnodeReq *pReq) if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; if (tEncodeI64(&encoder, pReq->dbUid) < 0) return -1; if (tEncodeCStr(&encoder, pReq->db) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tEncodeI64(&encoder, pReq->reserved[i]) < 0) return -1; + } tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3908,6 +3915,9 @@ int32_t tDeserializeSDropVnodeReq(void *buf, int32_t bufLen, SDropVnodeReq *pReq if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; if (tDecodeI64(&decoder, &pReq->dbUid) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tDecodeI64(&decoder, &pReq->reserved[i]) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); @@ -3921,6 +3931,9 @@ int32_t tSerializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq * if (tStartEncode(&encoder) < 0) return -1; if (tEncodeI64(&encoder, pReq->dbUid) < 0) return -1; if (tEncodeCStr(&encoder, pReq->db) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tEncodeI64(&encoder, pReq->reserved[i]) < 0) return -1; + } tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -3935,13 +3948,16 @@ int32_t tDeserializeSCompactVnodeReq(void *buf, int32_t bufLen, SCompactVnodeReq if (tStartDecode(&decoder) < 0) return -1; if (tDecodeI64(&decoder, &pReq->dbUid) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tDecodeI64(&decoder, &pReq->reserved[i]) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); return 0; } -int32_t tSerializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq) { +int32_t tSerializeSAlterVnodeConfigReq(void *buf, int32_t bufLen, SAlterVnodeConfigReq *pReq) { SEncoder encoder = {0}; tEncoderInit(&encoder, buf, bufLen); @@ -3959,11 +3975,8 @@ int32_t tSerializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq if (tEncodeI8(&encoder, pReq->walLevel) < 0) return -1; if (tEncodeI8(&encoder, pReq->strict) < 0) return -1; if (tEncodeI8(&encoder, pReq->cacheLast) < 0) return -1; - if (tEncodeI8(&encoder, pReq->selfIndex) < 0) return -1; - if (tEncodeI8(&encoder, pReq->replica) < 0) return -1; - for (int32_t i = 0; i < TSDB_MAX_REPLICA; ++i) { - SReplica *pReplica = &pReq->replicas[i]; - if (tEncodeSReplica(&encoder, pReplica) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tEncodeI64(&encoder, pReq->reserved[i]) < 0) return -1; } tEndEncode(&encoder); @@ -3972,7 +3985,7 @@ int32_t tSerializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq return tlen; } -int32_t tDeserializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pReq) { +int32_t tDeserializeSAlterVnodeConfigReq(void *buf, int32_t bufLen, SAlterVnodeConfigReq *pReq) { SDecoder decoder = {0}; tDecoderInit(&decoder, buf, bufLen); @@ -3990,12 +4003,54 @@ int32_t tDeserializeSAlterVnodeReq(void *buf, int32_t bufLen, SAlterVnodeReq *pR if (tDecodeI8(&decoder, &pReq->walLevel) < 0) return -1; if (tDecodeI8(&decoder, &pReq->strict) < 0) return -1; if (tDecodeI8(&decoder, &pReq->cacheLast) < 0) return -1; + for (int32_t i = 0; i < 8; ++i) { + if (tDecodeI64(&decoder, &pReq->reserved[i]) < 0) return -1; + } + + tEndDecode(&decoder); + tDecoderClear(&decoder); + return 0; +} + +int32_t tSerializeSAlterVnodeReplicaReq(void *buf, int32_t bufLen, SAlterVnodeReplicaReq *pReq) { + SEncoder encoder = {0}; + tEncoderInit(&encoder, buf, bufLen); + + if (tStartEncode(&encoder) < 0) return -1; + if (tEncodeI32(&encoder, pReq->vgId) < 0) return -1; + if (tEncodeI8(&encoder, pReq->strict) < 0) return -1; + if (tEncodeI8(&encoder, pReq->selfIndex) < 0) return -1; + if (tEncodeI8(&encoder, pReq->replica) < 0) return -1; + for (int32_t i = 0; i < TSDB_MAX_REPLICA; ++i) { + SReplica *pReplica = &pReq->replicas[i]; + if (tEncodeSReplica(&encoder, pReplica) < 0) return -1; + } + for (int32_t i = 0; i < 8; ++i) { + if (tEncodeI64(&encoder, pReq->reserved[i]) < 0) return -1; + } + tEndEncode(&encoder); + + int32_t tlen = encoder.pos; + tEncoderClear(&encoder); + return tlen; +} + +int32_t tDeserializeSAlterVnodeReplicaReq(void *buf, int32_t bufLen, SAlterVnodeReplicaReq *pReq) { + SDecoder decoder = {0}; + tDecoderInit(&decoder, buf, bufLen); + + if (tStartDecode(&decoder) < 0) return -1; + if (tDecodeI32(&decoder, &pReq->vgId) < 0) return -1; + if (tDecodeI8(&decoder, &pReq->strict) < 0) return -1; if (tDecodeI8(&decoder, &pReq->selfIndex) < 0) return -1; if (tDecodeI8(&decoder, &pReq->replica) < 0) return -1; for (int32_t i = 0; i < TSDB_MAX_REPLICA; ++i) { SReplica *pReplica = &pReq->replicas[i]; if (tDecodeSReplica(&decoder, pReplica) < 0) return -1; } + for (int32_t i = 0; i < 8; ++i) { + if (tDecodeI64(&decoder, &pReq->reserved[i]) < 0) return -1; + } tEndDecode(&decoder); tDecoderClear(&decoder); @@ -4218,33 +4273,6 @@ int32_t tDeserializeSDCreateMnodeReq(void *buf, int32_t bufLen, SDCreateMnodeReq return 0; } -int32_t tSerializeSSetStandbyReq(void *buf, int32_t bufLen, SSetStandbyReq *pReq) { - SEncoder encoder = {0}; - tEncoderInit(&encoder, buf, bufLen); - - if (tStartEncode(&encoder) < 0) return -1; - if (tEncodeI32(&encoder, pReq->dnodeId) < 0) return -1; - if (tEncodeI8(&encoder, pReq->standby) < 0) return -1; - tEndEncode(&encoder); - - int32_t tlen = encoder.pos; - tEncoderClear(&encoder); - return tlen; -} - -int32_t tDeserializeSSetStandbyReq(void *buf, int32_t bufLen, SSetStandbyReq *pReq) { - SDecoder decoder = {0}; - tDecoderInit(&decoder, buf, bufLen); - - if (tStartDecode(&decoder) < 0) return -1; - if (tDecodeI32(&decoder, &pReq->dnodeId) < 0) return -1; - if (tDecodeI8(&decoder, &pReq->standby) < 0) return -1; - tEndDecode(&decoder); - - tDecoderClear(&decoder); - return 0; -} - int32_t tSerializeSAuthReq(void *buf, int32_t bufLen, SAuthReq *pReq) { SEncoder encoder = {0}; tEncoderInit(&encoder, buf, bufLen); diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 7fb700e776..4c1b307b90 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -196,10 +196,6 @@ SArray *mmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_REPLY, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_SEND, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, mmPutMsgToSyncQueue, 1) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_MNODE_STANDBY, mmPutMsgToSyncQueue, 0) == NULL) goto _OVER; - - if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_MNODE_STANDBY_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_VNODE_STANDBY_RSP, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER; code = 0; diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index 1bd68e6d41..bf1ccc1a7b 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -88,6 +88,7 @@ void vmCloseVnode(SVnodeMgmt *pMgmt, SVnodeObj *pVnode); SArray *vmGetMsgHandles(); int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); +int32_t vmProcessAlterVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg); // vmFile.c int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes); diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index c92b6c4c4d..a121ff656e 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -265,6 +265,45 @@ _OVER: return code; } +int32_t vmProcessAlterVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { + SAlterVnodeReplicaReq alterReq = {0}; + if (tSerializeSAlterVnodeReplicaReq(pMsg->pCont, pMsg->contLen, &alterReq) != 0) { + terrno = TSDB_CODE_INVALID_MSG; + return -1; + } + + int32_t vgId = alterReq.vgId; + dInfo("vgId:%d, start to alter vnode replica", alterReq.vgId); + + SVnodeObj *pVnode = vmAcquireVnode(pMgmt, vgId); + if (pVnode == NULL) { + dError("vgId:%d, failed to alter replica since %s", vgId, terrstr()); + terrno = TSDB_CODE_NODE_NOT_DEPLOYED; + return -1; + } + + dInfo("vgId:%d, start to close vnode", vgId); + vmCloseVnode(pMgmt, pVnode); + + char path[TSDB_FILENAME_LEN] = {0}; + snprintf(path, TSDB_FILENAME_LEN, "vnode%svnode%d", TD_DIRSEP, vgId); + + dInfo("vgId:%d, start to alter vnode replica at %s", vgId, path); + if (vnodeAlter(path, &alterReq, pMgmt->pTfs) < 0) { + dError("vgId:%d, failed to alter vnode at %s since %s", vgId, path, terrstr()); + return -1; + } + + dInfo("vgId:%d, start to open vnode", vgId); + if (vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb) < 0) { + dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); + return -1; + } + + dInfo("vgId:%d, vnode config is altered", vgId); + return 0; +} + int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SDropVnodeReq dropReq = {0}; if (tDeserializeSDropVnodeReq(pMsg->pCont, pMsg->contLen, &dropReq) != 0) { @@ -348,7 +387,7 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_STREAM_RETRIEVE_RSP, vmPutMsgToStreamQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_REPLICA, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; + if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_REPLICA, vmPutMsgToMgmtQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_CONFIG, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_CONFIRM, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_VND_ALTER_HASHRANGE, vmPutMsgToWriteQueue, 0) == NULL) goto _OVER; @@ -370,7 +409,6 @@ SArray *vmGetMsgHandles() { if (dmSetMgmtHandle(pArray, TDMT_SYNC_APPEND_ENTRIES_REPLY, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_SEND, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_SNAPSHOT_RSP, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; - if (dmSetMgmtHandle(pArray, TDMT_SYNC_SET_VNODE_STANDBY, vmPutMsgToSyncQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT, vmPutMsgToSyncCtrlQueue, 0) == NULL) goto _OVER; if (dmSetMgmtHandle(pArray, TDMT_SYNC_HEARTBEAT_REPLY, vmPutMsgToSyncCtrlQueue, 0) == NULL) goto _OVER; diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index fd1dbe00ce..8cf89b7f35 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -40,6 +40,9 @@ static void vmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { case TDMT_DND_DROP_VNODE: code = vmProcessDropVnodeReq(pMgmt, pMsg); break; + case TDMT_VND_ALTER_REPLICA: + code = vmProcessAlterVnodeReq(pMgmt, pMsg); + break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; dGError("msg:%p, not processed in vnode-mgmt queue", pMsg); diff --git a/source/dnode/mgmt/test/vnode/vnode.cpp b/source/dnode/mgmt/test/vnode/vnode.cpp index 520d844dbd..8a8e332289 100644 --- a/source/dnode/mgmt/test/vnode/vnode.cpp +++ b/source/dnode/mgmt/test/vnode/vnode.cpp @@ -70,7 +70,7 @@ TEST_F(DndTestVnode, 01_Create_Vnode) { TEST_F(DndTestVnode, 02_Alter_Vnode) { for (int i = 0; i < 3; ++i) { - SAlterVnodeReq alterReq = {0}; + SAlterVnodeConfigReq alterReq = {0}; alterReq.vgVersion = 2; alterReq.daysPerFile = 10; alterReq.daysToKeep0 = 3650; diff --git a/source/dnode/mnode/impl/inc/mndVgroup.h b/source/dnode/mnode/impl/inc/mndVgroup.h index ad5fbef34c..76c3519808 100644 --- a/source/dnode/mnode/impl/inc/mndVgroup.h +++ b/source/dnode/mnode/impl/inc/mndVgroup.h @@ -38,7 +38,7 @@ int32_t mndAllocSmaVgroup(SMnode *, SDbObj *pDb, SVgObj *pVgroup); int32_t mndAllocVgroup(SMnode *, SDbObj *pDb, SVgObj **ppVgroups); int32_t mndAddVnodeToVgroup(SMnode *, SVgObj *pVgroup, SArray *pArray); int32_t mndRemoveVnodeFromVgroup(SMnode *, SVgObj *pVgroup, SArray *pArray, SVnodeGid *pDelVgid); -int32_t mndAddCreateVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid, bool standby); +int32_t mndAddCreateVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid); int32_t mndAddAlterVnodeConfirmAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup); int32_t mndAddAlterVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, tmsg_t msgType); int32_t mndAddDropVnodeAction(SMnode *, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid, bool isRedo); @@ -47,9 +47,8 @@ int32_t mndSetMoveVgroupsInfoToTrans(SMnode *, STrans *pTrans, int32_t dropDnode int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb, SDbObj *pNewDb, SVgObj *pVgroup, SArray *pArray); -void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *cntlen, bool standby); +void *mndBuildCreateVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); void *mndBuildDropVnodeReq(SMnode *, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); -void *mndBuildAlterVnodeReq(SMnode *, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen); bool mndVgroupInDb(SVgObj *pVgroup, int64_t dbUid); #ifdef __cplusplus diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 2660fa3146..ebf3382b1b 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -447,7 +447,7 @@ static int32_t mndSetCreateDbRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj for (int32_t vn = 0; vn < pVgroup->replica; ++vn) { SVnodeGid *pVgid = pVgroup->vnodeGid + vn; - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pVgid, false) != 0) { + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pVgid) != 0) { return -1; } } diff --git a/source/dnode/mnode/impl/src/mndMain.c b/source/dnode/mnode/impl/src/mndMain.c index a6177fc69f..ccfd7e4a2d 100644 --- a/source/dnode/mnode/impl/src/mndMain.c +++ b/source/dnode/mnode/impl/src/mndMain.c @@ -534,10 +534,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { SyncSnapshotRsp *pSyncMsg = syncSnapshotRspFromRpcMsg2(pMsg); code = syncNodeOnSnapshotRspCb(pSyncNode, pSyncMsg); syncSnapshotRspDestroy(pSyncMsg); - } else if (pMsg->msgType == TDMT_SYNC_SET_MNODE_STANDBY) { - code = syncSetStandby(pMgmt->sync); - SRpcMsg rsp = {.code = code, .info = pMsg->info}; - tmsgSendRsp(&rsp); } else { mError("failed to process msg:%p since invalid type:%s", pMsg, TMSG_INFO(pMsg->msgType)); code = -1; @@ -575,10 +571,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) { SyncAppendEntriesReply *pSyncMsg = syncAppendEntriesReplyFromRpcMsg2(pMsg); code = syncNodeOnAppendEntriesReplyCb(pSyncNode, pSyncMsg); syncAppendEntriesReplyDestroy(pSyncMsg); - } else if (pMsg->msgType == TDMT_SYNC_SET_MNODE_STANDBY) { - code = syncSetStandby(pMgmt->sync); - SRpcMsg rsp = {.code = code, .info = pMsg->info}; - tmsgSendRsp(&rsp); } else { mError("failed to process msg:%p since invalid type:%s", pMsg, TMSG_INFO(pMsg->msgType)); code = -1; diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index 1ab0ba8a16..5889a162f8 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -56,8 +56,6 @@ int32_t mndInitMnode(SMnode *pMnode) { mndSetMsgHandle(pMnode, TDMT_MND_ALTER_MNODE_RSP, mndTransProcessRsp); mndSetMsgHandle(pMnode, TDMT_MND_DROP_MNODE, mndProcessDropMnodeReq); mndSetMsgHandle(pMnode, TDMT_DND_DROP_MNODE_RSP, mndTransProcessRsp); - mndSetMsgHandle(pMnode, TDMT_SYNC_SET_MNODE_STANDBY_RSP, mndTransProcessRsp); - mndSetMsgHandle(pMnode, TDMT_SYNC_SET_VNODE_STANDBY_RSP, mndTransProcessRsp); mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_MNODE, mndRetrieveMnodes); mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_MNODE, mndCancelGetNextMnode); diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index da548cd3eb..56e725fac7 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -454,7 +454,7 @@ static int32_t mndSetCreateSmaVgroupRedoActions(SMnode *pMnode, STrans *pTrans, pVgroup->pTsma = pSmaReq; int32_t contLen = 0; - void *pReq = mndBuildCreateVnodeReq(pMnode, pDnode, pDb, pVgroup, &contLen, false); + void *pReq = mndBuildCreateVnodeReq(pMnode, pDnode, pDb, pVgroup, &contLen); taosMemoryFreeClear(pSmaReq); if (pReq == NULL) return -1; diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 47245fa2c4..91673a7ae9 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -196,8 +196,7 @@ void mndReleaseVgroup(SMnode *pMnode, SVgObj *pVgroup) { sdbRelease(pSdb, pVgroup); } -void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen, - bool standby) { +void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen) { SCreateVnodeReq createReq = {0}; createReq.vgId = pVgroup->vgId; memcpy(createReq.db, pDb->name, TSDB_DB_FNAME_LEN); @@ -227,7 +226,6 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg createReq.hashMethod = pDb->cfg.hashMethod; createReq.numOfRetensions = pDb->cfg.numOfRetensions; createReq.pRetensions = pDb->cfg.pRetensions; - createReq.standby = standby; createReq.isTsma = pVgroup->isTsma; createReq.pTsma = pVgroup->pTsma; createReq.walRetentionPeriod = pDb->cfg.walRetentionPeriod; @@ -279,8 +277,8 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg return pReq; } -void *mndBuildAlterVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen) { - SAlterVnodeReq alterReq = {0}; +static void *mndBuildAlterVnodeConfigReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen) { + SAlterVnodeConfigReq alterReq = {0}; alterReq.vgVersion = pVgroup->version; alterReq.buffer = pDb->cfg.buffer; alterReq.pageSize = pDb->cfg.pageSize; @@ -294,6 +292,34 @@ void *mndBuildAlterVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_ alterReq.walLevel = pDb->cfg.walLevel; alterReq.strict = pDb->cfg.strict; alterReq.cacheLast = pDb->cfg.cacheLast; + + int32_t contLen = tSerializeSAlterVnodeConfigReq(NULL, 0, &alterReq); + if (contLen < 0) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + contLen += sizeof(SMsgHead); + + void *pReq = taosMemoryMalloc(contLen); + if (pReq == NULL) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + return NULL; + } + + SMsgHead *pHead = pReq; + pHead->contLen = htonl(contLen); + pHead->vgId = htonl(pVgroup->vgId); + + tSerializeSAlterVnodeConfigReq((char *)pReq + sizeof(SMsgHead), contLen, &alterReq); + *pContLen = contLen; + return pReq; +} + +static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, + int32_t *pContLen) { + SAlterVnodeReplicaReq alterReq = {0}; + alterReq.vgId = pVgroup->vgId; + alterReq.strict = pDb->cfg.strict; alterReq.replica = pVgroup->replica; for (int32_t v = 0; v < pVgroup->replica; ++v) { @@ -308,14 +334,22 @@ void *mndBuildAlterVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_ pReplica->port = pVgidDnode->port; memcpy(pReplica->fqdn, pVgidDnode->fqdn, TSDB_FQDN_LEN); mndReleaseDnode(pMnode, pVgidDnode); + + if (pDnode->id == pVgid->dnodeId) { + alterReq.selfIndex = v; + } } - int32_t contLen = tSerializeSAlterVnodeReq(NULL, 0, &alterReq); + if (alterReq.selfIndex == -1) { + terrno = TSDB_CODE_MND_APP_ERROR; + return NULL; + } + + int32_t contLen = tSerializeSAlterVnodeReplicaReq(NULL, 0, &alterReq); if (contLen < 0) { terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } - contLen += sizeof(SMsgHead); void *pReq = taosMemoryMalloc(contLen); if (pReq == NULL) { @@ -323,38 +357,7 @@ void *mndBuildAlterVnodeReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_ return NULL; } - SMsgHead *pHead = pReq; - pHead->contLen = htonl(contLen); - pHead->vgId = htonl(pVgroup->vgId); - - tSerializeSAlterVnodeReq((char *)pReq + sizeof(SMsgHead), contLen, &alterReq); - *pContLen = contLen; - return pReq; -} - -void *mndBuildSetVnodeStandbyReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, int32_t *pContLen) { - SSetStandbyReq standbyReq = {0}; - standbyReq.dnodeId = pDnode->id; - standbyReq.standby = 1; - - int32_t contLen = tSerializeSSetStandbyReq(NULL, 0, &standbyReq); - if (contLen < 0) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return NULL; - } - - contLen += sizeof(SMsgHead); - void *pReq = taosMemoryMalloc(contLen); - if (pReq == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - return NULL; - } - - tSerializeSSetStandbyReq((char *)pReq + sizeof(SMsgHead), contLen, &standbyReq); - SMsgHead *pHead = pReq; - pHead->contLen = htonl(contLen); - pHead->vgId = htonl(pVgroup->vgId); - + tSerializeSAlterVnodeReplicaReq(pReq, contLen, &alterReq); *pContLen = contLen; return pReq; } @@ -948,8 +951,7 @@ _OVER: return 0; } -int32_t mndAddCreateVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid, - bool standby) { +int32_t mndAddCreateVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid) { STransAction action = {0}; SDnodeObj *pDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); @@ -958,7 +960,7 @@ int32_t mndAddCreateVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVg mndReleaseDnode(pMnode, pDnode); int32_t contLen = 0; - void *pReq = mndBuildCreateVnodeReq(pMnode, pDnode, pDb, pVgroup, &contLen, standby); + void *pReq = mndBuildCreateVnodeReq(pMnode, pDnode, pDb, pVgroup, &contLen); if (pReq == NULL) return -1; action.pCont = pReq; @@ -1007,7 +1009,7 @@ int32_t mndAddAlterVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgO action.epSet = mndGetVgroupEpset(pMnode, pVgroup); int32_t contLen = 0; - void *pReq = mndBuildAlterVnodeReq(pMnode, pDb, pVgroup, &contLen); + void *pReq = mndBuildAlterVnodeConfigReq(pMnode, pDb, pVgroup, &contLen); if (pReq == NULL) return -1; action.pCont = pReq; @@ -1022,41 +1024,6 @@ int32_t mndAddAlterVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgO return 0; } -static int32_t mndAddSetVnodeStandByAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, - SVnodeGid *pVgid, bool isRedo) { - STransAction action = {0}; - - SDnodeObj *pDnode = mndAcquireDnode(pMnode, pVgid->dnodeId); - if (pDnode == NULL) return -1; - action.epSet = mndGetDnodeEpset(pDnode); - mndReleaseDnode(pMnode, pDnode); - - int32_t contLen = 0; - void *pReq = mndBuildSetVnodeStandbyReq(pMnode, pDnode, pDb, pVgroup, &contLen); - if (pReq == NULL) return -1; - - action.pCont = pReq; - action.contLen = contLen; - action.msgType = TDMT_SYNC_SET_VNODE_STANDBY; - action.acceptableCode = TSDB_CODE_NODE_NOT_DEPLOYED; - // Keep retrying until the target vnode is not the leader - action.retryCode = TSDB_CODE_SYN_IS_LEADER; - - if (isRedo) { - if (mndTransAppendRedoAction(pTrans, &action) != 0) { - taosMemoryFree(pReq); - return -1; - } - } else { - if (mndTransAppendUndoAction(pTrans, &action) != 0) { - taosMemoryFree(pReq); - return -1; - } - } - - return 0; -} - int32_t mndAddDropVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, SVnodeGid *pVgid, bool isRedo) { STransAction action = {0}; @@ -1102,7 +1069,7 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, mInfo("vgId:%d, will add 1 vnodes", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, &newVg, pArray) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1], true) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg, TDMT_VND_ALTER_REPLICA) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; @@ -1111,7 +1078,6 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVnodeGid del = newVg.vnodeGid[vnIndex]; newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); - if (mndAddSetVnodeStandByAction(pMnode, pTrans, pDb, pVgroup, &del, true) != 0) return -1; if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg, TDMT_VND_ALTER_REPLICA) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; @@ -1185,7 +1151,7 @@ static int32_t mndAddIncVgroupReplicaToTrans(SMnode *pMnode, STrans *pTrans, SDb pGid->dnodeId = newDnodeId; pGid->syncState = TAOS_SYNC_STATE_ERROR; - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pGid, true) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pGid) != 0) return -1; if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, pVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, pVgroup) != 0) return -1; @@ -1212,7 +1178,6 @@ static int32_t mndAddDecVgroupReplicaFromTrans(SMnode *pMnode, STrans *pTrans, S memcpy(pGid, &pVgroup->vnodeGid[pVgroup->replica], sizeof(SVnodeGid)); memset(&pVgroup->vnodeGid[pVgroup->replica], 0, sizeof(SVnodeGid)); - if (mndAddSetVnodeStandByAction(pMnode, pTrans, pDb, pVgroup, &delGid, true) != 0) return -1; if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, pVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pDb, pVgroup, &delGid, true) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, pVgroup) != 0) return -1; @@ -1580,36 +1545,32 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb mndTransSetSerial(pTrans); - if (newVgroup.replica < pNewDb->cfg.replications) { - mInfo("db:%s, vgId:%d, vn:0 dnode:%d, will add 2 vnodes", pVgroup->dbName, pVgroup->vgId, + if (newVgroup.replica == 1 && pNewDb->cfg.replications == 3) { + mInfo("db:%s, vgId:%d, will add 2 vnodes, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId); if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1], true) != 0) return -1; - if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1; - if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2], true) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; + if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - } else if (newVgroup.replica > pNewDb->cfg.replications) { - mInfo("db:%s, vgId:%d, will remove 2 vnodes", pVgroup->dbName, pVgroup->vgId); + } + + if (newVgroup.replica == 3 && pNewDb->cfg.replications == 1) { + mInfo("db:%s, vgId:%d, will remove 2 vnodes, vn:0 dnode:%d vn:1 dnode:%d vn:2 dnode:%d", pVgroup->dbName, + pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId, pVgroup->vnodeGid[1].dnodeId, pVgroup->vnodeGid[2].dnodeId); SVnodeGid del1 = {0}; - if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del1) != 0) return -1; - if (mndAddSetVnodeStandByAction(pMnode, pTrans, pNewDb, pVgroup, &del1, true) != 0) return -1; - if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; - if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1; - if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - SVnodeGid del2 = {0}; + if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del1) != 0) return -1; if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del2) != 0) return -1; - if (mndAddSetVnodeStandByAction(pMnode, pTrans, pNewDb, pVgroup, &del2, true) != 0) return -1; - if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; + if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del2, true) != 0) return -1; + if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; } else { + return -1; } { @@ -1660,13 +1621,12 @@ static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj if (newVg1.replica == 1) { if (mndAddVnodeToVgroup(pMnode, &newVg1, pArray) != 0) goto _OVER; - if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg1, &newVg1.vnodeGid[1], true) != 0) goto _OVER; + if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg1, &newVg1.vnodeGid[1]) != 0) goto _OVER; if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg1, TDMT_VND_ALTER_REPLICA) != 0) goto _OVER; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; } else if (newVg1.replica == 3) { SVnodeGid del1 = {0}; if (mndRemoveVnodeFromVgroup(pMnode, &newVg1, pArray, &del1) != 0) goto _OVER; - if (mndAddSetVnodeStandByAction(pMnode, pTrans, pDb, pVgroup, &del1, true) != 0) goto _OVER; if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg1, TDMT_VND_ALTER_REPLICA) != 0) goto _OVER; if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg1, &del1, true) != 0) goto _OVER; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; diff --git a/source/dnode/vnode/inc/vnode.h b/source/dnode/vnode/inc/vnode.h index 96ba9a0602..be0d6fdc4d 100644 --- a/source/dnode/vnode/inc/vnode.h +++ b/source/dnode/vnode/inc/vnode.h @@ -50,6 +50,7 @@ extern const SVnodeCfg vnodeCfgDefault; int32_t vnodeInit(int32_t nthreads); void vnodeCleanup(); int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs); +int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs); void vnodeDestroy(const char *path, STfs *pTfs); SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb); void vnodePreClose(SVnode *pVnode); diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 3dbd93bb27..57fdb77533 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -15,11 +15,9 @@ #include "vnd.h" -int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) { +int32_t vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) { SVnodeInfo info = {0}; - char dir[TSDB_FILENAME_LEN]; - - // TODO: check if directory exists + char dir[TSDB_FILENAME_LEN] = {0}; // check config if (vnodeCheckCfg(pCfg) < 0) { @@ -56,18 +54,60 @@ int vnodeCreate(const char *path, SVnodeCfg *pCfg, STfs *pTfs) { } vInfo("vgId:%d, vnode is created", info.config.vgId); - return 0; } -void vnodeDestroy(const char *path, STfs *pTfs) { tfsRmdir(pTfs, path); } +int32_t vnodeAlter(const char *path, SAlterVnodeReplicaReq *pReq, STfs *pTfs) { + SVnodeInfo info = {0}; + char dir[TSDB_FILENAME_LEN] = {0}; + int32_t ret = 0; + + if (pTfs) { + snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pTfs), TD_DIRSEP, path); + } else { + snprintf(dir, TSDB_FILENAME_LEN, "%s", path); + } + + ret = vnodeLoadInfo(dir, &info); + if (ret < 0) { + vError("vgId:%d, failed to read vnode config from %s since %s", pReq->vgId, path, tstrerror(terrno)); + return -1; + } + + SSyncCfg *pCfg = &info.config.syncCfg; + pCfg->myIndex = pReq->selfIndex; + pCfg->replicaNum = pReq->replica; + memset(&pCfg->nodeInfo, 0, sizeof(pCfg->nodeInfo)); + + vInfo("vgId:%d, save config, replicas:%d selfIndex:%d", pReq->vgId, pCfg->replicaNum, pCfg->myIndex); + for (int i = 0; i < pReq->replica; ++i) { + SNodeInfo *pNode = &pCfg->nodeInfo[i]; + pNode->nodePort = pReq->replicas[i].port; + tstrncpy(pNode->nodeFqdn, pReq->replicas[i].fqdn, sizeof(pNode->nodeFqdn)); + vInfo("vgId:%d, save config, replica:%d ep:%s:%u", pReq->vgId, i, pNode->nodeFqdn, pNode->nodePort); + } + + ret = vnodeSaveInfo(dir, &info); + if (ret < 0) { + vError("vgId:%d, failed to save vnode config since %s", pReq->vgId, tstrerror(terrno)); + return -1; + } + + vInfo("vgId:%d, vnode config is saved", info.config.vgId); + return 0; +} + +void vnodeDestroy(const char *path, STfs *pTfs) { + vInfo("path:%s is removed while destroy vnode", path); + tfsRmdir(pTfs, path); +} SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { SVnode *pVnode = NULL; SVnodeInfo info = {0}; - char dir[TSDB_FILENAME_LEN]; - char tdir[TSDB_FILENAME_LEN * 2]; - int ret; + char dir[TSDB_FILENAME_LEN] = {0}; + char tdir[TSDB_FILENAME_LEN * 2] = {0}; + int32_t ret = 0; if (pTfs) { snprintf(dir, TSDB_FILENAME_LEN, "%s%s%s", tfsGetPrimaryPath(pTfs), TD_DIRSEP, path); @@ -85,7 +125,7 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { } // create handle - pVnode = (SVnode *)taosMemoryCalloc(1, sizeof(*pVnode) + strlen(path) + 1); + pVnode = taosMemoryCalloc(1, sizeof(*pVnode) + strlen(path) + 1); if (pVnode == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; vError("vgId:%d, failed to open vnode since %s", info.config.vgId, tstrerror(terrno)); diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index be6eaccb3b..d3d3a7ed95 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -1068,20 +1068,20 @@ static int32_t vnodeProcessAlterHashRangeReq(SVnode *pVnode, int64_t version, vo } static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t version, void *pReq, int32_t len, SRpcMsg *pRsp) { - SAlterVnodeReq req = {0}; - bool walChanged = false; - bool tsdbChanged = false; + bool walChanged = false; + bool tsdbChanged = false; - if (tDeserializeSAlterVnodeReq(pReq, len, &req) != 0) { + SAlterVnodeConfigReq req = {0}; + if (tDeserializeSAlterVnodeConfigReq(pReq, len, &req) != 0) { terrno = TSDB_CODE_INVALID_MSG; return TSDB_CODE_INVALID_MSG; } vInfo("vgId:%d, start to alter vnode config, page:%d pageSize:%d buffer:%d szPage:%d szBuf:%" PRIu64 - " cacheLast:%d cacheLastSize:%d days:%d keep0:%d keep1:%d keep2:%d fsync:%d level:%d strict:%d", + " cacheLast:%d cacheLastSize:%d days:%d keep0:%d keep1:%d keep2:%d fsync:%d level:%d", TD_VID(pVnode), req.pages, req.pageSize, req.buffer, req.pageSize * 1024, (uint64_t)req.buffer * 1024 * 1024, req.cacheLast, req.cacheLastSize, req.daysPerFile, req.daysToKeep0, req.daysToKeep1, req.daysToKeep2, - req.walFsyncPeriod, req.walLevel, req.strict); + req.walFsyncPeriod, req.walLevel); if (pVnode->config.cacheLastSize != req.cacheLastSize) { pVnode->config.cacheLastSize = req.cacheLastSize; diff --git a/source/dnode/vnode/src/vnd/vnodeSync.c b/source/dnode/vnode/src/vnd/vnodeSync.c index 6bcf603f7f..f59e28daaf 100644 --- a/source/dnode/vnode/src/vnd/vnodeSync.c +++ b/source/dnode/vnode/src/vnd/vnodeSync.c @@ -20,7 +20,7 @@ static inline bool vnodeIsMsgBlock(tmsg_t type) { return (type == TDMT_VND_CREATE_TABLE) || (type == TDMT_VND_ALTER_TABLE) || (type == TDMT_VND_DROP_TABLE) || - (type == TDMT_VND_UPDATE_TAG_VAL) || (type == TDMT_VND_ALTER_REPLICA); + (type == TDMT_VND_UPDATE_TAG_VAL); } static inline bool vnodeIsMsgWeak(tmsg_t type) { return false; } @@ -53,76 +53,6 @@ static inline void vnodePostBlockMsg(SVnode *pVnode, const SRpcMsg *pMsg) { } } -static int32_t vnodeSetStandBy(SVnode *pVnode) { - vInfo("vgId:%d, start to set standby", TD_VID(pVnode)); - - if (syncSetStandby(pVnode->sync) == 0) { - vInfo("vgId:%d, set standby success", TD_VID(pVnode)); - return 0; - } else if (terrno != TSDB_CODE_SYN_IS_LEADER) { - vError("vgId:%d, failed to set standby since %s", TD_VID(pVnode), terrstr()); - return -1; - } - - vInfo("vgId:%d, start to transfer leader", TD_VID(pVnode)); - if (syncLeaderTransfer(pVnode->sync) != 0) { - vError("vgId:%d, failed to transfer leader since:%s", TD_VID(pVnode), terrstr()); - return -1; - } else { - vInfo("vgId:%d, transfer leader success", TD_VID(pVnode)); - } - - if (syncSetStandby(pVnode->sync) == 0) { - vInfo("vgId:%d, set standby success", TD_VID(pVnode)); - return 0; - } else { - vError("vgId:%d, failed to set standby after leader transfer since %s", TD_VID(pVnode), terrstr()); - return -1; - } -} - -static int32_t vnodeProcessAlterReplicaReq(SVnode *pVnode, SRpcMsg *pMsg) { - SAlterVnodeReq req = {0}; - if (tDeserializeSAlterVnodeReq((char *)pMsg->pCont + sizeof(SMsgHead), pMsg->contLen - sizeof(SMsgHead), &req) != 0) { - terrno = TSDB_CODE_INVALID_MSG; - return TSDB_CODE_INVALID_MSG; - } - - const STraceId *trace = &pMsg->info.traceId; - vGTrace("vgId:%d, start to alter vnode replica to %d, handle:%p", TD_VID(pVnode), req.replica, pMsg->info.handle); - - SSyncCfg cfg = {.replicaNum = req.replica, .myIndex = req.selfIndex}; - for (int32_t r = 0; r < req.replica; ++r) { - SNodeInfo *pNode = &cfg.nodeInfo[r]; - tstrncpy(pNode->nodeFqdn, req.replicas[r].fqdn, sizeof(pNode->nodeFqdn)); - pNode->nodePort = req.replicas[r].port; - vInfo("vgId:%d, replica:%d %s:%u", TD_VID(pVnode), r, pNode->nodeFqdn, pNode->nodePort); - } - - SRpcMsg rpcMsg = {.info = pMsg->info}; - if (syncReconfigBuild(pVnode->sync, &cfg, &rpcMsg) != 0) { - vError("vgId:%d, failed to build reconfig msg since %s", TD_VID(pVnode), terrstr()); - return -1; - } - - int32_t code = syncPropose(pVnode->sync, &rpcMsg, false); - if (code != 0) { - if (terrno != 0) code = terrno; - - vInfo("vgId:%d, failed to propose reconfig msg since %s", TD_VID(pVnode), terrstr()); - if (terrno == TSDB_CODE_SYN_IS_LEADER) { - if (syncLeaderTransfer(pVnode->sync) != 0) { - vError("vgId:%d, failed to transfer leader since %s", TD_VID(pVnode), terrstr()); - } else { - vInfo("vgId:%d, transfer leader success", TD_VID(pVnode)); - } - } - } - - terrno = code; - return code; -} - void vnodeRedirectRpcMsg(SVnode *pVnode, SRpcMsg *pMsg) { SEpSet newEpSet = {0}; syncGetRetryEpSet(pVnode->sync, &newEpSet); @@ -169,24 +99,6 @@ static void vnodeHandleProposeError(SVnode *pVnode, SRpcMsg *pMsg, int32_t code) } } -static void vnodeHandleAlterReplicaReq(SVnode *pVnode, SRpcMsg *pMsg) { - int32_t code = vnodeProcessAlterReplicaReq(pVnode, pMsg); - - if (code > 0) { - ASSERT(0); - } else if (code == 0) { - vnodeWaitBlockMsg(pVnode, pMsg); - } else { - if (terrno != 0) code = terrno; - vnodeHandleProposeError(pVnode, pMsg, code); - } - - const STraceId *trace = &pMsg->info.traceId; - vGTrace("vgId:%d, msg:%p is freed, code:0x%x", pVnode->config.vgId, pMsg, code); - rpcFreeCont(pMsg->pCont); - taosFreeQitem(pMsg); -} - static void inline vnodeProposeBatchMsg(SVnode *pVnode, SRpcMsg **pMsgArr, bool *pIsWeakArr, int32_t *arrSize) { if (*arrSize <= 0) return; @@ -265,11 +177,6 @@ void vnodeProposeWriteMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) continue; } - if (pMsg->msgType == TDMT_VND_ALTER_REPLICA) { - vnodeHandleAlterReplicaReq(pVnode, pMsg); - continue; - } - if (isBlock || BATCH_DISABLE) { vnodeProposeBatchMsg(pVnode, pMsgArr, pIsWeakArr, &arrayPos); } @@ -431,11 +338,6 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) { ASSERT(pSyncMsg != NULL); code = syncNodeOnAppendEntriesReplyCb(pSyncNode, pSyncMsg); syncAppendEntriesReplyDestroy(pSyncMsg); - } else if (pMsg->msgType == TDMT_SYNC_SET_VNODE_STANDBY) { - code = vnodeSetStandBy(pVnode); - if (code != 0 && terrno != 0) code = terrno; - SRpcMsg rsp = {.code = code, .info = pMsg->info}; - tmsgSendRsp(&rsp); } else { vGError("vgId:%d, msg:%p failed to process since error msg type:%d", pVnode->config.vgId, pMsg, pMsg->msgType); code = -1; @@ -496,11 +398,6 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) { SyncSnapshotRsp *pSyncMsg = syncSnapshotRspFromRpcMsg2(pMsg); code = syncNodeOnSnapshotRspCb(pSyncNode, pSyncMsg); syncSnapshotRspDestroy(pSyncMsg); - } else if (pMsg->msgType == TDMT_SYNC_SET_VNODE_STANDBY) { - code = vnodeSetStandBy(pVnode); - if (code != 0 && terrno != 0) code = terrno; - SRpcMsg rsp = {.code = code, .info = pMsg->info}; - tmsgSendRsp(&rsp); } else { vGError("vgId:%d, msg:%p failed to process since error msg type:%d", pVnode->config.vgId, pMsg, pMsg->msgType); code = -1; @@ -543,22 +440,7 @@ static int32_t vnodeSyncGetSnapshot(SSyncFSM *pFsm, SSnapshot *pSnapshot) { return 0; } -static void vnodeSyncReconfig(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SReConfigCbMeta *cbMeta) { - SVnode *pVnode = pFsm->data; - - SRpcMsg rpcMsg = {.msgType = pMsg->msgType, .contLen = pMsg->contLen}; - syncGetAndDelRespRpc(pVnode->sync, cbMeta->newCfgSeqNum, &rpcMsg.info); - rpcMsg.info.conn.applyIndex = cbMeta->index; - - const STraceId *trace = (STraceId *)&pMsg->info.traceId; - vGTrace("vgId:%d, alter vnode replica is confirmed, type:%s contLen:%d seq:%" PRIu64 " handle:%p", TD_VID(pVnode), - TMSG_INFO(pMsg->msgType), pMsg->contLen, cbMeta->seqNum, rpcMsg.info.handle); - if (rpcMsg.info.handle != NULL) { - tmsgSendRsp(&rpcMsg); - } - - vnodePostBlockMsg(pVnode, pMsg); -} +static void vnodeSyncReconfig(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SReConfigCbMeta *cbMeta) {} static void vnodeSyncCommitMsg(SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cbMeta) { if (cbMeta.isWeak == 0) { From 2339b8c0a62144ca2fa9183b6e566d07ed11618c Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 20 Oct 2022 16:53:26 +0800 Subject: [PATCH 56/99] some parser problem --- source/libs/parser/src/parAstParser.c | 9 +++++++-- source/libs/parser/src/parTranslater.c | 18 +++++++++++++++++- tools/shell/src/shellEngine.c | 16 +++++----------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index 64aa017a68..95db6b93c9 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -455,8 +455,13 @@ static int32_t collectMetaKeyFromShowLicence(SCollectMetaKeyCxt* pCxt, SShowStmt } static int32_t collectMetaKeyFromShowVgroups(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { - return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, - pCxt->pMetaCache); + int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_VGROUPS, + pCxt->pMetaCache); + if (TSDB_CODE_SUCCESS == code) { + // just to verify whether the database exists + code = reserveDbCfgInCache(pCxt->pParseCxt->acctId, ((SValueNode*)pStmt->pDbName)->literal, pCxt->pMetaCache); + } + return code; } static int32_t collectMetaKeyFromShowTopics(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) { diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 5a05440c73..24f1bba5a3 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -6212,6 +6212,20 @@ static int32_t rewriteShow(STranslateContext* pCxt, SQuery* pQuery) { return code; } +static int32_t checkShowVgroups(STranslateContext* pCxt, SShowStmt* pShow) { + // just to verify whether the database exists + SDbCfgInfo dbCfg = {0}; + return getDBCfg(pCxt, ((SValueNode*)pShow->pDbName)->literal, &dbCfg); +} + +static int32_t rewriteShowVgroups(STranslateContext* pCxt, SQuery* pQuery) { + int32_t code = checkShowVgroups(pCxt, (SShowStmt*)pQuery->pRoot); + if (TSDB_CODE_SUCCESS == code) { + code = rewriteShow(pCxt, pQuery); + } + return code; +} + static SNode* createTagsFunction() { SFunctionNode* pFunc = (SFunctionNode*)nodesMakeNode(QUERY_NODE_FUNCTION); if (NULL == pFunc) { @@ -7358,7 +7372,6 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_STABLES_STMT: case QUERY_NODE_SHOW_USERS_STMT: case QUERY_NODE_SHOW_DNODES_STMT: - case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_MNODES_STMT: case QUERY_NODE_SHOW_MODULES_STMT: case QUERY_NODE_SHOW_QNODES_STMT: @@ -7378,6 +7391,9 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) { case QUERY_NODE_SHOW_TAGS_STMT: code = rewriteShow(pCxt, pQuery); break; + case QUERY_NODE_SHOW_VGROUPS_STMT: + code = rewriteShowVgroups(pCxt, pQuery); + break; case QUERY_NODE_SHOW_TABLE_TAGS_STMT: code = rewriteShowStableTags(pCxt, pQuery); break; diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 37d00c0a7c..e216d597a3 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -285,6 +285,10 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i return; } + char quotationStr[2]; + quotationStr[0] = '\"'; + quotationStr[1] = 0; + int n; char buf[TSDB_MAX_BYTES_PER_ROW]; switch (field->type) { @@ -330,33 +334,23 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_JSON: { - char quotationStr[2]; int32_t bufIndex = 0; - quotationStr[0] = 0; - quotationStr[1] = 0; for (int32_t i = 0; i < length; i++) { buf[bufIndex] = val[i]; bufIndex++; if (val[i] == '\"') { buf[bufIndex] = val[i]; bufIndex++; - quotationStr[0] = '\"'; - } - if (val[i] == ',') { - quotationStr[0] = '\"'; } } buf[bufIndex] = 0; - if (length == 0) { - quotationStr[0] = '\"'; - } taosFprintfFile(pFile, "%s%s%s", quotationStr, buf, quotationStr); } break; case TSDB_DATA_TYPE_TIMESTAMP: shellFormatTimestamp(buf, *(int64_t *)val, precision); - taosFprintfFile(pFile, "%s", buf); + taosFprintfFile(pFile, "%s%s%s", quotationStr, buf, quotationStr); break; default: break; From 7c6ade9c07b7446d9010c3e80718a68f3904c74d Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 20 Oct 2022 17:02:57 +0800 Subject: [PATCH 57/99] enh: alter db replica --- source/libs/parser/inc/sql.y | 4 +- source/libs/parser/src/sql.c | 3690 +++++++++++++++++----------------- 2 files changed, 1852 insertions(+), 1842 deletions(-) diff --git a/source/libs/parser/inc/sql.y b/source/libs/parser/inc/sql.y index 3eefd7fb44..09dfa54df6 100644 --- a/source/libs/parser/inc/sql.y +++ b/source/libs/parser/inc/sql.y @@ -224,8 +224,8 @@ alter_db_option(A) ::= WAL_FSYNC_PERIOD NK_INTEGER(B). alter_db_option(A) ::= KEEP integer_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; } alter_db_option(A) ::= KEEP variable_list(B). { A.type = DB_OPTION_KEEP; A.pList = B; } alter_db_option(A) ::= PAGES NK_INTEGER(B). { A.type = DB_OPTION_PAGES; A.val = B; } -//alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; } -//alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } +alter_db_option(A) ::= REPLICA NK_INTEGER(B). { A.type = DB_OPTION_REPLICA; A.val = B; } +alter_db_option(A) ::= STRICT NK_STRING(B). { A.type = DB_OPTION_STRICT; A.val = B; } alter_db_option(A) ::= WAL_LEVEL NK_INTEGER(B). { A.type = DB_OPTION_WAL; A.val = B; } alter_db_option(A) ::= STT_TRIGGER NK_INTEGER(B). { A.type = DB_OPTION_STT_TRIGGER; A.val = B; } diff --git a/source/libs/parser/src/sql.c b/source/libs/parser/src/sql.c index 6daf06731f..deb38a77e3 100644 --- a/source/libs/parser/src/sql.c +++ b/source/libs/parser/src/sql.c @@ -139,17 +139,17 @@ typedef union { #define ParseCTX_FETCH #define ParseCTX_STORE #define YYFALLBACK 1 -#define YYNSTATE 694 -#define YYNRULE 522 +#define YYNSTATE 696 +#define YYNRULE 524 #define YYNTOKEN 317 -#define YY_MAX_SHIFT 693 -#define YY_MIN_SHIFTREDUCE 1025 -#define YY_MAX_SHIFTREDUCE 1546 -#define YY_ERROR_ACTION 1547 -#define YY_ACCEPT_ACTION 1548 -#define YY_NO_ACTION 1549 -#define YY_MIN_REDUCE 1550 -#define YY_MAX_REDUCE 2071 +#define YY_MAX_SHIFT 695 +#define YY_MIN_SHIFTREDUCE 1029 +#define YY_MAX_SHIFTREDUCE 1552 +#define YY_ERROR_ACTION 1553 +#define YY_ACCEPT_ACTION 1554 +#define YY_NO_ACTION 1555 +#define YY_MIN_REDUCE 1556 +#define YY_MAX_REDUCE 2079 /************* End control #defines *******************************************/ #define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) @@ -218,288 +218,288 @@ typedef union { *********** Begin parsing tables **********************************************/ #define YY_ACTTAB_COUNT (2819) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 1873, 34, 267, 1873, 156, 1058, 1562, 1887, 62, 532, - /* 10 */ 1690, 1869, 44, 42, 1869, 446, 334, 447, 1585, 1799, - /* 20 */ 349, 1869, 1327, 43, 41, 40, 39, 38, 586, 157, - /* 30 */ 167, 1548, 1352, 1407, 1654, 1325, 1905, 1865, 1871, 337, - /* 40 */ 1865, 1871, 343, 1738, 587, 1062, 1063, 1865, 1871, 1855, - /* 50 */ 593, 599, 30, 593, 445, 1573, 1402, 449, 37, 36, - /* 60 */ 593, 17, 43, 41, 40, 39, 38, 1887, 1333, 44, - /* 70 */ 42, 1477, 1885, 1572, 503, 586, 1921, 349, 571, 1327, - /* 80 */ 97, 1886, 1888, 603, 1890, 1891, 598, 77, 593, 513, - /* 90 */ 1407, 364, 1325, 168, 1, 1974, 1905, 1855, 58, 342, - /* 100 */ 1970, 125, 46, 218, 600, 583, 58, 2042, 528, 1855, - /* 110 */ 1694, 599, 173, 1402, 463, 1855, 690, 506, 17, 1571, - /* 120 */ 2000, 500, 570, 171, 586, 1333, 217, 2043, 572, 2046, - /* 130 */ 1409, 1410, 601, 2047, 132, 583, 1921, 2042, 394, 1570, - /* 140 */ 98, 348, 1888, 603, 1890, 1891, 598, 454, 593, 447, - /* 150 */ 1585, 1, 2048, 171, 1075, 1974, 1074, 2043, 572, 314, - /* 160 */ 1970, 1855, 2042, 64, 132, 1474, 63, 58, 1481, 482, - /* 170 */ 2042, 130, 335, 690, 1352, 1328, 310, 1326, 2046, 219, - /* 180 */ 154, 1855, 2043, 2045, 1076, 570, 171, 1409, 1410, 1701, - /* 190 */ 2043, 572, 585, 169, 1982, 1983, 1353, 1987, 46, 1331, - /* 200 */ 1332, 121, 1382, 1383, 1385, 1386, 1387, 1388, 1389, 1390, - /* 210 */ 1391, 1392, 595, 591, 1400, 1401, 1403, 1404, 1405, 1406, - /* 220 */ 1408, 1411, 3, 264, 1982, 582, 1676, 581, 1745, 1746, - /* 230 */ 2042, 1417, 1328, 383, 1326, 79, 312, 1352, 388, 535, - /* 240 */ 174, 1503, 494, 493, 174, 570, 171, 387, 174, 386, - /* 250 */ 2043, 572, 174, 385, 381, 528, 1331, 1332, 58, 1382, - /* 260 */ 1383, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 595, - /* 270 */ 591, 1400, 1401, 1403, 1404, 1405, 1406, 1408, 1411, 3, - /* 280 */ 44, 42, 693, 181, 2042, 233, 234, 628, 349, 77, - /* 290 */ 1327, 558, 1501, 1502, 1504, 1505, 274, 545, 1887, 2048, - /* 300 */ 171, 1407, 545, 1325, 2043, 572, 1222, 1223, 1569, 52, - /* 310 */ 165, 1874, 1695, 174, 120, 683, 679, 675, 671, 272, - /* 320 */ 74, 484, 1869, 73, 1402, 220, 1699, 1905, 1729, 17, - /* 330 */ 354, 1699, 634, 1744, 1746, 600, 1333, 44, 42, 1075, - /* 340 */ 1855, 1074, 599, 312, 143, 349, 535, 1327, 1865, 1871, - /* 350 */ 1855, 145, 144, 631, 630, 629, 95, 1384, 1407, 240, - /* 360 */ 1325, 593, 1, 601, 451, 561, 545, 1921, 634, 1076, - /* 370 */ 1350, 294, 348, 1888, 603, 1890, 1891, 598, 120, 593, - /* 380 */ 47, 1402, 1551, 574, 690, 489, 17, 145, 144, 631, - /* 390 */ 630, 629, 542, 1333, 1568, 1699, 51, 453, 1409, 1410, - /* 400 */ 449, 2042, 1473, 110, 174, 1140, 109, 108, 107, 106, - /* 410 */ 105, 104, 103, 102, 101, 1352, 570, 171, 1989, 1, - /* 420 */ 1384, 2043, 572, 110, 229, 227, 109, 108, 107, 106, - /* 430 */ 105, 104, 103, 102, 101, 545, 1855, 545, 1142, 431, - /* 440 */ 545, 690, 1299, 1328, 222, 1326, 1986, 176, 1353, 392, - /* 450 */ 567, 562, 393, 37, 36, 1409, 1410, 43, 41, 40, - /* 460 */ 39, 38, 1567, 58, 1699, 81, 1699, 1331, 1332, 1699, - /* 470 */ 1382, 1383, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, - /* 480 */ 595, 591, 1400, 1401, 1403, 1404, 1405, 1406, 1408, 1411, - /* 490 */ 3, 11, 11, 9, 7, 185, 184, 40, 39, 38, - /* 500 */ 1328, 547, 1326, 1946, 1855, 325, 1180, 625, 624, 623, - /* 510 */ 1184, 622, 1186, 1187, 621, 1189, 618, 636, 1195, 615, - /* 520 */ 1197, 1198, 612, 609, 1331, 1332, 174, 1382, 1383, 1385, - /* 530 */ 1386, 1387, 1388, 1389, 1390, 1391, 1392, 595, 591, 1400, - /* 540 */ 1401, 1403, 1404, 1405, 1406, 1408, 1411, 3, 44, 42, - /* 550 */ 1751, 545, 1905, 498, 497, 496, 349, 336, 1327, 1550, - /* 560 */ 565, 126, 492, 403, 545, 326, 1749, 324, 323, 1407, - /* 570 */ 486, 1325, 491, 495, 488, 1352, 417, 1566, 490, 1565, - /* 580 */ 1699, 1887, 512, 119, 118, 117, 116, 115, 114, 113, - /* 590 */ 112, 111, 1402, 1699, 352, 510, 487, 508, 1384, 564, - /* 600 */ 1887, 1751, 154, 1564, 1333, 44, 42, 1412, 353, 174, - /* 610 */ 1905, 1701, 1543, 349, 2047, 1327, 355, 1749, 600, 1855, - /* 620 */ 1354, 1855, 1677, 1855, 154, 599, 1407, 1751, 1325, 1905, - /* 630 */ 8, 1354, 1802, 1701, 319, 2047, 11, 600, 232, 545, - /* 640 */ 13, 12, 1855, 1749, 599, 1855, 1885, 1561, 1675, 1402, - /* 650 */ 1921, 418, 690, 531, 158, 1886, 1888, 603, 1890, 1891, - /* 660 */ 598, 1333, 593, 1842, 2042, 1885, 1409, 1410, 1699, 1921, - /* 670 */ 528, 545, 571, 97, 1886, 1888, 603, 1890, 1891, 598, - /* 680 */ 2046, 593, 463, 461, 2043, 2044, 2062, 8, 1974, 1855, - /* 690 */ 94, 1438, 342, 1970, 1470, 550, 2011, 1305, 1306, 2042, - /* 700 */ 1699, 2042, 2008, 566, 127, 87, 1536, 1542, 636, 690, - /* 710 */ 371, 1328, 1691, 1326, 2048, 171, 570, 171, 532, 2043, - /* 720 */ 572, 2043, 572, 1409, 1410, 37, 36, 1692, 1800, 43, - /* 730 */ 41, 40, 39, 38, 1450, 1331, 1332, 1355, 1382, 1383, - /* 740 */ 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 595, 591, - /* 750 */ 1400, 1401, 1403, 1404, 1405, 1406, 1408, 1411, 3, 37, - /* 760 */ 36, 31, 266, 43, 41, 40, 39, 38, 1328, 1615, - /* 770 */ 1326, 1443, 1351, 266, 37, 36, 174, 32, 43, 41, - /* 780 */ 40, 39, 38, 37, 36, 1560, 1559, 43, 41, 40, - /* 790 */ 39, 38, 1331, 1332, 1558, 1382, 1383, 1385, 1386, 1387, - /* 800 */ 1388, 1389, 1390, 1391, 1392, 595, 591, 1400, 1401, 1403, - /* 810 */ 1404, 1405, 1406, 1408, 1411, 3, 44, 42, 549, 583, - /* 820 */ 1946, 661, 659, 1798, 349, 307, 1327, 1855, 1855, 1797, - /* 830 */ 395, 307, 498, 497, 496, 1333, 1855, 1407, 545, 1325, - /* 840 */ 126, 492, 545, 396, 1792, 1792, 1513, 1355, 132, 1887, - /* 850 */ 462, 491, 495, 1557, 1696, 179, 180, 490, 37, 36, - /* 860 */ 1402, 1493, 43, 41, 40, 39, 38, 1699, 1887, 1792, - /* 870 */ 545, 1699, 1333, 44, 42, 545, 1688, 545, 1905, 243, - /* 880 */ 183, 349, 137, 1327, 1751, 130, 600, 524, 1989, 529, - /* 890 */ 545, 1855, 154, 599, 1407, 1855, 1325, 1905, 8, 1699, - /* 900 */ 1750, 1702, 237, 545, 1699, 600, 1699, 170, 1982, 1983, - /* 910 */ 1855, 1987, 599, 1336, 1885, 541, 1985, 1402, 1921, 1699, - /* 920 */ 690, 1887, 159, 1886, 1888, 603, 1890, 1891, 598, 1333, - /* 930 */ 593, 488, 1699, 1885, 1409, 1410, 1556, 1921, 1555, 402, - /* 940 */ 545, 97, 1886, 1888, 603, 1890, 1891, 598, 128, 593, - /* 950 */ 1905, 1945, 356, 487, 2062, 1, 1974, 1989, 600, 545, - /* 960 */ 342, 1970, 578, 1855, 545, 599, 649, 648, 1669, 1699, - /* 970 */ 2036, 543, 545, 575, 573, 2063, 544, 690, 1855, 1328, - /* 980 */ 1855, 1326, 1674, 1602, 268, 1984, 1885, 72, 1699, 242, - /* 990 */ 1921, 1409, 1410, 1699, 159, 1886, 1888, 603, 1890, 1891, - /* 1000 */ 598, 1699, 593, 1331, 1332, 499, 1382, 1383, 1385, 1386, - /* 1010 */ 1387, 1388, 1389, 1390, 1391, 1392, 595, 591, 1400, 1401, - /* 1020 */ 1403, 1404, 1405, 1406, 1408, 1411, 3, 37, 36, 205, - /* 1030 */ 1684, 43, 41, 40, 39, 38, 1328, 632, 1326, 362, - /* 1040 */ 1742, 633, 45, 161, 1742, 1554, 1335, 2064, 480, 476, - /* 1050 */ 472, 468, 204, 1553, 279, 1339, 528, 1729, 1062, 1063, - /* 1060 */ 1331, 1332, 1612, 1382, 1383, 1385, 1386, 1387, 1388, 1389, - /* 1070 */ 1390, 1391, 1392, 595, 591, 1400, 1401, 1403, 1404, 1405, - /* 1080 */ 1406, 1408, 1411, 3, 309, 2042, 1350, 1855, 634, 78, - /* 1090 */ 1994, 1470, 202, 425, 1276, 1855, 436, 48, 4, 210, - /* 1100 */ 2048, 171, 208, 50, 527, 2043, 572, 145, 144, 631, - /* 1110 */ 630, 629, 1686, 410, 231, 437, 212, 412, 214, 211, - /* 1120 */ 216, 213, 138, 215, 226, 667, 666, 665, 664, 359, - /* 1130 */ 1682, 663, 662, 133, 657, 656, 655, 654, 653, 652, - /* 1140 */ 651, 650, 147, 646, 645, 644, 358, 357, 641, 640, - /* 1150 */ 639, 638, 637, 155, 201, 195, 1597, 200, 285, 322, - /* 1160 */ 1595, 459, 1545, 1546, 80, 642, 235, 142, 13, 12, - /* 1170 */ 590, 398, 283, 66, 538, 143, 65, 193, 501, 60, - /* 1180 */ 579, 153, 504, 247, 1327, 1876, 60, 1122, 1338, 576, - /* 1190 */ 223, 45, 189, 442, 440, 1887, 594, 1325, 2047, 435, - /* 1200 */ 45, 607, 430, 429, 428, 427, 424, 423, 422, 421, - /* 1210 */ 420, 416, 415, 414, 413, 407, 406, 405, 404, 239, - /* 1220 */ 400, 399, 321, 142, 1905, 523, 627, 1173, 143, 58, - /* 1230 */ 1333, 1500, 600, 1878, 1563, 250, 1655, 1855, 1444, 599, - /* 1240 */ 2014, 37, 36, 1393, 122, 43, 41, 40, 39, 38, - /* 1250 */ 37, 36, 278, 1201, 43, 41, 40, 39, 38, 1102, - /* 1260 */ 1885, 142, 643, 261, 1921, 559, 481, 96, 97, 1886, - /* 1270 */ 1888, 603, 1890, 1891, 598, 1205, 593, 1887, 690, 129, - /* 1280 */ 1212, 141, 1945, 1974, 1120, 26, 1591, 342, 1970, 255, - /* 1290 */ 1536, 1906, 1103, 360, 315, 1586, 1210, 1739, 2004, 93, - /* 1300 */ 584, 260, 71, 70, 391, 263, 1905, 178, 1428, 90, - /* 1310 */ 2, 332, 5, 146, 600, 365, 370, 320, 1292, 1855, - /* 1320 */ 182, 599, 275, 397, 308, 401, 1350, 379, 1887, 377, - /* 1330 */ 373, 369, 366, 363, 685, 419, 1436, 1328, 1794, 1326, - /* 1340 */ 426, 433, 1885, 432, 434, 583, 1921, 438, 1356, 439, - /* 1350 */ 301, 1886, 1888, 603, 1890, 1891, 598, 1905, 593, 186, - /* 1360 */ 1358, 1331, 1332, 441, 361, 587, 443, 444, 452, 455, - /* 1370 */ 1855, 192, 599, 456, 132, 174, 194, 516, 1357, 457, - /* 1380 */ 1359, 528, 458, 197, 199, 75, 76, 464, 460, 203, - /* 1390 */ 1437, 483, 485, 1885, 528, 100, 1689, 1921, 207, 1685, - /* 1400 */ 515, 97, 1886, 1888, 603, 1890, 1891, 598, 311, 593, - /* 1410 */ 2042, 130, 209, 148, 168, 221, 1974, 517, 1833, 276, - /* 1420 */ 342, 1970, 149, 2042, 1687, 2048, 171, 1683, 518, 150, - /* 1430 */ 2043, 572, 151, 172, 1982, 1983, 522, 1987, 2048, 171, - /* 1440 */ 519, 2001, 224, 2043, 572, 525, 1887, 530, 228, 557, - /* 1450 */ 331, 533, 1832, 139, 1804, 536, 140, 333, 539, 84, - /* 1460 */ 33, 346, 1431, 1432, 1433, 1434, 1435, 1439, 1440, 1441, - /* 1470 */ 1442, 540, 277, 1700, 86, 1905, 1355, 553, 560, 2005, - /* 1480 */ 2015, 6, 245, 600, 555, 556, 249, 338, 1855, 2020, - /* 1490 */ 599, 569, 563, 1996, 2019, 554, 552, 551, 259, 339, - /* 1500 */ 580, 577, 1470, 131, 1354, 57, 162, 254, 1955, 88, - /* 1510 */ 256, 1885, 1990, 1887, 605, 1921, 1743, 1670, 257, 97, - /* 1520 */ 1886, 1888, 603, 1890, 1891, 598, 258, 593, 280, 271, - /* 1530 */ 686, 687, 2062, 689, 1974, 1887, 2041, 292, 342, 1970, - /* 1540 */ 262, 306, 1905, 49, 2065, 282, 303, 302, 1993, 284, - /* 1550 */ 600, 1849, 1848, 68, 1847, 1855, 69, 599, 1846, 1843, - /* 1560 */ 367, 368, 1319, 1320, 1905, 177, 372, 1841, 374, 375, - /* 1570 */ 376, 1840, 600, 378, 1839, 380, 1838, 1855, 1885, 599, - /* 1580 */ 1837, 384, 1921, 382, 1295, 1294, 97, 1886, 1888, 603, - /* 1590 */ 1890, 1891, 598, 1887, 593, 1815, 1814, 389, 390, 1949, - /* 1600 */ 1885, 1974, 1813, 1812, 1921, 342, 1970, 134, 97, 1886, - /* 1610 */ 1888, 603, 1890, 1891, 598, 1887, 593, 1787, 1264, 345, - /* 1620 */ 344, 1947, 1905, 1974, 1786, 1784, 1783, 342, 1970, 1341, - /* 1630 */ 600, 1782, 1785, 135, 1781, 1855, 408, 599, 1780, 1779, - /* 1640 */ 1407, 1778, 1334, 1777, 1905, 1776, 409, 1775, 411, 1774, - /* 1650 */ 1773, 1772, 600, 1771, 1770, 1769, 1768, 1855, 1885, 599, - /* 1660 */ 1767, 1766, 1921, 1402, 1765, 1764, 97, 1886, 1888, 603, - /* 1670 */ 1890, 1891, 598, 1763, 593, 1333, 1762, 1761, 1760, 548, - /* 1680 */ 1885, 1974, 136, 1759, 1921, 342, 1970, 1148, 98, 1886, - /* 1690 */ 1888, 603, 1890, 1891, 598, 1758, 593, 1757, 1756, 1755, - /* 1700 */ 1754, 1266, 1753, 1974, 1752, 1617, 1616, 1973, 1970, 1614, - /* 1710 */ 1582, 190, 448, 187, 188, 166, 450, 1065, 1581, 123, - /* 1720 */ 124, 1064, 1887, 589, 191, 1828, 1822, 1811, 196, 198, - /* 1730 */ 1810, 1796, 1678, 1095, 1613, 1611, 465, 466, 1609, 470, - /* 1740 */ 1607, 474, 1605, 478, 1594, 1593, 469, 467, 1578, 473, - /* 1750 */ 1680, 1905, 471, 1679, 475, 477, 479, 1216, 1215, 600, - /* 1760 */ 1603, 1598, 59, 206, 1855, 502, 599, 658, 1139, 1132, - /* 1770 */ 1596, 660, 1138, 327, 1137, 1577, 1134, 328, 1133, 329, - /* 1780 */ 1576, 1131, 1342, 1575, 1337, 511, 99, 1885, 1311, 505, - /* 1790 */ 1887, 1921, 1827, 507, 509, 98, 1886, 1888, 603, 1890, - /* 1800 */ 1891, 598, 1821, 593, 53, 152, 1345, 1347, 1301, 1887, - /* 1810 */ 1974, 520, 1809, 25, 588, 1970, 1807, 2047, 1808, 1905, - /* 1820 */ 591, 1400, 1401, 1403, 1404, 1405, 1406, 597, 1309, 521, - /* 1830 */ 330, 1806, 1855, 225, 599, 1805, 1803, 1795, 1905, 526, - /* 1840 */ 83, 241, 537, 18, 238, 1419, 600, 230, 19, 20, - /* 1850 */ 534, 1855, 15, 599, 10, 1885, 236, 253, 82, 1921, - /* 1860 */ 90, 1876, 85, 300, 1886, 1888, 603, 1890, 1891, 598, - /* 1870 */ 596, 593, 546, 1939, 1885, 27, 1887, 1515, 1921, 246, - /* 1880 */ 244, 248, 98, 1886, 1888, 603, 1890, 1891, 598, 1497, - /* 1890 */ 593, 56, 1499, 1887, 160, 252, 29, 1974, 251, 61, - /* 1900 */ 22, 28, 1971, 1492, 89, 1905, 265, 1530, 1418, 1529, - /* 1910 */ 340, 1534, 1535, 597, 1536, 1533, 341, 1467, 1855, 1466, - /* 1920 */ 599, 55, 1905, 1875, 12, 163, 1343, 1924, 1429, 54, - /* 1930 */ 600, 164, 21, 1397, 592, 1855, 1887, 599, 1395, 35, - /* 1940 */ 14, 1885, 1375, 175, 1394, 1921, 1367, 604, 23, 300, - /* 1950 */ 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1885, 1940, - /* 1960 */ 24, 606, 1921, 1202, 351, 1905, 158, 1886, 1888, 603, - /* 1970 */ 1890, 1891, 598, 600, 593, 602, 608, 610, 1855, 1199, - /* 1980 */ 599, 611, 613, 1196, 614, 1905, 1190, 616, 617, 619, - /* 1990 */ 347, 1194, 620, 600, 1188, 1179, 91, 92, 1855, 626, - /* 2000 */ 599, 1885, 1211, 67, 1193, 1921, 269, 1887, 2012, 296, - /* 2010 */ 1886, 1888, 603, 1890, 1891, 598, 16, 593, 1192, 1191, - /* 2020 */ 1207, 1885, 1093, 635, 1128, 1921, 1127, 1126, 1125, 301, - /* 2030 */ 1886, 1888, 603, 1890, 1891, 598, 1905, 593, 1124, 1123, - /* 2040 */ 1121, 350, 1119, 1118, 600, 1117, 1146, 647, 1115, 1855, - /* 2050 */ 1114, 599, 270, 568, 1113, 1112, 1111, 1110, 1109, 1108, - /* 2060 */ 1141, 1105, 1143, 1104, 1101, 1100, 1099, 1610, 1098, 1608, - /* 2070 */ 668, 1606, 1885, 672, 669, 670, 1921, 676, 673, 674, - /* 2080 */ 301, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 678, - /* 2090 */ 677, 1604, 680, 681, 682, 1592, 684, 1055, 1574, 273, - /* 2100 */ 688, 1549, 1329, 281, 691, 1887, 692, 1549, 1549, 1549, - /* 2110 */ 1549, 1549, 1549, 1549, 1549, 1549, 1905, 1549, 1549, 1549, - /* 2120 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2130 */ 1549, 599, 1549, 1549, 1905, 1549, 1549, 1549, 1549, 1549, - /* 2140 */ 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, 1887, 599, - /* 2150 */ 1549, 1549, 514, 1549, 1549, 1549, 1921, 1549, 1549, 1549, - /* 2160 */ 294, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1549, - /* 2170 */ 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1905, 286, 1886, - /* 2180 */ 1888, 603, 1890, 1891, 598, 600, 593, 1549, 1549, 1549, - /* 2190 */ 1855, 1887, 599, 1549, 1549, 1549, 1905, 1549, 1549, 1549, - /* 2200 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2210 */ 1549, 599, 1549, 1885, 1549, 1549, 1549, 1921, 1549, 1549, - /* 2220 */ 1905, 287, 1886, 1888, 603, 1890, 1891, 598, 600, 593, - /* 2230 */ 1549, 1549, 1885, 1855, 1887, 599, 1921, 1549, 1549, 1549, - /* 2240 */ 288, 1886, 1888, 603, 1890, 1891, 598, 1549, 593, 1549, - /* 2250 */ 1549, 1887, 1549, 1549, 1549, 1549, 1885, 1549, 1549, 1549, - /* 2260 */ 1921, 1549, 1549, 1905, 295, 1886, 1888, 603, 1890, 1891, - /* 2270 */ 598, 600, 593, 1549, 1549, 1549, 1855, 1887, 599, 1549, - /* 2280 */ 1905, 1549, 1549, 1549, 1549, 1549, 1549, 1549, 600, 1549, - /* 2290 */ 1549, 1549, 1549, 1855, 1887, 599, 1549, 1549, 1549, 1885, - /* 2300 */ 1549, 1549, 1549, 1921, 1549, 1549, 1905, 297, 1886, 1888, - /* 2310 */ 603, 1890, 1891, 598, 600, 593, 1885, 1549, 1549, 1855, - /* 2320 */ 1921, 599, 1549, 1905, 289, 1886, 1888, 603, 1890, 1891, - /* 2330 */ 598, 600, 593, 1549, 1549, 1549, 1855, 1549, 599, 1549, - /* 2340 */ 1549, 1549, 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1549, - /* 2350 */ 298, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1885, - /* 2360 */ 1549, 1549, 1549, 1921, 1549, 1549, 1549, 290, 1886, 1888, - /* 2370 */ 603, 1890, 1891, 598, 1887, 593, 1549, 1549, 1549, 1549, - /* 2380 */ 1549, 1549, 1549, 1549, 1549, 1549, 1905, 1549, 1549, 1549, - /* 2390 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2400 */ 1549, 599, 1549, 1905, 1549, 1549, 1549, 1549, 1549, 1549, - /* 2410 */ 1549, 600, 1549, 1549, 1549, 1549, 1855, 1549, 599, 1549, - /* 2420 */ 1549, 1549, 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1549, - /* 2430 */ 299, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1885, - /* 2440 */ 1549, 1549, 1549, 1921, 1549, 1549, 1549, 291, 1886, 1888, - /* 2450 */ 603, 1890, 1891, 598, 1549, 593, 1549, 1549, 1549, 1549, - /* 2460 */ 1549, 1549, 1549, 1887, 1549, 1549, 1905, 1549, 1549, 1549, - /* 2470 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2480 */ 1549, 599, 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, - /* 2490 */ 1549, 1549, 1905, 1549, 1549, 1549, 1549, 1549, 1549, 1549, - /* 2500 */ 600, 1549, 1885, 1549, 1549, 1855, 1921, 599, 1549, 1549, - /* 2510 */ 304, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1549, - /* 2520 */ 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1885, 1549, - /* 2530 */ 1549, 1549, 1921, 1549, 1887, 1549, 305, 1886, 1888, 603, - /* 2540 */ 1890, 1891, 598, 1549, 593, 1549, 1905, 1549, 1549, 1549, - /* 2550 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2560 */ 1549, 599, 1549, 1905, 1549, 1549, 1549, 1549, 1549, 1549, - /* 2570 */ 1549, 600, 1549, 1549, 1549, 1549, 1855, 1887, 599, 1549, - /* 2580 */ 1549, 1549, 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1549, - /* 2590 */ 1899, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1885, - /* 2600 */ 1549, 1549, 1549, 1921, 1549, 1549, 1905, 1898, 1886, 1888, - /* 2610 */ 603, 1890, 1891, 598, 600, 593, 1549, 1549, 1549, 1855, - /* 2620 */ 1549, 599, 1549, 1549, 1549, 1549, 1905, 1549, 1549, 1549, - /* 2630 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2640 */ 1887, 599, 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1549, - /* 2650 */ 1897, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1549, - /* 2660 */ 1549, 1549, 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1905, - /* 2670 */ 316, 1886, 1888, 603, 1890, 1891, 598, 600, 593, 1549, - /* 2680 */ 1549, 1549, 1855, 1549, 599, 1549, 1905, 1549, 1549, 1549, - /* 2690 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2700 */ 1549, 599, 1549, 1549, 1549, 1885, 1549, 1549, 1549, 1921, - /* 2710 */ 1549, 1549, 1549, 317, 1886, 1888, 603, 1890, 1891, 598, - /* 2720 */ 1887, 593, 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1549, - /* 2730 */ 313, 1886, 1888, 603, 1890, 1891, 598, 1887, 593, 1549, - /* 2740 */ 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1905, - /* 2750 */ 1549, 1549, 1549, 1549, 1549, 1549, 1549, 600, 1549, 1549, - /* 2760 */ 1549, 1549, 1855, 1549, 599, 1549, 1905, 1549, 1549, 1549, - /* 2770 */ 1549, 1549, 1549, 1549, 600, 1549, 1549, 1549, 1549, 1855, - /* 2780 */ 1549, 599, 1549, 1549, 1549, 1885, 1549, 1549, 1549, 1921, - /* 2790 */ 1549, 1549, 1549, 318, 1886, 1888, 603, 1890, 1891, 598, - /* 2800 */ 1549, 593, 1885, 1549, 1549, 1549, 1921, 1549, 1549, 1549, - /* 2810 */ 293, 1886, 1888, 603, 1890, 1891, 598, 1549, 593, + /* 0 */ 1881, 34, 267, 1881, 157, 1062, 1568, 1895, 62, 534, + /* 10 */ 1698, 1877, 44, 42, 1877, 446, 334, 447, 1591, 1807, + /* 20 */ 349, 1877, 1333, 43, 41, 40, 39, 38, 588, 156, + /* 30 */ 167, 1554, 1358, 1413, 1660, 1331, 1913, 1873, 1879, 337, + /* 40 */ 1873, 1879, 343, 1746, 589, 1066, 1067, 1873, 1879, 1863, + /* 50 */ 595, 601, 30, 595, 445, 1579, 1408, 449, 37, 36, + /* 60 */ 595, 17, 43, 41, 40, 39, 38, 1895, 1339, 44, + /* 70 */ 42, 1483, 1893, 1578, 505, 588, 1929, 349, 573, 1333, + /* 80 */ 97, 1894, 1896, 605, 1898, 1899, 600, 77, 595, 515, + /* 90 */ 1413, 364, 1331, 168, 1, 1982, 1913, 1863, 58, 342, + /* 100 */ 1978, 125, 46, 218, 602, 585, 58, 2050, 530, 1863, + /* 110 */ 1702, 601, 173, 1408, 534, 1863, 692, 508, 17, 1577, + /* 120 */ 2008, 502, 572, 171, 1808, 1339, 217, 2051, 574, 1359, + /* 130 */ 1415, 1416, 603, 2055, 132, 585, 1929, 2050, 394, 1576, + /* 140 */ 98, 348, 1896, 605, 1898, 1899, 600, 454, 595, 447, + /* 150 */ 1591, 1, 2056, 171, 1079, 1982, 1078, 2051, 574, 314, + /* 160 */ 1978, 1863, 2050, 64, 132, 7, 63, 58, 1487, 482, + /* 170 */ 2050, 130, 335, 692, 1358, 1334, 310, 1332, 2054, 219, + /* 180 */ 154, 1863, 2051, 2053, 1080, 572, 171, 1415, 1416, 1709, + /* 190 */ 2051, 574, 587, 169, 1990, 1991, 1359, 1995, 463, 1337, + /* 200 */ 1338, 121, 1388, 1389, 1391, 1392, 1393, 1394, 1395, 1396, + /* 210 */ 1397, 1398, 597, 593, 1406, 1407, 1409, 1410, 1411, 1412, + /* 220 */ 1414, 1417, 3, 264, 1990, 584, 1684, 583, 1753, 1754, + /* 230 */ 2050, 1423, 1334, 383, 1332, 79, 312, 1358, 388, 537, + /* 240 */ 174, 1509, 496, 495, 174, 572, 171, 387, 174, 386, + /* 250 */ 2051, 574, 174, 385, 381, 530, 1337, 1338, 58, 1388, + /* 260 */ 1389, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 597, + /* 270 */ 593, 1406, 1407, 1409, 1410, 1411, 1412, 1414, 1417, 3, + /* 280 */ 44, 42, 695, 181, 2050, 233, 234, 1358, 349, 77, + /* 290 */ 1333, 560, 1507, 1508, 1510, 1511, 274, 547, 1895, 2056, + /* 300 */ 171, 1413, 547, 1331, 2051, 574, 1228, 1229, 2055, 52, + /* 310 */ 165, 1882, 1703, 174, 120, 685, 681, 677, 673, 272, + /* 320 */ 74, 484, 1877, 73, 1408, 220, 1707, 1913, 1737, 17, + /* 330 */ 354, 1707, 636, 1752, 1754, 602, 1339, 44, 42, 1079, + /* 340 */ 1863, 1078, 601, 312, 588, 349, 537, 1333, 1873, 1879, + /* 350 */ 563, 145, 144, 633, 632, 631, 95, 1390, 1413, 240, + /* 360 */ 1331, 595, 1, 603, 451, 1476, 547, 1929, 636, 1080, + /* 370 */ 1356, 294, 348, 1896, 605, 1898, 1899, 600, 120, 595, + /* 380 */ 47, 1408, 1557, 395, 692, 489, 17, 145, 144, 633, + /* 390 */ 632, 631, 544, 1339, 453, 1707, 396, 449, 1415, 1416, + /* 400 */ 1542, 2050, 1333, 110, 174, 431, 109, 108, 107, 106, + /* 410 */ 105, 104, 103, 102, 101, 1331, 572, 171, 46, 1, + /* 420 */ 1390, 2051, 574, 110, 229, 547, 109, 108, 107, 106, + /* 430 */ 105, 104, 103, 102, 101, 569, 564, 176, 500, 499, + /* 440 */ 498, 692, 1305, 1334, 222, 1332, 126, 494, 1339, 1575, + /* 450 */ 154, 493, 492, 1759, 1707, 1415, 1416, 491, 497, 1710, + /* 460 */ 336, 185, 184, 490, 1146, 1066, 1067, 1337, 1338, 1757, + /* 470 */ 1388, 1389, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, + /* 480 */ 597, 593, 1406, 1407, 1409, 1410, 1411, 1412, 1414, 1417, + /* 490 */ 3, 1863, 11, 40, 39, 38, 692, 1148, 2002, 1476, + /* 500 */ 1334, 1621, 1332, 232, 568, 1444, 1186, 627, 626, 625, + /* 510 */ 1190, 624, 1192, 1193, 623, 1195, 620, 638, 1201, 617, + /* 520 */ 1203, 1204, 614, 611, 1337, 1338, 174, 1388, 1389, 1391, + /* 530 */ 1392, 1393, 1394, 1395, 1396, 1397, 1398, 597, 593, 1406, + /* 540 */ 1407, 1409, 1410, 1411, 1412, 1414, 1417, 3, 44, 42, + /* 550 */ 1800, 352, 1913, 2055, 1997, 1334, 349, 1332, 1333, 154, + /* 560 */ 567, 179, 1311, 1312, 500, 499, 498, 630, 1709, 1413, + /* 570 */ 1360, 1331, 126, 494, 547, 31, 227, 493, 492, 1337, + /* 580 */ 1338, 1895, 1994, 491, 497, 1449, 392, 1685, 1810, 490, + /* 590 */ 37, 36, 1408, 1357, 43, 41, 40, 39, 38, 566, + /* 600 */ 1895, 1759, 577, 1707, 1339, 44, 42, 1418, 353, 547, + /* 610 */ 1913, 48, 4, 349, 58, 1333, 81, 1757, 602, 547, + /* 620 */ 11, 393, 9, 1863, 355, 601, 1413, 1759, 1331, 1913, + /* 630 */ 8, 403, 154, 128, 319, 2055, 1953, 602, 1707, 547, + /* 640 */ 1574, 1709, 1863, 1757, 601, 1542, 1893, 463, 1707, 1408, + /* 650 */ 1929, 417, 692, 533, 158, 1894, 1896, 605, 1898, 1899, + /* 660 */ 600, 1339, 595, 1480, 2050, 1893, 1415, 1416, 1707, 1929, + /* 670 */ 530, 547, 573, 97, 1894, 1896, 605, 1898, 1899, 600, + /* 680 */ 2054, 595, 1863, 418, 2051, 2052, 2070, 8, 1982, 549, + /* 690 */ 514, 1954, 342, 1978, 1759, 552, 2019, 663, 661, 2050, + /* 700 */ 1707, 2050, 2016, 512, 1683, 510, 551, 11, 1954, 692, + /* 710 */ 1758, 1334, 266, 1332, 2056, 171, 572, 171, 1358, 2051, + /* 720 */ 574, 2051, 574, 1415, 1416, 37, 36, 13, 12, 43, + /* 730 */ 41, 40, 39, 38, 1850, 1337, 1338, 1361, 1388, 1389, + /* 740 */ 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 597, 593, + /* 750 */ 1406, 1407, 1409, 1410, 1411, 1412, 1414, 1417, 3, 1556, + /* 760 */ 174, 1339, 1360, 1800, 638, 1806, 1800, 307, 1334, 651, + /* 770 */ 1332, 1677, 87, 325, 180, 650, 174, 183, 1573, 525, + /* 780 */ 1805, 371, 307, 119, 118, 117, 116, 115, 114, 113, + /* 790 */ 112, 111, 1337, 1338, 1700, 1388, 1389, 1391, 1392, 1393, + /* 800 */ 1394, 1395, 1396, 1397, 1398, 597, 593, 1406, 1407, 1409, + /* 810 */ 1410, 1411, 1412, 1414, 1417, 3, 44, 42, 578, 547, + /* 820 */ 1863, 1456, 634, 362, 349, 1750, 1333, 1997, 1997, 635, + /* 830 */ 1696, 461, 1750, 326, 1572, 324, 323, 1413, 486, 1331, + /* 840 */ 530, 361, 488, 94, 488, 1361, 37, 36, 1707, 1895, + /* 850 */ 43, 41, 40, 39, 38, 1993, 1992, 127, 530, 547, + /* 860 */ 1408, 1692, 2054, 547, 487, 1699, 487, 1571, 1895, 2050, + /* 870 */ 547, 462, 1339, 44, 42, 1704, 1863, 1694, 1913, 243, + /* 880 */ 143, 349, 137, 1333, 2056, 171, 602, 2050, 1707, 2051, + /* 890 */ 574, 1863, 1707, 601, 1413, 1690, 1331, 1913, 8, 1707, + /* 900 */ 1479, 1390, 2056, 171, 266, 602, 580, 2051, 574, 1863, + /* 910 */ 1863, 223, 601, 279, 1893, 1570, 1737, 1408, 1929, 547, + /* 920 */ 692, 1895, 159, 1894, 1896, 605, 1898, 1899, 600, 1339, + /* 930 */ 595, 526, 51, 1893, 1415, 1416, 1567, 1929, 1566, 547, + /* 940 */ 1608, 97, 1894, 1896, 605, 1898, 1899, 600, 1707, 595, + /* 950 */ 1913, 531, 50, 529, 2070, 1, 1982, 1863, 602, 547, + /* 960 */ 342, 1978, 501, 1863, 547, 601, 210, 596, 1707, 208, + /* 970 */ 2044, 237, 547, 629, 575, 2071, 543, 692, 1863, 1334, + /* 980 */ 1863, 1332, 1682, 592, 545, 1661, 1893, 242, 1707, 402, + /* 990 */ 1929, 1415, 1416, 1707, 159, 1894, 1896, 605, 1898, 1899, + /* 1000 */ 600, 1707, 595, 1337, 1338, 1549, 1388, 1389, 1391, 1392, + /* 1010 */ 1393, 1394, 1395, 1396, 1397, 1398, 597, 593, 1406, 1407, + /* 1020 */ 1409, 1410, 1411, 1412, 1414, 1417, 3, 37, 36, 205, + /* 1030 */ 547, 43, 41, 40, 39, 38, 1334, 72, 1332, 1551, + /* 1040 */ 1552, 212, 546, 161, 211, 1565, 2022, 2072, 480, 476, + /* 1050 */ 472, 468, 204, 1564, 214, 13, 12, 213, 1342, 1707, + /* 1060 */ 1337, 1338, 1618, 1388, 1389, 1391, 1392, 1393, 1394, 1395, + /* 1070 */ 1396, 1397, 1398, 597, 593, 1406, 1407, 1409, 1410, 1411, + /* 1080 */ 1412, 1414, 1417, 3, 309, 1569, 1356, 1863, 636, 78, + /* 1090 */ 226, 216, 202, 425, 215, 1863, 436, 1603, 37, 36, + /* 1100 */ 1548, 481, 43, 41, 40, 39, 38, 145, 144, 633, + /* 1110 */ 632, 631, 261, 410, 1519, 437, 576, 412, 1563, 503, + /* 1120 */ 1341, 1434, 1562, 1561, 581, 669, 668, 667, 666, 359, + /* 1130 */ 80, 665, 664, 133, 659, 658, 657, 656, 655, 654, + /* 1140 */ 653, 652, 147, 648, 647, 646, 358, 357, 643, 642, + /* 1150 */ 641, 640, 639, 155, 201, 195, 1560, 200, 285, 322, + /* 1160 */ 1863, 459, 37, 36, 1863, 1863, 43, 41, 40, 39, + /* 1170 */ 38, 398, 283, 66, 1601, 45, 65, 193, 255, 231, + /* 1180 */ 561, 138, 142, 1914, 1559, 1499, 143, 360, 60, 1592, + /* 1190 */ 1747, 247, 189, 442, 440, 1895, 506, 26, 1863, 435, + /* 1200 */ 1345, 60, 430, 429, 428, 427, 424, 423, 422, 421, + /* 1210 */ 420, 416, 415, 414, 413, 407, 406, 405, 404, 2012, + /* 1220 */ 400, 399, 321, 547, 1913, 263, 1863, 1282, 45, 58, + /* 1230 */ 1106, 235, 602, 540, 239, 268, 1597, 1863, 1179, 601, + /* 1240 */ 1506, 37, 36, 250, 32, 43, 41, 40, 39, 38, + /* 1250 */ 37, 36, 1707, 1450, 43, 41, 40, 39, 38, 260, + /* 1260 */ 1893, 586, 1344, 1107, 1929, 1884, 547, 96, 97, 1894, + /* 1270 */ 1896, 605, 1898, 1899, 600, 2, 595, 1895, 356, 129, + /* 1280 */ 1399, 141, 1953, 1982, 687, 37, 36, 342, 1978, 43, + /* 1290 */ 41, 40, 39, 38, 315, 1707, 45, 609, 93, 5, + /* 1300 */ 365, 518, 71, 70, 391, 370, 1913, 178, 90, 142, + /* 1310 */ 1298, 332, 143, 1886, 602, 644, 645, 122, 530, 1863, + /* 1320 */ 320, 601, 142, 275, 308, 182, 1356, 379, 1895, 377, + /* 1330 */ 373, 369, 366, 363, 397, 401, 1442, 1126, 1124, 419, + /* 1340 */ 1802, 426, 1893, 433, 585, 432, 1929, 2050, 278, 1207, + /* 1350 */ 301, 1894, 1896, 605, 1898, 1899, 600, 1913, 595, 434, + /* 1360 */ 585, 1211, 2056, 171, 1218, 589, 186, 2051, 574, 1216, + /* 1370 */ 1863, 439, 601, 132, 146, 174, 438, 441, 443, 1362, + /* 1380 */ 444, 452, 1364, 455, 192, 456, 1363, 194, 1365, 132, + /* 1390 */ 1443, 457, 458, 1893, 460, 197, 199, 1929, 464, 75, + /* 1400 */ 76, 97, 1894, 1896, 605, 1898, 1899, 600, 203, 595, + /* 1410 */ 130, 483, 99, 311, 168, 1841, 1982, 517, 485, 519, + /* 1420 */ 342, 1978, 1697, 207, 1693, 276, 130, 209, 148, 149, + /* 1430 */ 1695, 1691, 170, 1990, 1991, 150, 1995, 151, 221, 153, + /* 1440 */ 520, 2009, 521, 224, 527, 532, 1895, 524, 172, 1990, + /* 1450 */ 1991, 228, 1995, 331, 559, 535, 1840, 1812, 538, 139, + /* 1460 */ 33, 346, 1437, 1438, 1439, 1440, 1441, 1445, 1446, 1447, + /* 1470 */ 1448, 140, 333, 541, 542, 1913, 84, 86, 277, 1708, + /* 1480 */ 1361, 555, 562, 602, 2013, 2028, 245, 557, 1863, 558, + /* 1490 */ 601, 338, 2023, 565, 2027, 249, 571, 6, 553, 259, + /* 1500 */ 556, 162, 554, 2004, 339, 582, 579, 1476, 131, 2073, + /* 1510 */ 1360, 1893, 57, 1895, 88, 1929, 607, 1751, 1963, 97, + /* 1520 */ 1894, 1896, 605, 1898, 1899, 600, 1678, 595, 257, 254, + /* 1530 */ 256, 258, 2070, 1998, 1982, 1895, 280, 688, 342, 1978, + /* 1540 */ 271, 689, 1913, 691, 49, 2049, 306, 262, 2001, 292, + /* 1550 */ 602, 282, 303, 284, 302, 1863, 68, 601, 1857, 1856, + /* 1560 */ 1855, 1854, 69, 1851, 1913, 367, 368, 1325, 1326, 177, + /* 1570 */ 372, 1849, 602, 374, 375, 376, 1848, 1863, 1893, 601, + /* 1580 */ 378, 1847, 1929, 380, 1846, 1845, 97, 1894, 1896, 605, + /* 1590 */ 1898, 1899, 600, 1895, 595, 1823, 382, 384, 1301, 1957, + /* 1600 */ 1893, 1982, 1300, 1822, 1929, 342, 1978, 389, 97, 1894, + /* 1610 */ 1896, 605, 1898, 1899, 600, 1895, 595, 390, 1821, 345, + /* 1620 */ 344, 1955, 1913, 1982, 1820, 1270, 1795, 342, 1978, 1347, + /* 1630 */ 602, 1794, 1792, 134, 1791, 1863, 135, 601, 1790, 1793, + /* 1640 */ 1413, 1789, 1340, 1788, 1913, 1787, 1786, 1785, 1784, 409, + /* 1650 */ 408, 1783, 602, 411, 1782, 1781, 1780, 1863, 1893, 601, + /* 1660 */ 1779, 1778, 1929, 1408, 1777, 1776, 97, 1894, 1896, 605, + /* 1670 */ 1898, 1899, 600, 1775, 595, 1339, 1774, 1773, 1772, 550, + /* 1680 */ 1893, 1982, 1771, 1770, 1929, 342, 1978, 1154, 98, 1894, + /* 1690 */ 1896, 605, 1898, 1899, 600, 1769, 595, 1768, 1767, 136, + /* 1700 */ 1766, 1765, 1764, 1982, 1763, 1762, 1272, 1981, 1978, 1761, + /* 1710 */ 1760, 1623, 1622, 1620, 187, 188, 1588, 190, 123, 1587, + /* 1720 */ 1069, 1068, 1895, 591, 166, 124, 448, 1836, 191, 1830, + /* 1730 */ 1819, 450, 196, 198, 1818, 1804, 1686, 1619, 1617, 466, + /* 1740 */ 1615, 470, 467, 465, 1613, 1611, 474, 1600, 1599, 469, + /* 1750 */ 1584, 1913, 1099, 473, 471, 477, 475, 1688, 1222, 602, + /* 1760 */ 1687, 479, 1609, 1221, 1863, 59, 601, 206, 478, 660, + /* 1770 */ 1604, 1143, 1602, 504, 1145, 662, 1136, 1144, 1142, 1583, + /* 1780 */ 1582, 1141, 1348, 327, 1343, 328, 1138, 1893, 1137, 1581, + /* 1790 */ 1895, 1929, 53, 1135, 507, 98, 1894, 1896, 605, 1898, + /* 1800 */ 1899, 600, 1835, 595, 329, 513, 1351, 1353, 509, 1895, + /* 1810 */ 1982, 511, 100, 1307, 590, 1978, 1829, 522, 152, 1913, + /* 1820 */ 593, 1406, 1407, 1409, 1410, 1411, 1412, 599, 1317, 523, + /* 1830 */ 225, 1817, 1863, 1815, 601, 2055, 330, 1816, 1913, 1814, + /* 1840 */ 1813, 1315, 1811, 1803, 83, 241, 602, 230, 1425, 25, + /* 1850 */ 18, 1863, 19, 601, 10, 1893, 536, 20, 236, 1929, + /* 1860 */ 528, 15, 82, 300, 1894, 1896, 605, 1898, 1899, 600, + /* 1870 */ 598, 595, 548, 1947, 1893, 85, 1895, 56, 1929, 90, + /* 1880 */ 27, 244, 98, 1894, 1896, 605, 1898, 1899, 600, 1521, + /* 1890 */ 595, 539, 246, 1895, 248, 1424, 1503, 1982, 1505, 1498, + /* 1900 */ 252, 160, 1979, 29, 251, 1913, 28, 253, 1884, 89, + /* 1910 */ 61, 22, 21, 599, 1541, 1542, 1536, 1535, 1863, 340, + /* 1920 */ 601, 1540, 1913, 238, 1539, 341, 265, 12, 55, 54, + /* 1930 */ 602, 1473, 1349, 16, 1883, 1863, 1895, 601, 163, 1472, + /* 1940 */ 1932, 1893, 164, 1403, 594, 1929, 1401, 35, 14, 300, + /* 1950 */ 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1893, 1948, + /* 1960 */ 1400, 23, 1929, 175, 1373, 1913, 158, 1894, 1896, 605, + /* 1970 */ 1898, 1899, 600, 602, 595, 1381, 1435, 24, 1863, 606, + /* 1980 */ 601, 608, 1208, 351, 612, 1913, 1205, 610, 613, 604, + /* 1990 */ 347, 615, 1202, 602, 616, 618, 1196, 619, 1863, 1194, + /* 2000 */ 601, 1893, 621, 622, 1185, 1929, 1217, 1895, 2020, 296, + /* 2010 */ 1894, 1896, 605, 1898, 1899, 600, 1200, 595, 628, 269, + /* 2020 */ 1199, 1893, 91, 1198, 1197, 1929, 92, 67, 1213, 301, + /* 2030 */ 1894, 1896, 605, 1898, 1899, 600, 1913, 595, 1132, 1097, + /* 2040 */ 637, 350, 1131, 1130, 602, 1129, 1128, 1127, 1125, 1863, + /* 2050 */ 1123, 601, 1122, 570, 1121, 1152, 649, 270, 1119, 1118, + /* 2060 */ 1117, 1116, 1115, 1114, 1113, 1112, 1149, 1147, 1109, 1108, + /* 2070 */ 1105, 1104, 1893, 1103, 1102, 1616, 1929, 670, 671, 1614, + /* 2080 */ 301, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 672, + /* 2090 */ 674, 675, 676, 1612, 678, 679, 680, 1610, 682, 683, + /* 2100 */ 684, 1598, 686, 1059, 1580, 1895, 273, 690, 1555, 1335, + /* 2110 */ 281, 693, 694, 1555, 1555, 1555, 1913, 1555, 1555, 1555, + /* 2120 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2130 */ 1555, 601, 1555, 1555, 1913, 1555, 1555, 1555, 1555, 1555, + /* 2140 */ 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, 1895, 601, + /* 2150 */ 1555, 1555, 516, 1555, 1555, 1555, 1929, 1555, 1555, 1555, + /* 2160 */ 294, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1555, + /* 2170 */ 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1913, 286, 1894, + /* 2180 */ 1896, 605, 1898, 1899, 600, 602, 595, 1555, 1555, 1555, + /* 2190 */ 1863, 1895, 601, 1555, 1555, 1555, 1913, 1555, 1555, 1555, + /* 2200 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2210 */ 1555, 601, 1555, 1893, 1555, 1555, 1555, 1929, 1555, 1555, + /* 2220 */ 1913, 287, 1894, 1896, 605, 1898, 1899, 600, 602, 595, + /* 2230 */ 1555, 1555, 1893, 1863, 1895, 601, 1929, 1555, 1555, 1555, + /* 2240 */ 288, 1894, 1896, 605, 1898, 1899, 600, 1555, 595, 1555, + /* 2250 */ 1555, 1895, 1555, 1555, 1555, 1555, 1893, 1555, 1555, 1555, + /* 2260 */ 1929, 1555, 1555, 1913, 295, 1894, 1896, 605, 1898, 1899, + /* 2270 */ 600, 602, 595, 1555, 1555, 1555, 1863, 1895, 601, 1555, + /* 2280 */ 1913, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 602, 1555, + /* 2290 */ 1555, 1555, 1555, 1863, 1895, 601, 1555, 1555, 1555, 1893, + /* 2300 */ 1555, 1555, 1555, 1929, 1555, 1555, 1913, 297, 1894, 1896, + /* 2310 */ 605, 1898, 1899, 600, 602, 595, 1893, 1555, 1555, 1863, + /* 2320 */ 1929, 601, 1555, 1913, 289, 1894, 1896, 605, 1898, 1899, + /* 2330 */ 600, 602, 595, 1555, 1555, 1555, 1863, 1555, 601, 1555, + /* 2340 */ 1555, 1555, 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1555, + /* 2350 */ 298, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1893, + /* 2360 */ 1555, 1555, 1555, 1929, 1555, 1555, 1555, 290, 1894, 1896, + /* 2370 */ 605, 1898, 1899, 600, 1895, 595, 1555, 1555, 1555, 1555, + /* 2380 */ 1555, 1555, 1555, 1555, 1555, 1555, 1913, 1555, 1555, 1555, + /* 2390 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2400 */ 1555, 601, 1555, 1913, 1555, 1555, 1555, 1555, 1555, 1555, + /* 2410 */ 1555, 602, 1555, 1555, 1555, 1555, 1863, 1555, 601, 1555, + /* 2420 */ 1555, 1555, 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1555, + /* 2430 */ 299, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1893, + /* 2440 */ 1555, 1555, 1555, 1929, 1555, 1555, 1555, 291, 1894, 1896, + /* 2450 */ 605, 1898, 1899, 600, 1555, 595, 1555, 1555, 1555, 1555, + /* 2460 */ 1555, 1555, 1555, 1895, 1555, 1555, 1913, 1555, 1555, 1555, + /* 2470 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2480 */ 1555, 601, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, + /* 2490 */ 1555, 1555, 1913, 1555, 1555, 1555, 1555, 1555, 1555, 1555, + /* 2500 */ 602, 1555, 1893, 1555, 1555, 1863, 1929, 601, 1555, 1555, + /* 2510 */ 304, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1555, + /* 2520 */ 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1893, 1555, + /* 2530 */ 1555, 1555, 1929, 1555, 1895, 1555, 305, 1894, 1896, 605, + /* 2540 */ 1898, 1899, 600, 1555, 595, 1555, 1913, 1555, 1555, 1555, + /* 2550 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2560 */ 1555, 601, 1555, 1913, 1555, 1555, 1555, 1555, 1555, 1555, + /* 2570 */ 1555, 602, 1555, 1555, 1555, 1555, 1863, 1895, 601, 1555, + /* 2580 */ 1555, 1555, 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1555, + /* 2590 */ 1907, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1893, + /* 2600 */ 1555, 1555, 1555, 1929, 1555, 1555, 1913, 1906, 1894, 1896, + /* 2610 */ 605, 1898, 1899, 600, 602, 595, 1555, 1555, 1555, 1863, + /* 2620 */ 1555, 601, 1555, 1555, 1555, 1555, 1913, 1555, 1555, 1555, + /* 2630 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2640 */ 1895, 601, 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1555, + /* 2650 */ 1905, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1555, + /* 2660 */ 1555, 1555, 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1913, + /* 2670 */ 316, 1894, 1896, 605, 1898, 1899, 600, 602, 595, 1555, + /* 2680 */ 1555, 1555, 1863, 1555, 601, 1555, 1913, 1555, 1555, 1555, + /* 2690 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2700 */ 1555, 601, 1555, 1555, 1555, 1893, 1555, 1555, 1555, 1929, + /* 2710 */ 1555, 1555, 1555, 317, 1894, 1896, 605, 1898, 1899, 600, + /* 2720 */ 1895, 595, 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1555, + /* 2730 */ 313, 1894, 1896, 605, 1898, 1899, 600, 1895, 595, 1555, + /* 2740 */ 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1913, + /* 2750 */ 1555, 1555, 1555, 1555, 1555, 1555, 1555, 602, 1555, 1555, + /* 2760 */ 1555, 1555, 1863, 1555, 601, 1555, 1913, 1555, 1555, 1555, + /* 2770 */ 1555, 1555, 1555, 1555, 602, 1555, 1555, 1555, 1555, 1863, + /* 2780 */ 1555, 601, 1555, 1555, 1555, 1893, 1555, 1555, 1555, 1929, + /* 2790 */ 1555, 1555, 1555, 318, 1894, 1896, 605, 1898, 1899, 600, + /* 2800 */ 1555, 595, 1893, 1555, 1555, 1555, 1929, 1555, 1555, 1555, + /* 2810 */ 293, 1894, 1896, 605, 1898, 1899, 600, 1555, 595, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 351, 409, 410, 351, 319, 4, 321, 320, 4, 364, @@ -513,15 +513,15 @@ static const YYCODETYPE yy_lookahead[] = { /* 80 */ 393, 394, 395, 396, 397, 398, 399, 332, 401, 19, /* 90 */ 33, 377, 35, 406, 94, 408, 349, 362, 94, 412, /* 100 */ 413, 346, 94, 33, 357, 328, 94, 423, 394, 362, - /* 110 */ 355, 364, 425, 56, 60, 362, 116, 47, 61, 320, - /* 120 */ 433, 51, 438, 439, 20, 68, 56, 443, 444, 3, + /* 110 */ 355, 364, 425, 56, 364, 362, 116, 47, 61, 320, + /* 120 */ 433, 51, 438, 439, 374, 68, 56, 443, 444, 20, /* 130 */ 130, 131, 385, 394, 357, 328, 389, 423, 328, 320, /* 140 */ 393, 394, 395, 396, 397, 398, 399, 324, 401, 326, /* 150 */ 327, 94, 438, 439, 20, 408, 22, 443, 444, 412, - /* 160 */ 413, 362, 423, 93, 357, 4, 96, 94, 14, 35, + /* 160 */ 413, 362, 423, 93, 357, 39, 96, 94, 14, 35, /* 170 */ 423, 394, 341, 116, 20, 175, 366, 177, 439, 126, /* 180 */ 349, 362, 443, 444, 50, 438, 439, 130, 131, 358, - /* 190 */ 443, 444, 415, 416, 417, 418, 20, 420, 94, 199, + /* 190 */ 443, 444, 415, 416, 417, 418, 20, 420, 60, 199, /* 200 */ 200, 394, 202, 203, 204, 205, 206, 207, 208, 209, /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, /* 220 */ 220, 221, 222, 416, 417, 418, 0, 420, 363, 364, @@ -530,190 +530,190 @@ static const YYCODETYPE yy_lookahead[] = { /* 250 */ 443, 444, 240, 190, 191, 394, 199, 200, 94, 202, /* 260 */ 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, /* 270 */ 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - /* 280 */ 12, 13, 19, 56, 423, 125, 126, 105, 20, 332, + /* 280 */ 12, 13, 19, 56, 423, 125, 126, 20, 20, 332, /* 290 */ 22, 249, 250, 251, 252, 253, 33, 328, 320, 438, - /* 300 */ 439, 33, 328, 35, 443, 444, 130, 131, 320, 340, + /* 300 */ 439, 33, 328, 35, 443, 444, 130, 131, 3, 340, /* 310 */ 47, 351, 355, 240, 340, 52, 53, 54, 55, 56, /* 320 */ 93, 347, 362, 96, 56, 342, 357, 349, 345, 61, /* 330 */ 360, 357, 106, 363, 364, 357, 68, 12, 13, 20, - /* 340 */ 362, 22, 364, 183, 43, 20, 186, 22, 388, 389, - /* 350 */ 362, 125, 126, 127, 128, 129, 93, 203, 33, 96, - /* 360 */ 35, 401, 94, 385, 14, 160, 328, 389, 106, 50, + /* 340 */ 362, 22, 364, 183, 20, 20, 186, 22, 388, 389, + /* 350 */ 160, 125, 126, 127, 128, 129, 93, 203, 33, 96, + /* 360 */ 35, 401, 94, 385, 14, 239, 328, 389, 106, 50, /* 370 */ 20, 393, 394, 395, 396, 397, 398, 399, 340, 401, - /* 380 */ 94, 56, 0, 257, 116, 347, 61, 125, 126, 127, - /* 390 */ 128, 129, 129, 68, 320, 357, 95, 325, 130, 131, - /* 400 */ 328, 423, 241, 21, 240, 35, 24, 25, 26, 27, - /* 410 */ 28, 29, 30, 31, 32, 20, 438, 439, 391, 94, - /* 420 */ 203, 443, 444, 21, 161, 56, 24, 25, 26, 27, - /* 430 */ 28, 29, 30, 31, 32, 328, 362, 328, 68, 78, - /* 440 */ 328, 116, 179, 175, 181, 177, 419, 340, 20, 340, - /* 450 */ 245, 246, 340, 8, 9, 130, 131, 12, 13, 14, - /* 460 */ 15, 16, 320, 94, 357, 96, 357, 199, 200, 357, + /* 380 */ 94, 56, 0, 22, 116, 347, 61, 125, 126, 127, + /* 390 */ 128, 129, 129, 68, 325, 357, 35, 328, 130, 131, + /* 400 */ 95, 423, 22, 21, 240, 78, 24, 25, 26, 27, + /* 410 */ 28, 29, 30, 31, 32, 35, 438, 439, 94, 94, + /* 420 */ 203, 443, 444, 21, 161, 328, 24, 25, 26, 27, + /* 430 */ 28, 29, 30, 31, 32, 245, 246, 340, 63, 64, + /* 440 */ 65, 116, 179, 175, 181, 177, 71, 72, 68, 320, + /* 450 */ 349, 76, 77, 349, 357, 130, 131, 82, 83, 358, + /* 460 */ 356, 134, 135, 88, 35, 44, 45, 199, 200, 365, /* 470 */ 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, /* 480 */ 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 490 */ 222, 224, 224, 226, 39, 134, 135, 14, 15, 16, - /* 500 */ 175, 405, 177, 407, 362, 37, 107, 108, 109, 110, + /* 490 */ 222, 362, 224, 14, 15, 16, 116, 68, 238, 239, + /* 500 */ 175, 0, 177, 125, 20, 157, 107, 108, 109, 110, /* 510 */ 111, 112, 113, 114, 115, 116, 117, 60, 119, 120, /* 520 */ 121, 122, 123, 124, 199, 200, 240, 202, 203, 204, /* 530 */ 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, /* 540 */ 215, 216, 217, 218, 219, 220, 221, 222, 12, 13, - /* 550 */ 349, 328, 349, 63, 64, 65, 20, 356, 22, 0, - /* 560 */ 357, 71, 72, 340, 328, 97, 365, 99, 100, 33, - /* 570 */ 102, 35, 82, 83, 106, 20, 340, 320, 88, 320, - /* 580 */ 357, 320, 21, 24, 25, 26, 27, 28, 29, 30, - /* 590 */ 31, 32, 56, 357, 341, 34, 128, 36, 203, 396, - /* 600 */ 320, 349, 349, 320, 68, 12, 13, 14, 356, 240, - /* 610 */ 349, 358, 167, 20, 3, 22, 341, 365, 357, 362, - /* 620 */ 20, 362, 0, 362, 349, 364, 33, 349, 35, 349, - /* 630 */ 94, 20, 0, 358, 356, 394, 224, 357, 125, 328, - /* 640 */ 1, 2, 362, 365, 364, 362, 385, 320, 0, 56, + /* 550 */ 357, 341, 349, 3, 391, 175, 20, 177, 22, 349, + /* 560 */ 357, 368, 184, 185, 63, 64, 65, 105, 358, 33, + /* 570 */ 20, 35, 71, 72, 328, 227, 56, 76, 77, 199, + /* 580 */ 200, 320, 419, 82, 83, 237, 340, 0, 0, 88, + /* 590 */ 8, 9, 56, 20, 12, 13, 14, 15, 16, 396, + /* 600 */ 320, 349, 43, 357, 68, 12, 13, 14, 356, 328, + /* 610 */ 349, 42, 43, 20, 94, 22, 96, 365, 357, 328, + /* 620 */ 224, 340, 226, 362, 341, 364, 33, 349, 35, 349, + /* 630 */ 94, 340, 349, 404, 356, 394, 407, 357, 357, 328, + /* 640 */ 320, 358, 362, 365, 364, 95, 385, 60, 357, 56, /* 650 */ 389, 340, 116, 377, 393, 394, 395, 396, 397, 398, - /* 660 */ 399, 68, 401, 0, 423, 385, 130, 131, 357, 389, + /* 660 */ 399, 68, 401, 4, 423, 385, 130, 131, 357, 389, /* 670 */ 394, 328, 394, 393, 394, 395, 396, 397, 398, 399, - /* 680 */ 439, 401, 60, 340, 443, 444, 406, 94, 408, 362, - /* 690 */ 330, 157, 412, 413, 239, 434, 435, 184, 185, 423, - /* 700 */ 357, 423, 422, 20, 344, 330, 95, 262, 60, 116, - /* 710 */ 47, 175, 352, 177, 438, 439, 438, 439, 364, 443, - /* 720 */ 444, 443, 444, 130, 131, 8, 9, 352, 374, 12, - /* 730 */ 13, 14, 15, 16, 95, 199, 200, 20, 202, 203, + /* 680 */ 439, 401, 362, 340, 443, 444, 406, 94, 408, 405, + /* 690 */ 21, 407, 412, 413, 349, 434, 435, 335, 336, 423, + /* 700 */ 357, 423, 422, 34, 0, 36, 405, 224, 407, 116, + /* 710 */ 365, 175, 162, 177, 438, 439, 438, 439, 20, 443, + /* 720 */ 444, 443, 444, 130, 131, 8, 9, 1, 2, 12, + /* 730 */ 13, 14, 15, 16, 0, 199, 200, 20, 202, 203, /* 740 */ 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 8, - /* 760 */ 9, 227, 162, 12, 13, 14, 15, 16, 175, 0, - /* 770 */ 177, 237, 20, 162, 8, 9, 240, 2, 12, 13, - /* 780 */ 14, 15, 16, 8, 9, 320, 320, 12, 13, 14, - /* 790 */ 15, 16, 199, 200, 320, 202, 203, 204, 205, 206, + /* 750 */ 214, 215, 216, 217, 218, 219, 220, 221, 222, 0, + /* 760 */ 240, 68, 20, 357, 60, 373, 357, 375, 175, 337, + /* 770 */ 177, 339, 330, 37, 368, 68, 240, 368, 320, 381, + /* 780 */ 373, 47, 375, 24, 25, 26, 27, 28, 29, 30, + /* 790 */ 31, 32, 199, 200, 352, 202, 203, 204, 205, 206, /* 800 */ 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - /* 810 */ 217, 218, 219, 220, 221, 222, 12, 13, 405, 328, - /* 820 */ 407, 335, 336, 373, 20, 375, 22, 362, 362, 373, - /* 830 */ 22, 375, 63, 64, 65, 68, 362, 33, 328, 35, - /* 840 */ 71, 72, 328, 35, 357, 357, 95, 20, 357, 320, - /* 850 */ 340, 82, 83, 320, 340, 368, 368, 88, 8, 9, - /* 860 */ 56, 95, 12, 13, 14, 15, 16, 357, 320, 357, - /* 870 */ 328, 357, 68, 12, 13, 328, 350, 328, 349, 162, - /* 880 */ 368, 20, 340, 22, 349, 394, 357, 340, 391, 340, - /* 890 */ 328, 362, 349, 364, 33, 362, 35, 349, 94, 357, - /* 900 */ 365, 358, 340, 328, 357, 357, 357, 416, 417, 418, - /* 910 */ 362, 420, 364, 35, 385, 340, 419, 56, 389, 357, + /* 810 */ 217, 218, 219, 220, 221, 222, 12, 13, 259, 328, + /* 820 */ 362, 95, 359, 377, 20, 362, 22, 391, 391, 359, + /* 830 */ 350, 340, 362, 97, 320, 99, 100, 33, 102, 35, + /* 840 */ 394, 377, 106, 330, 106, 20, 8, 9, 357, 320, + /* 850 */ 12, 13, 14, 15, 16, 419, 419, 344, 394, 328, + /* 860 */ 56, 350, 3, 328, 128, 352, 128, 320, 320, 423, + /* 870 */ 328, 340, 68, 12, 13, 340, 362, 350, 349, 162, + /* 880 */ 43, 20, 340, 22, 438, 439, 357, 423, 357, 443, + /* 890 */ 444, 362, 357, 364, 33, 350, 35, 349, 94, 357, + /* 900 */ 241, 203, 438, 439, 162, 357, 43, 443, 444, 362, + /* 910 */ 362, 350, 364, 342, 385, 320, 345, 56, 389, 328, /* 920 */ 116, 320, 393, 394, 395, 396, 397, 398, 399, 68, - /* 930 */ 401, 106, 357, 385, 130, 131, 320, 389, 320, 105, - /* 940 */ 328, 393, 394, 395, 396, 397, 398, 399, 404, 401, - /* 950 */ 349, 407, 340, 128, 406, 94, 408, 391, 357, 328, - /* 960 */ 412, 413, 43, 362, 328, 364, 337, 68, 339, 357, - /* 970 */ 422, 340, 328, 43, 445, 446, 340, 116, 362, 175, - /* 980 */ 362, 177, 0, 0, 340, 419, 385, 153, 357, 162, + /* 930 */ 401, 340, 95, 385, 130, 131, 320, 389, 320, 328, + /* 940 */ 0, 393, 394, 395, 396, 397, 398, 399, 357, 401, + /* 950 */ 349, 340, 162, 163, 406, 94, 408, 362, 357, 328, + /* 960 */ 412, 413, 22, 362, 328, 364, 98, 350, 357, 101, + /* 970 */ 422, 340, 328, 350, 445, 446, 340, 116, 362, 175, + /* 980 */ 362, 177, 0, 61, 340, 338, 385, 162, 357, 105, /* 990 */ 389, 130, 131, 357, 393, 394, 395, 396, 397, 398, - /* 1000 */ 399, 357, 401, 199, 200, 22, 202, 203, 204, 205, + /* 1000 */ 399, 357, 401, 199, 200, 167, 202, 203, 204, 205, /* 1010 */ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, /* 1020 */ 216, 217, 218, 219, 220, 221, 222, 8, 9, 33, - /* 1030 */ 350, 12, 13, 14, 15, 16, 175, 359, 177, 377, - /* 1040 */ 362, 359, 43, 47, 362, 320, 35, 446, 52, 53, - /* 1050 */ 54, 55, 56, 320, 342, 177, 394, 345, 44, 45, + /* 1030 */ 328, 12, 13, 14, 15, 16, 175, 153, 177, 130, + /* 1040 */ 131, 98, 340, 47, 101, 320, 392, 446, 52, 53, + /* 1050 */ 54, 55, 56, 320, 98, 1, 2, 101, 35, 357, /* 1060 */ 199, 200, 0, 202, 203, 204, 205, 206, 207, 208, /* 1070 */ 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - /* 1080 */ 219, 220, 221, 222, 18, 423, 20, 362, 106, 93, - /* 1090 */ 238, 239, 96, 27, 95, 362, 30, 42, 43, 98, - /* 1100 */ 438, 439, 101, 162, 163, 443, 444, 125, 126, 127, - /* 1110 */ 128, 129, 350, 47, 43, 49, 98, 51, 98, 101, - /* 1120 */ 98, 101, 43, 101, 56, 63, 64, 65, 66, 67, - /* 1130 */ 350, 69, 70, 71, 72, 73, 74, 75, 76, 77, + /* 1080 */ 219, 220, 221, 222, 18, 321, 20, 362, 106, 93, + /* 1090 */ 56, 98, 96, 27, 101, 362, 30, 0, 8, 9, + /* 1100 */ 262, 329, 12, 13, 14, 15, 16, 125, 126, 127, + /* 1110 */ 128, 129, 447, 47, 95, 49, 257, 51, 320, 22, + /* 1120 */ 35, 199, 320, 320, 261, 63, 64, 65, 66, 67, + /* 1130 */ 96, 69, 70, 71, 72, 73, 74, 75, 76, 77, /* 1140 */ 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - /* 1150 */ 88, 89, 90, 18, 158, 159, 0, 161, 23, 93, - /* 1160 */ 0, 165, 130, 131, 96, 13, 95, 43, 1, 2, - /* 1170 */ 61, 105, 37, 38, 95, 43, 41, 181, 22, 43, - /* 1180 */ 261, 162, 22, 43, 22, 46, 43, 35, 177, 259, - /* 1190 */ 350, 43, 57, 58, 59, 320, 350, 35, 3, 133, - /* 1200 */ 43, 43, 136, 137, 138, 139, 140, 141, 142, 143, - /* 1210 */ 144, 145, 146, 147, 148, 149, 150, 151, 152, 95, - /* 1220 */ 154, 155, 156, 43, 349, 381, 350, 95, 43, 94, - /* 1230 */ 68, 95, 357, 94, 321, 95, 338, 362, 95, 364, - /* 1240 */ 392, 8, 9, 95, 43, 12, 13, 14, 15, 16, - /* 1250 */ 8, 9, 95, 95, 12, 13, 14, 15, 16, 35, - /* 1260 */ 385, 43, 13, 447, 389, 436, 329, 132, 393, 394, - /* 1270 */ 395, 396, 397, 398, 399, 95, 401, 320, 116, 404, - /* 1280 */ 95, 406, 407, 408, 35, 43, 0, 412, 413, 430, - /* 1290 */ 95, 349, 68, 329, 61, 327, 95, 361, 392, 94, - /* 1300 */ 421, 414, 167, 168, 169, 440, 349, 172, 199, 104, - /* 1310 */ 424, 354, 242, 95, 357, 387, 47, 386, 173, 362, - /* 1320 */ 42, 364, 379, 369, 189, 369, 20, 192, 320, 194, - /* 1330 */ 195, 196, 197, 198, 48, 328, 103, 175, 328, 177, - /* 1340 */ 369, 157, 385, 367, 367, 328, 389, 92, 20, 334, - /* 1350 */ 393, 394, 395, 396, 397, 398, 399, 349, 401, 328, - /* 1360 */ 20, 199, 200, 328, 377, 357, 328, 322, 322, 383, - /* 1370 */ 362, 332, 364, 364, 357, 240, 332, 377, 20, 376, - /* 1380 */ 20, 394, 378, 332, 332, 332, 332, 328, 376, 332, - /* 1390 */ 157, 322, 349, 385, 394, 328, 349, 389, 349, 349, - /* 1400 */ 188, 393, 394, 395, 396, 397, 398, 399, 322, 401, - /* 1410 */ 423, 394, 349, 349, 406, 330, 408, 384, 362, 383, - /* 1420 */ 412, 413, 349, 423, 349, 438, 439, 349, 180, 349, - /* 1430 */ 443, 444, 349, 416, 417, 418, 364, 420, 438, 439, - /* 1440 */ 382, 433, 330, 443, 444, 328, 320, 328, 330, 247, - /* 1450 */ 376, 362, 362, 372, 362, 362, 372, 362, 159, 330, + /* 1150 */ 88, 89, 90, 18, 158, 159, 320, 161, 23, 93, + /* 1160 */ 362, 165, 8, 9, 362, 362, 12, 13, 14, 15, + /* 1170 */ 16, 105, 37, 38, 0, 43, 41, 181, 430, 43, + /* 1180 */ 436, 43, 43, 349, 320, 95, 43, 329, 43, 327, + /* 1190 */ 361, 43, 57, 58, 59, 320, 22, 43, 362, 133, + /* 1200 */ 177, 43, 136, 137, 138, 139, 140, 141, 142, 143, + /* 1210 */ 144, 145, 146, 147, 148, 149, 150, 151, 152, 392, + /* 1220 */ 154, 155, 156, 328, 349, 440, 362, 95, 43, 94, + /* 1230 */ 35, 95, 357, 95, 95, 340, 0, 362, 95, 364, + /* 1240 */ 95, 8, 9, 95, 2, 12, 13, 14, 15, 16, + /* 1250 */ 8, 9, 357, 95, 12, 13, 14, 15, 16, 414, + /* 1260 */ 385, 421, 177, 68, 389, 46, 328, 132, 393, 394, + /* 1270 */ 395, 396, 397, 398, 399, 424, 401, 320, 340, 404, + /* 1280 */ 95, 406, 407, 408, 48, 8, 9, 412, 413, 12, + /* 1290 */ 13, 14, 15, 16, 61, 357, 43, 43, 94, 242, + /* 1300 */ 387, 377, 167, 168, 169, 47, 349, 172, 104, 43, + /* 1310 */ 173, 354, 43, 94, 357, 13, 13, 43, 394, 362, + /* 1320 */ 386, 364, 43, 379, 189, 42, 20, 192, 320, 194, + /* 1330 */ 195, 196, 197, 198, 369, 369, 103, 35, 35, 328, + /* 1340 */ 328, 369, 385, 157, 328, 367, 389, 423, 95, 95, + /* 1350 */ 393, 394, 395, 396, 397, 398, 399, 349, 401, 367, + /* 1360 */ 328, 95, 438, 439, 95, 357, 328, 443, 444, 95, + /* 1370 */ 362, 334, 364, 357, 95, 240, 92, 328, 328, 20, + /* 1380 */ 322, 322, 20, 383, 332, 364, 20, 332, 20, 357, + /* 1390 */ 157, 376, 378, 385, 376, 332, 332, 389, 328, 332, + /* 1400 */ 332, 393, 394, 395, 396, 397, 398, 399, 332, 401, + /* 1410 */ 394, 322, 328, 322, 406, 362, 408, 188, 349, 384, + /* 1420 */ 412, 413, 349, 349, 349, 383, 394, 349, 349, 349, + /* 1430 */ 349, 349, 416, 417, 418, 349, 420, 349, 330, 162, + /* 1440 */ 180, 433, 382, 330, 328, 328, 320, 364, 416, 417, + /* 1450 */ 418, 330, 420, 376, 247, 362, 362, 362, 362, 372, /* 1460 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - /* 1470 */ 237, 370, 345, 357, 330, 349, 20, 362, 248, 392, - /* 1480 */ 392, 254, 372, 357, 362, 362, 372, 362, 362, 429, - /* 1490 */ 364, 166, 362, 432, 429, 256, 255, 243, 387, 263, - /* 1500 */ 260, 258, 239, 357, 20, 94, 429, 431, 411, 94, - /* 1510 */ 428, 385, 391, 320, 353, 389, 362, 339, 427, 393, - /* 1520 */ 394, 395, 396, 397, 398, 399, 426, 401, 328, 330, - /* 1530 */ 36, 323, 406, 322, 408, 320, 442, 343, 412, 413, - /* 1540 */ 441, 375, 349, 380, 448, 331, 343, 343, 422, 318, - /* 1550 */ 357, 0, 0, 182, 0, 362, 42, 364, 0, 0, - /* 1560 */ 35, 193, 35, 35, 349, 35, 193, 0, 35, 35, - /* 1570 */ 193, 0, 357, 193, 0, 35, 0, 362, 385, 364, - /* 1580 */ 0, 35, 389, 22, 177, 175, 393, 394, 395, 396, - /* 1590 */ 397, 398, 399, 320, 401, 0, 0, 171, 170, 406, - /* 1600 */ 385, 408, 0, 0, 389, 412, 413, 42, 393, 394, - /* 1610 */ 395, 396, 397, 398, 399, 320, 401, 0, 46, 12, - /* 1620 */ 13, 406, 349, 408, 0, 0, 0, 412, 413, 22, - /* 1630 */ 357, 0, 0, 42, 0, 362, 148, 364, 0, 0, - /* 1640 */ 33, 0, 35, 0, 349, 0, 35, 0, 148, 0, - /* 1650 */ 0, 0, 357, 0, 0, 0, 0, 362, 385, 364, + /* 1470 */ 237, 372, 362, 159, 370, 349, 330, 330, 345, 357, + /* 1480 */ 20, 362, 248, 357, 392, 429, 372, 362, 362, 362, + /* 1490 */ 364, 362, 392, 362, 429, 372, 166, 254, 243, 387, + /* 1500 */ 256, 429, 255, 432, 263, 260, 258, 239, 357, 448, + /* 1510 */ 20, 385, 94, 320, 94, 389, 353, 362, 411, 393, + /* 1520 */ 394, 395, 396, 397, 398, 399, 339, 401, 427, 431, + /* 1530 */ 428, 426, 406, 391, 408, 320, 328, 36, 412, 413, + /* 1540 */ 330, 323, 349, 322, 380, 442, 375, 441, 422, 343, + /* 1550 */ 357, 331, 343, 318, 343, 362, 182, 364, 0, 0, + /* 1560 */ 0, 0, 42, 0, 349, 35, 193, 35, 35, 35, + /* 1570 */ 193, 0, 357, 35, 35, 193, 0, 362, 385, 364, + /* 1580 */ 193, 0, 389, 35, 0, 0, 393, 394, 395, 396, + /* 1590 */ 397, 398, 399, 320, 401, 0, 22, 35, 177, 406, + /* 1600 */ 385, 408, 175, 0, 389, 412, 413, 171, 393, 394, + /* 1610 */ 395, 396, 397, 398, 399, 320, 401, 170, 0, 12, + /* 1620 */ 13, 406, 349, 408, 0, 46, 0, 412, 413, 22, + /* 1630 */ 357, 0, 0, 42, 0, 362, 42, 364, 0, 0, + /* 1640 */ 33, 0, 35, 0, 349, 0, 0, 0, 0, 35, + /* 1650 */ 148, 0, 357, 148, 0, 0, 0, 362, 385, 364, /* 1660 */ 0, 0, 389, 56, 0, 0, 393, 394, 395, 396, /* 1670 */ 397, 398, 399, 0, 401, 68, 0, 0, 0, 406, - /* 1680 */ 385, 408, 42, 0, 389, 412, 413, 35, 393, 394, - /* 1690 */ 395, 396, 397, 398, 399, 0, 401, 0, 0, 0, - /* 1700 */ 0, 22, 0, 408, 0, 0, 0, 412, 413, 0, - /* 1710 */ 0, 42, 46, 56, 56, 43, 46, 14, 0, 39, - /* 1720 */ 39, 14, 320, 116, 40, 0, 0, 0, 39, 166, - /* 1730 */ 0, 0, 0, 62, 0, 0, 35, 47, 0, 47, - /* 1740 */ 0, 47, 0, 47, 0, 0, 35, 39, 0, 35, - /* 1750 */ 0, 349, 39, 0, 39, 35, 39, 35, 22, 357, - /* 1760 */ 0, 0, 103, 101, 362, 49, 364, 43, 35, 22, - /* 1770 */ 0, 43, 35, 22, 35, 0, 35, 22, 35, 22, - /* 1780 */ 0, 35, 175, 0, 177, 22, 20, 385, 95, 35, - /* 1790 */ 320, 389, 0, 35, 35, 393, 394, 395, 396, 397, - /* 1800 */ 398, 399, 0, 401, 162, 178, 199, 200, 35, 320, - /* 1810 */ 408, 22, 0, 94, 412, 413, 0, 3, 0, 349, - /* 1820 */ 213, 214, 215, 216, 217, 218, 219, 357, 35, 162, - /* 1830 */ 162, 0, 362, 159, 364, 0, 0, 0, 349, 164, - /* 1840 */ 39, 46, 160, 94, 158, 223, 357, 95, 43, 43, - /* 1850 */ 187, 362, 244, 364, 225, 385, 94, 46, 94, 389, - /* 1860 */ 104, 46, 94, 393, 394, 395, 396, 397, 398, 399, - /* 1870 */ 400, 401, 402, 403, 385, 94, 320, 95, 389, 95, + /* 1680 */ 385, 408, 0, 0, 389, 412, 413, 35, 393, 394, + /* 1690 */ 395, 396, 397, 398, 399, 0, 401, 0, 0, 42, + /* 1700 */ 0, 0, 0, 408, 0, 0, 22, 412, 413, 0, + /* 1710 */ 0, 0, 0, 0, 56, 56, 0, 42, 39, 0, + /* 1720 */ 14, 14, 320, 116, 43, 39, 46, 0, 40, 0, + /* 1730 */ 0, 46, 39, 166, 0, 0, 0, 0, 0, 47, + /* 1740 */ 0, 47, 39, 35, 0, 0, 47, 0, 0, 35, + /* 1750 */ 0, 349, 62, 35, 39, 35, 39, 0, 35, 357, + /* 1760 */ 0, 39, 0, 22, 362, 103, 364, 101, 47, 43, + /* 1770 */ 0, 22, 0, 49, 35, 43, 22, 35, 35, 0, + /* 1780 */ 0, 35, 175, 22, 177, 22, 35, 385, 35, 0, + /* 1790 */ 320, 389, 162, 35, 35, 393, 394, 395, 396, 397, + /* 1800 */ 398, 399, 0, 401, 22, 22, 199, 200, 35, 320, + /* 1810 */ 408, 35, 20, 35, 412, 413, 0, 22, 178, 349, + /* 1820 */ 213, 214, 215, 216, 217, 218, 219, 357, 95, 162, + /* 1830 */ 159, 0, 362, 0, 364, 3, 162, 0, 349, 0, + /* 1840 */ 0, 35, 0, 0, 39, 46, 357, 95, 223, 94, + /* 1850 */ 94, 362, 43, 364, 225, 385, 187, 43, 94, 389, + /* 1860 */ 164, 244, 94, 393, 394, 395, 396, 397, 398, 399, + /* 1870 */ 400, 401, 402, 403, 385, 94, 320, 43, 389, 104, /* 1880 */ 94, 94, 393, 394, 395, 396, 397, 398, 399, 95, - /* 1890 */ 401, 43, 95, 320, 94, 43, 43, 408, 94, 3, - /* 1900 */ 43, 94, 413, 95, 94, 349, 46, 35, 223, 35, - /* 1910 */ 35, 35, 95, 357, 95, 35, 35, 95, 362, 95, - /* 1920 */ 364, 43, 349, 46, 2, 46, 22, 94, 199, 238, - /* 1930 */ 357, 46, 244, 95, 94, 362, 320, 364, 95, 94, - /* 1940 */ 94, 385, 22, 46, 95, 389, 95, 105, 94, 393, + /* 1890 */ 401, 160, 95, 320, 94, 223, 95, 408, 95, 95, + /* 1900 */ 43, 94, 413, 43, 94, 349, 94, 46, 46, 94, + /* 1910 */ 3, 43, 244, 357, 95, 95, 35, 35, 362, 35, + /* 1920 */ 364, 35, 349, 158, 35, 35, 46, 2, 43, 238, + /* 1930 */ 357, 95, 22, 244, 46, 362, 320, 364, 46, 95, + /* 1940 */ 94, 385, 46, 95, 94, 389, 95, 94, 94, 393, /* 1950 */ 394, 395, 396, 397, 398, 399, 320, 401, 385, 403, - /* 1960 */ 94, 35, 389, 95, 35, 349, 393, 394, 395, 396, - /* 1970 */ 397, 398, 399, 357, 401, 201, 94, 35, 362, 95, - /* 1980 */ 364, 94, 35, 95, 94, 349, 95, 35, 94, 35, - /* 1990 */ 354, 118, 94, 357, 95, 22, 94, 94, 362, 106, - /* 2000 */ 364, 385, 35, 94, 118, 389, 43, 320, 435, 393, - /* 2010 */ 394, 395, 396, 397, 398, 399, 244, 401, 118, 118, - /* 2020 */ 22, 385, 62, 61, 35, 389, 35, 35, 35, 393, - /* 2030 */ 394, 395, 396, 397, 398, 399, 349, 401, 35, 35, - /* 2040 */ 35, 354, 35, 35, 357, 35, 68, 91, 35, 362, - /* 2050 */ 35, 364, 43, 437, 22, 35, 22, 35, 35, 35, - /* 2060 */ 35, 35, 68, 35, 35, 35, 22, 0, 35, 0, - /* 2070 */ 35, 0, 385, 35, 47, 39, 389, 35, 47, 39, + /* 1960 */ 95, 94, 389, 46, 95, 349, 393, 394, 395, 396, + /* 1970 */ 397, 398, 399, 357, 401, 22, 199, 94, 362, 105, + /* 1980 */ 364, 35, 95, 35, 35, 349, 95, 94, 94, 201, + /* 1990 */ 354, 35, 95, 357, 94, 35, 95, 94, 362, 95, + /* 2000 */ 364, 385, 35, 94, 22, 389, 35, 320, 435, 393, + /* 2010 */ 394, 395, 396, 397, 398, 399, 118, 401, 106, 43, + /* 2020 */ 118, 385, 94, 118, 118, 389, 94, 94, 22, 393, + /* 2030 */ 394, 395, 396, 397, 398, 399, 349, 401, 35, 62, + /* 2040 */ 61, 354, 35, 35, 357, 35, 35, 35, 35, 362, + /* 2050 */ 35, 364, 35, 437, 35, 68, 91, 43, 35, 35, + /* 2060 */ 22, 35, 22, 35, 35, 35, 68, 35, 35, 35, + /* 2070 */ 35, 35, 385, 22, 35, 0, 389, 35, 47, 0, /* 2080 */ 393, 394, 395, 396, 397, 398, 399, 320, 401, 39, - /* 2090 */ 47, 0, 35, 47, 39, 0, 35, 35, 0, 22, - /* 2100 */ 21, 449, 22, 22, 21, 320, 20, 449, 449, 449, - /* 2110 */ 449, 449, 449, 449, 449, 449, 349, 449, 449, 449, + /* 2090 */ 35, 47, 39, 0, 35, 47, 39, 0, 35, 47, + /* 2100 */ 39, 0, 35, 35, 0, 320, 22, 21, 449, 22, + /* 2110 */ 22, 21, 20, 449, 449, 449, 349, 449, 449, 449, /* 2120 */ 449, 449, 449, 449, 357, 449, 449, 449, 449, 362, /* 2130 */ 449, 364, 449, 449, 349, 449, 449, 449, 449, 449, /* 2140 */ 449, 449, 357, 449, 449, 449, 449, 362, 320, 364, @@ -785,80 +785,80 @@ static const YYCODETYPE yy_lookahead[] = { /* 2800 */ 449, 401, 385, 449, 449, 449, 389, 449, 449, 449, /* 2810 */ 393, 394, 395, 396, 397, 398, 399, 449, 401, }; -#define YY_SHIFT_COUNT (693) +#define YY_SHIFT_COUNT (695) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (2098) +#define YY_SHIFT_MAX (2104) static const unsigned short int yy_shift_ofst[] = { /* 0 */ 1135, 0, 57, 268, 57, 325, 325, 325, 536, 325, /* 10 */ 325, 325, 325, 325, 593, 804, 804, 861, 804, 804, /* 20 */ 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, /* 30 */ 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - /* 40 */ 804, 804, 804, 804, 804, 804, 8, 12, 104, 73, - /* 50 */ 369, 164, 286, 164, 104, 104, 1607, 1607, 164, 1607, + /* 40 */ 804, 804, 804, 804, 804, 804, 8, 12, 324, 73, + /* 50 */ 520, 164, 286, 164, 324, 324, 1607, 1607, 164, 1607, /* 60 */ 1607, 4, 164, 55, 55, 1, 1, 176, 55, 55, - /* 70 */ 55, 55, 55, 55, 55, 55, 55, 55, 54, 55, - /* 80 */ 55, 55, 428, 55, 55, 555, 55, 55, 555, 683, - /* 90 */ 55, 555, 555, 555, 55, 457, 1066, 1233, 1233, 402, - /* 100 */ 490, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, - /* 110 */ 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, - /* 120 */ 468, 611, 176, 350, 350, 622, 370, 648, 267, 267, - /* 130 */ 600, 600, 600, 370, 752, 752, 752, 182, 428, 632, - /* 140 */ 632, 412, 555, 555, 767, 767, 182, 899, 399, 399, - /* 150 */ 399, 399, 399, 399, 399, 263, 382, 769, 717, 445, - /* 160 */ 42, 134, 205, 154, 217, 319, 1014, 825, 827, 852, - /* 170 */ 455, 126, 852, 1055, 161, 395, 1070, 1269, 1145, 1278, - /* 180 */ 1278, 1306, 1306, 1278, 1184, 1184, 1255, 1306, 1306, 1306, - /* 190 */ 1328, 1328, 1340, 54, 428, 54, 1358, 1360, 54, 1358, - /* 200 */ 54, 54, 54, 1306, 54, 1328, 555, 555, 555, 555, - /* 210 */ 555, 555, 555, 555, 555, 555, 555, 1306, 1328, 767, - /* 220 */ 1212, 1340, 457, 1248, 428, 457, 1306, 1306, 1358, 457, - /* 230 */ 1202, 767, 767, 767, 767, 1202, 767, 1299, 457, 182, - /* 240 */ 457, 752, 1456, 1456, 767, 1230, 1202, 767, 767, 1230, - /* 250 */ 1202, 767, 767, 555, 1227, 1325, 1230, 1239, 1241, 1254, - /* 260 */ 1070, 1236, 1240, 1243, 1263, 752, 1484, 1411, 1415, 767, - /* 270 */ 899, 1306, 457, 1494, 1328, 2819, 2819, 2819, 2819, 2819, - /* 280 */ 2819, 2819, 1062, 996, 559, 70, 751, 1242, 766, 50, - /* 290 */ 775, 1019, 226, 850, 850, 850, 850, 850, 850, 850, - /* 300 */ 850, 850, 982, 262, 11, 11, 53, 160, 63, 227, - /* 310 */ 361, 561, 513, 483, 639, 534, 483, 483, 483, 301, - /* 320 */ 663, 808, 834, 1001, 1018, 1020, 1022, 983, 1156, 1160, - /* 330 */ 1068, 941, 999, 1071, 1079, 1124, 1132, 1136, 1140, 1032, - /* 340 */ 930, 919, 1167, 1143, 878, 1011, 1109, 1148, 1195, 1139, - /* 350 */ 1157, 1158, 1180, 1185, 1201, 1218, 1205, 1152, 1249, 1224, - /* 360 */ 1286, 1551, 1552, 1371, 1554, 1558, 1514, 1559, 1525, 1368, - /* 370 */ 1527, 1528, 1530, 1373, 1567, 1533, 1534, 1377, 1571, 1380, - /* 380 */ 1574, 1540, 1576, 1561, 1580, 1546, 1407, 1410, 1595, 1596, - /* 390 */ 1426, 1428, 1602, 1603, 1572, 1617, 1624, 1625, 1565, 1626, - /* 400 */ 1631, 1632, 1591, 1634, 1638, 1639, 1641, 1643, 1645, 1488, - /* 410 */ 1611, 1647, 1500, 1649, 1650, 1651, 1653, 1654, 1655, 1656, - /* 420 */ 1660, 1661, 1664, 1665, 1673, 1676, 1677, 1640, 1678, 1683, - /* 430 */ 1695, 1697, 1698, 1679, 1699, 1700, 1702, 1704, 1652, 1705, - /* 440 */ 1657, 1706, 1658, 1709, 1710, 1669, 1680, 1672, 1703, 1666, - /* 450 */ 1707, 1670, 1718, 1684, 1681, 1725, 1726, 1727, 1689, 1563, - /* 460 */ 1730, 1731, 1732, 1671, 1734, 1735, 1701, 1690, 1708, 1738, - /* 470 */ 1711, 1692, 1713, 1740, 1714, 1694, 1715, 1742, 1720, 1696, - /* 480 */ 1717, 1744, 1745, 1748, 1750, 1659, 1662, 1722, 1736, 1753, - /* 490 */ 1733, 1737, 1739, 1724, 1728, 1741, 1743, 1747, 1746, 1760, - /* 500 */ 1751, 1761, 1755, 1716, 1770, 1757, 1754, 1775, 1758, 1780, - /* 510 */ 1759, 1783, 1763, 1766, 1693, 1719, 1792, 1642, 1773, 1802, - /* 520 */ 1627, 1789, 1667, 1674, 1812, 1816, 1668, 1675, 1814, 1818, - /* 530 */ 1831, 1835, 1749, 1752, 1793, 1663, 1836, 1762, 1682, 1764, - /* 540 */ 1837, 1801, 1686, 1768, 1756, 1795, 1805, 1622, 1629, 1685, - /* 550 */ 1806, 1608, 1781, 1782, 1786, 1784, 1794, 1787, 1848, 1797, - /* 560 */ 1800, 1804, 1807, 1808, 1852, 1811, 1815, 1810, 1853, 1688, - /* 570 */ 1817, 1819, 1896, 1857, 1772, 1872, 1874, 1875, 1876, 1880, - /* 580 */ 1881, 1822, 1824, 1860, 1691, 1878, 1877, 1879, 1922, 1904, - /* 590 */ 1729, 1833, 1838, 1840, 1843, 1845, 1849, 1885, 1846, 1854, - /* 600 */ 1897, 1851, 1920, 1774, 1866, 1842, 1868, 1926, 1929, 1882, - /* 610 */ 1884, 1942, 1887, 1888, 1947, 1890, 1891, 1952, 1894, 1899, - /* 620 */ 1954, 1898, 1873, 1886, 1900, 1901, 1973, 1893, 1902, 1903, - /* 630 */ 1967, 1909, 1963, 1963, 1998, 1960, 1962, 1989, 1991, 1992, - /* 640 */ 1993, 2003, 2004, 2005, 2007, 2008, 2010, 1978, 1956, 2009, - /* 650 */ 2013, 2015, 2032, 2020, 2034, 2022, 2023, 2024, 1994, 1724, - /* 660 */ 2025, 1728, 2026, 2028, 2029, 2030, 2044, 2033, 2067, 2035, - /* 670 */ 2027, 2036, 2069, 2038, 2031, 2040, 2071, 2042, 2043, 2050, - /* 680 */ 2091, 2057, 2046, 2055, 2095, 2061, 2062, 2098, 2077, 2079, - /* 690 */ 2080, 2081, 2083, 2086, + /* 70 */ 55, 55, 55, 55, 55, 55, 55, 55, 138, 55, + /* 80 */ 55, 55, 109, 55, 55, 267, 55, 55, 267, 484, + /* 90 */ 55, 267, 267, 267, 55, 457, 1066, 1233, 1233, 375, + /* 100 */ 402, 380, 380, 380, 380, 380, 380, 380, 380, 380, + /* 110 */ 380, 380, 380, 380, 380, 380, 380, 380, 380, 380, + /* 120 */ 736, 550, 176, 350, 350, 587, 429, 704, 396, 396, + /* 130 */ 742, 742, 742, 429, 573, 573, 573, 462, 109, 588, + /* 140 */ 588, 483, 267, 267, 693, 693, 462, 707, 399, 399, + /* 150 */ 399, 399, 399, 399, 399, 263, 501, 382, 717, 838, + /* 160 */ 42, 134, 190, 154, 217, 319, 421, 738, 825, 260, + /* 170 */ 126, 859, 260, 569, 659, 698, 1057, 1258, 1137, 1283, + /* 180 */ 1283, 1306, 1306, 1283, 1186, 1186, 1284, 1306, 1306, 1306, + /* 190 */ 1359, 1359, 1362, 138, 109, 138, 1366, 1368, 138, 1366, + /* 200 */ 138, 138, 138, 1306, 138, 1359, 267, 267, 267, 267, + /* 210 */ 267, 267, 267, 267, 267, 267, 267, 1306, 1359, 693, + /* 220 */ 1229, 1362, 457, 1260, 109, 457, 1306, 1306, 1366, 457, + /* 230 */ 1207, 693, 693, 693, 693, 1207, 693, 1314, 457, 462, + /* 240 */ 457, 573, 1460, 1460, 693, 1234, 1207, 693, 693, 1234, + /* 250 */ 1207, 693, 693, 267, 1243, 1330, 1234, 1244, 1247, 1255, + /* 260 */ 1057, 1241, 1245, 1248, 1268, 573, 1490, 1418, 1420, 693, + /* 270 */ 707, 1306, 457, 1501, 1359, 2819, 2819, 2819, 2819, 2819, + /* 280 */ 2819, 2819, 1062, 996, 759, 70, 1019, 1154, 1090, 50, + /* 290 */ 1242, 1277, 226, 582, 582, 582, 582, 582, 582, 582, + /* 300 */ 582, 582, 982, 262, 11, 11, 53, 160, 63, 227, + /* 310 */ 327, 669, 378, 479, 726, 348, 479, 479, 479, 837, + /* 320 */ 734, 361, 884, 868, 943, 956, 993, 940, 1097, 1174, + /* 330 */ 1034, 790, 1132, 1136, 1138, 1139, 1143, 1145, 1148, 909, + /* 340 */ 559, 863, 1054, 1158, 1023, 1085, 922, 1185, 305, 1219, + /* 350 */ 1253, 1254, 1266, 1269, 1274, 1279, 1204, 1302, 1303, 1195, + /* 360 */ 1236, 1558, 1559, 1374, 1560, 1561, 1520, 1563, 1530, 1373, + /* 370 */ 1532, 1533, 1534, 1377, 1571, 1538, 1539, 1382, 1576, 1387, + /* 380 */ 1581, 1548, 1584, 1574, 1585, 1562, 1421, 1427, 1595, 1603, + /* 390 */ 1436, 1447, 1618, 1624, 1579, 1626, 1631, 1632, 1591, 1634, + /* 400 */ 1638, 1639, 1594, 1641, 1643, 1645, 1646, 1647, 1648, 1502, + /* 410 */ 1614, 1651, 1505, 1654, 1655, 1656, 1660, 1661, 1664, 1665, + /* 420 */ 1673, 1676, 1677, 1678, 1682, 1683, 1695, 1657, 1697, 1698, + /* 430 */ 1700, 1701, 1702, 1684, 1704, 1705, 1709, 1710, 1652, 1711, + /* 440 */ 1658, 1712, 1659, 1713, 1716, 1675, 1679, 1681, 1706, 1680, + /* 450 */ 1707, 1685, 1719, 1688, 1686, 1727, 1729, 1730, 1693, 1567, + /* 460 */ 1734, 1735, 1736, 1690, 1737, 1738, 1708, 1692, 1703, 1740, + /* 470 */ 1714, 1694, 1715, 1744, 1718, 1699, 1717, 1745, 1720, 1721, + /* 480 */ 1722, 1747, 1748, 1750, 1757, 1662, 1666, 1723, 1741, 1760, + /* 490 */ 1739, 1742, 1749, 1743, 1746, 1726, 1732, 1751, 1753, 1754, + /* 500 */ 1758, 1762, 1761, 1770, 1763, 1724, 1772, 1782, 1759, 1779, + /* 510 */ 1773, 1780, 1776, 1789, 1783, 1792, 1733, 1755, 1802, 1630, + /* 520 */ 1778, 1816, 1640, 1795, 1667, 1671, 1831, 1833, 1674, 1696, + /* 530 */ 1832, 1837, 1839, 1840, 1756, 1752, 1806, 1669, 1842, 1764, + /* 540 */ 1731, 1768, 1843, 1805, 1765, 1781, 1775, 1799, 1809, 1625, + /* 550 */ 1629, 1672, 1814, 1617, 1786, 1794, 1787, 1797, 1801, 1800, + /* 560 */ 1834, 1803, 1807, 1810, 1812, 1804, 1857, 1861, 1862, 1815, + /* 570 */ 1860, 1668, 1819, 1820, 1907, 1868, 1689, 1881, 1882, 1884, + /* 580 */ 1886, 1889, 1890, 1836, 1844, 1880, 1691, 1885, 1888, 1892, + /* 590 */ 1925, 1910, 1777, 1846, 1848, 1850, 1851, 1853, 1865, 1896, + /* 600 */ 1854, 1867, 1917, 1869, 1953, 1788, 1883, 1874, 1887, 1946, + /* 610 */ 1948, 1893, 1891, 1949, 1894, 1897, 1956, 1900, 1901, 1960, + /* 620 */ 1903, 1904, 1967, 1909, 1898, 1902, 1905, 1906, 1982, 1912, + /* 630 */ 1928, 1932, 1971, 1933, 1976, 1976, 2006, 1977, 1979, 2003, + /* 640 */ 2007, 2008, 2010, 2011, 2012, 2013, 2015, 2017, 2019, 1987, + /* 650 */ 1965, 2014, 2023, 2024, 2038, 2026, 2040, 2028, 2029, 2030, + /* 660 */ 1998, 1726, 2032, 1732, 2033, 2034, 2035, 2036, 2051, 2039, + /* 670 */ 2075, 2042, 2031, 2050, 2079, 2055, 2044, 2053, 2093, 2059, + /* 680 */ 2048, 2057, 2097, 2063, 2052, 2061, 2101, 2067, 2068, 2104, + /* 690 */ 2084, 2086, 2087, 2088, 2090, 2092, }; #define YY_REDUCE_COUNT (281) #define YY_REDUCE_MIN (-408) @@ -869,102 +869,102 @@ static const short yy_reduce_ofst[] = { /* 20 */ 1573, 1616, 601, 1636, 1687, 1767, 1785, 1828, 1847, 1871, /* 30 */ 1914, 1931, 1957, 1974, 2037, 2054, 2117, 2143, 2197, 2214, /* 40 */ 2257, 2277, 2320, 2337, 2400, 2417, -193, 278, -223, -139, - /* 50 */ 276, 662, 987, 1000, 491, 1017, -351, -348, -316, -341, - /* 60 */ -40, -261, 241, -26, 38, -309, -177, -30, -31, 107, - /* 70 */ 109, 112, 223, 236, 311, 343, 510, 514, -245, 542, - /* 80 */ 547, 549, -355, 562, 575, -169, 631, 636, 201, 203, - /* 90 */ 644, 253, 252, 275, 612, 360, -190, -408, -408, -315, - /* 100 */ -304, -265, -247, -201, -181, -12, 74, 142, 257, 259, - /* 110 */ 283, 327, 465, 466, 474, 533, 616, 618, 725, 733, - /* 120 */ -318, 27, -135, -271, 72, -43, -93, 375, 96, 413, - /* 130 */ 27, 497, 566, 486, 487, 488, 512, -17, 354, 450, - /* 140 */ 456, 544, 543, 535, 678, 682, 712, 629, 526, 680, - /* 150 */ 762, 780, 840, 846, 876, 844, 913, 898, 848, 816, - /* 160 */ 829, 937, 859, 942, 942, 964, 968, 936, 906, 879, - /* 170 */ 879, 865, 879, 887, 886, 942, 928, 931, 943, 954, - /* 180 */ 956, 1007, 1010, 971, 976, 977, 1015, 1031, 1035, 1038, - /* 190 */ 1045, 1046, 986, 1039, 1009, 1044, 1003, 1004, 1051, 1012, - /* 200 */ 1052, 1053, 1054, 1059, 1057, 1069, 1043, 1047, 1049, 1050, - /* 210 */ 1063, 1064, 1073, 1075, 1078, 1080, 1083, 1067, 1086, 1056, - /* 220 */ 1033, 1036, 1085, 1058, 1072, 1112, 1117, 1119, 1074, 1118, - /* 230 */ 1081, 1089, 1090, 1092, 1093, 1084, 1095, 1101, 1129, 1127, - /* 240 */ 1144, 1116, 1087, 1088, 1115, 1060, 1110, 1122, 1123, 1065, - /* 250 */ 1114, 1125, 1130, 942, 1061, 1076, 1077, 1082, 1091, 1100, - /* 260 */ 1111, 1096, 1094, 1099, 879, 1146, 1121, 1097, 1161, 1154, - /* 270 */ 1178, 1200, 1199, 1208, 1211, 1163, 1166, 1194, 1203, 1204, - /* 280 */ 1214, 1231, + /* 50 */ 276, 446, 464, 924, 1016, 1032, -351, -348, -316, -341, + /* 60 */ -40, -261, 241, -26, 38, -309, -177, -30, -31, 97, + /* 70 */ 246, 281, 291, 311, 343, 491, 531, 535, -245, 542, + /* 80 */ 591, 611, -355, 631, 636, -169, 644, 702, 104, 203, + /* 90 */ 895, 210, 252, 283, 938, 513, -190, -408, -408, -304, + /* 100 */ -315, -265, -247, -201, -181, 129, 320, 458, 514, 547, + /* 110 */ 595, 616, 618, 725, 733, 798, 802, 803, 836, 864, + /* 120 */ -318, 163, -135, -271, 69, -43, -93, 442, 284, 301, + /* 130 */ 163, 436, 437, 362, 193, 406, 409, -17, -250, 392, + /* 140 */ 407, 229, 101, 345, 463, 470, 571, 432, 480, 511, + /* 150 */ 527, 545, 561, 617, 623, 398, 647, 764, 654, 665, + /* 160 */ 744, 772, 748, 834, 834, 858, 862, 829, 827, 840, + /* 170 */ 840, 785, 840, 845, 851, 834, 913, 934, 944, 965, + /* 180 */ 966, 1011, 1012, 972, 978, 992, 1037, 1038, 1049, 1050, + /* 190 */ 1058, 1059, 1000, 1052, 1021, 1055, 1015, 1014, 1063, 1018, + /* 200 */ 1064, 1067, 1068, 1070, 1076, 1089, 1069, 1073, 1074, 1075, + /* 210 */ 1078, 1079, 1080, 1081, 1082, 1086, 1088, 1084, 1091, 1053, + /* 220 */ 1035, 1042, 1108, 1060, 1083, 1113, 1116, 1117, 1077, 1121, + /* 230 */ 1087, 1093, 1094, 1095, 1096, 1099, 1110, 1104, 1146, 1133, + /* 240 */ 1147, 1122, 1092, 1100, 1119, 1056, 1114, 1125, 1127, 1065, + /* 250 */ 1123, 1129, 1131, 834, 1071, 1098, 1072, 1102, 1101, 1105, + /* 260 */ 1112, 1061, 1103, 1106, 840, 1151, 1142, 1107, 1163, 1155, + /* 270 */ 1187, 1208, 1210, 1218, 1221, 1164, 1171, 1206, 1209, 1211, + /* 280 */ 1220, 1235, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 10 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 20 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 30 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 40 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 50 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 60 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 70 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1621, 1547, - /* 80 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 90 */ 1547, 1547, 1547, 1547, 1547, 1619, 1788, 1976, 1547, 1547, - /* 100 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 110 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 120 */ 1547, 1988, 1547, 1547, 1547, 1621, 1547, 1619, 1948, 1948, - /* 130 */ 1988, 1988, 1988, 1547, 1547, 1547, 1547, 1728, 1547, 1829, - /* 140 */ 1829, 1547, 1547, 1547, 1547, 1547, 1728, 1547, 1547, 1547, - /* 150 */ 1547, 1547, 1547, 1547, 1547, 1823, 1547, 1547, 2013, 2066, - /* 160 */ 1547, 1547, 2016, 1547, 1547, 1547, 1547, 1681, 2003, 1980, - /* 170 */ 1994, 2050, 1981, 1978, 1997, 1547, 2007, 1547, 1816, 1793, - /* 180 */ 1793, 1547, 1547, 1793, 1790, 1790, 1672, 1547, 1547, 1547, - /* 190 */ 1547, 1547, 1547, 1621, 1547, 1621, 1547, 1547, 1621, 1547, - /* 200 */ 1621, 1621, 1621, 1547, 1621, 1547, 1547, 1547, 1547, 1547, - /* 210 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 220 */ 1835, 1547, 1619, 1825, 1547, 1619, 1547, 1547, 1547, 1619, - /* 230 */ 2021, 1547, 1547, 1547, 1547, 2021, 1547, 1547, 1619, 1547, - /* 240 */ 1619, 1547, 1547, 1547, 1547, 2023, 2021, 1547, 1547, 2023, - /* 250 */ 2021, 1547, 1547, 1547, 2035, 2031, 2023, 2039, 2037, 2009, - /* 260 */ 2007, 2069, 2056, 2052, 1994, 1547, 1547, 1547, 1697, 1547, - /* 270 */ 1547, 1547, 1619, 1579, 1547, 1818, 1829, 1731, 1731, 1731, - /* 280 */ 1622, 1552, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 290 */ 1547, 1547, 1547, 1904, 1547, 2034, 2033, 1952, 1951, 1950, - /* 300 */ 1941, 1903, 1547, 1693, 1902, 1901, 1547, 1547, 1547, 1547, - /* 310 */ 1547, 1547, 1547, 1895, 1547, 1547, 1896, 1894, 1893, 1547, - /* 320 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 330 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 340 */ 2053, 2057, 1977, 1547, 1547, 1547, 1547, 1547, 1886, 1877, - /* 350 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 360 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 370 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 380 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 390 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 400 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 410 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 420 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 430 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 440 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1584, 1547, 1547, - /* 450 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 460 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 470 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 480 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 490 */ 1547, 1547, 1547, 1661, 1660, 1547, 1547, 1547, 1547, 1547, - /* 500 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 510 */ 1547, 1547, 1547, 1547, 1885, 1547, 1547, 1547, 1547, 1547, - /* 520 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 2049, 1547, - /* 530 */ 1547, 1547, 1547, 1547, 1547, 1547, 1833, 1547, 1547, 1547, - /* 540 */ 1547, 1547, 1547, 1547, 1547, 1547, 1938, 1547, 1547, 1547, - /* 550 */ 2010, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 560 */ 1547, 1547, 1547, 1547, 1547, 1547, 1877, 1547, 2032, 1547, - /* 570 */ 1547, 2047, 1547, 2051, 1547, 1547, 1547, 1547, 1547, 1547, - /* 580 */ 1547, 1987, 1983, 1547, 1547, 1979, 1876, 1547, 1972, 1547, - /* 590 */ 1547, 1923, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 600 */ 1547, 1885, 1547, 1889, 1547, 1547, 1547, 1547, 1547, 1725, - /* 610 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 620 */ 1547, 1547, 1710, 1708, 1707, 1706, 1547, 1703, 1547, 1547, - /* 630 */ 1547, 1547, 1734, 1733, 1547, 1547, 1547, 1547, 1547, 1547, - /* 640 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1641, - /* 650 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1632, - /* 660 */ 1547, 1631, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 670 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 680 */ 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, - /* 690 */ 1547, 1547, 1547, 1547, + /* 0 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 10 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 20 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 30 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 40 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 50 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 60 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 70 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1627, 1553, + /* 80 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 90 */ 1553, 1553, 1553, 1553, 1553, 1625, 1796, 1984, 1553, 1553, + /* 100 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 110 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 120 */ 1553, 1996, 1553, 1553, 1553, 1627, 1553, 1625, 1956, 1956, + /* 130 */ 1996, 1996, 1996, 1553, 1553, 1553, 1553, 1736, 1553, 1837, + /* 140 */ 1837, 1553, 1553, 1553, 1553, 1553, 1736, 1553, 1553, 1553, + /* 150 */ 1553, 1553, 1553, 1553, 1553, 1831, 1553, 1553, 2021, 2074, + /* 160 */ 1553, 1553, 2024, 1553, 1553, 1553, 1553, 1689, 2011, 1988, + /* 170 */ 2002, 2058, 1989, 1986, 2005, 1553, 2015, 1553, 1824, 1801, + /* 180 */ 1801, 1553, 1553, 1801, 1798, 1798, 1680, 1553, 1553, 1553, + /* 190 */ 1553, 1553, 1553, 1627, 1553, 1627, 1553, 1553, 1627, 1553, + /* 200 */ 1627, 1627, 1627, 1553, 1627, 1553, 1553, 1553, 1553, 1553, + /* 210 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 220 */ 1843, 1553, 1625, 1833, 1553, 1625, 1553, 1553, 1553, 1625, + /* 230 */ 2029, 1553, 1553, 1553, 1553, 2029, 1553, 1553, 1625, 1553, + /* 240 */ 1625, 1553, 1553, 1553, 1553, 2031, 2029, 1553, 1553, 2031, + /* 250 */ 2029, 1553, 1553, 1553, 2043, 2039, 2031, 2047, 2045, 2017, + /* 260 */ 2015, 2077, 2064, 2060, 2002, 1553, 1553, 1553, 1705, 1553, + /* 270 */ 1553, 1553, 1625, 1585, 1553, 1826, 1837, 1739, 1739, 1739, + /* 280 */ 1628, 1558, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 290 */ 1553, 1553, 1553, 1912, 1553, 2042, 2041, 1960, 1959, 1958, + /* 300 */ 1949, 1911, 1553, 1701, 1910, 1909, 1553, 1553, 1553, 1553, + /* 310 */ 1553, 1553, 1553, 1903, 1553, 1553, 1904, 1902, 1901, 1553, + /* 320 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 330 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 340 */ 2061, 2065, 1985, 1553, 1553, 1553, 1553, 1553, 1894, 1885, + /* 350 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 360 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 370 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 380 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 390 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 400 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 410 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 420 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 430 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 440 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1590, 1553, 1553, + /* 450 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 460 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 470 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 480 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 490 */ 1553, 1553, 1553, 1553, 1553, 1667, 1666, 1553, 1553, 1553, + /* 500 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 510 */ 1553, 1553, 1553, 1553, 1553, 1553, 1893, 1553, 1553, 1553, + /* 520 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 530 */ 2057, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1841, 1553, + /* 540 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1946, 1553, + /* 550 */ 1553, 1553, 2018, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 560 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1885, 1553, + /* 570 */ 2040, 1553, 1553, 2055, 1553, 2059, 1553, 1553, 1553, 1553, + /* 580 */ 1553, 1553, 1553, 1995, 1991, 1553, 1553, 1987, 1884, 1553, + /* 590 */ 1980, 1553, 1553, 1931, 1553, 1553, 1553, 1553, 1553, 1553, + /* 600 */ 1553, 1553, 1553, 1893, 1553, 1897, 1553, 1553, 1553, 1553, + /* 610 */ 1553, 1733, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 620 */ 1553, 1553, 1553, 1553, 1718, 1716, 1715, 1714, 1553, 1711, + /* 630 */ 1553, 1553, 1553, 1553, 1742, 1741, 1553, 1553, 1553, 1553, + /* 640 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 650 */ 1553, 1647, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 660 */ 1553, 1638, 1553, 1637, 1553, 1553, 1553, 1553, 1553, 1553, + /* 670 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 680 */ 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, + /* 690 */ 1553, 1553, 1553, 1553, 1553, 1553, }; /********** End of lemon-generated parsing tables *****************************/ @@ -1957,415 +1957,417 @@ static const char *const yyRuleName[] = { /* 110 */ "alter_db_option ::= KEEP integer_list", /* 111 */ "alter_db_option ::= KEEP variable_list", /* 112 */ "alter_db_option ::= PAGES NK_INTEGER", - /* 113 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", - /* 114 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", - /* 115 */ "integer_list ::= NK_INTEGER", - /* 116 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", - /* 117 */ "variable_list ::= NK_VARIABLE", - /* 118 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", - /* 119 */ "retention_list ::= retention", - /* 120 */ "retention_list ::= retention_list NK_COMMA retention", - /* 121 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", - /* 122 */ "speed_opt ::=", - /* 123 */ "speed_opt ::= MAX_SPEED NK_INTEGER", - /* 124 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", - /* 125 */ "cmd ::= CREATE TABLE multi_create_clause", - /* 126 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", - /* 127 */ "cmd ::= DROP TABLE multi_drop_clause", - /* 128 */ "cmd ::= DROP STABLE exists_opt full_table_name", - /* 129 */ "cmd ::= ALTER TABLE alter_table_clause", - /* 130 */ "cmd ::= ALTER STABLE alter_table_clause", - /* 131 */ "alter_table_clause ::= full_table_name alter_table_options", - /* 132 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", - /* 133 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", - /* 134 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", - /* 135 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", - /* 136 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", - /* 137 */ "alter_table_clause ::= full_table_name DROP TAG column_name", - /* 138 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", - /* 139 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", - /* 140 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", - /* 141 */ "multi_create_clause ::= create_subtable_clause", - /* 142 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", - /* 143 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", - /* 144 */ "multi_drop_clause ::= drop_table_clause", - /* 145 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", - /* 146 */ "drop_table_clause ::= exists_opt full_table_name", - /* 147 */ "specific_cols_opt ::=", - /* 148 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", - /* 149 */ "full_table_name ::= table_name", - /* 150 */ "full_table_name ::= db_name NK_DOT table_name", - /* 151 */ "column_def_list ::= column_def", - /* 152 */ "column_def_list ::= column_def_list NK_COMMA column_def", - /* 153 */ "column_def ::= column_name type_name", - /* 154 */ "column_def ::= column_name type_name COMMENT NK_STRING", - /* 155 */ "type_name ::= BOOL", - /* 156 */ "type_name ::= TINYINT", - /* 157 */ "type_name ::= SMALLINT", - /* 158 */ "type_name ::= INT", - /* 159 */ "type_name ::= INTEGER", - /* 160 */ "type_name ::= BIGINT", - /* 161 */ "type_name ::= FLOAT", - /* 162 */ "type_name ::= DOUBLE", - /* 163 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", - /* 164 */ "type_name ::= TIMESTAMP", - /* 165 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", - /* 166 */ "type_name ::= TINYINT UNSIGNED", - /* 167 */ "type_name ::= SMALLINT UNSIGNED", - /* 168 */ "type_name ::= INT UNSIGNED", - /* 169 */ "type_name ::= BIGINT UNSIGNED", - /* 170 */ "type_name ::= JSON", - /* 171 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", - /* 172 */ "type_name ::= MEDIUMBLOB", - /* 173 */ "type_name ::= BLOB", - /* 174 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", - /* 175 */ "type_name ::= DECIMAL", - /* 176 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", - /* 177 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", - /* 178 */ "tags_def_opt ::=", - /* 179 */ "tags_def_opt ::= tags_def", - /* 180 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", - /* 181 */ "table_options ::=", - /* 182 */ "table_options ::= table_options COMMENT NK_STRING", - /* 183 */ "table_options ::= table_options MAX_DELAY duration_list", - /* 184 */ "table_options ::= table_options WATERMARK duration_list", - /* 185 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", - /* 186 */ "table_options ::= table_options TTL NK_INTEGER", - /* 187 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", - /* 188 */ "alter_table_options ::= alter_table_option", - /* 189 */ "alter_table_options ::= alter_table_options alter_table_option", - /* 190 */ "alter_table_option ::= COMMENT NK_STRING", - /* 191 */ "alter_table_option ::= TTL NK_INTEGER", - /* 192 */ "duration_list ::= duration_literal", - /* 193 */ "duration_list ::= duration_list NK_COMMA duration_literal", - /* 194 */ "rollup_func_list ::= rollup_func_name", - /* 195 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", - /* 196 */ "rollup_func_name ::= function_name", - /* 197 */ "rollup_func_name ::= FIRST", - /* 198 */ "rollup_func_name ::= LAST", - /* 199 */ "col_name_list ::= col_name", - /* 200 */ "col_name_list ::= col_name_list NK_COMMA col_name", - /* 201 */ "col_name ::= column_name", - /* 202 */ "cmd ::= SHOW DNODES", - /* 203 */ "cmd ::= SHOW USERS", - /* 204 */ "cmd ::= SHOW DATABASES", - /* 205 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", - /* 206 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", - /* 207 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", - /* 208 */ "cmd ::= SHOW MNODES", - /* 209 */ "cmd ::= SHOW QNODES", - /* 210 */ "cmd ::= SHOW FUNCTIONS", - /* 211 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", - /* 212 */ "cmd ::= SHOW STREAMS", - /* 213 */ "cmd ::= SHOW ACCOUNTS", - /* 214 */ "cmd ::= SHOW APPS", - /* 215 */ "cmd ::= SHOW CONNECTIONS", - /* 216 */ "cmd ::= SHOW LICENCES", - /* 217 */ "cmd ::= SHOW GRANTS", - /* 218 */ "cmd ::= SHOW CREATE DATABASE db_name", - /* 219 */ "cmd ::= SHOW CREATE TABLE full_table_name", - /* 220 */ "cmd ::= SHOW CREATE STABLE full_table_name", - /* 221 */ "cmd ::= SHOW QUERIES", - /* 222 */ "cmd ::= SHOW SCORES", - /* 223 */ "cmd ::= SHOW TOPICS", - /* 224 */ "cmd ::= SHOW VARIABLES", - /* 225 */ "cmd ::= SHOW LOCAL VARIABLES", - /* 226 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES", - /* 227 */ "cmd ::= SHOW BNODES", - /* 228 */ "cmd ::= SHOW SNODES", - /* 229 */ "cmd ::= SHOW CLUSTER", - /* 230 */ "cmd ::= SHOW TRANSACTIONS", - /* 231 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", - /* 232 */ "cmd ::= SHOW CONSUMERS", - /* 233 */ "cmd ::= SHOW SUBSCRIPTIONS", - /* 234 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", - /* 235 */ "cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt", - /* 236 */ "cmd ::= SHOW VNODES NK_INTEGER", - /* 237 */ "cmd ::= SHOW VNODES NK_STRING", - /* 238 */ "db_name_cond_opt ::=", - /* 239 */ "db_name_cond_opt ::= db_name NK_DOT", - /* 240 */ "like_pattern_opt ::=", - /* 241 */ "like_pattern_opt ::= LIKE NK_STRING", - /* 242 */ "table_name_cond ::= table_name", - /* 243 */ "from_db_opt ::=", - /* 244 */ "from_db_opt ::= FROM db_name", - /* 245 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", - /* 246 */ "cmd ::= DROP INDEX exists_opt full_table_name", - /* 247 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", - /* 248 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", - /* 249 */ "func_list ::= func", - /* 250 */ "func_list ::= func_list NK_COMMA func", - /* 251 */ "func ::= function_name NK_LP expression_list NK_RP", - /* 252 */ "sma_stream_opt ::=", - /* 253 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", - /* 254 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", - /* 255 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", - /* 256 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", - /* 257 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", - /* 258 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", - /* 259 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", - /* 260 */ "cmd ::= DROP TOPIC exists_opt topic_name", - /* 261 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", - /* 262 */ "cmd ::= DESC full_table_name", - /* 263 */ "cmd ::= DESCRIBE full_table_name", - /* 264 */ "cmd ::= RESET QUERY CACHE", - /* 265 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", - /* 266 */ "analyze_opt ::=", - /* 267 */ "analyze_opt ::= ANALYZE", - /* 268 */ "explain_options ::=", - /* 269 */ "explain_options ::= explain_options VERBOSE NK_BOOL", - /* 270 */ "explain_options ::= explain_options RATIO NK_FLOAT", - /* 271 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", - /* 272 */ "cmd ::= DROP FUNCTION exists_opt function_name", - /* 273 */ "agg_func_opt ::=", - /* 274 */ "agg_func_opt ::= AGGREGATE", - /* 275 */ "bufsize_opt ::=", - /* 276 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", - /* 277 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", - /* 278 */ "cmd ::= DROP STREAM exists_opt stream_name", - /* 279 */ "stream_options ::=", - /* 280 */ "stream_options ::= stream_options TRIGGER AT_ONCE", - /* 281 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", - /* 282 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", - /* 283 */ "stream_options ::= stream_options WATERMARK duration_literal", - /* 284 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", - /* 285 */ "subtable_opt ::=", - /* 286 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", - /* 287 */ "cmd ::= KILL CONNECTION NK_INTEGER", - /* 288 */ "cmd ::= KILL QUERY NK_STRING", - /* 289 */ "cmd ::= KILL TRANSACTION NK_INTEGER", - /* 290 */ "cmd ::= BALANCE VGROUP", - /* 291 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", - /* 292 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", - /* 293 */ "cmd ::= SPLIT VGROUP NK_INTEGER", - /* 294 */ "dnode_list ::= DNODE NK_INTEGER", - /* 295 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", - /* 296 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", - /* 297 */ "cmd ::= query_or_subquery", - /* 298 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", - /* 299 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", - /* 300 */ "literal ::= NK_INTEGER", - /* 301 */ "literal ::= NK_FLOAT", - /* 302 */ "literal ::= NK_STRING", - /* 303 */ "literal ::= NK_BOOL", - /* 304 */ "literal ::= TIMESTAMP NK_STRING", - /* 305 */ "literal ::= duration_literal", - /* 306 */ "literal ::= NULL", - /* 307 */ "literal ::= NK_QUESTION", - /* 308 */ "duration_literal ::= NK_VARIABLE", - /* 309 */ "signed ::= NK_INTEGER", - /* 310 */ "signed ::= NK_PLUS NK_INTEGER", - /* 311 */ "signed ::= NK_MINUS NK_INTEGER", - /* 312 */ "signed ::= NK_FLOAT", - /* 313 */ "signed ::= NK_PLUS NK_FLOAT", - /* 314 */ "signed ::= NK_MINUS NK_FLOAT", - /* 315 */ "signed_literal ::= signed", - /* 316 */ "signed_literal ::= NK_STRING", - /* 317 */ "signed_literal ::= NK_BOOL", - /* 318 */ "signed_literal ::= TIMESTAMP NK_STRING", - /* 319 */ "signed_literal ::= duration_literal", - /* 320 */ "signed_literal ::= NULL", - /* 321 */ "signed_literal ::= literal_func", - /* 322 */ "signed_literal ::= NK_QUESTION", - /* 323 */ "literal_list ::= signed_literal", - /* 324 */ "literal_list ::= literal_list NK_COMMA signed_literal", - /* 325 */ "db_name ::= NK_ID", - /* 326 */ "table_name ::= NK_ID", - /* 327 */ "column_name ::= NK_ID", - /* 328 */ "function_name ::= NK_ID", - /* 329 */ "table_alias ::= NK_ID", - /* 330 */ "column_alias ::= NK_ID", - /* 331 */ "user_name ::= NK_ID", - /* 332 */ "topic_name ::= NK_ID", - /* 333 */ "stream_name ::= NK_ID", - /* 334 */ "cgroup_name ::= NK_ID", - /* 335 */ "expr_or_subquery ::= expression", - /* 336 */ "expr_or_subquery ::= subquery", - /* 337 */ "expression ::= literal", - /* 338 */ "expression ::= pseudo_column", - /* 339 */ "expression ::= column_reference", - /* 340 */ "expression ::= function_expression", - /* 341 */ "expression ::= case_when_expression", - /* 342 */ "expression ::= NK_LP expression NK_RP", - /* 343 */ "expression ::= NK_PLUS expr_or_subquery", - /* 344 */ "expression ::= NK_MINUS expr_or_subquery", - /* 345 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", - /* 346 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", - /* 347 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", - /* 348 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", - /* 349 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", - /* 350 */ "expression ::= column_reference NK_ARROW NK_STRING", - /* 351 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", - /* 352 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", - /* 353 */ "expression_list ::= expr_or_subquery", - /* 354 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", - /* 355 */ "column_reference ::= column_name", - /* 356 */ "column_reference ::= table_name NK_DOT column_name", - /* 357 */ "pseudo_column ::= ROWTS", - /* 358 */ "pseudo_column ::= TBNAME", - /* 359 */ "pseudo_column ::= table_name NK_DOT TBNAME", - /* 360 */ "pseudo_column ::= QSTART", - /* 361 */ "pseudo_column ::= QEND", - /* 362 */ "pseudo_column ::= QDURATION", - /* 363 */ "pseudo_column ::= WSTART", - /* 364 */ "pseudo_column ::= WEND", - /* 365 */ "pseudo_column ::= WDURATION", - /* 366 */ "pseudo_column ::= IROWTS", - /* 367 */ "pseudo_column ::= QTAGS", - /* 368 */ "function_expression ::= function_name NK_LP expression_list NK_RP", - /* 369 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", - /* 370 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", - /* 371 */ "function_expression ::= literal_func", - /* 372 */ "literal_func ::= noarg_func NK_LP NK_RP", - /* 373 */ "literal_func ::= NOW", - /* 374 */ "noarg_func ::= NOW", - /* 375 */ "noarg_func ::= TODAY", - /* 376 */ "noarg_func ::= TIMEZONE", - /* 377 */ "noarg_func ::= DATABASE", - /* 378 */ "noarg_func ::= CLIENT_VERSION", - /* 379 */ "noarg_func ::= SERVER_VERSION", - /* 380 */ "noarg_func ::= SERVER_STATUS", - /* 381 */ "noarg_func ::= CURRENT_USER", - /* 382 */ "noarg_func ::= USER", - /* 383 */ "star_func ::= COUNT", - /* 384 */ "star_func ::= FIRST", - /* 385 */ "star_func ::= LAST", - /* 386 */ "star_func ::= LAST_ROW", - /* 387 */ "star_func_para_list ::= NK_STAR", - /* 388 */ "star_func_para_list ::= other_para_list", - /* 389 */ "other_para_list ::= star_func_para", - /* 390 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", - /* 391 */ "star_func_para ::= expr_or_subquery", - /* 392 */ "star_func_para ::= table_name NK_DOT NK_STAR", - /* 393 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", - /* 394 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", - /* 395 */ "when_then_list ::= when_then_expr", - /* 396 */ "when_then_list ::= when_then_list when_then_expr", - /* 397 */ "when_then_expr ::= WHEN common_expression THEN common_expression", - /* 398 */ "case_when_else_opt ::=", - /* 399 */ "case_when_else_opt ::= ELSE common_expression", - /* 400 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", - /* 401 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", - /* 402 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", - /* 403 */ "predicate ::= expr_or_subquery IS NULL", - /* 404 */ "predicate ::= expr_or_subquery IS NOT NULL", - /* 405 */ "predicate ::= expr_or_subquery in_op in_predicate_value", - /* 406 */ "compare_op ::= NK_LT", - /* 407 */ "compare_op ::= NK_GT", - /* 408 */ "compare_op ::= NK_LE", - /* 409 */ "compare_op ::= NK_GE", - /* 410 */ "compare_op ::= NK_NE", - /* 411 */ "compare_op ::= NK_EQ", - /* 412 */ "compare_op ::= LIKE", - /* 413 */ "compare_op ::= NOT LIKE", - /* 414 */ "compare_op ::= MATCH", - /* 415 */ "compare_op ::= NMATCH", - /* 416 */ "compare_op ::= CONTAINS", - /* 417 */ "in_op ::= IN", - /* 418 */ "in_op ::= NOT IN", - /* 419 */ "in_predicate_value ::= NK_LP literal_list NK_RP", - /* 420 */ "boolean_value_expression ::= boolean_primary", - /* 421 */ "boolean_value_expression ::= NOT boolean_primary", - /* 422 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", - /* 423 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", - /* 424 */ "boolean_primary ::= predicate", - /* 425 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", - /* 426 */ "common_expression ::= expr_or_subquery", - /* 427 */ "common_expression ::= boolean_value_expression", - /* 428 */ "from_clause_opt ::=", - /* 429 */ "from_clause_opt ::= FROM table_reference_list", - /* 430 */ "table_reference_list ::= table_reference", - /* 431 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", - /* 432 */ "table_reference ::= table_primary", - /* 433 */ "table_reference ::= joined_table", - /* 434 */ "table_primary ::= table_name alias_opt", - /* 435 */ "table_primary ::= db_name NK_DOT table_name alias_opt", - /* 436 */ "table_primary ::= subquery alias_opt", - /* 437 */ "table_primary ::= parenthesized_joined_table", - /* 438 */ "alias_opt ::=", - /* 439 */ "alias_opt ::= table_alias", - /* 440 */ "alias_opt ::= AS table_alias", - /* 441 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", - /* 442 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", - /* 443 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", - /* 444 */ "join_type ::=", - /* 445 */ "join_type ::= INNER", - /* 446 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", - /* 447 */ "set_quantifier_opt ::=", - /* 448 */ "set_quantifier_opt ::= DISTINCT", - /* 449 */ "set_quantifier_opt ::= ALL", - /* 450 */ "select_list ::= select_item", - /* 451 */ "select_list ::= select_list NK_COMMA select_item", - /* 452 */ "select_item ::= NK_STAR", - /* 453 */ "select_item ::= common_expression", - /* 454 */ "select_item ::= common_expression column_alias", - /* 455 */ "select_item ::= common_expression AS column_alias", - /* 456 */ "select_item ::= table_name NK_DOT NK_STAR", - /* 457 */ "where_clause_opt ::=", - /* 458 */ "where_clause_opt ::= WHERE search_condition", - /* 459 */ "partition_by_clause_opt ::=", - /* 460 */ "partition_by_clause_opt ::= PARTITION BY partition_list", - /* 461 */ "partition_list ::= partition_item", - /* 462 */ "partition_list ::= partition_list NK_COMMA partition_item", - /* 463 */ "partition_item ::= expr_or_subquery", - /* 464 */ "partition_item ::= expr_or_subquery column_alias", - /* 465 */ "partition_item ::= expr_or_subquery AS column_alias", - /* 466 */ "twindow_clause_opt ::=", - /* 467 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", - /* 468 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", - /* 469 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", - /* 470 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", - /* 471 */ "sliding_opt ::=", - /* 472 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", - /* 473 */ "fill_opt ::=", - /* 474 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", - /* 475 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", - /* 476 */ "fill_mode ::= NONE", - /* 477 */ "fill_mode ::= PREV", - /* 478 */ "fill_mode ::= NULL", - /* 479 */ "fill_mode ::= LINEAR", - /* 480 */ "fill_mode ::= NEXT", - /* 481 */ "group_by_clause_opt ::=", - /* 482 */ "group_by_clause_opt ::= GROUP BY group_by_list", - /* 483 */ "group_by_list ::= expr_or_subquery", - /* 484 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", - /* 485 */ "having_clause_opt ::=", - /* 486 */ "having_clause_opt ::= HAVING search_condition", - /* 487 */ "range_opt ::=", - /* 488 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", - /* 489 */ "every_opt ::=", - /* 490 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", - /* 491 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", - /* 492 */ "query_simple ::= query_specification", - /* 493 */ "query_simple ::= union_query_expression", - /* 494 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", - /* 495 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", - /* 496 */ "query_simple_or_subquery ::= query_simple", - /* 497 */ "query_simple_or_subquery ::= subquery", - /* 498 */ "query_or_subquery ::= query_expression", - /* 499 */ "query_or_subquery ::= subquery", - /* 500 */ "order_by_clause_opt ::=", - /* 501 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", - /* 502 */ "slimit_clause_opt ::=", - /* 503 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", - /* 504 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", - /* 505 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 506 */ "limit_clause_opt ::=", - /* 507 */ "limit_clause_opt ::= LIMIT NK_INTEGER", - /* 508 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", - /* 509 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", - /* 510 */ "subquery ::= NK_LP query_expression NK_RP", - /* 511 */ "subquery ::= NK_LP subquery NK_RP", - /* 512 */ "search_condition ::= common_expression", - /* 513 */ "sort_specification_list ::= sort_specification", - /* 514 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", - /* 515 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", - /* 516 */ "ordering_specification_opt ::=", - /* 517 */ "ordering_specification_opt ::= ASC", - /* 518 */ "ordering_specification_opt ::= DESC", - /* 519 */ "null_ordering_opt ::=", - /* 520 */ "null_ordering_opt ::= NULLS FIRST", - /* 521 */ "null_ordering_opt ::= NULLS LAST", + /* 113 */ "alter_db_option ::= REPLICA NK_INTEGER", + /* 114 */ "alter_db_option ::= STRICT NK_STRING", + /* 115 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER", + /* 116 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER", + /* 117 */ "integer_list ::= NK_INTEGER", + /* 118 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER", + /* 119 */ "variable_list ::= NK_VARIABLE", + /* 120 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE", + /* 121 */ "retention_list ::= retention", + /* 122 */ "retention_list ::= retention_list NK_COMMA retention", + /* 123 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE", + /* 124 */ "speed_opt ::=", + /* 125 */ "speed_opt ::= MAX_SPEED NK_INTEGER", + /* 126 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options", + /* 127 */ "cmd ::= CREATE TABLE multi_create_clause", + /* 128 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options", + /* 129 */ "cmd ::= DROP TABLE multi_drop_clause", + /* 130 */ "cmd ::= DROP STABLE exists_opt full_table_name", + /* 131 */ "cmd ::= ALTER TABLE alter_table_clause", + /* 132 */ "cmd ::= ALTER STABLE alter_table_clause", + /* 133 */ "alter_table_clause ::= full_table_name alter_table_options", + /* 134 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name", + /* 135 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name", + /* 136 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name", + /* 137 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name", + /* 138 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name", + /* 139 */ "alter_table_clause ::= full_table_name DROP TAG column_name", + /* 140 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name", + /* 141 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name", + /* 142 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal", + /* 143 */ "multi_create_clause ::= create_subtable_clause", + /* 144 */ "multi_create_clause ::= multi_create_clause create_subtable_clause", + /* 145 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options", + /* 146 */ "multi_drop_clause ::= drop_table_clause", + /* 147 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause", + /* 148 */ "drop_table_clause ::= exists_opt full_table_name", + /* 149 */ "specific_cols_opt ::=", + /* 150 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP", + /* 151 */ "full_table_name ::= table_name", + /* 152 */ "full_table_name ::= db_name NK_DOT table_name", + /* 153 */ "column_def_list ::= column_def", + /* 154 */ "column_def_list ::= column_def_list NK_COMMA column_def", + /* 155 */ "column_def ::= column_name type_name", + /* 156 */ "column_def ::= column_name type_name COMMENT NK_STRING", + /* 157 */ "type_name ::= BOOL", + /* 158 */ "type_name ::= TINYINT", + /* 159 */ "type_name ::= SMALLINT", + /* 160 */ "type_name ::= INT", + /* 161 */ "type_name ::= INTEGER", + /* 162 */ "type_name ::= BIGINT", + /* 163 */ "type_name ::= FLOAT", + /* 164 */ "type_name ::= DOUBLE", + /* 165 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP", + /* 166 */ "type_name ::= TIMESTAMP", + /* 167 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP", + /* 168 */ "type_name ::= TINYINT UNSIGNED", + /* 169 */ "type_name ::= SMALLINT UNSIGNED", + /* 170 */ "type_name ::= INT UNSIGNED", + /* 171 */ "type_name ::= BIGINT UNSIGNED", + /* 172 */ "type_name ::= JSON", + /* 173 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP", + /* 174 */ "type_name ::= MEDIUMBLOB", + /* 175 */ "type_name ::= BLOB", + /* 176 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP", + /* 177 */ "type_name ::= DECIMAL", + /* 178 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP", + /* 179 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP", + /* 180 */ "tags_def_opt ::=", + /* 181 */ "tags_def_opt ::= tags_def", + /* 182 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP", + /* 183 */ "table_options ::=", + /* 184 */ "table_options ::= table_options COMMENT NK_STRING", + /* 185 */ "table_options ::= table_options MAX_DELAY duration_list", + /* 186 */ "table_options ::= table_options WATERMARK duration_list", + /* 187 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP", + /* 188 */ "table_options ::= table_options TTL NK_INTEGER", + /* 189 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP", + /* 190 */ "alter_table_options ::= alter_table_option", + /* 191 */ "alter_table_options ::= alter_table_options alter_table_option", + /* 192 */ "alter_table_option ::= COMMENT NK_STRING", + /* 193 */ "alter_table_option ::= TTL NK_INTEGER", + /* 194 */ "duration_list ::= duration_literal", + /* 195 */ "duration_list ::= duration_list NK_COMMA duration_literal", + /* 196 */ "rollup_func_list ::= rollup_func_name", + /* 197 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name", + /* 198 */ "rollup_func_name ::= function_name", + /* 199 */ "rollup_func_name ::= FIRST", + /* 200 */ "rollup_func_name ::= LAST", + /* 201 */ "col_name_list ::= col_name", + /* 202 */ "col_name_list ::= col_name_list NK_COMMA col_name", + /* 203 */ "col_name ::= column_name", + /* 204 */ "cmd ::= SHOW DNODES", + /* 205 */ "cmd ::= SHOW USERS", + /* 206 */ "cmd ::= SHOW DATABASES", + /* 207 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt", + /* 208 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt", + /* 209 */ "cmd ::= SHOW db_name_cond_opt VGROUPS", + /* 210 */ "cmd ::= SHOW MNODES", + /* 211 */ "cmd ::= SHOW QNODES", + /* 212 */ "cmd ::= SHOW FUNCTIONS", + /* 213 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt", + /* 214 */ "cmd ::= SHOW STREAMS", + /* 215 */ "cmd ::= SHOW ACCOUNTS", + /* 216 */ "cmd ::= SHOW APPS", + /* 217 */ "cmd ::= SHOW CONNECTIONS", + /* 218 */ "cmd ::= SHOW LICENCES", + /* 219 */ "cmd ::= SHOW GRANTS", + /* 220 */ "cmd ::= SHOW CREATE DATABASE db_name", + /* 221 */ "cmd ::= SHOW CREATE TABLE full_table_name", + /* 222 */ "cmd ::= SHOW CREATE STABLE full_table_name", + /* 223 */ "cmd ::= SHOW QUERIES", + /* 224 */ "cmd ::= SHOW SCORES", + /* 225 */ "cmd ::= SHOW TOPICS", + /* 226 */ "cmd ::= SHOW VARIABLES", + /* 227 */ "cmd ::= SHOW LOCAL VARIABLES", + /* 228 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES", + /* 229 */ "cmd ::= SHOW BNODES", + /* 230 */ "cmd ::= SHOW SNODES", + /* 231 */ "cmd ::= SHOW CLUSTER", + /* 232 */ "cmd ::= SHOW TRANSACTIONS", + /* 233 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name", + /* 234 */ "cmd ::= SHOW CONSUMERS", + /* 235 */ "cmd ::= SHOW SUBSCRIPTIONS", + /* 236 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt", + /* 237 */ "cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt", + /* 238 */ "cmd ::= SHOW VNODES NK_INTEGER", + /* 239 */ "cmd ::= SHOW VNODES NK_STRING", + /* 240 */ "db_name_cond_opt ::=", + /* 241 */ "db_name_cond_opt ::= db_name NK_DOT", + /* 242 */ "like_pattern_opt ::=", + /* 243 */ "like_pattern_opt ::= LIKE NK_STRING", + /* 244 */ "table_name_cond ::= table_name", + /* 245 */ "from_db_opt ::=", + /* 246 */ "from_db_opt ::= FROM db_name", + /* 247 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options", + /* 248 */ "cmd ::= DROP INDEX exists_opt full_table_name", + /* 249 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt", + /* 250 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt", + /* 251 */ "func_list ::= func", + /* 252 */ "func_list ::= func_list NK_COMMA func", + /* 253 */ "func ::= function_name NK_LP expression_list NK_RP", + /* 254 */ "sma_stream_opt ::=", + /* 255 */ "sma_stream_opt ::= stream_options WATERMARK duration_literal", + /* 256 */ "sma_stream_opt ::= stream_options MAX_DELAY duration_literal", + /* 257 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery", + /* 258 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name", + /* 259 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name", + /* 260 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name", + /* 261 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name", + /* 262 */ "cmd ::= DROP TOPIC exists_opt topic_name", + /* 263 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name", + /* 264 */ "cmd ::= DESC full_table_name", + /* 265 */ "cmd ::= DESCRIBE full_table_name", + /* 266 */ "cmd ::= RESET QUERY CACHE", + /* 267 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery", + /* 268 */ "analyze_opt ::=", + /* 269 */ "analyze_opt ::= ANALYZE", + /* 270 */ "explain_options ::=", + /* 271 */ "explain_options ::= explain_options VERBOSE NK_BOOL", + /* 272 */ "explain_options ::= explain_options RATIO NK_FLOAT", + /* 273 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt", + /* 274 */ "cmd ::= DROP FUNCTION exists_opt function_name", + /* 275 */ "agg_func_opt ::=", + /* 276 */ "agg_func_opt ::= AGGREGATE", + /* 277 */ "bufsize_opt ::=", + /* 278 */ "bufsize_opt ::= BUFSIZE NK_INTEGER", + /* 279 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery", + /* 280 */ "cmd ::= DROP STREAM exists_opt stream_name", + /* 281 */ "stream_options ::=", + /* 282 */ "stream_options ::= stream_options TRIGGER AT_ONCE", + /* 283 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE", + /* 284 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal", + /* 285 */ "stream_options ::= stream_options WATERMARK duration_literal", + /* 286 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER", + /* 287 */ "subtable_opt ::=", + /* 288 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP", + /* 289 */ "cmd ::= KILL CONNECTION NK_INTEGER", + /* 290 */ "cmd ::= KILL QUERY NK_STRING", + /* 291 */ "cmd ::= KILL TRANSACTION NK_INTEGER", + /* 292 */ "cmd ::= BALANCE VGROUP", + /* 293 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER", + /* 294 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list", + /* 295 */ "cmd ::= SPLIT VGROUP NK_INTEGER", + /* 296 */ "dnode_list ::= DNODE NK_INTEGER", + /* 297 */ "dnode_list ::= dnode_list DNODE NK_INTEGER", + /* 298 */ "cmd ::= DELETE FROM full_table_name where_clause_opt", + /* 299 */ "cmd ::= query_or_subquery", + /* 300 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery", + /* 301 */ "cmd ::= INSERT INTO full_table_name query_or_subquery", + /* 302 */ "literal ::= NK_INTEGER", + /* 303 */ "literal ::= NK_FLOAT", + /* 304 */ "literal ::= NK_STRING", + /* 305 */ "literal ::= NK_BOOL", + /* 306 */ "literal ::= TIMESTAMP NK_STRING", + /* 307 */ "literal ::= duration_literal", + /* 308 */ "literal ::= NULL", + /* 309 */ "literal ::= NK_QUESTION", + /* 310 */ "duration_literal ::= NK_VARIABLE", + /* 311 */ "signed ::= NK_INTEGER", + /* 312 */ "signed ::= NK_PLUS NK_INTEGER", + /* 313 */ "signed ::= NK_MINUS NK_INTEGER", + /* 314 */ "signed ::= NK_FLOAT", + /* 315 */ "signed ::= NK_PLUS NK_FLOAT", + /* 316 */ "signed ::= NK_MINUS NK_FLOAT", + /* 317 */ "signed_literal ::= signed", + /* 318 */ "signed_literal ::= NK_STRING", + /* 319 */ "signed_literal ::= NK_BOOL", + /* 320 */ "signed_literal ::= TIMESTAMP NK_STRING", + /* 321 */ "signed_literal ::= duration_literal", + /* 322 */ "signed_literal ::= NULL", + /* 323 */ "signed_literal ::= literal_func", + /* 324 */ "signed_literal ::= NK_QUESTION", + /* 325 */ "literal_list ::= signed_literal", + /* 326 */ "literal_list ::= literal_list NK_COMMA signed_literal", + /* 327 */ "db_name ::= NK_ID", + /* 328 */ "table_name ::= NK_ID", + /* 329 */ "column_name ::= NK_ID", + /* 330 */ "function_name ::= NK_ID", + /* 331 */ "table_alias ::= NK_ID", + /* 332 */ "column_alias ::= NK_ID", + /* 333 */ "user_name ::= NK_ID", + /* 334 */ "topic_name ::= NK_ID", + /* 335 */ "stream_name ::= NK_ID", + /* 336 */ "cgroup_name ::= NK_ID", + /* 337 */ "expr_or_subquery ::= expression", + /* 338 */ "expr_or_subquery ::= subquery", + /* 339 */ "expression ::= literal", + /* 340 */ "expression ::= pseudo_column", + /* 341 */ "expression ::= column_reference", + /* 342 */ "expression ::= function_expression", + /* 343 */ "expression ::= case_when_expression", + /* 344 */ "expression ::= NK_LP expression NK_RP", + /* 345 */ "expression ::= NK_PLUS expr_or_subquery", + /* 346 */ "expression ::= NK_MINUS expr_or_subquery", + /* 347 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery", + /* 348 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery", + /* 349 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery", + /* 350 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery", + /* 351 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery", + /* 352 */ "expression ::= column_reference NK_ARROW NK_STRING", + /* 353 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery", + /* 354 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery", + /* 355 */ "expression_list ::= expr_or_subquery", + /* 356 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery", + /* 357 */ "column_reference ::= column_name", + /* 358 */ "column_reference ::= table_name NK_DOT column_name", + /* 359 */ "pseudo_column ::= ROWTS", + /* 360 */ "pseudo_column ::= TBNAME", + /* 361 */ "pseudo_column ::= table_name NK_DOT TBNAME", + /* 362 */ "pseudo_column ::= QSTART", + /* 363 */ "pseudo_column ::= QEND", + /* 364 */ "pseudo_column ::= QDURATION", + /* 365 */ "pseudo_column ::= WSTART", + /* 366 */ "pseudo_column ::= WEND", + /* 367 */ "pseudo_column ::= WDURATION", + /* 368 */ "pseudo_column ::= IROWTS", + /* 369 */ "pseudo_column ::= QTAGS", + /* 370 */ "function_expression ::= function_name NK_LP expression_list NK_RP", + /* 371 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP", + /* 372 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP", + /* 373 */ "function_expression ::= literal_func", + /* 374 */ "literal_func ::= noarg_func NK_LP NK_RP", + /* 375 */ "literal_func ::= NOW", + /* 376 */ "noarg_func ::= NOW", + /* 377 */ "noarg_func ::= TODAY", + /* 378 */ "noarg_func ::= TIMEZONE", + /* 379 */ "noarg_func ::= DATABASE", + /* 380 */ "noarg_func ::= CLIENT_VERSION", + /* 381 */ "noarg_func ::= SERVER_VERSION", + /* 382 */ "noarg_func ::= SERVER_STATUS", + /* 383 */ "noarg_func ::= CURRENT_USER", + /* 384 */ "noarg_func ::= USER", + /* 385 */ "star_func ::= COUNT", + /* 386 */ "star_func ::= FIRST", + /* 387 */ "star_func ::= LAST", + /* 388 */ "star_func ::= LAST_ROW", + /* 389 */ "star_func_para_list ::= NK_STAR", + /* 390 */ "star_func_para_list ::= other_para_list", + /* 391 */ "other_para_list ::= star_func_para", + /* 392 */ "other_para_list ::= other_para_list NK_COMMA star_func_para", + /* 393 */ "star_func_para ::= expr_or_subquery", + /* 394 */ "star_func_para ::= table_name NK_DOT NK_STAR", + /* 395 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END", + /* 396 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END", + /* 397 */ "when_then_list ::= when_then_expr", + /* 398 */ "when_then_list ::= when_then_list when_then_expr", + /* 399 */ "when_then_expr ::= WHEN common_expression THEN common_expression", + /* 400 */ "case_when_else_opt ::=", + /* 401 */ "case_when_else_opt ::= ELSE common_expression", + /* 402 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery", + /* 403 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery", + /* 404 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery", + /* 405 */ "predicate ::= expr_or_subquery IS NULL", + /* 406 */ "predicate ::= expr_or_subquery IS NOT NULL", + /* 407 */ "predicate ::= expr_or_subquery in_op in_predicate_value", + /* 408 */ "compare_op ::= NK_LT", + /* 409 */ "compare_op ::= NK_GT", + /* 410 */ "compare_op ::= NK_LE", + /* 411 */ "compare_op ::= NK_GE", + /* 412 */ "compare_op ::= NK_NE", + /* 413 */ "compare_op ::= NK_EQ", + /* 414 */ "compare_op ::= LIKE", + /* 415 */ "compare_op ::= NOT LIKE", + /* 416 */ "compare_op ::= MATCH", + /* 417 */ "compare_op ::= NMATCH", + /* 418 */ "compare_op ::= CONTAINS", + /* 419 */ "in_op ::= IN", + /* 420 */ "in_op ::= NOT IN", + /* 421 */ "in_predicate_value ::= NK_LP literal_list NK_RP", + /* 422 */ "boolean_value_expression ::= boolean_primary", + /* 423 */ "boolean_value_expression ::= NOT boolean_primary", + /* 424 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression", + /* 425 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression", + /* 426 */ "boolean_primary ::= predicate", + /* 427 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP", + /* 428 */ "common_expression ::= expr_or_subquery", + /* 429 */ "common_expression ::= boolean_value_expression", + /* 430 */ "from_clause_opt ::=", + /* 431 */ "from_clause_opt ::= FROM table_reference_list", + /* 432 */ "table_reference_list ::= table_reference", + /* 433 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference", + /* 434 */ "table_reference ::= table_primary", + /* 435 */ "table_reference ::= joined_table", + /* 436 */ "table_primary ::= table_name alias_opt", + /* 437 */ "table_primary ::= db_name NK_DOT table_name alias_opt", + /* 438 */ "table_primary ::= subquery alias_opt", + /* 439 */ "table_primary ::= parenthesized_joined_table", + /* 440 */ "alias_opt ::=", + /* 441 */ "alias_opt ::= table_alias", + /* 442 */ "alias_opt ::= AS table_alias", + /* 443 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP", + /* 444 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP", + /* 445 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition", + /* 446 */ "join_type ::=", + /* 447 */ "join_type ::= INNER", + /* 448 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt", + /* 449 */ "set_quantifier_opt ::=", + /* 450 */ "set_quantifier_opt ::= DISTINCT", + /* 451 */ "set_quantifier_opt ::= ALL", + /* 452 */ "select_list ::= select_item", + /* 453 */ "select_list ::= select_list NK_COMMA select_item", + /* 454 */ "select_item ::= NK_STAR", + /* 455 */ "select_item ::= common_expression", + /* 456 */ "select_item ::= common_expression column_alias", + /* 457 */ "select_item ::= common_expression AS column_alias", + /* 458 */ "select_item ::= table_name NK_DOT NK_STAR", + /* 459 */ "where_clause_opt ::=", + /* 460 */ "where_clause_opt ::= WHERE search_condition", + /* 461 */ "partition_by_clause_opt ::=", + /* 462 */ "partition_by_clause_opt ::= PARTITION BY partition_list", + /* 463 */ "partition_list ::= partition_item", + /* 464 */ "partition_list ::= partition_list NK_COMMA partition_item", + /* 465 */ "partition_item ::= expr_or_subquery", + /* 466 */ "partition_item ::= expr_or_subquery column_alias", + /* 467 */ "partition_item ::= expr_or_subquery AS column_alias", + /* 468 */ "twindow_clause_opt ::=", + /* 469 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP", + /* 470 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP", + /* 471 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt", + /* 472 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt", + /* 473 */ "sliding_opt ::=", + /* 474 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP", + /* 475 */ "fill_opt ::=", + /* 476 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP", + /* 477 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP", + /* 478 */ "fill_mode ::= NONE", + /* 479 */ "fill_mode ::= PREV", + /* 480 */ "fill_mode ::= NULL", + /* 481 */ "fill_mode ::= LINEAR", + /* 482 */ "fill_mode ::= NEXT", + /* 483 */ "group_by_clause_opt ::=", + /* 484 */ "group_by_clause_opt ::= GROUP BY group_by_list", + /* 485 */ "group_by_list ::= expr_or_subquery", + /* 486 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery", + /* 487 */ "having_clause_opt ::=", + /* 488 */ "having_clause_opt ::= HAVING search_condition", + /* 489 */ "range_opt ::=", + /* 490 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP", + /* 491 */ "every_opt ::=", + /* 492 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP", + /* 493 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt", + /* 494 */ "query_simple ::= query_specification", + /* 495 */ "query_simple ::= union_query_expression", + /* 496 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery", + /* 497 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery", + /* 498 */ "query_simple_or_subquery ::= query_simple", + /* 499 */ "query_simple_or_subquery ::= subquery", + /* 500 */ "query_or_subquery ::= query_expression", + /* 501 */ "query_or_subquery ::= subquery", + /* 502 */ "order_by_clause_opt ::=", + /* 503 */ "order_by_clause_opt ::= ORDER BY sort_specification_list", + /* 504 */ "slimit_clause_opt ::=", + /* 505 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER", + /* 506 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER", + /* 507 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 508 */ "limit_clause_opt ::=", + /* 509 */ "limit_clause_opt ::= LIMIT NK_INTEGER", + /* 510 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER", + /* 511 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER", + /* 512 */ "subquery ::= NK_LP query_expression NK_RP", + /* 513 */ "subquery ::= NK_LP subquery NK_RP", + /* 514 */ "search_condition ::= common_expression", + /* 515 */ "sort_specification_list ::= sort_specification", + /* 516 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification", + /* 517 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt", + /* 518 */ "ordering_specification_opt ::=", + /* 519 */ "ordering_specification_opt ::= ASC", + /* 520 */ "ordering_specification_opt ::= DESC", + /* 521 */ "null_ordering_opt ::=", + /* 522 */ "null_ordering_opt ::= NULLS FIRST", + /* 523 */ "null_ordering_opt ::= NULLS LAST", }; #endif /* NDEBUG */ @@ -3087,415 +3089,417 @@ static const struct { { 338, -2 }, /* (110) alter_db_option ::= KEEP integer_list */ { 338, -2 }, /* (111) alter_db_option ::= KEEP variable_list */ { 338, -2 }, /* (112) alter_db_option ::= PAGES NK_INTEGER */ - { 338, -2 }, /* (113) alter_db_option ::= WAL_LEVEL NK_INTEGER */ - { 338, -2 }, /* (114) alter_db_option ::= STT_TRIGGER NK_INTEGER */ - { 335, -1 }, /* (115) integer_list ::= NK_INTEGER */ - { 335, -3 }, /* (116) integer_list ::= integer_list NK_COMMA NK_INTEGER */ - { 336, -1 }, /* (117) variable_list ::= NK_VARIABLE */ - { 336, -3 }, /* (118) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ - { 337, -1 }, /* (119) retention_list ::= retention */ - { 337, -3 }, /* (120) retention_list ::= retention_list NK_COMMA retention */ - { 339, -3 }, /* (121) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ - { 334, 0 }, /* (122) speed_opt ::= */ - { 334, -2 }, /* (123) speed_opt ::= MAX_SPEED NK_INTEGER */ - { 317, -9 }, /* (124) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - { 317, -3 }, /* (125) cmd ::= CREATE TABLE multi_create_clause */ - { 317, -9 }, /* (126) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ - { 317, -3 }, /* (127) cmd ::= DROP TABLE multi_drop_clause */ - { 317, -4 }, /* (128) cmd ::= DROP STABLE exists_opt full_table_name */ - { 317, -3 }, /* (129) cmd ::= ALTER TABLE alter_table_clause */ - { 317, -3 }, /* (130) cmd ::= ALTER STABLE alter_table_clause */ - { 347, -2 }, /* (131) alter_table_clause ::= full_table_name alter_table_options */ - { 347, -5 }, /* (132) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ - { 347, -4 }, /* (133) alter_table_clause ::= full_table_name DROP COLUMN column_name */ - { 347, -5 }, /* (134) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ - { 347, -5 }, /* (135) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ - { 347, -5 }, /* (136) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ - { 347, -4 }, /* (137) alter_table_clause ::= full_table_name DROP TAG column_name */ - { 347, -5 }, /* (138) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ - { 347, -5 }, /* (139) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ - { 347, -6 }, /* (140) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ - { 344, -1 }, /* (141) multi_create_clause ::= create_subtable_clause */ - { 344, -2 }, /* (142) multi_create_clause ::= multi_create_clause create_subtable_clause */ - { 352, -10 }, /* (143) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ - { 346, -1 }, /* (144) multi_drop_clause ::= drop_table_clause */ - { 346, -2 }, /* (145) multi_drop_clause ::= multi_drop_clause drop_table_clause */ - { 355, -2 }, /* (146) drop_table_clause ::= exists_opt full_table_name */ - { 353, 0 }, /* (147) specific_cols_opt ::= */ - { 353, -3 }, /* (148) specific_cols_opt ::= NK_LP col_name_list NK_RP */ - { 340, -1 }, /* (149) full_table_name ::= table_name */ - { 340, -3 }, /* (150) full_table_name ::= db_name NK_DOT table_name */ - { 341, -1 }, /* (151) column_def_list ::= column_def */ - { 341, -3 }, /* (152) column_def_list ::= column_def_list NK_COMMA column_def */ - { 358, -2 }, /* (153) column_def ::= column_name type_name */ - { 358, -4 }, /* (154) column_def ::= column_name type_name COMMENT NK_STRING */ - { 350, -1 }, /* (155) type_name ::= BOOL */ - { 350, -1 }, /* (156) type_name ::= TINYINT */ - { 350, -1 }, /* (157) type_name ::= SMALLINT */ - { 350, -1 }, /* (158) type_name ::= INT */ - { 350, -1 }, /* (159) type_name ::= INTEGER */ - { 350, -1 }, /* (160) type_name ::= BIGINT */ - { 350, -1 }, /* (161) type_name ::= FLOAT */ - { 350, -1 }, /* (162) type_name ::= DOUBLE */ - { 350, -4 }, /* (163) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ - { 350, -1 }, /* (164) type_name ::= TIMESTAMP */ - { 350, -4 }, /* (165) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ - { 350, -2 }, /* (166) type_name ::= TINYINT UNSIGNED */ - { 350, -2 }, /* (167) type_name ::= SMALLINT UNSIGNED */ - { 350, -2 }, /* (168) type_name ::= INT UNSIGNED */ - { 350, -2 }, /* (169) type_name ::= BIGINT UNSIGNED */ - { 350, -1 }, /* (170) type_name ::= JSON */ - { 350, -4 }, /* (171) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ - { 350, -1 }, /* (172) type_name ::= MEDIUMBLOB */ - { 350, -1 }, /* (173) type_name ::= BLOB */ - { 350, -4 }, /* (174) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ - { 350, -1 }, /* (175) type_name ::= DECIMAL */ - { 350, -4 }, /* (176) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ - { 350, -6 }, /* (177) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ - { 342, 0 }, /* (178) tags_def_opt ::= */ - { 342, -1 }, /* (179) tags_def_opt ::= tags_def */ - { 345, -4 }, /* (180) tags_def ::= TAGS NK_LP column_def_list NK_RP */ - { 343, 0 }, /* (181) table_options ::= */ - { 343, -3 }, /* (182) table_options ::= table_options COMMENT NK_STRING */ - { 343, -3 }, /* (183) table_options ::= table_options MAX_DELAY duration_list */ - { 343, -3 }, /* (184) table_options ::= table_options WATERMARK duration_list */ - { 343, -5 }, /* (185) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ - { 343, -3 }, /* (186) table_options ::= table_options TTL NK_INTEGER */ - { 343, -5 }, /* (187) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ - { 348, -1 }, /* (188) alter_table_options ::= alter_table_option */ - { 348, -2 }, /* (189) alter_table_options ::= alter_table_options alter_table_option */ - { 361, -2 }, /* (190) alter_table_option ::= COMMENT NK_STRING */ - { 361, -2 }, /* (191) alter_table_option ::= TTL NK_INTEGER */ - { 359, -1 }, /* (192) duration_list ::= duration_literal */ - { 359, -3 }, /* (193) duration_list ::= duration_list NK_COMMA duration_literal */ - { 360, -1 }, /* (194) rollup_func_list ::= rollup_func_name */ - { 360, -3 }, /* (195) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ - { 363, -1 }, /* (196) rollup_func_name ::= function_name */ - { 363, -1 }, /* (197) rollup_func_name ::= FIRST */ - { 363, -1 }, /* (198) rollup_func_name ::= LAST */ - { 356, -1 }, /* (199) col_name_list ::= col_name */ - { 356, -3 }, /* (200) col_name_list ::= col_name_list NK_COMMA col_name */ - { 365, -1 }, /* (201) col_name ::= column_name */ - { 317, -2 }, /* (202) cmd ::= SHOW DNODES */ - { 317, -2 }, /* (203) cmd ::= SHOW USERS */ - { 317, -2 }, /* (204) cmd ::= SHOW DATABASES */ - { 317, -4 }, /* (205) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ - { 317, -4 }, /* (206) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ - { 317, -3 }, /* (207) cmd ::= SHOW db_name_cond_opt VGROUPS */ - { 317, -2 }, /* (208) cmd ::= SHOW MNODES */ - { 317, -2 }, /* (209) cmd ::= SHOW QNODES */ - { 317, -2 }, /* (210) cmd ::= SHOW FUNCTIONS */ - { 317, -5 }, /* (211) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ - { 317, -2 }, /* (212) cmd ::= SHOW STREAMS */ - { 317, -2 }, /* (213) cmd ::= SHOW ACCOUNTS */ - { 317, -2 }, /* (214) cmd ::= SHOW APPS */ - { 317, -2 }, /* (215) cmd ::= SHOW CONNECTIONS */ - { 317, -2 }, /* (216) cmd ::= SHOW LICENCES */ - { 317, -2 }, /* (217) cmd ::= SHOW GRANTS */ - { 317, -4 }, /* (218) cmd ::= SHOW CREATE DATABASE db_name */ - { 317, -4 }, /* (219) cmd ::= SHOW CREATE TABLE full_table_name */ - { 317, -4 }, /* (220) cmd ::= SHOW CREATE STABLE full_table_name */ - { 317, -2 }, /* (221) cmd ::= SHOW QUERIES */ - { 317, -2 }, /* (222) cmd ::= SHOW SCORES */ - { 317, -2 }, /* (223) cmd ::= SHOW TOPICS */ - { 317, -2 }, /* (224) cmd ::= SHOW VARIABLES */ - { 317, -3 }, /* (225) cmd ::= SHOW LOCAL VARIABLES */ - { 317, -4 }, /* (226) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ - { 317, -2 }, /* (227) cmd ::= SHOW BNODES */ - { 317, -2 }, /* (228) cmd ::= SHOW SNODES */ - { 317, -2 }, /* (229) cmd ::= SHOW CLUSTER */ - { 317, -2 }, /* (230) cmd ::= SHOW TRANSACTIONS */ - { 317, -4 }, /* (231) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ - { 317, -2 }, /* (232) cmd ::= SHOW CONSUMERS */ - { 317, -2 }, /* (233) cmd ::= SHOW SUBSCRIPTIONS */ - { 317, -5 }, /* (234) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ - { 317, -6 }, /* (235) cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt */ - { 317, -3 }, /* (236) cmd ::= SHOW VNODES NK_INTEGER */ - { 317, -3 }, /* (237) cmd ::= SHOW VNODES NK_STRING */ - { 366, 0 }, /* (238) db_name_cond_opt ::= */ - { 366, -2 }, /* (239) db_name_cond_opt ::= db_name NK_DOT */ - { 367, 0 }, /* (240) like_pattern_opt ::= */ - { 367, -2 }, /* (241) like_pattern_opt ::= LIKE NK_STRING */ - { 368, -1 }, /* (242) table_name_cond ::= table_name */ - { 369, 0 }, /* (243) from_db_opt ::= */ - { 369, -2 }, /* (244) from_db_opt ::= FROM db_name */ - { 317, -8 }, /* (245) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ - { 317, -4 }, /* (246) cmd ::= DROP INDEX exists_opt full_table_name */ - { 370, -10 }, /* (247) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ - { 370, -12 }, /* (248) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ - { 371, -1 }, /* (249) func_list ::= func */ - { 371, -3 }, /* (250) func_list ::= func_list NK_COMMA func */ - { 374, -4 }, /* (251) func ::= function_name NK_LP expression_list NK_RP */ - { 373, 0 }, /* (252) sma_stream_opt ::= */ - { 373, -3 }, /* (253) sma_stream_opt ::= stream_options WATERMARK duration_literal */ - { 373, -3 }, /* (254) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ - { 317, -6 }, /* (255) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ - { 317, -7 }, /* (256) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ - { 317, -9 }, /* (257) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ - { 317, -7 }, /* (258) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ - { 317, -9 }, /* (259) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ - { 317, -4 }, /* (260) cmd ::= DROP TOPIC exists_opt topic_name */ - { 317, -7 }, /* (261) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ - { 317, -2 }, /* (262) cmd ::= DESC full_table_name */ - { 317, -2 }, /* (263) cmd ::= DESCRIBE full_table_name */ - { 317, -3 }, /* (264) cmd ::= RESET QUERY CACHE */ - { 317, -4 }, /* (265) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ - { 379, 0 }, /* (266) analyze_opt ::= */ - { 379, -1 }, /* (267) analyze_opt ::= ANALYZE */ - { 380, 0 }, /* (268) explain_options ::= */ - { 380, -3 }, /* (269) explain_options ::= explain_options VERBOSE NK_BOOL */ - { 380, -3 }, /* (270) explain_options ::= explain_options RATIO NK_FLOAT */ - { 317, -10 }, /* (271) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ - { 317, -4 }, /* (272) cmd ::= DROP FUNCTION exists_opt function_name */ - { 381, 0 }, /* (273) agg_func_opt ::= */ - { 381, -1 }, /* (274) agg_func_opt ::= AGGREGATE */ - { 382, 0 }, /* (275) bufsize_opt ::= */ - { 382, -2 }, /* (276) bufsize_opt ::= BUFSIZE NK_INTEGER */ - { 317, -11 }, /* (277) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ - { 317, -4 }, /* (278) cmd ::= DROP STREAM exists_opt stream_name */ - { 375, 0 }, /* (279) stream_options ::= */ - { 375, -3 }, /* (280) stream_options ::= stream_options TRIGGER AT_ONCE */ - { 375, -3 }, /* (281) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ - { 375, -4 }, /* (282) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ - { 375, -3 }, /* (283) stream_options ::= stream_options WATERMARK duration_literal */ - { 375, -4 }, /* (284) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ - { 384, 0 }, /* (285) subtable_opt ::= */ - { 384, -4 }, /* (286) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - { 317, -3 }, /* (287) cmd ::= KILL CONNECTION NK_INTEGER */ - { 317, -3 }, /* (288) cmd ::= KILL QUERY NK_STRING */ - { 317, -3 }, /* (289) cmd ::= KILL TRANSACTION NK_INTEGER */ - { 317, -2 }, /* (290) cmd ::= BALANCE VGROUP */ - { 317, -4 }, /* (291) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ - { 317, -4 }, /* (292) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ - { 317, -3 }, /* (293) cmd ::= SPLIT VGROUP NK_INTEGER */ - { 386, -2 }, /* (294) dnode_list ::= DNODE NK_INTEGER */ - { 386, -3 }, /* (295) dnode_list ::= dnode_list DNODE NK_INTEGER */ - { 317, -4 }, /* (296) cmd ::= DELETE FROM full_table_name where_clause_opt */ - { 317, -1 }, /* (297) cmd ::= query_or_subquery */ - { 317, -7 }, /* (298) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ - { 317, -4 }, /* (299) cmd ::= INSERT INTO full_table_name query_or_subquery */ - { 320, -1 }, /* (300) literal ::= NK_INTEGER */ - { 320, -1 }, /* (301) literal ::= NK_FLOAT */ - { 320, -1 }, /* (302) literal ::= NK_STRING */ - { 320, -1 }, /* (303) literal ::= NK_BOOL */ - { 320, -2 }, /* (304) literal ::= TIMESTAMP NK_STRING */ - { 320, -1 }, /* (305) literal ::= duration_literal */ - { 320, -1 }, /* (306) literal ::= NULL */ - { 320, -1 }, /* (307) literal ::= NK_QUESTION */ - { 362, -1 }, /* (308) duration_literal ::= NK_VARIABLE */ - { 388, -1 }, /* (309) signed ::= NK_INTEGER */ - { 388, -2 }, /* (310) signed ::= NK_PLUS NK_INTEGER */ - { 388, -2 }, /* (311) signed ::= NK_MINUS NK_INTEGER */ - { 388, -1 }, /* (312) signed ::= NK_FLOAT */ - { 388, -2 }, /* (313) signed ::= NK_PLUS NK_FLOAT */ - { 388, -2 }, /* (314) signed ::= NK_MINUS NK_FLOAT */ - { 351, -1 }, /* (315) signed_literal ::= signed */ - { 351, -1 }, /* (316) signed_literal ::= NK_STRING */ - { 351, -1 }, /* (317) signed_literal ::= NK_BOOL */ - { 351, -2 }, /* (318) signed_literal ::= TIMESTAMP NK_STRING */ - { 351, -1 }, /* (319) signed_literal ::= duration_literal */ - { 351, -1 }, /* (320) signed_literal ::= NULL */ - { 351, -1 }, /* (321) signed_literal ::= literal_func */ - { 351, -1 }, /* (322) signed_literal ::= NK_QUESTION */ - { 390, -1 }, /* (323) literal_list ::= signed_literal */ - { 390, -3 }, /* (324) literal_list ::= literal_list NK_COMMA signed_literal */ - { 328, -1 }, /* (325) db_name ::= NK_ID */ - { 357, -1 }, /* (326) table_name ::= NK_ID */ - { 349, -1 }, /* (327) column_name ::= NK_ID */ - { 364, -1 }, /* (328) function_name ::= NK_ID */ - { 391, -1 }, /* (329) table_alias ::= NK_ID */ - { 392, -1 }, /* (330) column_alias ::= NK_ID */ - { 322, -1 }, /* (331) user_name ::= NK_ID */ - { 376, -1 }, /* (332) topic_name ::= NK_ID */ - { 383, -1 }, /* (333) stream_name ::= NK_ID */ - { 378, -1 }, /* (334) cgroup_name ::= NK_ID */ - { 393, -1 }, /* (335) expr_or_subquery ::= expression */ - { 393, -1 }, /* (336) expr_or_subquery ::= subquery */ - { 385, -1 }, /* (337) expression ::= literal */ - { 385, -1 }, /* (338) expression ::= pseudo_column */ - { 385, -1 }, /* (339) expression ::= column_reference */ - { 385, -1 }, /* (340) expression ::= function_expression */ - { 385, -1 }, /* (341) expression ::= case_when_expression */ - { 385, -3 }, /* (342) expression ::= NK_LP expression NK_RP */ - { 385, -2 }, /* (343) expression ::= NK_PLUS expr_or_subquery */ - { 385, -2 }, /* (344) expression ::= NK_MINUS expr_or_subquery */ - { 385, -3 }, /* (345) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ - { 385, -3 }, /* (346) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ - { 385, -3 }, /* (347) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ - { 385, -3 }, /* (348) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ - { 385, -3 }, /* (349) expression ::= expr_or_subquery NK_REM expr_or_subquery */ - { 385, -3 }, /* (350) expression ::= column_reference NK_ARROW NK_STRING */ - { 385, -3 }, /* (351) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ - { 385, -3 }, /* (352) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ - { 354, -1 }, /* (353) expression_list ::= expr_or_subquery */ - { 354, -3 }, /* (354) expression_list ::= expression_list NK_COMMA expr_or_subquery */ - { 396, -1 }, /* (355) column_reference ::= column_name */ - { 396, -3 }, /* (356) column_reference ::= table_name NK_DOT column_name */ - { 395, -1 }, /* (357) pseudo_column ::= ROWTS */ - { 395, -1 }, /* (358) pseudo_column ::= TBNAME */ - { 395, -3 }, /* (359) pseudo_column ::= table_name NK_DOT TBNAME */ - { 395, -1 }, /* (360) pseudo_column ::= QSTART */ - { 395, -1 }, /* (361) pseudo_column ::= QEND */ - { 395, -1 }, /* (362) pseudo_column ::= QDURATION */ - { 395, -1 }, /* (363) pseudo_column ::= WSTART */ - { 395, -1 }, /* (364) pseudo_column ::= WEND */ - { 395, -1 }, /* (365) pseudo_column ::= WDURATION */ - { 395, -1 }, /* (366) pseudo_column ::= IROWTS */ - { 395, -1 }, /* (367) pseudo_column ::= QTAGS */ - { 397, -4 }, /* (368) function_expression ::= function_name NK_LP expression_list NK_RP */ - { 397, -4 }, /* (369) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ - { 397, -6 }, /* (370) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ - { 397, -1 }, /* (371) function_expression ::= literal_func */ - { 389, -3 }, /* (372) literal_func ::= noarg_func NK_LP NK_RP */ - { 389, -1 }, /* (373) literal_func ::= NOW */ - { 401, -1 }, /* (374) noarg_func ::= NOW */ - { 401, -1 }, /* (375) noarg_func ::= TODAY */ - { 401, -1 }, /* (376) noarg_func ::= TIMEZONE */ - { 401, -1 }, /* (377) noarg_func ::= DATABASE */ - { 401, -1 }, /* (378) noarg_func ::= CLIENT_VERSION */ - { 401, -1 }, /* (379) noarg_func ::= SERVER_VERSION */ - { 401, -1 }, /* (380) noarg_func ::= SERVER_STATUS */ - { 401, -1 }, /* (381) noarg_func ::= CURRENT_USER */ - { 401, -1 }, /* (382) noarg_func ::= USER */ - { 399, -1 }, /* (383) star_func ::= COUNT */ - { 399, -1 }, /* (384) star_func ::= FIRST */ - { 399, -1 }, /* (385) star_func ::= LAST */ - { 399, -1 }, /* (386) star_func ::= LAST_ROW */ - { 400, -1 }, /* (387) star_func_para_list ::= NK_STAR */ - { 400, -1 }, /* (388) star_func_para_list ::= other_para_list */ - { 402, -1 }, /* (389) other_para_list ::= star_func_para */ - { 402, -3 }, /* (390) other_para_list ::= other_para_list NK_COMMA star_func_para */ - { 403, -1 }, /* (391) star_func_para ::= expr_or_subquery */ - { 403, -3 }, /* (392) star_func_para ::= table_name NK_DOT NK_STAR */ - { 398, -4 }, /* (393) case_when_expression ::= CASE when_then_list case_when_else_opt END */ - { 398, -5 }, /* (394) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ - { 404, -1 }, /* (395) when_then_list ::= when_then_expr */ - { 404, -2 }, /* (396) when_then_list ::= when_then_list when_then_expr */ - { 407, -4 }, /* (397) when_then_expr ::= WHEN common_expression THEN common_expression */ - { 405, 0 }, /* (398) case_when_else_opt ::= */ - { 405, -2 }, /* (399) case_when_else_opt ::= ELSE common_expression */ - { 408, -3 }, /* (400) predicate ::= expr_or_subquery compare_op expr_or_subquery */ - { 408, -5 }, /* (401) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ - { 408, -6 }, /* (402) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ - { 408, -3 }, /* (403) predicate ::= expr_or_subquery IS NULL */ - { 408, -4 }, /* (404) predicate ::= expr_or_subquery IS NOT NULL */ - { 408, -3 }, /* (405) predicate ::= expr_or_subquery in_op in_predicate_value */ - { 409, -1 }, /* (406) compare_op ::= NK_LT */ - { 409, -1 }, /* (407) compare_op ::= NK_GT */ - { 409, -1 }, /* (408) compare_op ::= NK_LE */ - { 409, -1 }, /* (409) compare_op ::= NK_GE */ - { 409, -1 }, /* (410) compare_op ::= NK_NE */ - { 409, -1 }, /* (411) compare_op ::= NK_EQ */ - { 409, -1 }, /* (412) compare_op ::= LIKE */ - { 409, -2 }, /* (413) compare_op ::= NOT LIKE */ - { 409, -1 }, /* (414) compare_op ::= MATCH */ - { 409, -1 }, /* (415) compare_op ::= NMATCH */ - { 409, -1 }, /* (416) compare_op ::= CONTAINS */ - { 410, -1 }, /* (417) in_op ::= IN */ - { 410, -2 }, /* (418) in_op ::= NOT IN */ - { 411, -3 }, /* (419) in_predicate_value ::= NK_LP literal_list NK_RP */ - { 412, -1 }, /* (420) boolean_value_expression ::= boolean_primary */ - { 412, -2 }, /* (421) boolean_value_expression ::= NOT boolean_primary */ - { 412, -3 }, /* (422) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ - { 412, -3 }, /* (423) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ - { 413, -1 }, /* (424) boolean_primary ::= predicate */ - { 413, -3 }, /* (425) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ - { 406, -1 }, /* (426) common_expression ::= expr_or_subquery */ - { 406, -1 }, /* (427) common_expression ::= boolean_value_expression */ - { 414, 0 }, /* (428) from_clause_opt ::= */ - { 414, -2 }, /* (429) from_clause_opt ::= FROM table_reference_list */ - { 415, -1 }, /* (430) table_reference_list ::= table_reference */ - { 415, -3 }, /* (431) table_reference_list ::= table_reference_list NK_COMMA table_reference */ - { 416, -1 }, /* (432) table_reference ::= table_primary */ - { 416, -1 }, /* (433) table_reference ::= joined_table */ - { 417, -2 }, /* (434) table_primary ::= table_name alias_opt */ - { 417, -4 }, /* (435) table_primary ::= db_name NK_DOT table_name alias_opt */ - { 417, -2 }, /* (436) table_primary ::= subquery alias_opt */ - { 417, -1 }, /* (437) table_primary ::= parenthesized_joined_table */ - { 419, 0 }, /* (438) alias_opt ::= */ - { 419, -1 }, /* (439) alias_opt ::= table_alias */ - { 419, -2 }, /* (440) alias_opt ::= AS table_alias */ - { 420, -3 }, /* (441) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - { 420, -3 }, /* (442) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ - { 418, -6 }, /* (443) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ - { 421, 0 }, /* (444) join_type ::= */ - { 421, -1 }, /* (445) join_type ::= INNER */ - { 423, -12 }, /* (446) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ - { 424, 0 }, /* (447) set_quantifier_opt ::= */ - { 424, -1 }, /* (448) set_quantifier_opt ::= DISTINCT */ - { 424, -1 }, /* (449) set_quantifier_opt ::= ALL */ - { 425, -1 }, /* (450) select_list ::= select_item */ - { 425, -3 }, /* (451) select_list ::= select_list NK_COMMA select_item */ - { 433, -1 }, /* (452) select_item ::= NK_STAR */ - { 433, -1 }, /* (453) select_item ::= common_expression */ - { 433, -2 }, /* (454) select_item ::= common_expression column_alias */ - { 433, -3 }, /* (455) select_item ::= common_expression AS column_alias */ - { 433, -3 }, /* (456) select_item ::= table_name NK_DOT NK_STAR */ - { 387, 0 }, /* (457) where_clause_opt ::= */ - { 387, -2 }, /* (458) where_clause_opt ::= WHERE search_condition */ - { 426, 0 }, /* (459) partition_by_clause_opt ::= */ - { 426, -3 }, /* (460) partition_by_clause_opt ::= PARTITION BY partition_list */ - { 434, -1 }, /* (461) partition_list ::= partition_item */ - { 434, -3 }, /* (462) partition_list ::= partition_list NK_COMMA partition_item */ - { 435, -1 }, /* (463) partition_item ::= expr_or_subquery */ - { 435, -2 }, /* (464) partition_item ::= expr_or_subquery column_alias */ - { 435, -3 }, /* (465) partition_item ::= expr_or_subquery AS column_alias */ - { 430, 0 }, /* (466) twindow_clause_opt ::= */ - { 430, -6 }, /* (467) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ - { 430, -4 }, /* (468) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ - { 430, -6 }, /* (469) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ - { 430, -8 }, /* (470) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ - { 372, 0 }, /* (471) sliding_opt ::= */ - { 372, -4 }, /* (472) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ - { 429, 0 }, /* (473) fill_opt ::= */ - { 429, -4 }, /* (474) fill_opt ::= FILL NK_LP fill_mode NK_RP */ - { 429, -6 }, /* (475) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ - { 436, -1 }, /* (476) fill_mode ::= NONE */ - { 436, -1 }, /* (477) fill_mode ::= PREV */ - { 436, -1 }, /* (478) fill_mode ::= NULL */ - { 436, -1 }, /* (479) fill_mode ::= LINEAR */ - { 436, -1 }, /* (480) fill_mode ::= NEXT */ - { 431, 0 }, /* (481) group_by_clause_opt ::= */ - { 431, -3 }, /* (482) group_by_clause_opt ::= GROUP BY group_by_list */ - { 437, -1 }, /* (483) group_by_list ::= expr_or_subquery */ - { 437, -3 }, /* (484) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ - { 432, 0 }, /* (485) having_clause_opt ::= */ - { 432, -2 }, /* (486) having_clause_opt ::= HAVING search_condition */ - { 427, 0 }, /* (487) range_opt ::= */ - { 427, -6 }, /* (488) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ - { 428, 0 }, /* (489) every_opt ::= */ - { 428, -4 }, /* (490) every_opt ::= EVERY NK_LP duration_literal NK_RP */ - { 438, -4 }, /* (491) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ - { 439, -1 }, /* (492) query_simple ::= query_specification */ - { 439, -1 }, /* (493) query_simple ::= union_query_expression */ - { 443, -4 }, /* (494) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ - { 443, -3 }, /* (495) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ - { 444, -1 }, /* (496) query_simple_or_subquery ::= query_simple */ - { 444, -1 }, /* (497) query_simple_or_subquery ::= subquery */ - { 377, -1 }, /* (498) query_or_subquery ::= query_expression */ - { 377, -1 }, /* (499) query_or_subquery ::= subquery */ - { 440, 0 }, /* (500) order_by_clause_opt ::= */ - { 440, -3 }, /* (501) order_by_clause_opt ::= ORDER BY sort_specification_list */ - { 441, 0 }, /* (502) slimit_clause_opt ::= */ - { 441, -2 }, /* (503) slimit_clause_opt ::= SLIMIT NK_INTEGER */ - { 441, -4 }, /* (504) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - { 441, -4 }, /* (505) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 442, 0 }, /* (506) limit_clause_opt ::= */ - { 442, -2 }, /* (507) limit_clause_opt ::= LIMIT NK_INTEGER */ - { 442, -4 }, /* (508) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ - { 442, -4 }, /* (509) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - { 394, -3 }, /* (510) subquery ::= NK_LP query_expression NK_RP */ - { 394, -3 }, /* (511) subquery ::= NK_LP subquery NK_RP */ - { 422, -1 }, /* (512) search_condition ::= common_expression */ - { 445, -1 }, /* (513) sort_specification_list ::= sort_specification */ - { 445, -3 }, /* (514) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ - { 446, -3 }, /* (515) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ - { 447, 0 }, /* (516) ordering_specification_opt ::= */ - { 447, -1 }, /* (517) ordering_specification_opt ::= ASC */ - { 447, -1 }, /* (518) ordering_specification_opt ::= DESC */ - { 448, 0 }, /* (519) null_ordering_opt ::= */ - { 448, -2 }, /* (520) null_ordering_opt ::= NULLS FIRST */ - { 448, -2 }, /* (521) null_ordering_opt ::= NULLS LAST */ + { 338, -2 }, /* (113) alter_db_option ::= REPLICA NK_INTEGER */ + { 338, -2 }, /* (114) alter_db_option ::= STRICT NK_STRING */ + { 338, -2 }, /* (115) alter_db_option ::= WAL_LEVEL NK_INTEGER */ + { 338, -2 }, /* (116) alter_db_option ::= STT_TRIGGER NK_INTEGER */ + { 335, -1 }, /* (117) integer_list ::= NK_INTEGER */ + { 335, -3 }, /* (118) integer_list ::= integer_list NK_COMMA NK_INTEGER */ + { 336, -1 }, /* (119) variable_list ::= NK_VARIABLE */ + { 336, -3 }, /* (120) variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + { 337, -1 }, /* (121) retention_list ::= retention */ + { 337, -3 }, /* (122) retention_list ::= retention_list NK_COMMA retention */ + { 339, -3 }, /* (123) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + { 334, 0 }, /* (124) speed_opt ::= */ + { 334, -2 }, /* (125) speed_opt ::= MAX_SPEED NK_INTEGER */ + { 317, -9 }, /* (126) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + { 317, -3 }, /* (127) cmd ::= CREATE TABLE multi_create_clause */ + { 317, -9 }, /* (128) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ + { 317, -3 }, /* (129) cmd ::= DROP TABLE multi_drop_clause */ + { 317, -4 }, /* (130) cmd ::= DROP STABLE exists_opt full_table_name */ + { 317, -3 }, /* (131) cmd ::= ALTER TABLE alter_table_clause */ + { 317, -3 }, /* (132) cmd ::= ALTER STABLE alter_table_clause */ + { 347, -2 }, /* (133) alter_table_clause ::= full_table_name alter_table_options */ + { 347, -5 }, /* (134) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + { 347, -4 }, /* (135) alter_table_clause ::= full_table_name DROP COLUMN column_name */ + { 347, -5 }, /* (136) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + { 347, -5 }, /* (137) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + { 347, -5 }, /* (138) alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + { 347, -4 }, /* (139) alter_table_clause ::= full_table_name DROP TAG column_name */ + { 347, -5 }, /* (140) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + { 347, -5 }, /* (141) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + { 347, -6 }, /* (142) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + { 344, -1 }, /* (143) multi_create_clause ::= create_subtable_clause */ + { 344, -2 }, /* (144) multi_create_clause ::= multi_create_clause create_subtable_clause */ + { 352, -10 }, /* (145) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + { 346, -1 }, /* (146) multi_drop_clause ::= drop_table_clause */ + { 346, -2 }, /* (147) multi_drop_clause ::= multi_drop_clause drop_table_clause */ + { 355, -2 }, /* (148) drop_table_clause ::= exists_opt full_table_name */ + { 353, 0 }, /* (149) specific_cols_opt ::= */ + { 353, -3 }, /* (150) specific_cols_opt ::= NK_LP col_name_list NK_RP */ + { 340, -1 }, /* (151) full_table_name ::= table_name */ + { 340, -3 }, /* (152) full_table_name ::= db_name NK_DOT table_name */ + { 341, -1 }, /* (153) column_def_list ::= column_def */ + { 341, -3 }, /* (154) column_def_list ::= column_def_list NK_COMMA column_def */ + { 358, -2 }, /* (155) column_def ::= column_name type_name */ + { 358, -4 }, /* (156) column_def ::= column_name type_name COMMENT NK_STRING */ + { 350, -1 }, /* (157) type_name ::= BOOL */ + { 350, -1 }, /* (158) type_name ::= TINYINT */ + { 350, -1 }, /* (159) type_name ::= SMALLINT */ + { 350, -1 }, /* (160) type_name ::= INT */ + { 350, -1 }, /* (161) type_name ::= INTEGER */ + { 350, -1 }, /* (162) type_name ::= BIGINT */ + { 350, -1 }, /* (163) type_name ::= FLOAT */ + { 350, -1 }, /* (164) type_name ::= DOUBLE */ + { 350, -4 }, /* (165) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + { 350, -1 }, /* (166) type_name ::= TIMESTAMP */ + { 350, -4 }, /* (167) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + { 350, -2 }, /* (168) type_name ::= TINYINT UNSIGNED */ + { 350, -2 }, /* (169) type_name ::= SMALLINT UNSIGNED */ + { 350, -2 }, /* (170) type_name ::= INT UNSIGNED */ + { 350, -2 }, /* (171) type_name ::= BIGINT UNSIGNED */ + { 350, -1 }, /* (172) type_name ::= JSON */ + { 350, -4 }, /* (173) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + { 350, -1 }, /* (174) type_name ::= MEDIUMBLOB */ + { 350, -1 }, /* (175) type_name ::= BLOB */ + { 350, -4 }, /* (176) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + { 350, -1 }, /* (177) type_name ::= DECIMAL */ + { 350, -4 }, /* (178) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + { 350, -6 }, /* (179) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + { 342, 0 }, /* (180) tags_def_opt ::= */ + { 342, -1 }, /* (181) tags_def_opt ::= tags_def */ + { 345, -4 }, /* (182) tags_def ::= TAGS NK_LP column_def_list NK_RP */ + { 343, 0 }, /* (183) table_options ::= */ + { 343, -3 }, /* (184) table_options ::= table_options COMMENT NK_STRING */ + { 343, -3 }, /* (185) table_options ::= table_options MAX_DELAY duration_list */ + { 343, -3 }, /* (186) table_options ::= table_options WATERMARK duration_list */ + { 343, -5 }, /* (187) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + { 343, -3 }, /* (188) table_options ::= table_options TTL NK_INTEGER */ + { 343, -5 }, /* (189) table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + { 348, -1 }, /* (190) alter_table_options ::= alter_table_option */ + { 348, -2 }, /* (191) alter_table_options ::= alter_table_options alter_table_option */ + { 361, -2 }, /* (192) alter_table_option ::= COMMENT NK_STRING */ + { 361, -2 }, /* (193) alter_table_option ::= TTL NK_INTEGER */ + { 359, -1 }, /* (194) duration_list ::= duration_literal */ + { 359, -3 }, /* (195) duration_list ::= duration_list NK_COMMA duration_literal */ + { 360, -1 }, /* (196) rollup_func_list ::= rollup_func_name */ + { 360, -3 }, /* (197) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ + { 363, -1 }, /* (198) rollup_func_name ::= function_name */ + { 363, -1 }, /* (199) rollup_func_name ::= FIRST */ + { 363, -1 }, /* (200) rollup_func_name ::= LAST */ + { 356, -1 }, /* (201) col_name_list ::= col_name */ + { 356, -3 }, /* (202) col_name_list ::= col_name_list NK_COMMA col_name */ + { 365, -1 }, /* (203) col_name ::= column_name */ + { 317, -2 }, /* (204) cmd ::= SHOW DNODES */ + { 317, -2 }, /* (205) cmd ::= SHOW USERS */ + { 317, -2 }, /* (206) cmd ::= SHOW DATABASES */ + { 317, -4 }, /* (207) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + { 317, -4 }, /* (208) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + { 317, -3 }, /* (209) cmd ::= SHOW db_name_cond_opt VGROUPS */ + { 317, -2 }, /* (210) cmd ::= SHOW MNODES */ + { 317, -2 }, /* (211) cmd ::= SHOW QNODES */ + { 317, -2 }, /* (212) cmd ::= SHOW FUNCTIONS */ + { 317, -5 }, /* (213) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + { 317, -2 }, /* (214) cmd ::= SHOW STREAMS */ + { 317, -2 }, /* (215) cmd ::= SHOW ACCOUNTS */ + { 317, -2 }, /* (216) cmd ::= SHOW APPS */ + { 317, -2 }, /* (217) cmd ::= SHOW CONNECTIONS */ + { 317, -2 }, /* (218) cmd ::= SHOW LICENCES */ + { 317, -2 }, /* (219) cmd ::= SHOW GRANTS */ + { 317, -4 }, /* (220) cmd ::= SHOW CREATE DATABASE db_name */ + { 317, -4 }, /* (221) cmd ::= SHOW CREATE TABLE full_table_name */ + { 317, -4 }, /* (222) cmd ::= SHOW CREATE STABLE full_table_name */ + { 317, -2 }, /* (223) cmd ::= SHOW QUERIES */ + { 317, -2 }, /* (224) cmd ::= SHOW SCORES */ + { 317, -2 }, /* (225) cmd ::= SHOW TOPICS */ + { 317, -2 }, /* (226) cmd ::= SHOW VARIABLES */ + { 317, -3 }, /* (227) cmd ::= SHOW LOCAL VARIABLES */ + { 317, -4 }, /* (228) cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ + { 317, -2 }, /* (229) cmd ::= SHOW BNODES */ + { 317, -2 }, /* (230) cmd ::= SHOW SNODES */ + { 317, -2 }, /* (231) cmd ::= SHOW CLUSTER */ + { 317, -2 }, /* (232) cmd ::= SHOW TRANSACTIONS */ + { 317, -4 }, /* (233) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + { 317, -2 }, /* (234) cmd ::= SHOW CONSUMERS */ + { 317, -2 }, /* (235) cmd ::= SHOW SUBSCRIPTIONS */ + { 317, -5 }, /* (236) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + { 317, -6 }, /* (237) cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt */ + { 317, -3 }, /* (238) cmd ::= SHOW VNODES NK_INTEGER */ + { 317, -3 }, /* (239) cmd ::= SHOW VNODES NK_STRING */ + { 366, 0 }, /* (240) db_name_cond_opt ::= */ + { 366, -2 }, /* (241) db_name_cond_opt ::= db_name NK_DOT */ + { 367, 0 }, /* (242) like_pattern_opt ::= */ + { 367, -2 }, /* (243) like_pattern_opt ::= LIKE NK_STRING */ + { 368, -1 }, /* (244) table_name_cond ::= table_name */ + { 369, 0 }, /* (245) from_db_opt ::= */ + { 369, -2 }, /* (246) from_db_opt ::= FROM db_name */ + { 317, -8 }, /* (247) cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + { 317, -4 }, /* (248) cmd ::= DROP INDEX exists_opt full_table_name */ + { 370, -10 }, /* (249) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + { 370, -12 }, /* (250) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + { 371, -1 }, /* (251) func_list ::= func */ + { 371, -3 }, /* (252) func_list ::= func_list NK_COMMA func */ + { 374, -4 }, /* (253) func ::= function_name NK_LP expression_list NK_RP */ + { 373, 0 }, /* (254) sma_stream_opt ::= */ + { 373, -3 }, /* (255) sma_stream_opt ::= stream_options WATERMARK duration_literal */ + { 373, -3 }, /* (256) sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ + { 317, -6 }, /* (257) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + { 317, -7 }, /* (258) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + { 317, -9 }, /* (259) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + { 317, -7 }, /* (260) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + { 317, -9 }, /* (261) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + { 317, -4 }, /* (262) cmd ::= DROP TOPIC exists_opt topic_name */ + { 317, -7 }, /* (263) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + { 317, -2 }, /* (264) cmd ::= DESC full_table_name */ + { 317, -2 }, /* (265) cmd ::= DESCRIBE full_table_name */ + { 317, -3 }, /* (266) cmd ::= RESET QUERY CACHE */ + { 317, -4 }, /* (267) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + { 379, 0 }, /* (268) analyze_opt ::= */ + { 379, -1 }, /* (269) analyze_opt ::= ANALYZE */ + { 380, 0 }, /* (270) explain_options ::= */ + { 380, -3 }, /* (271) explain_options ::= explain_options VERBOSE NK_BOOL */ + { 380, -3 }, /* (272) explain_options ::= explain_options RATIO NK_FLOAT */ + { 317, -10 }, /* (273) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + { 317, -4 }, /* (274) cmd ::= DROP FUNCTION exists_opt function_name */ + { 381, 0 }, /* (275) agg_func_opt ::= */ + { 381, -1 }, /* (276) agg_func_opt ::= AGGREGATE */ + { 382, 0 }, /* (277) bufsize_opt ::= */ + { 382, -2 }, /* (278) bufsize_opt ::= BUFSIZE NK_INTEGER */ + { 317, -11 }, /* (279) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + { 317, -4 }, /* (280) cmd ::= DROP STREAM exists_opt stream_name */ + { 375, 0 }, /* (281) stream_options ::= */ + { 375, -3 }, /* (282) stream_options ::= stream_options TRIGGER AT_ONCE */ + { 375, -3 }, /* (283) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + { 375, -4 }, /* (284) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + { 375, -3 }, /* (285) stream_options ::= stream_options WATERMARK duration_literal */ + { 375, -4 }, /* (286) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + { 384, 0 }, /* (287) subtable_opt ::= */ + { 384, -4 }, /* (288) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + { 317, -3 }, /* (289) cmd ::= KILL CONNECTION NK_INTEGER */ + { 317, -3 }, /* (290) cmd ::= KILL QUERY NK_STRING */ + { 317, -3 }, /* (291) cmd ::= KILL TRANSACTION NK_INTEGER */ + { 317, -2 }, /* (292) cmd ::= BALANCE VGROUP */ + { 317, -4 }, /* (293) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + { 317, -4 }, /* (294) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + { 317, -3 }, /* (295) cmd ::= SPLIT VGROUP NK_INTEGER */ + { 386, -2 }, /* (296) dnode_list ::= DNODE NK_INTEGER */ + { 386, -3 }, /* (297) dnode_list ::= dnode_list DNODE NK_INTEGER */ + { 317, -4 }, /* (298) cmd ::= DELETE FROM full_table_name where_clause_opt */ + { 317, -1 }, /* (299) cmd ::= query_or_subquery */ + { 317, -7 }, /* (300) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + { 317, -4 }, /* (301) cmd ::= INSERT INTO full_table_name query_or_subquery */ + { 320, -1 }, /* (302) literal ::= NK_INTEGER */ + { 320, -1 }, /* (303) literal ::= NK_FLOAT */ + { 320, -1 }, /* (304) literal ::= NK_STRING */ + { 320, -1 }, /* (305) literal ::= NK_BOOL */ + { 320, -2 }, /* (306) literal ::= TIMESTAMP NK_STRING */ + { 320, -1 }, /* (307) literal ::= duration_literal */ + { 320, -1 }, /* (308) literal ::= NULL */ + { 320, -1 }, /* (309) literal ::= NK_QUESTION */ + { 362, -1 }, /* (310) duration_literal ::= NK_VARIABLE */ + { 388, -1 }, /* (311) signed ::= NK_INTEGER */ + { 388, -2 }, /* (312) signed ::= NK_PLUS NK_INTEGER */ + { 388, -2 }, /* (313) signed ::= NK_MINUS NK_INTEGER */ + { 388, -1 }, /* (314) signed ::= NK_FLOAT */ + { 388, -2 }, /* (315) signed ::= NK_PLUS NK_FLOAT */ + { 388, -2 }, /* (316) signed ::= NK_MINUS NK_FLOAT */ + { 351, -1 }, /* (317) signed_literal ::= signed */ + { 351, -1 }, /* (318) signed_literal ::= NK_STRING */ + { 351, -1 }, /* (319) signed_literal ::= NK_BOOL */ + { 351, -2 }, /* (320) signed_literal ::= TIMESTAMP NK_STRING */ + { 351, -1 }, /* (321) signed_literal ::= duration_literal */ + { 351, -1 }, /* (322) signed_literal ::= NULL */ + { 351, -1 }, /* (323) signed_literal ::= literal_func */ + { 351, -1 }, /* (324) signed_literal ::= NK_QUESTION */ + { 390, -1 }, /* (325) literal_list ::= signed_literal */ + { 390, -3 }, /* (326) literal_list ::= literal_list NK_COMMA signed_literal */ + { 328, -1 }, /* (327) db_name ::= NK_ID */ + { 357, -1 }, /* (328) table_name ::= NK_ID */ + { 349, -1 }, /* (329) column_name ::= NK_ID */ + { 364, -1 }, /* (330) function_name ::= NK_ID */ + { 391, -1 }, /* (331) table_alias ::= NK_ID */ + { 392, -1 }, /* (332) column_alias ::= NK_ID */ + { 322, -1 }, /* (333) user_name ::= NK_ID */ + { 376, -1 }, /* (334) topic_name ::= NK_ID */ + { 383, -1 }, /* (335) stream_name ::= NK_ID */ + { 378, -1 }, /* (336) cgroup_name ::= NK_ID */ + { 393, -1 }, /* (337) expr_or_subquery ::= expression */ + { 393, -1 }, /* (338) expr_or_subquery ::= subquery */ + { 385, -1 }, /* (339) expression ::= literal */ + { 385, -1 }, /* (340) expression ::= pseudo_column */ + { 385, -1 }, /* (341) expression ::= column_reference */ + { 385, -1 }, /* (342) expression ::= function_expression */ + { 385, -1 }, /* (343) expression ::= case_when_expression */ + { 385, -3 }, /* (344) expression ::= NK_LP expression NK_RP */ + { 385, -2 }, /* (345) expression ::= NK_PLUS expr_or_subquery */ + { 385, -2 }, /* (346) expression ::= NK_MINUS expr_or_subquery */ + { 385, -3 }, /* (347) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + { 385, -3 }, /* (348) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + { 385, -3 }, /* (349) expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + { 385, -3 }, /* (350) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + { 385, -3 }, /* (351) expression ::= expr_or_subquery NK_REM expr_or_subquery */ + { 385, -3 }, /* (352) expression ::= column_reference NK_ARROW NK_STRING */ + { 385, -3 }, /* (353) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + { 385, -3 }, /* (354) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + { 354, -1 }, /* (355) expression_list ::= expr_or_subquery */ + { 354, -3 }, /* (356) expression_list ::= expression_list NK_COMMA expr_or_subquery */ + { 396, -1 }, /* (357) column_reference ::= column_name */ + { 396, -3 }, /* (358) column_reference ::= table_name NK_DOT column_name */ + { 395, -1 }, /* (359) pseudo_column ::= ROWTS */ + { 395, -1 }, /* (360) pseudo_column ::= TBNAME */ + { 395, -3 }, /* (361) pseudo_column ::= table_name NK_DOT TBNAME */ + { 395, -1 }, /* (362) pseudo_column ::= QSTART */ + { 395, -1 }, /* (363) pseudo_column ::= QEND */ + { 395, -1 }, /* (364) pseudo_column ::= QDURATION */ + { 395, -1 }, /* (365) pseudo_column ::= WSTART */ + { 395, -1 }, /* (366) pseudo_column ::= WEND */ + { 395, -1 }, /* (367) pseudo_column ::= WDURATION */ + { 395, -1 }, /* (368) pseudo_column ::= IROWTS */ + { 395, -1 }, /* (369) pseudo_column ::= QTAGS */ + { 397, -4 }, /* (370) function_expression ::= function_name NK_LP expression_list NK_RP */ + { 397, -4 }, /* (371) function_expression ::= star_func NK_LP star_func_para_list NK_RP */ + { 397, -6 }, /* (372) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + { 397, -1 }, /* (373) function_expression ::= literal_func */ + { 389, -3 }, /* (374) literal_func ::= noarg_func NK_LP NK_RP */ + { 389, -1 }, /* (375) literal_func ::= NOW */ + { 401, -1 }, /* (376) noarg_func ::= NOW */ + { 401, -1 }, /* (377) noarg_func ::= TODAY */ + { 401, -1 }, /* (378) noarg_func ::= TIMEZONE */ + { 401, -1 }, /* (379) noarg_func ::= DATABASE */ + { 401, -1 }, /* (380) noarg_func ::= CLIENT_VERSION */ + { 401, -1 }, /* (381) noarg_func ::= SERVER_VERSION */ + { 401, -1 }, /* (382) noarg_func ::= SERVER_STATUS */ + { 401, -1 }, /* (383) noarg_func ::= CURRENT_USER */ + { 401, -1 }, /* (384) noarg_func ::= USER */ + { 399, -1 }, /* (385) star_func ::= COUNT */ + { 399, -1 }, /* (386) star_func ::= FIRST */ + { 399, -1 }, /* (387) star_func ::= LAST */ + { 399, -1 }, /* (388) star_func ::= LAST_ROW */ + { 400, -1 }, /* (389) star_func_para_list ::= NK_STAR */ + { 400, -1 }, /* (390) star_func_para_list ::= other_para_list */ + { 402, -1 }, /* (391) other_para_list ::= star_func_para */ + { 402, -3 }, /* (392) other_para_list ::= other_para_list NK_COMMA star_func_para */ + { 403, -1 }, /* (393) star_func_para ::= expr_or_subquery */ + { 403, -3 }, /* (394) star_func_para ::= table_name NK_DOT NK_STAR */ + { 398, -4 }, /* (395) case_when_expression ::= CASE when_then_list case_when_else_opt END */ + { 398, -5 }, /* (396) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + { 404, -1 }, /* (397) when_then_list ::= when_then_expr */ + { 404, -2 }, /* (398) when_then_list ::= when_then_list when_then_expr */ + { 407, -4 }, /* (399) when_then_expr ::= WHEN common_expression THEN common_expression */ + { 405, 0 }, /* (400) case_when_else_opt ::= */ + { 405, -2 }, /* (401) case_when_else_opt ::= ELSE common_expression */ + { 408, -3 }, /* (402) predicate ::= expr_or_subquery compare_op expr_or_subquery */ + { 408, -5 }, /* (403) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + { 408, -6 }, /* (404) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + { 408, -3 }, /* (405) predicate ::= expr_or_subquery IS NULL */ + { 408, -4 }, /* (406) predicate ::= expr_or_subquery IS NOT NULL */ + { 408, -3 }, /* (407) predicate ::= expr_or_subquery in_op in_predicate_value */ + { 409, -1 }, /* (408) compare_op ::= NK_LT */ + { 409, -1 }, /* (409) compare_op ::= NK_GT */ + { 409, -1 }, /* (410) compare_op ::= NK_LE */ + { 409, -1 }, /* (411) compare_op ::= NK_GE */ + { 409, -1 }, /* (412) compare_op ::= NK_NE */ + { 409, -1 }, /* (413) compare_op ::= NK_EQ */ + { 409, -1 }, /* (414) compare_op ::= LIKE */ + { 409, -2 }, /* (415) compare_op ::= NOT LIKE */ + { 409, -1 }, /* (416) compare_op ::= MATCH */ + { 409, -1 }, /* (417) compare_op ::= NMATCH */ + { 409, -1 }, /* (418) compare_op ::= CONTAINS */ + { 410, -1 }, /* (419) in_op ::= IN */ + { 410, -2 }, /* (420) in_op ::= NOT IN */ + { 411, -3 }, /* (421) in_predicate_value ::= NK_LP literal_list NK_RP */ + { 412, -1 }, /* (422) boolean_value_expression ::= boolean_primary */ + { 412, -2 }, /* (423) boolean_value_expression ::= NOT boolean_primary */ + { 412, -3 }, /* (424) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + { 412, -3 }, /* (425) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + { 413, -1 }, /* (426) boolean_primary ::= predicate */ + { 413, -3 }, /* (427) boolean_primary ::= NK_LP boolean_value_expression NK_RP */ + { 406, -1 }, /* (428) common_expression ::= expr_or_subquery */ + { 406, -1 }, /* (429) common_expression ::= boolean_value_expression */ + { 414, 0 }, /* (430) from_clause_opt ::= */ + { 414, -2 }, /* (431) from_clause_opt ::= FROM table_reference_list */ + { 415, -1 }, /* (432) table_reference_list ::= table_reference */ + { 415, -3 }, /* (433) table_reference_list ::= table_reference_list NK_COMMA table_reference */ + { 416, -1 }, /* (434) table_reference ::= table_primary */ + { 416, -1 }, /* (435) table_reference ::= joined_table */ + { 417, -2 }, /* (436) table_primary ::= table_name alias_opt */ + { 417, -4 }, /* (437) table_primary ::= db_name NK_DOT table_name alias_opt */ + { 417, -2 }, /* (438) table_primary ::= subquery alias_opt */ + { 417, -1 }, /* (439) table_primary ::= parenthesized_joined_table */ + { 419, 0 }, /* (440) alias_opt ::= */ + { 419, -1 }, /* (441) alias_opt ::= table_alias */ + { 419, -2 }, /* (442) alias_opt ::= AS table_alias */ + { 420, -3 }, /* (443) parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + { 420, -3 }, /* (444) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ + { 418, -6 }, /* (445) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + { 421, 0 }, /* (446) join_type ::= */ + { 421, -1 }, /* (447) join_type ::= INNER */ + { 423, -12 }, /* (448) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + { 424, 0 }, /* (449) set_quantifier_opt ::= */ + { 424, -1 }, /* (450) set_quantifier_opt ::= DISTINCT */ + { 424, -1 }, /* (451) set_quantifier_opt ::= ALL */ + { 425, -1 }, /* (452) select_list ::= select_item */ + { 425, -3 }, /* (453) select_list ::= select_list NK_COMMA select_item */ + { 433, -1 }, /* (454) select_item ::= NK_STAR */ + { 433, -1 }, /* (455) select_item ::= common_expression */ + { 433, -2 }, /* (456) select_item ::= common_expression column_alias */ + { 433, -3 }, /* (457) select_item ::= common_expression AS column_alias */ + { 433, -3 }, /* (458) select_item ::= table_name NK_DOT NK_STAR */ + { 387, 0 }, /* (459) where_clause_opt ::= */ + { 387, -2 }, /* (460) where_clause_opt ::= WHERE search_condition */ + { 426, 0 }, /* (461) partition_by_clause_opt ::= */ + { 426, -3 }, /* (462) partition_by_clause_opt ::= PARTITION BY partition_list */ + { 434, -1 }, /* (463) partition_list ::= partition_item */ + { 434, -3 }, /* (464) partition_list ::= partition_list NK_COMMA partition_item */ + { 435, -1 }, /* (465) partition_item ::= expr_or_subquery */ + { 435, -2 }, /* (466) partition_item ::= expr_or_subquery column_alias */ + { 435, -3 }, /* (467) partition_item ::= expr_or_subquery AS column_alias */ + { 430, 0 }, /* (468) twindow_clause_opt ::= */ + { 430, -6 }, /* (469) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + { 430, -4 }, /* (470) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + { 430, -6 }, /* (471) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + { 430, -8 }, /* (472) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + { 372, 0 }, /* (473) sliding_opt ::= */ + { 372, -4 }, /* (474) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ + { 429, 0 }, /* (475) fill_opt ::= */ + { 429, -4 }, /* (476) fill_opt ::= FILL NK_LP fill_mode NK_RP */ + { 429, -6 }, /* (477) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + { 436, -1 }, /* (478) fill_mode ::= NONE */ + { 436, -1 }, /* (479) fill_mode ::= PREV */ + { 436, -1 }, /* (480) fill_mode ::= NULL */ + { 436, -1 }, /* (481) fill_mode ::= LINEAR */ + { 436, -1 }, /* (482) fill_mode ::= NEXT */ + { 431, 0 }, /* (483) group_by_clause_opt ::= */ + { 431, -3 }, /* (484) group_by_clause_opt ::= GROUP BY group_by_list */ + { 437, -1 }, /* (485) group_by_list ::= expr_or_subquery */ + { 437, -3 }, /* (486) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + { 432, 0 }, /* (487) having_clause_opt ::= */ + { 432, -2 }, /* (488) having_clause_opt ::= HAVING search_condition */ + { 427, 0 }, /* (489) range_opt ::= */ + { 427, -6 }, /* (490) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + { 428, 0 }, /* (491) every_opt ::= */ + { 428, -4 }, /* (492) every_opt ::= EVERY NK_LP duration_literal NK_RP */ + { 438, -4 }, /* (493) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + { 439, -1 }, /* (494) query_simple ::= query_specification */ + { 439, -1 }, /* (495) query_simple ::= union_query_expression */ + { 443, -4 }, /* (496) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + { 443, -3 }, /* (497) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + { 444, -1 }, /* (498) query_simple_or_subquery ::= query_simple */ + { 444, -1 }, /* (499) query_simple_or_subquery ::= subquery */ + { 377, -1 }, /* (500) query_or_subquery ::= query_expression */ + { 377, -1 }, /* (501) query_or_subquery ::= subquery */ + { 440, 0 }, /* (502) order_by_clause_opt ::= */ + { 440, -3 }, /* (503) order_by_clause_opt ::= ORDER BY sort_specification_list */ + { 441, 0 }, /* (504) slimit_clause_opt ::= */ + { 441, -2 }, /* (505) slimit_clause_opt ::= SLIMIT NK_INTEGER */ + { 441, -4 }, /* (506) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + { 441, -4 }, /* (507) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 442, 0 }, /* (508) limit_clause_opt ::= */ + { 442, -2 }, /* (509) limit_clause_opt ::= LIMIT NK_INTEGER */ + { 442, -4 }, /* (510) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ + { 442, -4 }, /* (511) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + { 394, -3 }, /* (512) subquery ::= NK_LP query_expression NK_RP */ + { 394, -3 }, /* (513) subquery ::= NK_LP subquery NK_RP */ + { 422, -1 }, /* (514) search_condition ::= common_expression */ + { 445, -1 }, /* (515) sort_specification_list ::= sort_specification */ + { 445, -3 }, /* (516) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ + { 446, -3 }, /* (517) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + { 447, 0 }, /* (518) ordering_specification_opt ::= */ + { 447, -1 }, /* (519) ordering_specification_opt ::= ASC */ + { 447, -1 }, /* (520) ordering_specification_opt ::= DESC */ + { 448, 0 }, /* (521) null_ordering_opt ::= */ + { 448, -2 }, /* (522) null_ordering_opt ::= NULLS FIRST */ + { 448, -2 }, /* (523) null_ordering_opt ::= NULLS LAST */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -3711,29 +3715,29 @@ static YYACTIONTYPE yy_reduce( case 49: /* dnode_endpoint ::= NK_STRING */ case 50: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==50); case 51: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==51); - case 325: /* db_name ::= NK_ID */ yytestcase(yyruleno==325); - case 326: /* table_name ::= NK_ID */ yytestcase(yyruleno==326); - case 327: /* column_name ::= NK_ID */ yytestcase(yyruleno==327); - case 328: /* function_name ::= NK_ID */ yytestcase(yyruleno==328); - case 329: /* table_alias ::= NK_ID */ yytestcase(yyruleno==329); - case 330: /* column_alias ::= NK_ID */ yytestcase(yyruleno==330); - case 331: /* user_name ::= NK_ID */ yytestcase(yyruleno==331); - case 332: /* topic_name ::= NK_ID */ yytestcase(yyruleno==332); - case 333: /* stream_name ::= NK_ID */ yytestcase(yyruleno==333); - case 334: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==334); - case 374: /* noarg_func ::= NOW */ yytestcase(yyruleno==374); - case 375: /* noarg_func ::= TODAY */ yytestcase(yyruleno==375); - case 376: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==376); - case 377: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==377); - case 378: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==378); - case 379: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==379); - case 380: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==380); - case 381: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==381); - case 382: /* noarg_func ::= USER */ yytestcase(yyruleno==382); - case 383: /* star_func ::= COUNT */ yytestcase(yyruleno==383); - case 384: /* star_func ::= FIRST */ yytestcase(yyruleno==384); - case 385: /* star_func ::= LAST */ yytestcase(yyruleno==385); - case 386: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==386); + case 327: /* db_name ::= NK_ID */ yytestcase(yyruleno==327); + case 328: /* table_name ::= NK_ID */ yytestcase(yyruleno==328); + case 329: /* column_name ::= NK_ID */ yytestcase(yyruleno==329); + case 330: /* function_name ::= NK_ID */ yytestcase(yyruleno==330); + case 331: /* table_alias ::= NK_ID */ yytestcase(yyruleno==331); + case 332: /* column_alias ::= NK_ID */ yytestcase(yyruleno==332); + case 333: /* user_name ::= NK_ID */ yytestcase(yyruleno==333); + case 334: /* topic_name ::= NK_ID */ yytestcase(yyruleno==334); + case 335: /* stream_name ::= NK_ID */ yytestcase(yyruleno==335); + case 336: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==336); + case 376: /* noarg_func ::= NOW */ yytestcase(yyruleno==376); + case 377: /* noarg_func ::= TODAY */ yytestcase(yyruleno==377); + case 378: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==378); + case 379: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==379); + case 380: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==380); + case 381: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==381); + case 382: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==382); + case 383: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==383); + case 384: /* noarg_func ::= USER */ yytestcase(yyruleno==384); + case 385: /* star_func ::= COUNT */ yytestcase(yyruleno==385); + case 386: /* star_func ::= FIRST */ yytestcase(yyruleno==386); + case 387: /* star_func ::= LAST */ yytestcase(yyruleno==387); + case 388: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==388); { yylhsminor.yy181 = yymsp[0].minor.yy0; } yymsp[0].minor.yy181 = yylhsminor.yy181; break; @@ -3790,9 +3794,9 @@ static YYACTIONTYPE yy_reduce( break; case 69: /* not_exists_opt ::= */ case 71: /* exists_opt ::= */ yytestcase(yyruleno==71); - case 266: /* analyze_opt ::= */ yytestcase(yyruleno==266); - case 273: /* agg_func_opt ::= */ yytestcase(yyruleno==273); - case 447: /* set_quantifier_opt ::= */ yytestcase(yyruleno==447); + case 268: /* analyze_opt ::= */ yytestcase(yyruleno==268); + case 275: /* agg_func_opt ::= */ yytestcase(yyruleno==275); + case 449: /* set_quantifier_opt ::= */ yytestcase(yyruleno==449); { yymsp[1].minor.yy39 = false; } break; case 70: /* exists_opt ::= IF EXISTS */ @@ -3954,655 +3958,661 @@ static YYACTIONTYPE yy_reduce( case 112: /* alter_db_option ::= PAGES NK_INTEGER */ { yymsp[-1].minor.yy645.type = DB_OPTION_PAGES; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; - case 113: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ + case 113: /* alter_db_option ::= REPLICA NK_INTEGER */ +{ yymsp[-1].minor.yy645.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } + break; + case 114: /* alter_db_option ::= STRICT NK_STRING */ +{ yymsp[-1].minor.yy645.type = DB_OPTION_STRICT; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } + break; + case 115: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */ { yymsp[-1].minor.yy645.type = DB_OPTION_WAL; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; - case 114: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ + case 116: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */ { yymsp[-1].minor.yy645.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; - case 115: /* integer_list ::= NK_INTEGER */ + case 117: /* integer_list ::= NK_INTEGER */ { yylhsminor.yy282 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 116: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ - case 295: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==295); + case 118: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */ + case 297: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==297); { yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy282 = yylhsminor.yy282; break; - case 117: /* variable_list ::= NK_VARIABLE */ + case 119: /* variable_list ::= NK_VARIABLE */ { yylhsminor.yy282 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 118: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ + case 120: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */ { yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy282 = yylhsminor.yy282; break; - case 119: /* retention_list ::= retention */ - case 141: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==141); - case 144: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==144); - case 151: /* column_def_list ::= column_def */ yytestcase(yyruleno==151); - case 194: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==194); - case 199: /* col_name_list ::= col_name */ yytestcase(yyruleno==199); - case 249: /* func_list ::= func */ yytestcase(yyruleno==249); - case 323: /* literal_list ::= signed_literal */ yytestcase(yyruleno==323); - case 389: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==389); - case 395: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==395); - case 450: /* select_list ::= select_item */ yytestcase(yyruleno==450); - case 461: /* partition_list ::= partition_item */ yytestcase(yyruleno==461); - case 513: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==513); + case 121: /* retention_list ::= retention */ + case 143: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==143); + case 146: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==146); + case 153: /* column_def_list ::= column_def */ yytestcase(yyruleno==153); + case 196: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==196); + case 201: /* col_name_list ::= col_name */ yytestcase(yyruleno==201); + case 251: /* func_list ::= func */ yytestcase(yyruleno==251); + case 325: /* literal_list ::= signed_literal */ yytestcase(yyruleno==325); + case 391: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==391); + case 397: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==397); + case 452: /* select_list ::= select_item */ yytestcase(yyruleno==452); + case 463: /* partition_list ::= partition_item */ yytestcase(yyruleno==463); + case 515: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==515); { yylhsminor.yy282 = createNodeList(pCxt, yymsp[0].minor.yy778); } yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 120: /* retention_list ::= retention_list NK_COMMA retention */ - case 152: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==152); - case 195: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==195); - case 200: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==200); - case 250: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==250); - case 324: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==324); - case 390: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==390); - case 451: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==451); - case 462: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==462); - case 514: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==514); + case 122: /* retention_list ::= retention_list NK_COMMA retention */ + case 154: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==154); + case 197: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==197); + case 202: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==202); + case 252: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==252); + case 326: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==326); + case 392: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==392); + case 453: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==453); + case 464: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==464); + case 516: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==516); { yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, yymsp[0].minor.yy778); } yymsp[-2].minor.yy282 = yylhsminor.yy282; break; - case 121: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ + case 123: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */ { yylhsminor.yy778 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 122: /* speed_opt ::= */ - case 275: /* bufsize_opt ::= */ yytestcase(yyruleno==275); + case 124: /* speed_opt ::= */ + case 277: /* bufsize_opt ::= */ yytestcase(yyruleno==277); { yymsp[1].minor.yy276 = 0; } break; - case 123: /* speed_opt ::= MAX_SPEED NK_INTEGER */ - case 276: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==276); + case 125: /* speed_opt ::= MAX_SPEED NK_INTEGER */ + case 278: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==278); { yymsp[-1].minor.yy276 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 124: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ - case 126: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==126); + case 126: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */ + case 128: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==128); { pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy39, yymsp[-5].minor.yy778, yymsp[-3].minor.yy282, yymsp[-1].minor.yy282, yymsp[0].minor.yy778); } break; - case 125: /* cmd ::= CREATE TABLE multi_create_clause */ + case 127: /* cmd ::= CREATE TABLE multi_create_clause */ { pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy282); } break; - case 127: /* cmd ::= DROP TABLE multi_drop_clause */ + case 129: /* cmd ::= DROP TABLE multi_drop_clause */ { pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy282); } break; - case 128: /* cmd ::= DROP STABLE exists_opt full_table_name */ + case 130: /* cmd ::= DROP STABLE exists_opt full_table_name */ { pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy39, yymsp[0].minor.yy778); } break; - case 129: /* cmd ::= ALTER TABLE alter_table_clause */ - case 297: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==297); + case 131: /* cmd ::= ALTER TABLE alter_table_clause */ + case 299: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==299); { pCxt->pRootNode = yymsp[0].minor.yy778; } break; - case 130: /* cmd ::= ALTER STABLE alter_table_clause */ + case 132: /* cmd ::= ALTER STABLE alter_table_clause */ { pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy778); } break; - case 131: /* alter_table_clause ::= full_table_name alter_table_options */ + case 133: /* alter_table_clause ::= full_table_name alter_table_options */ { yylhsminor.yy778 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 132: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ + case 134: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */ { yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 133: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ + case 135: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */ { yylhsminor.yy778 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy778, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy181); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 134: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ + case 136: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */ { yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 135: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ + case 137: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */ { yylhsminor.yy778 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 136: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ + case 138: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */ { yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 137: /* alter_table_clause ::= full_table_name DROP TAG column_name */ + case 139: /* alter_table_clause ::= full_table_name DROP TAG column_name */ { yylhsminor.yy778 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy778, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy181); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 138: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ + case 140: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */ { yylhsminor.yy778 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 139: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ + case 141: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */ { yylhsminor.yy778 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy778, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 140: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ + case 142: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */ { yylhsminor.yy778 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy778, &yymsp[-2].minor.yy181, yymsp[0].minor.yy778); } yymsp[-5].minor.yy778 = yylhsminor.yy778; break; - case 142: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ - case 145: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==145); - case 396: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==396); + case 144: /* multi_create_clause ::= multi_create_clause create_subtable_clause */ + case 147: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==147); + case 398: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==398); { yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-1].minor.yy282, yymsp[0].minor.yy778); } yymsp[-1].minor.yy282 = yylhsminor.yy282; break; - case 143: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ + case 145: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */ { yylhsminor.yy778 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy39, yymsp[-8].minor.yy778, yymsp[-6].minor.yy778, yymsp[-5].minor.yy282, yymsp[-2].minor.yy282, yymsp[0].minor.yy778); } yymsp[-9].minor.yy778 = yylhsminor.yy778; break; - case 146: /* drop_table_clause ::= exists_opt full_table_name */ + case 148: /* drop_table_clause ::= exists_opt full_table_name */ { yylhsminor.yy778 = createDropTableClause(pCxt, yymsp[-1].minor.yy39, yymsp[0].minor.yy778); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 147: /* specific_cols_opt ::= */ - case 178: /* tags_def_opt ::= */ yytestcase(yyruleno==178); - case 459: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==459); - case 481: /* group_by_clause_opt ::= */ yytestcase(yyruleno==481); - case 500: /* order_by_clause_opt ::= */ yytestcase(yyruleno==500); + case 149: /* specific_cols_opt ::= */ + case 180: /* tags_def_opt ::= */ yytestcase(yyruleno==180); + case 461: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==461); + case 483: /* group_by_clause_opt ::= */ yytestcase(yyruleno==483); + case 502: /* order_by_clause_opt ::= */ yytestcase(yyruleno==502); { yymsp[1].minor.yy282 = NULL; } break; - case 148: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ + case 150: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */ { yymsp[-2].minor.yy282 = yymsp[-1].minor.yy282; } break; - case 149: /* full_table_name ::= table_name */ + case 151: /* full_table_name ::= table_name */ { yylhsminor.yy778 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy181, NULL); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 150: /* full_table_name ::= db_name NK_DOT table_name */ + case 152: /* full_table_name ::= db_name NK_DOT table_name */ { yylhsminor.yy778 = createRealTableNode(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181, NULL); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 153: /* column_def ::= column_name type_name */ + case 155: /* column_def ::= column_name type_name */ { yylhsminor.yy778 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy181, yymsp[0].minor.yy380, NULL); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 154: /* column_def ::= column_name type_name COMMENT NK_STRING */ + case 156: /* column_def ::= column_name type_name COMMENT NK_STRING */ { yylhsminor.yy778 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy181, yymsp[-2].minor.yy380, &yymsp[0].minor.yy0); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 155: /* type_name ::= BOOL */ + case 157: /* type_name ::= BOOL */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_BOOL); } break; - case 156: /* type_name ::= TINYINT */ + case 158: /* type_name ::= TINYINT */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_TINYINT); } break; - case 157: /* type_name ::= SMALLINT */ + case 159: /* type_name ::= SMALLINT */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_SMALLINT); } break; - case 158: /* type_name ::= INT */ - case 159: /* type_name ::= INTEGER */ yytestcase(yyruleno==159); + case 160: /* type_name ::= INT */ + case 161: /* type_name ::= INTEGER */ yytestcase(yyruleno==161); { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_INT); } break; - case 160: /* type_name ::= BIGINT */ + case 162: /* type_name ::= BIGINT */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_BIGINT); } break; - case 161: /* type_name ::= FLOAT */ + case 163: /* type_name ::= FLOAT */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_FLOAT); } break; - case 162: /* type_name ::= DOUBLE */ + case 164: /* type_name ::= DOUBLE */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_DOUBLE); } break; - case 163: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ + case 165: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); } break; - case 164: /* type_name ::= TIMESTAMP */ + case 166: /* type_name ::= TIMESTAMP */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); } break; - case 165: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ + case 167: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); } break; - case 166: /* type_name ::= TINYINT UNSIGNED */ + case 168: /* type_name ::= TINYINT UNSIGNED */ { yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_UTINYINT); } break; - case 167: /* type_name ::= SMALLINT UNSIGNED */ + case 169: /* type_name ::= SMALLINT UNSIGNED */ { yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_USMALLINT); } break; - case 168: /* type_name ::= INT UNSIGNED */ + case 170: /* type_name ::= INT UNSIGNED */ { yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_UINT); } break; - case 169: /* type_name ::= BIGINT UNSIGNED */ + case 171: /* type_name ::= BIGINT UNSIGNED */ { yymsp[-1].minor.yy380 = createDataType(TSDB_DATA_TYPE_UBIGINT); } break; - case 170: /* type_name ::= JSON */ + case 172: /* type_name ::= JSON */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_JSON); } break; - case 171: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ + case 173: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); } break; - case 172: /* type_name ::= MEDIUMBLOB */ + case 174: /* type_name ::= MEDIUMBLOB */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); } break; - case 173: /* type_name ::= BLOB */ + case 175: /* type_name ::= BLOB */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_BLOB); } break; - case 174: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ + case 176: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy380 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); } break; - case 175: /* type_name ::= DECIMAL */ + case 177: /* type_name ::= DECIMAL */ { yymsp[0].minor.yy380 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 176: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ + case 178: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */ { yymsp[-3].minor.yy380 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 177: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ + case 179: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */ { yymsp[-5].minor.yy380 = createDataType(TSDB_DATA_TYPE_DECIMAL); } break; - case 179: /* tags_def_opt ::= tags_def */ - case 388: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==388); + case 181: /* tags_def_opt ::= tags_def */ + case 390: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==390); { yylhsminor.yy282 = yymsp[0].minor.yy282; } yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 180: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ + case 182: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */ { yymsp[-3].minor.yy282 = yymsp[-1].minor.yy282; } break; - case 181: /* table_options ::= */ + case 183: /* table_options ::= */ { yymsp[1].minor.yy778 = createDefaultTableOptions(pCxt); } break; - case 182: /* table_options ::= table_options COMMENT NK_STRING */ + case 184: /* table_options ::= table_options COMMENT NK_STRING */ { yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 183: /* table_options ::= table_options MAX_DELAY duration_list */ + case 185: /* table_options ::= table_options MAX_DELAY duration_list */ { yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy282); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 184: /* table_options ::= table_options WATERMARK duration_list */ + case 186: /* table_options ::= table_options WATERMARK duration_list */ { yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy282); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 185: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ + case 187: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */ { yylhsminor.yy778 = setTableOption(pCxt, yymsp[-4].minor.yy778, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy282); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 186: /* table_options ::= table_options TTL NK_INTEGER */ + case 188: /* table_options ::= table_options TTL NK_INTEGER */ { yylhsminor.yy778 = setTableOption(pCxt, yymsp[-2].minor.yy778, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 187: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ + case 189: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */ { yylhsminor.yy778 = setTableOption(pCxt, yymsp[-4].minor.yy778, TABLE_OPTION_SMA, yymsp[-1].minor.yy282); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 188: /* alter_table_options ::= alter_table_option */ + case 190: /* alter_table_options ::= alter_table_option */ { yylhsminor.yy778 = createAlterTableOptions(pCxt); yylhsminor.yy778 = setTableOption(pCxt, yylhsminor.yy778, yymsp[0].minor.yy645.type, &yymsp[0].minor.yy645.val); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 189: /* alter_table_options ::= alter_table_options alter_table_option */ + case 191: /* alter_table_options ::= alter_table_options alter_table_option */ { yylhsminor.yy778 = setTableOption(pCxt, yymsp[-1].minor.yy778, yymsp[0].minor.yy645.type, &yymsp[0].minor.yy645.val); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 190: /* alter_table_option ::= COMMENT NK_STRING */ + case 192: /* alter_table_option ::= COMMENT NK_STRING */ { yymsp[-1].minor.yy645.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; - case 191: /* alter_table_option ::= TTL NK_INTEGER */ + case 193: /* alter_table_option ::= TTL NK_INTEGER */ { yymsp[-1].minor.yy645.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy645.val = yymsp[0].minor.yy0; } break; - case 192: /* duration_list ::= duration_literal */ - case 353: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==353); + case 194: /* duration_list ::= duration_literal */ + case 355: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==355); { yylhsminor.yy282 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 193: /* duration_list ::= duration_list NK_COMMA duration_literal */ - case 354: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==354); + case 195: /* duration_list ::= duration_list NK_COMMA duration_literal */ + case 356: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==356); { yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } yymsp[-2].minor.yy282 = yylhsminor.yy282; break; - case 196: /* rollup_func_name ::= function_name */ + case 198: /* rollup_func_name ::= function_name */ { yylhsminor.yy778 = createFunctionNode(pCxt, &yymsp[0].minor.yy181, NULL); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 197: /* rollup_func_name ::= FIRST */ - case 198: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==198); + case 199: /* rollup_func_name ::= FIRST */ + case 200: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==200); { yylhsminor.yy778 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 201: /* col_name ::= column_name */ + case 203: /* col_name ::= column_name */ { yylhsminor.yy778 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy181); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 202: /* cmd ::= SHOW DNODES */ + case 204: /* cmd ::= SHOW DNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); } break; - case 203: /* cmd ::= SHOW USERS */ + case 205: /* cmd ::= SHOW USERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); } break; - case 204: /* cmd ::= SHOW DATABASES */ + case 206: /* cmd ::= SHOW DATABASES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); } break; - case 205: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ + case 207: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy778, yymsp[0].minor.yy778, OP_TYPE_LIKE); } break; - case 206: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ + case 208: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy778, yymsp[0].minor.yy778, OP_TYPE_LIKE); } break; - case 207: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ + case 209: /* cmd ::= SHOW db_name_cond_opt VGROUPS */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy778, NULL, OP_TYPE_LIKE); } break; - case 208: /* cmd ::= SHOW MNODES */ + case 210: /* cmd ::= SHOW MNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); } break; - case 209: /* cmd ::= SHOW QNODES */ + case 211: /* cmd ::= SHOW QNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); } break; - case 210: /* cmd ::= SHOW FUNCTIONS */ + case 212: /* cmd ::= SHOW FUNCTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); } break; - case 211: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ + case 213: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy778, yymsp[-1].minor.yy778, OP_TYPE_EQUAL); } break; - case 212: /* cmd ::= SHOW STREAMS */ + case 214: /* cmd ::= SHOW STREAMS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); } break; - case 213: /* cmd ::= SHOW ACCOUNTS */ + case 215: /* cmd ::= SHOW ACCOUNTS */ { pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); } break; - case 214: /* cmd ::= SHOW APPS */ + case 216: /* cmd ::= SHOW APPS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); } break; - case 215: /* cmd ::= SHOW CONNECTIONS */ + case 217: /* cmd ::= SHOW CONNECTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); } break; - case 216: /* cmd ::= SHOW LICENCES */ - case 217: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==217); + case 218: /* cmd ::= SHOW LICENCES */ + case 219: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==219); { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); } break; - case 218: /* cmd ::= SHOW CREATE DATABASE db_name */ + case 220: /* cmd ::= SHOW CREATE DATABASE db_name */ { pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy181); } break; - case 219: /* cmd ::= SHOW CREATE TABLE full_table_name */ + case 221: /* cmd ::= SHOW CREATE TABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy778); } break; - case 220: /* cmd ::= SHOW CREATE STABLE full_table_name */ + case 222: /* cmd ::= SHOW CREATE STABLE full_table_name */ { pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy778); } break; - case 221: /* cmd ::= SHOW QUERIES */ + case 223: /* cmd ::= SHOW QUERIES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); } break; - case 222: /* cmd ::= SHOW SCORES */ + case 224: /* cmd ::= SHOW SCORES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); } break; - case 223: /* cmd ::= SHOW TOPICS */ + case 225: /* cmd ::= SHOW TOPICS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); } break; - case 224: /* cmd ::= SHOW VARIABLES */ + case 226: /* cmd ::= SHOW VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); } break; - case 225: /* cmd ::= SHOW LOCAL VARIABLES */ + case 227: /* cmd ::= SHOW LOCAL VARIABLES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); } break; - case 226: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ + case 228: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES */ { pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-1].minor.yy0)); } break; - case 227: /* cmd ::= SHOW BNODES */ + case 229: /* cmd ::= SHOW BNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); } break; - case 228: /* cmd ::= SHOW SNODES */ + case 230: /* cmd ::= SHOW SNODES */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); } break; - case 229: /* cmd ::= SHOW CLUSTER */ + case 231: /* cmd ::= SHOW CLUSTER */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); } break; - case 230: /* cmd ::= SHOW TRANSACTIONS */ + case 232: /* cmd ::= SHOW TRANSACTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); } break; - case 231: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ + case 233: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */ { pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy778); } break; - case 232: /* cmd ::= SHOW CONSUMERS */ + case 234: /* cmd ::= SHOW CONSUMERS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); } break; - case 233: /* cmd ::= SHOW SUBSCRIPTIONS */ + case 235: /* cmd ::= SHOW SUBSCRIPTIONS */ { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); } break; - case 234: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ + case 236: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy778, yymsp[-1].minor.yy778, OP_TYPE_EQUAL); } break; - case 235: /* cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt */ + case 237: /* cmd ::= SHOW TABLE TAGS FROM table_name_cond from_db_opt */ { pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLE_TAGS_STMT, yymsp[0].minor.yy778, yymsp[-1].minor.yy778, OP_TYPE_EQUAL); } break; - case 236: /* cmd ::= SHOW VNODES NK_INTEGER */ + case 238: /* cmd ::= SHOW VNODES NK_INTEGER */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); } break; - case 237: /* cmd ::= SHOW VNODES NK_STRING */ + case 239: /* cmd ::= SHOW VNODES NK_STRING */ { pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); } break; - case 238: /* db_name_cond_opt ::= */ - case 243: /* from_db_opt ::= */ yytestcase(yyruleno==243); + case 240: /* db_name_cond_opt ::= */ + case 245: /* from_db_opt ::= */ yytestcase(yyruleno==245); { yymsp[1].minor.yy778 = createDefaultDatabaseCondValue(pCxt); } break; - case 239: /* db_name_cond_opt ::= db_name NK_DOT */ + case 241: /* db_name_cond_opt ::= db_name NK_DOT */ { yylhsminor.yy778 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy181); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 240: /* like_pattern_opt ::= */ - case 285: /* subtable_opt ::= */ yytestcase(yyruleno==285); - case 398: /* case_when_else_opt ::= */ yytestcase(yyruleno==398); - case 428: /* from_clause_opt ::= */ yytestcase(yyruleno==428); - case 457: /* where_clause_opt ::= */ yytestcase(yyruleno==457); - case 466: /* twindow_clause_opt ::= */ yytestcase(yyruleno==466); - case 471: /* sliding_opt ::= */ yytestcase(yyruleno==471); - case 473: /* fill_opt ::= */ yytestcase(yyruleno==473); - case 485: /* having_clause_opt ::= */ yytestcase(yyruleno==485); - case 487: /* range_opt ::= */ yytestcase(yyruleno==487); - case 489: /* every_opt ::= */ yytestcase(yyruleno==489); - case 502: /* slimit_clause_opt ::= */ yytestcase(yyruleno==502); - case 506: /* limit_clause_opt ::= */ yytestcase(yyruleno==506); + case 242: /* like_pattern_opt ::= */ + case 287: /* subtable_opt ::= */ yytestcase(yyruleno==287); + case 400: /* case_when_else_opt ::= */ yytestcase(yyruleno==400); + case 430: /* from_clause_opt ::= */ yytestcase(yyruleno==430); + case 459: /* where_clause_opt ::= */ yytestcase(yyruleno==459); + case 468: /* twindow_clause_opt ::= */ yytestcase(yyruleno==468); + case 473: /* sliding_opt ::= */ yytestcase(yyruleno==473); + case 475: /* fill_opt ::= */ yytestcase(yyruleno==475); + case 487: /* having_clause_opt ::= */ yytestcase(yyruleno==487); + case 489: /* range_opt ::= */ yytestcase(yyruleno==489); + case 491: /* every_opt ::= */ yytestcase(yyruleno==491); + case 504: /* slimit_clause_opt ::= */ yytestcase(yyruleno==504); + case 508: /* limit_clause_opt ::= */ yytestcase(yyruleno==508); { yymsp[1].minor.yy778 = NULL; } break; - case 241: /* like_pattern_opt ::= LIKE NK_STRING */ + case 243: /* like_pattern_opt ::= LIKE NK_STRING */ { yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } break; - case 242: /* table_name_cond ::= table_name */ + case 244: /* table_name_cond ::= table_name */ { yylhsminor.yy778 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy181); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 244: /* from_db_opt ::= FROM db_name */ + case 246: /* from_db_opt ::= FROM db_name */ { yymsp[-1].minor.yy778 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy181); } break; - case 245: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ + case 247: /* cmd ::= CREATE SMA INDEX not_exists_opt full_table_name ON full_table_name index_options */ { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy39, yymsp[-3].minor.yy778, yymsp[-1].minor.yy778, NULL, yymsp[0].minor.yy778); } break; - case 246: /* cmd ::= DROP INDEX exists_opt full_table_name */ + case 248: /* cmd ::= DROP INDEX exists_opt full_table_name */ { pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy39, yymsp[0].minor.yy778); } break; - case 247: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ + case 249: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */ { yymsp[-9].minor.yy778 = createIndexOption(pCxt, yymsp[-7].minor.yy282, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), NULL, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 248: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ + case 250: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */ { yymsp[-11].minor.yy778 = createIndexOption(pCxt, yymsp[-9].minor.yy282, releaseRawExprNode(pCxt, yymsp[-5].minor.yy778), releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 251: /* func ::= function_name NK_LP expression_list NK_RP */ + case 253: /* func ::= function_name NK_LP expression_list NK_RP */ { yylhsminor.yy778 = createFunctionNode(pCxt, &yymsp[-3].minor.yy181, yymsp[-1].minor.yy282); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 252: /* sma_stream_opt ::= */ - case 279: /* stream_options ::= */ yytestcase(yyruleno==279); + case 254: /* sma_stream_opt ::= */ + case 281: /* stream_options ::= */ yytestcase(yyruleno==281); { yymsp[1].minor.yy778 = createStreamOptions(pCxt); } break; - case 253: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ - case 283: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==283); + case 255: /* sma_stream_opt ::= stream_options WATERMARK duration_literal */ + case 285: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==285); { ((SStreamOptions*)yymsp[-2].minor.yy778)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = yymsp[-2].minor.yy778; } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 254: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ + case 256: /* sma_stream_opt ::= stream_options MAX_DELAY duration_literal */ { ((SStreamOptions*)yymsp[-2].minor.yy778)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = yymsp[-2].minor.yy778; } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 255: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ + case 257: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */ { pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy39, &yymsp[-2].minor.yy181, yymsp[0].minor.yy778); } break; - case 256: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ + case 258: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */ { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy39, &yymsp[-3].minor.yy181, &yymsp[0].minor.yy181, false); } break; - case 257: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ + case 259: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */ { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy39, &yymsp[-5].minor.yy181, &yymsp[0].minor.yy181, true); } break; - case 258: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ + case 260: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */ { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy39, &yymsp[-3].minor.yy181, yymsp[0].minor.yy778, false); } break; - case 259: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ + case 261: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */ { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy39, &yymsp[-5].minor.yy181, yymsp[0].minor.yy778, true); } break; - case 260: /* cmd ::= DROP TOPIC exists_opt topic_name */ + case 262: /* cmd ::= DROP TOPIC exists_opt topic_name */ { pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy39, &yymsp[0].minor.yy181); } break; - case 261: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ + case 263: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */ { pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy39, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181); } break; - case 262: /* cmd ::= DESC full_table_name */ - case 263: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==263); + case 264: /* cmd ::= DESC full_table_name */ + case 265: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==265); { pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy778); } break; - case 264: /* cmd ::= RESET QUERY CACHE */ + case 266: /* cmd ::= RESET QUERY CACHE */ { pCxt->pRootNode = createResetQueryCacheStmt(pCxt); } break; - case 265: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ + case 267: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */ { pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy39, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 267: /* analyze_opt ::= ANALYZE */ - case 274: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==274); - case 448: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==448); + case 269: /* analyze_opt ::= ANALYZE */ + case 276: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==276); + case 450: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==450); { yymsp[0].minor.yy39 = true; } break; - case 268: /* explain_options ::= */ + case 270: /* explain_options ::= */ { yymsp[1].minor.yy778 = createDefaultExplainOptions(pCxt); } break; - case 269: /* explain_options ::= explain_options VERBOSE NK_BOOL */ + case 271: /* explain_options ::= explain_options VERBOSE NK_BOOL */ { yylhsminor.yy778 = setExplainVerbose(pCxt, yymsp[-2].minor.yy778, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 270: /* explain_options ::= explain_options RATIO NK_FLOAT */ + case 272: /* explain_options ::= explain_options RATIO NK_FLOAT */ { yylhsminor.yy778 = setExplainRatio(pCxt, yymsp[-2].minor.yy778, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 271: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ + case 273: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */ { pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy39, yymsp[-8].minor.yy39, &yymsp[-5].minor.yy181, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy380, yymsp[0].minor.yy276); } break; - case 272: /* cmd ::= DROP FUNCTION exists_opt function_name */ + case 274: /* cmd ::= DROP FUNCTION exists_opt function_name */ { pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy39, &yymsp[0].minor.yy181); } break; - case 277: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ + case 279: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */ { pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy39, &yymsp[-7].minor.yy181, yymsp[-4].minor.yy778, yymsp[-6].minor.yy778, yymsp[-3].minor.yy282, yymsp[-2].minor.yy778, yymsp[0].minor.yy778); } break; - case 278: /* cmd ::= DROP STREAM exists_opt stream_name */ + case 280: /* cmd ::= DROP STREAM exists_opt stream_name */ { pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy39, &yymsp[0].minor.yy181); } break; - case 280: /* stream_options ::= stream_options TRIGGER AT_ONCE */ + case 282: /* stream_options ::= stream_options TRIGGER AT_ONCE */ { ((SStreamOptions*)yymsp[-2].minor.yy778)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy778 = yymsp[-2].minor.yy778; } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 281: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ + case 283: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */ { ((SStreamOptions*)yymsp[-2].minor.yy778)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy778 = yymsp[-2].minor.yy778; } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 282: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ + case 284: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */ { ((SStreamOptions*)yymsp[-3].minor.yy778)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy778)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = yymsp[-3].minor.yy778; } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 284: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ + case 286: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */ { ((SStreamOptions*)yymsp[-3].minor.yy778)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy778 = yymsp[-3].minor.yy778; } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 286: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ - case 472: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==472); - case 490: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==490); + case 288: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */ + case 474: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==474); + case 492: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==492); { yymsp[-3].minor.yy778 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy778); } break; - case 287: /* cmd ::= KILL CONNECTION NK_INTEGER */ + case 289: /* cmd ::= KILL CONNECTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); } break; - case 288: /* cmd ::= KILL QUERY NK_STRING */ + case 290: /* cmd ::= KILL QUERY NK_STRING */ { pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 289: /* cmd ::= KILL TRANSACTION NK_INTEGER */ + case 291: /* cmd ::= KILL TRANSACTION NK_INTEGER */ { pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); } break; - case 290: /* cmd ::= BALANCE VGROUP */ + case 292: /* cmd ::= BALANCE VGROUP */ { pCxt->pRootNode = createBalanceVgroupStmt(pCxt); } break; - case 291: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ + case 293: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */ { pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } break; - case 292: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ + case 294: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */ { pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy282); } break; - case 293: /* cmd ::= SPLIT VGROUP NK_INTEGER */ + case 295: /* cmd ::= SPLIT VGROUP NK_INTEGER */ { pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); } break; - case 294: /* dnode_list ::= DNODE NK_INTEGER */ + case 296: /* dnode_list ::= DNODE NK_INTEGER */ { yymsp[-1].minor.yy282 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); } break; - case 296: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ + case 298: /* cmd ::= DELETE FROM full_table_name where_clause_opt */ { pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 298: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ + case 300: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */ { pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy778, yymsp[-2].minor.yy282, yymsp[0].minor.yy778); } break; - case 299: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ + case 301: /* cmd ::= INSERT INTO full_table_name query_or_subquery */ { pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy778, NULL, yymsp[0].minor.yy778); } break; - case 300: /* literal ::= NK_INTEGER */ + case 302: /* literal ::= NK_INTEGER */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 301: /* literal ::= NK_FLOAT */ + case 303: /* literal ::= NK_FLOAT */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 302: /* literal ::= NK_STRING */ + case 304: /* literal ::= NK_STRING */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 303: /* literal ::= NK_BOOL */ + case 305: /* literal ::= NK_BOOL */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 304: /* literal ::= TIMESTAMP NK_STRING */ + case 306: /* literal ::= TIMESTAMP NK_STRING */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 305: /* literal ::= duration_literal */ - case 315: /* signed_literal ::= signed */ yytestcase(yyruleno==315); - case 335: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==335); - case 336: /* expr_or_subquery ::= subquery */ yytestcase(yyruleno==336); - case 337: /* expression ::= literal */ yytestcase(yyruleno==337); - case 338: /* expression ::= pseudo_column */ yytestcase(yyruleno==338); - case 339: /* expression ::= column_reference */ yytestcase(yyruleno==339); - case 340: /* expression ::= function_expression */ yytestcase(yyruleno==340); - case 341: /* expression ::= case_when_expression */ yytestcase(yyruleno==341); - case 371: /* function_expression ::= literal_func */ yytestcase(yyruleno==371); - case 420: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==420); - case 424: /* boolean_primary ::= predicate */ yytestcase(yyruleno==424); - case 426: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==426); - case 427: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==427); - case 430: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==430); - case 432: /* table_reference ::= table_primary */ yytestcase(yyruleno==432); - case 433: /* table_reference ::= joined_table */ yytestcase(yyruleno==433); - case 437: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==437); - case 492: /* query_simple ::= query_specification */ yytestcase(yyruleno==492); - case 493: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==493); - case 496: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==496); - case 498: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==498); + case 307: /* literal ::= duration_literal */ + case 317: /* signed_literal ::= signed */ yytestcase(yyruleno==317); + case 337: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==337); + case 338: /* expr_or_subquery ::= subquery */ yytestcase(yyruleno==338); + case 339: /* expression ::= literal */ yytestcase(yyruleno==339); + case 340: /* expression ::= pseudo_column */ yytestcase(yyruleno==340); + case 341: /* expression ::= column_reference */ yytestcase(yyruleno==341); + case 342: /* expression ::= function_expression */ yytestcase(yyruleno==342); + case 343: /* expression ::= case_when_expression */ yytestcase(yyruleno==343); + case 373: /* function_expression ::= literal_func */ yytestcase(yyruleno==373); + case 422: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==422); + case 426: /* boolean_primary ::= predicate */ yytestcase(yyruleno==426); + case 428: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==428); + case 429: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==429); + case 432: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==432); + case 434: /* table_reference ::= table_primary */ yytestcase(yyruleno==434); + case 435: /* table_reference ::= joined_table */ yytestcase(yyruleno==435); + case 439: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==439); + case 494: /* query_simple ::= query_specification */ yytestcase(yyruleno==494); + case 495: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==495); + case 498: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==498); + case 500: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==500); { yylhsminor.yy778 = yymsp[0].minor.yy778; } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 306: /* literal ::= NULL */ + case 308: /* literal ::= NULL */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 307: /* literal ::= NK_QUESTION */ + case 309: /* literal ::= NK_QUESTION */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 308: /* duration_literal ::= NK_VARIABLE */ + case 310: /* duration_literal ::= NK_VARIABLE */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 309: /* signed ::= NK_INTEGER */ + case 311: /* signed ::= NK_INTEGER */ { yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 310: /* signed ::= NK_PLUS NK_INTEGER */ + case 312: /* signed ::= NK_PLUS NK_INTEGER */ { yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); } break; - case 311: /* signed ::= NK_MINUS NK_INTEGER */ + case 313: /* signed ::= NK_MINUS NK_INTEGER */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; @@ -4610,14 +4620,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 312: /* signed ::= NK_FLOAT */ + case 314: /* signed ::= NK_FLOAT */ { yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 313: /* signed ::= NK_PLUS NK_FLOAT */ + case 315: /* signed ::= NK_PLUS NK_FLOAT */ { yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); } break; - case 314: /* signed ::= NK_MINUS NK_FLOAT */ + case 316: /* signed ::= NK_MINUS NK_FLOAT */ { SToken t = yymsp[-1].minor.yy0; t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z; @@ -4625,57 +4635,57 @@ static YYACTIONTYPE yy_reduce( } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 316: /* signed_literal ::= NK_STRING */ + case 318: /* signed_literal ::= NK_STRING */ { yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 317: /* signed_literal ::= NK_BOOL */ + case 319: /* signed_literal ::= NK_BOOL */ { yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 318: /* signed_literal ::= TIMESTAMP NK_STRING */ + case 320: /* signed_literal ::= TIMESTAMP NK_STRING */ { yymsp[-1].minor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); } break; - case 319: /* signed_literal ::= duration_literal */ - case 321: /* signed_literal ::= literal_func */ yytestcase(yyruleno==321); - case 391: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==391); - case 453: /* select_item ::= common_expression */ yytestcase(yyruleno==453); - case 463: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==463); - case 497: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==497); - case 499: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==499); - case 512: /* search_condition ::= common_expression */ yytestcase(yyruleno==512); + case 321: /* signed_literal ::= duration_literal */ + case 323: /* signed_literal ::= literal_func */ yytestcase(yyruleno==323); + case 393: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==393); + case 455: /* select_item ::= common_expression */ yytestcase(yyruleno==455); + case 465: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==465); + case 499: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==499); + case 501: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==501); + case 514: /* search_condition ::= common_expression */ yytestcase(yyruleno==514); { yylhsminor.yy778 = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 320: /* signed_literal ::= NULL */ + case 322: /* signed_literal ::= NULL */ { yylhsminor.yy778 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 322: /* signed_literal ::= NK_QUESTION */ + case 324: /* signed_literal ::= NK_QUESTION */ { yylhsminor.yy778 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 342: /* expression ::= NK_LP expression NK_RP */ - case 425: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==425); - case 511: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==511); + case 344: /* expression ::= NK_LP expression NK_RP */ + case 427: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==427); + case 513: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==513); { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 343: /* expression ::= NK_PLUS expr_or_subquery */ + case 345: /* expression ::= NK_PLUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 344: /* expression ::= NK_MINUS expr_or_subquery */ + case 346: /* expression ::= NK_MINUS expr_or_subquery */ { SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy778), NULL)); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 345: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ + case 347: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4683,7 +4693,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 346: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ + case 348: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4691,7 +4701,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 347: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ + case 349: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4699,7 +4709,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 348: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ + case 350: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4707,7 +4717,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 349: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ + case 351: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4715,14 +4725,14 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 350: /* expression ::= column_reference NK_ARROW NK_STRING */ + case 352: /* expression ::= column_reference NK_ARROW NK_STRING */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 351: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ + case 353: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4730,7 +4740,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 352: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ + case 354: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4738,70 +4748,70 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 355: /* column_reference ::= column_name */ + case 357: /* column_reference ::= column_name */ { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy181, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy181)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 356: /* column_reference ::= table_name NK_DOT column_name */ + case 358: /* column_reference ::= table_name NK_DOT column_name */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181, createColumnNode(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy181)); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 357: /* pseudo_column ::= ROWTS */ - case 358: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==358); - case 360: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==360); - case 361: /* pseudo_column ::= QEND */ yytestcase(yyruleno==361); - case 362: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==362); - case 363: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==363); - case 364: /* pseudo_column ::= WEND */ yytestcase(yyruleno==364); - case 365: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==365); - case 366: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==366); - case 367: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==367); - case 373: /* literal_func ::= NOW */ yytestcase(yyruleno==373); + case 359: /* pseudo_column ::= ROWTS */ + case 360: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==360); + case 362: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==362); + case 363: /* pseudo_column ::= QEND */ yytestcase(yyruleno==363); + case 364: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==364); + case 365: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==365); + case 366: /* pseudo_column ::= WEND */ yytestcase(yyruleno==366); + case 367: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==367); + case 368: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==368); + case 369: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==369); + case 375: /* literal_func ::= NOW */ yytestcase(yyruleno==375); { yylhsminor.yy778 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 359: /* pseudo_column ::= table_name NK_DOT TBNAME */ + case 361: /* pseudo_column ::= table_name NK_DOT TBNAME */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy181)))); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 368: /* function_expression ::= function_name NK_LP expression_list NK_RP */ - case 369: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==369); + case 370: /* function_expression ::= function_name NK_LP expression_list NK_RP */ + case 371: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==371); { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy181, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy181, yymsp[-1].minor.yy282)); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 370: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ + case 372: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-1].minor.yy380)); } yymsp[-5].minor.yy778 = yylhsminor.yy778; break; - case 372: /* literal_func ::= noarg_func NK_LP NK_RP */ + case 374: /* literal_func ::= noarg_func NK_LP NK_RP */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy181, NULL)); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 387: /* star_func_para_list ::= NK_STAR */ + case 389: /* star_func_para_list ::= NK_STAR */ { yylhsminor.yy282 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); } yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 392: /* star_func_para ::= table_name NK_DOT NK_STAR */ - case 456: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==456); + case 394: /* star_func_para ::= table_name NK_DOT NK_STAR */ + case 458: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==458); { yylhsminor.yy778 = createColumnNode(pCxt, &yymsp[-2].minor.yy181, &yymsp[0].minor.yy0); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 393: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ + case 395: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy282, yymsp[-1].minor.yy778)); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 394: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ + case 396: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-2].minor.yy282, yymsp[-1].minor.yy778)); } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 397: /* when_then_expr ::= WHEN common_expression THEN common_expression */ + case 399: /* when_then_expr ::= WHEN common_expression THEN common_expression */ { yymsp[-3].minor.yy778 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), releaseRawExprNode(pCxt, yymsp[0].minor.yy778)); } break; - case 399: /* case_when_else_opt ::= ELSE common_expression */ + case 401: /* case_when_else_opt ::= ELSE common_expression */ { yymsp[-1].minor.yy778 = releaseRawExprNode(pCxt, yymsp[0].minor.yy778); } break; - case 400: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ - case 405: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==405); + case 402: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */ + case 407: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==407); { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4809,7 +4819,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 401: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ + case 403: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4817,7 +4827,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-4].minor.yy778 = yylhsminor.yy778; break; - case 402: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ + case 404: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4825,71 +4835,71 @@ static YYACTIONTYPE yy_reduce( } yymsp[-5].minor.yy778 = yylhsminor.yy778; break; - case 403: /* predicate ::= expr_or_subquery IS NULL */ + case 405: /* predicate ::= expr_or_subquery IS NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), NULL)); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 404: /* predicate ::= expr_or_subquery IS NOT NULL */ + case 406: /* predicate ::= expr_or_subquery IS NOT NULL */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy778); yylhsminor.yy778 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), NULL)); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 406: /* compare_op ::= NK_LT */ + case 408: /* compare_op ::= NK_LT */ { yymsp[0].minor.yy682 = OP_TYPE_LOWER_THAN; } break; - case 407: /* compare_op ::= NK_GT */ + case 409: /* compare_op ::= NK_GT */ { yymsp[0].minor.yy682 = OP_TYPE_GREATER_THAN; } break; - case 408: /* compare_op ::= NK_LE */ + case 410: /* compare_op ::= NK_LE */ { yymsp[0].minor.yy682 = OP_TYPE_LOWER_EQUAL; } break; - case 409: /* compare_op ::= NK_GE */ + case 411: /* compare_op ::= NK_GE */ { yymsp[0].minor.yy682 = OP_TYPE_GREATER_EQUAL; } break; - case 410: /* compare_op ::= NK_NE */ + case 412: /* compare_op ::= NK_NE */ { yymsp[0].minor.yy682 = OP_TYPE_NOT_EQUAL; } break; - case 411: /* compare_op ::= NK_EQ */ + case 413: /* compare_op ::= NK_EQ */ { yymsp[0].minor.yy682 = OP_TYPE_EQUAL; } break; - case 412: /* compare_op ::= LIKE */ + case 414: /* compare_op ::= LIKE */ { yymsp[0].minor.yy682 = OP_TYPE_LIKE; } break; - case 413: /* compare_op ::= NOT LIKE */ + case 415: /* compare_op ::= NOT LIKE */ { yymsp[-1].minor.yy682 = OP_TYPE_NOT_LIKE; } break; - case 414: /* compare_op ::= MATCH */ + case 416: /* compare_op ::= MATCH */ { yymsp[0].minor.yy682 = OP_TYPE_MATCH; } break; - case 415: /* compare_op ::= NMATCH */ + case 417: /* compare_op ::= NMATCH */ { yymsp[0].minor.yy682 = OP_TYPE_NMATCH; } break; - case 416: /* compare_op ::= CONTAINS */ + case 418: /* compare_op ::= CONTAINS */ { yymsp[0].minor.yy682 = OP_TYPE_JSON_CONTAINS; } break; - case 417: /* in_op ::= IN */ + case 419: /* in_op ::= IN */ { yymsp[0].minor.yy682 = OP_TYPE_IN; } break; - case 418: /* in_op ::= NOT IN */ + case 420: /* in_op ::= NOT IN */ { yymsp[-1].minor.yy682 = OP_TYPE_NOT_IN; } break; - case 419: /* in_predicate_value ::= NK_LP literal_list NK_RP */ + case 421: /* in_predicate_value ::= NK_LP literal_list NK_RP */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy282)); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 421: /* boolean_value_expression ::= NOT boolean_primary */ + case 423: /* boolean_value_expression ::= NOT boolean_primary */ { SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy778), NULL)); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 422: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ + case 424: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4897,7 +4907,7 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 423: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ + case 425: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */ { SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy778); SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy778); @@ -4905,52 +4915,52 @@ static YYACTIONTYPE yy_reduce( } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 429: /* from_clause_opt ::= FROM table_reference_list */ - case 458: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==458); - case 486: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==486); + case 431: /* from_clause_opt ::= FROM table_reference_list */ + case 460: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==460); + case 488: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==488); { yymsp[-1].minor.yy778 = yymsp[0].minor.yy778; } break; - case 431: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ + case 433: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */ { yylhsminor.yy778 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy778, yymsp[0].minor.yy778, NULL); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 434: /* table_primary ::= table_name alias_opt */ + case 436: /* table_primary ::= table_name alias_opt */ { yylhsminor.yy778 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 435: /* table_primary ::= db_name NK_DOT table_name alias_opt */ + case 437: /* table_primary ::= db_name NK_DOT table_name alias_opt */ { yylhsminor.yy778 = createRealTableNode(pCxt, &yymsp[-3].minor.yy181, &yymsp[-1].minor.yy181, &yymsp[0].minor.yy181); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 436: /* table_primary ::= subquery alias_opt */ + case 438: /* table_primary ::= subquery alias_opt */ { yylhsminor.yy778 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778), &yymsp[0].minor.yy181); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 438: /* alias_opt ::= */ + case 440: /* alias_opt ::= */ { yymsp[1].minor.yy181 = nil_token; } break; - case 439: /* alias_opt ::= table_alias */ + case 441: /* alias_opt ::= table_alias */ { yylhsminor.yy181 = yymsp[0].minor.yy181; } yymsp[0].minor.yy181 = yylhsminor.yy181; break; - case 440: /* alias_opt ::= AS table_alias */ + case 442: /* alias_opt ::= AS table_alias */ { yymsp[-1].minor.yy181 = yymsp[0].minor.yy181; } break; - case 441: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ - case 442: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==442); + case 443: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */ + case 444: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==444); { yymsp[-2].minor.yy778 = yymsp[-1].minor.yy778; } break; - case 443: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ + case 445: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */ { yylhsminor.yy778 = createJoinTableNode(pCxt, yymsp[-4].minor.yy202, yymsp[-5].minor.yy778, yymsp[-2].minor.yy778, yymsp[0].minor.yy778); } yymsp[-5].minor.yy778 = yylhsminor.yy778; break; - case 444: /* join_type ::= */ + case 446: /* join_type ::= */ { yymsp[1].minor.yy202 = JOIN_TYPE_INNER; } break; - case 445: /* join_type ::= INNER */ + case 447: /* join_type ::= INNER */ { yymsp[0].minor.yy202 = JOIN_TYPE_INNER; } break; - case 446: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ + case 448: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */ { yymsp[-11].minor.yy778 = createSelectStmt(pCxt, yymsp[-10].minor.yy39, yymsp[-9].minor.yy282, yymsp[-8].minor.yy778); yymsp[-11].minor.yy778 = addWhereClause(pCxt, yymsp[-11].minor.yy778, yymsp[-7].minor.yy778); @@ -4963,73 +4973,73 @@ static YYACTIONTYPE yy_reduce( yymsp[-11].minor.yy778 = addFillClause(pCxt, yymsp[-11].minor.yy778, yymsp[-3].minor.yy778); } break; - case 449: /* set_quantifier_opt ::= ALL */ + case 451: /* set_quantifier_opt ::= ALL */ { yymsp[0].minor.yy39 = false; } break; - case 452: /* select_item ::= NK_STAR */ + case 454: /* select_item ::= NK_STAR */ { yylhsminor.yy778 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); } yymsp[0].minor.yy778 = yylhsminor.yy778; break; - case 454: /* select_item ::= common_expression column_alias */ - case 464: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==464); + case 456: /* select_item ::= common_expression column_alias */ + case 466: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==466); { yylhsminor.yy778 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778), &yymsp[0].minor.yy181); } yymsp[-1].minor.yy778 = yylhsminor.yy778; break; - case 455: /* select_item ::= common_expression AS column_alias */ - case 465: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==465); + case 457: /* select_item ::= common_expression AS column_alias */ + case 467: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==467); { yylhsminor.yy778 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), &yymsp[0].minor.yy181); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 460: /* partition_by_clause_opt ::= PARTITION BY partition_list */ - case 482: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==482); - case 501: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==501); + case 462: /* partition_by_clause_opt ::= PARTITION BY partition_list */ + case 484: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==484); + case 503: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==503); { yymsp[-2].minor.yy282 = yymsp[0].minor.yy282; } break; - case 467: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ + case 469: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */ { yymsp[-5].minor.yy778 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } break; - case 468: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ + case 470: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */ { yymsp[-3].minor.yy778 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } break; - case 469: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ + case 471: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-5].minor.yy778 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), NULL, yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 470: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ + case 472: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */ { yymsp[-7].minor.yy778 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy778), releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), yymsp[-1].minor.yy778, yymsp[0].minor.yy778); } break; - case 474: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ + case 476: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */ { yymsp[-3].minor.yy778 = createFillNode(pCxt, yymsp[-1].minor.yy381, NULL); } break; - case 475: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ + case 477: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */ { yymsp[-5].minor.yy778 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy282)); } break; - case 476: /* fill_mode ::= NONE */ + case 478: /* fill_mode ::= NONE */ { yymsp[0].minor.yy381 = FILL_MODE_NONE; } break; - case 477: /* fill_mode ::= PREV */ + case 479: /* fill_mode ::= PREV */ { yymsp[0].minor.yy381 = FILL_MODE_PREV; } break; - case 478: /* fill_mode ::= NULL */ + case 480: /* fill_mode ::= NULL */ { yymsp[0].minor.yy381 = FILL_MODE_NULL; } break; - case 479: /* fill_mode ::= LINEAR */ + case 481: /* fill_mode ::= LINEAR */ { yymsp[0].minor.yy381 = FILL_MODE_LINEAR; } break; - case 480: /* fill_mode ::= NEXT */ + case 482: /* fill_mode ::= NEXT */ { yymsp[0].minor.yy381 = FILL_MODE_NEXT; } break; - case 483: /* group_by_list ::= expr_or_subquery */ + case 485: /* group_by_list ::= expr_or_subquery */ { yylhsminor.yy282 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } yymsp[0].minor.yy282 = yylhsminor.yy282; break; - case 484: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ + case 486: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */ { yylhsminor.yy282 = addNodeToList(pCxt, yymsp[-2].minor.yy282, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy778))); } yymsp[-2].minor.yy282 = yylhsminor.yy282; break; - case 488: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ + case 490: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */ { yymsp[-5].minor.yy778 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy778), releaseRawExprNode(pCxt, yymsp[-1].minor.yy778)); } break; - case 491: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ + case 493: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */ { yylhsminor.yy778 = addOrderByClause(pCxt, yymsp[-3].minor.yy778, yymsp[-2].minor.yy282); yylhsminor.yy778 = addSlimitClause(pCxt, yylhsminor.yy778, yymsp[-1].minor.yy778); @@ -5037,50 +5047,50 @@ static YYACTIONTYPE yy_reduce( } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 494: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ + case 496: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */ { yylhsminor.yy778 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy778, yymsp[0].minor.yy778); } yymsp[-3].minor.yy778 = yylhsminor.yy778; break; - case 495: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ + case 497: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */ { yylhsminor.yy778 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy778, yymsp[0].minor.yy778); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 503: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ - case 507: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==507); + case 505: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */ + case 509: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==509); { yymsp[-1].minor.yy778 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); } break; - case 504: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ - case 508: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==508); + case 506: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */ + case 510: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==510); { yymsp[-3].minor.yy778 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 505: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ - case 509: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==509); + case 507: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */ + case 511: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==511); { yymsp[-3].minor.yy778 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); } break; - case 510: /* subquery ::= NK_LP query_expression NK_RP */ + case 512: /* subquery ::= NK_LP query_expression NK_RP */ { yylhsminor.yy778 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy778); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 515: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ + case 517: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */ { yylhsminor.yy778 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy778), yymsp[-1].minor.yy14, yymsp[0].minor.yy305); } yymsp[-2].minor.yy778 = yylhsminor.yy778; break; - case 516: /* ordering_specification_opt ::= */ + case 518: /* ordering_specification_opt ::= */ { yymsp[1].minor.yy14 = ORDER_ASC; } break; - case 517: /* ordering_specification_opt ::= ASC */ + case 519: /* ordering_specification_opt ::= ASC */ { yymsp[0].minor.yy14 = ORDER_ASC; } break; - case 518: /* ordering_specification_opt ::= DESC */ + case 520: /* ordering_specification_opt ::= DESC */ { yymsp[0].minor.yy14 = ORDER_DESC; } break; - case 519: /* null_ordering_opt ::= */ + case 521: /* null_ordering_opt ::= */ { yymsp[1].minor.yy305 = NULL_ORDER_DEFAULT; } break; - case 520: /* null_ordering_opt ::= NULLS FIRST */ + case 522: /* null_ordering_opt ::= NULLS FIRST */ { yymsp[-1].minor.yy305 = NULL_ORDER_FIRST; } break; - case 521: /* null_ordering_opt ::= NULLS LAST */ + case 523: /* null_ordering_opt ::= NULLS LAST */ { yymsp[-1].minor.yy305 = NULL_ORDER_LAST; } break; default: From 18da7fc3eb94a898cf7a53165da284708cc3554c Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 20 Oct 2022 17:43:49 +0800 Subject: [PATCH 58/99] fix: fix param missing issue --- source/libs/catalog/src/catalog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/catalog/src/catalog.c b/source/libs/catalog/src/catalog.c index 118b631f5d..a1dc2e9a58 100644 --- a/source/libs/catalog/src/catalog.c +++ b/source/libs/catalog/src/catalog.c @@ -788,7 +788,7 @@ int32_t catalogGetDBVgInfo(SCatalog* pCtg, SRequestConnInfo* pConn, const char* SCtgDBCache* dbCache = NULL; int32_t code = 0; SDBVgInfo* dbInfo = NULL; - CTG_ERR_JRET(ctgGetDBVgInfo(pCtg, pConn, dbFName, &dbCache, &dbInfo)); + CTG_ERR_JRET(ctgGetDBVgInfo(pCtg, pConn, dbFName, &dbCache, &dbInfo, NULL)); if (dbCache) { dbInfo = dbCache->vgCache.vgInfo; } From 062faacc38ae49aa2e731706ac7ff1c7ad055189 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 18:01:58 +0800 Subject: [PATCH 59/99] Update compatibility.py --- tests/system-test/0-others/compatibility.py | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index 988dc9414c..4fa75b75f1 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -84,21 +84,21 @@ class TDTestCase: tableNumbers=100 recordNumbers1=100 recordNumbers2=1000 -# tdsqlF=tdCom.newTdSql() -# print(tdsqlF) -# tdsqlF.query(f"SELECT SERVER_VERSION();") -# print(tdsqlF.query(f"SELECT SERVER_VERSION();")) -# oldServerVersion=tdsqlF.queryResult[0][0] -# tdLog.info(f"Base server version is {oldServerVersion}") -# tdsqlF.query(f"SELECT CLIENT_VERSION();") -# # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison -# oldClientVersion=tdsqlF.queryResult[0][0] -# tdLog.info(f"Base client version is {oldClientVersion}") + tdsqlF=tdCom.newTdSql() + print(tdsqlF) + tdsqlF.query(f"SELECT SERVER_VERSION();") + print(tdsqlF.query(f"SELECT SERVER_VERSION();")) + oldServerVersion=tdsqlF.queryResult[0][0] + tdLog.info(f"Base server version is {oldServerVersion}") + tdsqlF.query(f"SELECT CLIENT_VERSION();") + # the oldClientVersion can't be updated in the same python process,so the version is new compiled verison + oldClientVersion=tdsqlF.queryResult[0][0] + tdLog.info(f"Base client version is {oldClientVersion}") -# tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") -# tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") -# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") -# sleep(3) + tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") + tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") + os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") + sleep(3) # # tdsqlF.query(f"select count(*) from {stb}") # # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) From 3163f757331fca963c127fc8bd7f61704765030e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 20 Oct 2022 18:11:37 +0800 Subject: [PATCH 60/99] enh: alter db replica --- source/dnode/mnode/impl/src/mndDb.c | 15 ------ source/dnode/mnode/impl/src/mndVgroup.c | 72 +++++++++++++++++-------- 2 files changed, 50 insertions(+), 37 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index ebf3382b1b..13990f4ba7 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -631,29 +631,18 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) { terrno = TSDB_CODE_MND_DB_OPTION_UNCHANGED; if (pAlter->buffer > 0 && pAlter->buffer != pDb->cfg.buffer) { -#if 0 - terrno = TSDB_CODE_OPS_NOT_SUPPORT; - return terrno; -#else pDb->cfg.buffer = pAlter->buffer; terrno = 0; -#endif } if (pAlter->pages > 0 && pAlter->pages != pDb->cfg.pages) { -#if 0 - terrno = TSDB_CODE_OPS_NOT_SUPPORT; - return terrno; -#else pDb->cfg.pages = pAlter->pages; terrno = 0; -#endif } if (pAlter->pageSize > 0 && pAlter->pageSize != pDb->cfg.pageSize) { #if 1 terrno = TSDB_CODE_OPS_NOT_SUPPORT; - return terrno; #else pDb->cfg.pageSize = pAlter->pageSize; terrno = 0; @@ -710,13 +699,9 @@ static int32_t mndSetDbCfgFromAlterDbReq(SDbObj *pDb, SAlterDbReq *pAlter) { } if (pAlter->replications > 0 && pAlter->replications != pDb->cfg.replications) { -#if 1 - terrno = TSDB_CODE_OPS_NOT_SUPPORT; -#else pDb->cfg.replications = pAlter->replications; pDb->vgVersion++; terrno = 0; -#endif } return terrno; diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 91673a7ae9..11f5a9f12a 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -315,12 +315,14 @@ static void *mndBuildAlterVnodeConfigReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pV return pReq; } -static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVgObj *pVgroup, +static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDbObj *pDb, SVgObj *pVgroup, int32_t dnodeId, int32_t *pContLen) { - SAlterVnodeReplicaReq alterReq = {0}; - alterReq.vgId = pVgroup->vgId; - alterReq.strict = pDb->cfg.strict; - alterReq.replica = pVgroup->replica; + SAlterVnodeReplicaReq alterReq = { + alterReq.vgId = pVgroup->vgId, + alterReq.strict = pDb->cfg.strict, + alterReq.replica = pVgroup->replica, + alterReq.selfIndex = -1, + }; for (int32_t v = 0; v < pVgroup->replica; ++v) { SReplica *pReplica = &alterReq.replicas[v]; @@ -335,7 +337,7 @@ static void *mndBuildAlterVnodeReplicaReq(SMnode *pMnode, SDnodeObj *pDnode, SDb memcpy(pReplica->fqdn, pVgidDnode->fqdn, TSDB_FQDN_LEN); mndReleaseDnode(pMnode, pVgidDnode); - if (pDnode->id == pVgid->dnodeId) { + if (dnodeId == pVgid->dnodeId) { alterReq.selfIndex = v; } } @@ -1004,7 +1006,9 @@ int32_t mndAddAlterVnodeConfirmAction(SMnode *pMnode, STrans *pTrans, SDbObj *pD return 0; } -int32_t mndAddAlterVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, tmsg_t msgType) { +int32_t mndAddAlterVnodeHashRangeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup) { return 0; } + +int32_t mndAddAlterVnodeConfigAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup) { STransAction action = {0}; action.epSet = mndGetVgroupEpset(pMnode, pVgroup); @@ -1014,7 +1018,31 @@ int32_t mndAddAlterVnodeAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgO action.pCont = pReq; action.contLen = contLen; - action.msgType = msgType; + action.msgType = TDMT_VND_ALTER_CONFIG; + + if (mndTransAppendRedoAction(pTrans, &action) != 0) { + taosMemoryFree(pReq); + return -1; + } + + return 0; +} + +int32_t mndAddAlterVnodeReplicaAction(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgObj *pVgroup, int32_t dnodeId) { + SDnodeObj *pDnode = mndAcquireDnode(pMnode, dnodeId); + if (pDnode == NULL) return -1; + + STransAction action = {0}; + action.epSet = mndGetDnodeEpset(pDnode); + mndReleaseDnode(pMnode, pDnode); + + int32_t contLen = 0; + void *pReq = mndBuildAlterVnodeReplicaReq(pMnode, pDb, pVgroup, dnodeId, &contLen); + if (pReq == NULL) return -1; + + action.pCont = pReq; + action.contLen = contLen; + action.msgType = TDMT_VND_ALTER_REPLICA; if (mndTransAppendRedoAction(pTrans, &action) != 0) { taosMemoryFree(pReq); @@ -1070,7 +1098,7 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, mInfo("vgId:%d, will add 1 vnodes", pVgroup->vgId); if (mndAddVnodeToVgroup(pMnode, &newVg, pArray) != 0) return -1; if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg, &newVg.vnodeGid[newVg.replica - 1]) != 0) return -1; - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg, TDMT_VND_ALTER_REPLICA) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, -1) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; mInfo("vgId:%d, will remove 1 vnodes", pVgroup->vgId); @@ -1078,7 +1106,7 @@ int32_t mndSetMoveVgroupInfoToTrans(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVnodeGid del = newVg.vnodeGid[vnIndex]; newVg.vnodeGid[vnIndex] = newVg.vnodeGid[newVg.replica]; memset(&newVg.vnodeGid[newVg.replica], 0, sizeof(SVnodeGid)); - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg, TDMT_VND_ALTER_REPLICA) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg, -1) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg, &del, true) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg) != 0) return -1; @@ -1152,7 +1180,7 @@ static int32_t mndAddIncVgroupReplicaToTrans(SMnode *pMnode, STrans *pTrans, SDb pGid->syncState = TAOS_SYNC_STATE_ERROR; if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, pVgroup, pGid) != 0) return -1; - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, pVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, pVgroup, -1) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, pVgroup) != 0) return -1; return 0; @@ -1178,7 +1206,7 @@ static int32_t mndAddDecVgroupReplicaFromTrans(SMnode *pMnode, STrans *pTrans, S memcpy(pGid, &pVgroup->vnodeGid[pVgroup->replica], sizeof(SVnodeGid)); memset(&pVgroup->vnodeGid[pVgroup->replica], 0, sizeof(SVnodeGid)); - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, pVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, pVgroup, -1) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pDb, pVgroup, &delGid, true) != 0) return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, pVgroup) != 0) return -1; @@ -1538,7 +1566,7 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb memcpy(&newVgroup, pVgroup, sizeof(SVgObj)); if (pVgroup->replica <= 0 || pVgroup->replica == pNewDb->cfg.replications) { - if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, pVgroup, TDMT_VND_ALTER_CONFIG) != 0) return -1; + if (mndAddAlterVnodeConfigAction(pMnode, pTrans, pNewDb, pVgroup) != 0) return -1; if (mndCheckDnodeMemory(pMnode, pOldDb, pNewDb, &newVgroup, pVgroup, pArray) != 0) return -1; return 0; } @@ -1553,11 +1581,10 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb if (mndAddVnodeToVgroup(pMnode, &newVgroup, pArray) != 0) return -1; if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[1]) != 0) return -1; if (mndAddCreateVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &newVgroup.vnodeGid[2]) != 0) return -1; - if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; - } - - if (newVgroup.replica == 3 && pNewDb->cfg.replications == 1) { + } else if (newVgroup.replica == 3 && pNewDb->cfg.replications == 1) { mInfo("db:%s, vgId:%d, will remove 2 vnodes, vn:0 dnode:%d vn:1 dnode:%d vn:2 dnode:%d", pVgroup->dbName, pVgroup->vgId, pVgroup->vnodeGid[0].dnodeId, pVgroup->vnodeGid[1].dnodeId, pVgroup->vnodeGid[2].dnodeId); @@ -1567,7 +1594,8 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb if (mndRemoveVnodeFromVgroup(pMnode, &newVgroup, pArray, &del2) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del1, true) != 0) return -1; if (mndAddDropVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, &del2, true) != 0) return -1; - if (mndAddAlterVnodeAction(pMnode, pTrans, pNewDb, &newVgroup, TDMT_VND_ALTER_REPLICA) != 0) return -1; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, &newVgroup, newVgroup.vnodeGid[0].dnodeId) != 0) + return -1; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, &newVgroup) != 0) return -1; } else { return -1; @@ -1622,12 +1650,12 @@ static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj if (newVg1.replica == 1) { if (mndAddVnodeToVgroup(pMnode, &newVg1, pArray) != 0) goto _OVER; if (mndAddCreateVnodeAction(pMnode, pTrans, pDb, &newVg1, &newVg1.vnodeGid[1]) != 0) goto _OVER; - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg1, TDMT_VND_ALTER_REPLICA) != 0) goto _OVER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, -1) != 0) goto _OVER; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; } else if (newVg1.replica == 3) { SVnodeGid del1 = {0}; if (mndRemoveVnodeFromVgroup(pMnode, &newVg1, pArray, &del1) != 0) goto _OVER; - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg1, TDMT_VND_ALTER_REPLICA) != 0) goto _OVER; + if (mndAddAlterVnodeReplicaAction(pMnode, pTrans, pDb, &newVg1, -1) != 0) goto _OVER; if (mndAddDropVnodeAction(pMnode, pTrans, pDb, &newVg1, &del1, true) != 0) goto _OVER; if (mndAddAlterVnodeConfirmAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; } else { @@ -1645,8 +1673,8 @@ static int32_t mndSplitVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb, SVgObj memcpy(&newVg2.vnodeGid[0], &newVg2.vnodeGid[1], sizeof(SVnodeGid)); memset(&newVg1.vnodeGid[1], 0, sizeof(SVnodeGid)); - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg1, TDMT_VND_ALTER_HASHRANGE) != 0) goto _OVER; - if (mndAddAlterVnodeAction(pMnode, pTrans, pDb, &newVg2, TDMT_VND_ALTER_HASHRANGE) != 0) goto _OVER; + if (mndAddAlterVnodeHashRangeAction(pMnode, pTrans, pDb, &newVg1) != 0) goto _OVER; + if (mndAddAlterVnodeHashRangeAction(pMnode, pTrans, pDb, &newVg2) != 0) goto _OVER; // adjust vgroup if (mndBuildAlterVgroupAction(pMnode, pTrans, pDb, pDb, &newVg1, pArray) != 0) goto _OVER; From 8f28a9c9d2cc495d111ba7d36cc285c884a1ac5c Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Thu, 20 Oct 2022 18:18:07 +0800 Subject: [PATCH 61/99] import format error --- tools/shell/src/shellEngine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index e216d597a3..d5c765e8c5 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -282,6 +282,7 @@ char *shellFormatTimestamp(char *buf, int64_t val, int32_t precision) { void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, int32_t length, int32_t precision) { if (val == NULL) { + taosFprintfFile(pFile, "NULL"); return; } From e831c84bf59d300692046f8d52163a0e1f3b11ab Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 20 Oct 2022 18:30:59 +0800 Subject: [PATCH 62/99] chore: rm tools/taosws-rs (#17530) --- tools/taosws-rs | 1 - 1 file changed, 1 deletion(-) delete mode 160000 tools/taosws-rs diff --git a/tools/taosws-rs b/tools/taosws-rs deleted file mode 160000 index 1bdfca396c..0000000000 --- a/tools/taosws-rs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1bdfca396cd6730cdc334e06fc7b2156dd1239a0 From 892bdb75fcc92c0514bbb2a57c34d3bf83359d8a Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 20 Oct 2022 18:39:35 +0800 Subject: [PATCH 63/99] fix(shell): fixed chinese input error --- tools/shell/src/shellAuto.c | 11 ++++++----- tools/shell/src/shellCommand.c | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/tools/shell/src/shellAuto.c b/tools/shell/src/shellAuto.c index 8d980ba653..e7dfd45c60 100644 --- a/tools/shell/src/shellAuto.c +++ b/tools/shell/src/shellAuto.c @@ -30,6 +30,7 @@ void shellClearScreen(int32_t ecmd_pos, int32_t cursor_pos); void shellGetPrevCharSize(const char* str, int32_t pos, int32_t* size, int32_t* width); void shellShowOnScreen(SShellCmd* cmd); void shellInsertChar(SShellCmd* cmd, char* c, int size); +void shellInsertStr(SShellCmd* cmd, char* str, int size); bool appendAfterSelect(TAOS* con, SShellCmd* cmd, char* p, int32_t len); typedef struct SAutoPtr { @@ -1099,7 +1100,7 @@ void printScreen(TAOS* con, SShellCmd* cmd, SWords* match) { } // insert new - shellInsertChar(cmd, (char*)str, strLen); + shellInsertStr(cmd, (char*)str, strLen); } // main key press tab , matched return true else false @@ -1220,7 +1221,7 @@ bool fillWithType(TAOS* con, SShellCmd* cmd, char* pre, int type) { // show int count = strlen(part); - shellInsertChar(cmd, part, count); + shellInsertStr(cmd, part, count); cntDel = count; // next press tab delete current append count taosMemoryFree(str); @@ -1247,7 +1248,7 @@ bool fillTableName(TAOS* con, SShellCmd* cmd, char* pre) { // show int count = strlen(part); - shellInsertChar(cmd, part, count); + shellInsertStr(cmd, part, count); cntDel = count; // next press tab delete current append count taosMemoryFree(str); @@ -1371,7 +1372,7 @@ bool appendAfterSelect(TAOS* con, SShellCmd* cmd, char* sql, int32_t len) { bool fieldEnd = fieldsInputEnd(p); // check fields input end then insert from keyword if (fieldEnd && p[len - 1] == ' ') { - shellInsertChar(cmd, "from", 4); + shellInsertStr(cmd, "from", 4); taosMemoryFree(p); return true; } @@ -1569,7 +1570,7 @@ bool matchOther(TAOS* con, SShellCmd* cmd) { if (p[len - 1] == '\\') { // append '\G' char a[] = "G;"; - shellInsertChar(cmd, a, 2); + shellInsertStr(cmd, a, 2); return true; } diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index 047aeb5b95..29aea21d54 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -47,6 +47,7 @@ void shellClearScreen(int32_t ecmd_pos, int32_t cursor_pos); void shellShowOnScreen(SShellCmd *cmd); void shellGetPrevCharSize(const char *str, int32_t pos, int32_t *size, int32_t *width); void shellInsertChar(SShellCmd *cmd, char *c, int size); +void shellInsertString(SShellCmd *cmd, char *str, int size); int32_t shellCountPrefixOnes(uint8_t c) { uint8_t mask = 127; @@ -114,6 +115,27 @@ void shellInsertChar(SShellCmd *cmd, char *c, int32_t size) { #endif } +// insert string . count is str char count +void shellInsertStr(SShellCmd *cmd, char *str, int32_t size) { + shellClearScreen(cmd->endOffset + PSIZE, cmd->screenOffset + PSIZE); + /* update the buffer */ + memmove(cmd->command + cmd->cursorOffset + size, cmd->command + cmd->cursorOffset, + cmd->commandSize - cmd->cursorOffset); + memcpy(cmd->command + cmd->cursorOffset, str, size); + /* update the values */ + cmd->commandSize += size; + cmd->cursorOffset += size; + cmd->screenOffset += size; + cmd->endOffset += size; + + // set string end + cmd->command[cmd->commandSize] = 0; +#ifdef WINDOWS +#else + shellShowOnScreen(cmd); +#endif +} + void shellBackspaceChar(SShellCmd *cmd) { assert(cmd->cursorOffset <= cmd->commandSize && cmd->endOffset >= cmd->screenOffset); From 14c02530b50180ecde97d826b4d7f6b4d9c1b0ed Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 20 Oct 2022 18:46:39 +0800 Subject: [PATCH 64/99] fix(shell): fixed chinese input error 1 --- tools/shell/src/shellCommand.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index 29aea21d54..a0ac8e07c7 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -102,11 +102,9 @@ void shellInsertChar(SShellCmd *cmd, char *c, int32_t size) { /* update the values */ cmd->commandSize += size; cmd->cursorOffset += size; - for (int i = 0; i < size; i++) { - taosMbToWchar(&wc, c + i, size); - cmd->screenOffset += taosWcharWidth(wc); - cmd->endOffset += taosWcharWidth(wc); - } + cmd->screenOffset += taosWcharWidth(wc); + cmd->endOffset += taosWcharWidth(wc); + // set string end cmd->command[cmd->commandSize] = 0; #ifdef WINDOWS From c2d071a2e45c37fe7b63f4ae503d86fe93770704 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 20 Oct 2022 19:43:33 +0800 Subject: [PATCH 65/99] fix: add debug log --- source/libs/qcom/src/querymsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/qcom/src/querymsg.c b/source/libs/qcom/src/querymsg.c index a6f26088de..d393701721 100644 --- a/source/libs/qcom/src/querymsg.c +++ b/source/libs/qcom/src/querymsg.c @@ -529,7 +529,7 @@ int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) { } if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) { - qError("tDeserializeSDbCfgRsp failed, msgSize:%d", msgSize); + qError("tDeserializeSDbCfgRsp failed, msgSize:%d,dbCfgRsp:%d", msgSize, sizeof(out)); return TSDB_CODE_INVALID_MSG; } From f5e1c440dcc0d83f4ffb0a6d5fa10e06b61cad5a Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 20 Oct 2022 19:50:35 +0800 Subject: [PATCH 66/99] fix: fix ut issue --- source/libs/parser/test/mockCatalogService.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/parser/test/mockCatalogService.h b/source/libs/parser/test/mockCatalogService.h index c0330692ee..d9d2185728 100644 --- a/source/libs/parser/test/mockCatalogService.h +++ b/source/libs/parser/test/mockCatalogService.h @@ -70,7 +70,7 @@ class MockCatalogService { int32_t catalogGetTableMeta(const SName* pTableName, STableMeta** pTableMeta) const; int32_t catalogGetTableHashVgroup(const SName* pTableName, SVgroupInfo* vgInfo) const; int32_t catalogGetTableDistVgInfo(const SName* pTableName, SArray** pVgList) const; - int32_t catalogGetDBVgInfo(const char* pDbFName, SArray** pVgList) const; + int32_t catalogGetDBVgList(const char* pDbFName, SArray** pVgList) const; int32_t catalogGetDBCfg(const char* pDbFName, SDbCfgInfo* pDbCfg) const; int32_t catalogGetUdfInfo(const std::string& funcName, SFuncInfo* pInfo) const; int32_t catalogGetTableIndex(const SName* pTableName, SArray** pIndexes) const; From a871a7f27a441b0a7b88aa7dc6a82d2e1ebb2b8d Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 20:47:53 +0800 Subject: [PATCH 67/99] Update compatibility.py --- tests/system-test/0-others/compatibility.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index 4fa75b75f1..7539ddcbea 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -81,6 +81,7 @@ class TDTestCase: dbname = "test" stb = f"{dbname}.meters" self.installTaosd(bPath,cPath) + os.system("echo 'debugFlag 143' > /etc/taos/taos.cfg ") tableNumbers=100 recordNumbers1=100 recordNumbers2=1000 From 93742337fbf42ed87be035f858f7de8b7d7f43f8 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 21:14:46 +0800 Subject: [PATCH 68/99] Update querymsg.c --- source/libs/qcom/src/querymsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/qcom/src/querymsg.c b/source/libs/qcom/src/querymsg.c index 2b45756547..ca01a9a0fb 100644 --- a/source/libs/qcom/src/querymsg.c +++ b/source/libs/qcom/src/querymsg.c @@ -529,7 +529,7 @@ int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) { } if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) { - qError("tDeserializeSDbCfgRsp failed, msgSize:%d,dbCfgRsp:%d", msgSize, sizeof(out)); + qError("tDeserializeSDbCfgRsp failed, msgSize:%d,dbCfgRsp:%u", msgSize, sizeof(out)); return TSDB_CODE_INVALID_MSG; } From 06f276f1373ba511127d56096149525a0366bae6 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Thu, 20 Oct 2022 21:19:33 +0800 Subject: [PATCH 69/99] Update querymsg.c --- source/libs/qcom/src/querymsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/qcom/src/querymsg.c b/source/libs/qcom/src/querymsg.c index ca01a9a0fb..953abd5956 100644 --- a/source/libs/qcom/src/querymsg.c +++ b/source/libs/qcom/src/querymsg.c @@ -529,7 +529,7 @@ int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) { } if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) { - qError("tDeserializeSDbCfgRsp failed, msgSize:%d,dbCfgRsp:%u", msgSize, sizeof(out)); + qError("tDeserializeSDbCfgRsp failed, msgSize:%d,dbCfgRsp:%lu", msgSize, sizeof(out)); return TSDB_CODE_INVALID_MSG; } From 4d899c4e8eb9713112a4ea070e95a43d047f3c18 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Fri, 21 Oct 2022 08:22:26 +0800 Subject: [PATCH 70/99] Update run_case.sh --- tests/parallel_test/run_case.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 0da68ad618..9972fdbf14 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -79,7 +79,7 @@ if [ $RET -ne 0 ]; then pwd fi -sleep 3600 +sleep 36000 exit $RET From c640c034533b307d850ac6fa4c44ab490720711f Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Fri, 21 Oct 2022 08:59:19 +0800 Subject: [PATCH 71/99] import format error --- utils/test/c/tmqSim.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/utils/test/c/tmqSim.c b/utils/test/c/tmqSim.c index 7452a67fed..f77a910f35 100644 --- a/utils/test/c/tmqSim.c +++ b/utils/test/c/tmqSim.c @@ -497,9 +497,14 @@ static char* shellFormatTimestamp(char* buf, int64_t val, int32_t precision) { static void shellDumpFieldToFile(TdFilePtr pFile, const char* val, TAOS_FIELD* field, int32_t length, int32_t precision) { if (val == NULL) { + taosFprintfFile(pFile, "NULL"); return; } + char quotationStr[2]; + quotationStr[0] = '\"'; + quotationStr[1] = 0; + int n; char buf[TSDB_MAX_BYTES_PER_ROW]; switch (field->type) { @@ -545,33 +550,23 @@ static void shellDumpFieldToFile(TdFilePtr pFile, const char* val, TAOS_FIELD* f case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_JSON: { - char quotationStr[2]; int32_t bufIndex = 0; - quotationStr[0] = 0; - quotationStr[1] = 0; for (int32_t i = 0; i < length; i++) { buf[bufIndex] = val[i]; bufIndex++; if (val[i] == '\"') { buf[bufIndex] = val[i]; bufIndex++; - quotationStr[0] = '\"'; - } - if (val[i] == ',') { - quotationStr[0] = '\"'; } } buf[bufIndex] = 0; - if (length == 0) { - quotationStr[0] = '\"'; - } taosFprintfFile(pFile, "%s%s%s", quotationStr, buf, quotationStr); } break; case TSDB_DATA_TYPE_TIMESTAMP: shellFormatTimestamp(buf, *(int64_t*)val, precision); - taosFprintfFile(pFile, "%s", buf); + taosFprintfFile(pFile, "%s%s%s", quotationStr, buf, quotationStr); break; default: break; From 6a6357c21a4a1eb3d9d809046194e062653b4f22 Mon Sep 17 00:00:00 2001 From: Huo Linhe Date: Fri, 21 Oct 2022 09:24:40 +0800 Subject: [PATCH 72/99] fix: fix libtaosws compile error in ci Close [TD-19701](https://jira.taosdata.com:18080/browse/TD-19701) --- cmake/taosws_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taosws_CMakeLists.txt.in b/cmake/taosws_CMakeLists.txt.in index ca8fff8da5..67a23b32b0 100644 --- a/cmake/taosws_CMakeLists.txt.in +++ b/cmake/taosws_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosws-rs ExternalProject_Add(taosws-rs GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git - GIT_TAG 1bdfca3 + GIT_TAG 0373a70 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From e8123178e3783ced63600a0f5922ad4fe3fab18c Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Fri, 21 Oct 2022 10:20:21 +0800 Subject: [PATCH 73/99] fix: fix coverity scan issue --- source/libs/function/src/tudf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/function/src/tudf.c b/source/libs/function/src/tudf.c index f3a724d4da..13af126f9c 100644 --- a/source/libs/function/src/tudf.c +++ b/source/libs/function/src/tudf.c @@ -920,7 +920,7 @@ int32_t acquireUdfFuncHandle(char *udfName, UdfcFuncHandle *pHandle) { code = doSetupUdf(udfName, pHandle); if (code == TSDB_CODE_SUCCESS) { SUdfcFuncStub stub = {0}; - strcpy(stub.udfName, udfName); + strncpy(stub.udfName, udfName, TSDB_FUNC_NAME_LEN); stub.handle = *pHandle; ++stub.refCount; stub.lastRefTime = taosGetTimestampUs(); From 035e6b13c8fd492b8d0afb8f38499cfb95f94665 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 21 Oct 2022 09:47:04 +0800 Subject: [PATCH 74/99] enh(stream): internal optimize --- include/common/tmsg.h | 5 +-- include/libs/stream/tstream.h | 4 +++ include/libs/stream/tstreamUpdate.h | 7 ++++ include/util/thash.h | 3 ++ source/dnode/mnode/impl/inc/mndDef.h | 1 + source/dnode/mnode/impl/src/mndDef.c | 6 ++++ source/dnode/mnode/impl/src/mndStream.c | 3 +- source/libs/executor/inc/executorimpl.h | 2 ++ source/libs/executor/src/executorimpl.c | 6 ++-- source/libs/executor/src/scanoperator.c | 13 ++++--- source/libs/executor/src/timewindowoperator.c | 9 ++--- source/libs/stream/src/streamMeta.c | 7 ++++ source/libs/stream/src/streamTask.c | 16 ++++++--- source/libs/stream/src/streamUpdate.c | 34 +++++++++++++++++-- source/util/src/tbloomfilter.c | 8 +++-- source/util/src/thashutil.c | 17 ++++++++++ 16 files changed, 118 insertions(+), 23 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 3409071932..4356c0fd24 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1726,13 +1726,14 @@ typedef struct { char name[TSDB_STREAM_FNAME_LEN]; char sourceDB[TSDB_DB_FNAME_LEN]; char targetStbFullName[TSDB_TABLE_FNAME_LEN]; - int8_t igExists; char* sql; char* ast; + int8_t igExists; int8_t triggerType; + int8_t igExpired; + int8_t fillHistory; // process data inserted before creating stream int64_t maxDelay; int64_t watermark; - int8_t igExpired; int32_t numOfTags; SArray* pTags; // array of SField } SCMCreateStreamReq; diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h index bdc12f7e3f..247293dbb6 100644 --- a/include/libs/stream/tstream.h +++ b/include/libs/stream/tstream.h @@ -36,6 +36,7 @@ typedef struct SStreamTask SStreamTask; enum { STREAM_STATUS__NORMAL = 0, STREAM_STATUS__STOP, + STREAM_STATUS__INIT, STREAM_STATUS__FAILED, STREAM_STATUS__RECOVER, }; @@ -291,6 +292,9 @@ typedef struct SStreamTask { int64_t recoverSnapVer; int64_t startVer; + // fill history + int8_t fillHistory; + // children info SArray* childEpInfo; // SArray int32_t nextCheckId; diff --git a/include/libs/stream/tstreamUpdate.h b/include/libs/stream/tstreamUpdate.h index c186430f3f..1c490852f9 100644 --- a/include/libs/stream/tstreamUpdate.h +++ b/include/libs/stream/tstreamUpdate.h @@ -17,6 +17,7 @@ #include "taosdef.h" #include "tarray.h" +#include "tcommon.h" #include "tmsg.h" #include "tscalablebf.h" @@ -24,6 +25,11 @@ extern "C" { #endif +typedef struct SUpdateKey { + int64_t tbUid; + TSKEY ts; +} SUpdateKey; + typedef struct SUpdateInfo { SArray *pTsBuckets; uint64_t numBuckets; @@ -41,6 +47,7 @@ typedef struct SUpdateInfo { SUpdateInfo *updateInfoInitP(SInterval *pInterval, int64_t watermark); SUpdateInfo *updateInfoInit(int64_t interval, int32_t precision, int64_t watermark); +void updateInfoFillBlockData(SUpdateInfo *pInfo, SSDataBlock *pBlock, int32_t primaryTsCol); bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts); bool updateInfoIsTableInserted(SUpdateInfo *pInfo, int64_t tbUid); void updateInfoSetScanRange(SUpdateInfo *pInfo, STimeWindow *pWin, uint64_t groupId, uint64_t version); diff --git a/include/util/thash.h b/include/util/thash.h index 2be5f4a047..08caad495d 100644 --- a/include/util/thash.h +++ b/include/util/thash.h @@ -50,6 +50,9 @@ uint64_t MurmurHash3_64(const char *key, uint32_t len); uint32_t taosIntHash_32(const char *key, uint32_t len); uint32_t taosIntHash_64(const char *key, uint32_t len); +uint32_t taosFastHash(const char *key, uint32_t len); +uint32_t taosDJB2Hash(const char *key, uint32_t len); + _hash_fn_t taosGetDefaultHashFunction(int32_t type); _equal_fn_t taosGetDefaultEqualFunction(int32_t type); diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 2ee732e797..74a92c9fcd 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -613,6 +613,7 @@ typedef struct { // config int8_t igExpired; int8_t trigger; + int8_t fillHistory; int64_t triggerParam; int64_t watermark; // source and target diff --git a/source/dnode/mnode/impl/src/mndDef.c b/source/dnode/mnode/impl/src/mndDef.c index 462b068a73..143131bac8 100644 --- a/source/dnode/mnode/impl/src/mndDef.c +++ b/source/dnode/mnode/impl/src/mndDef.c @@ -18,6 +18,7 @@ #include "mndConsumer.h" int32_t tEncodeSStreamObj(SEncoder *pEncoder, const SStreamObj *pObj) { + if (tStartEncode(pEncoder) < 0) return -1; if (tEncodeCStr(pEncoder, pObj->name) < 0) return -1; if (tEncodeI64(pEncoder, pObj->createTime) < 0) return -1; @@ -31,6 +32,7 @@ int32_t tEncodeSStreamObj(SEncoder *pEncoder, const SStreamObj *pObj) { if (tEncodeI8(pEncoder, pObj->igExpired) < 0) return -1; if (tEncodeI8(pEncoder, pObj->trigger) < 0) return -1; + if (tEncodeI8(pEncoder, pObj->fillHistory) < 0) return -1; if (tEncodeI64(pEncoder, pObj->triggerParam) < 0) return -1; if (tEncodeI64(pEncoder, pObj->watermark) < 0) return -1; @@ -74,10 +76,12 @@ int32_t tEncodeSStreamObj(SEncoder *pEncoder, const SStreamObj *pObj) { if (tEncodeSSchemaWrapper(pEncoder, &pObj->outputSchema) < 0) return -1; + tEndEncode(pEncoder); return pEncoder->pos; } int32_t tDecodeSStreamObj(SDecoder *pDecoder, SStreamObj *pObj) { + if (tStartDecode(pDecoder) < 0) return -1; if (tDecodeCStrTo(pDecoder, pObj->name) < 0) return -1; if (tDecodeI64(pDecoder, &pObj->createTime) < 0) return -1; @@ -91,6 +95,7 @@ int32_t tDecodeSStreamObj(SDecoder *pDecoder, SStreamObj *pObj) { if (tDecodeI8(pDecoder, &pObj->igExpired) < 0) return -1; if (tDecodeI8(pDecoder, &pObj->trigger) < 0) return -1; + if (tDecodeI8(pDecoder, &pObj->fillHistory) < 0) return -1; if (tDecodeI64(pDecoder, &pObj->triggerParam) < 0) return -1; if (tDecodeI64(pDecoder, &pObj->watermark) < 0) return -1; @@ -134,6 +139,7 @@ int32_t tDecodeSStreamObj(SDecoder *pDecoder, SStreamObj *pObj) { if (tDecodeSSchemaWrapper(pDecoder, &pObj->outputSchema) < 0) return -1; + tEndDecode(pDecoder); return 0; } diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index ce6b3b0656..6fffdf9a59 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -280,6 +280,7 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj, pObj->trigger = pCreate->triggerType; pObj->triggerParam = pCreate->maxDelay; pObj->watermark = pCreate->watermark; + pObj->fillHistory = pCreate->fillHistory; memcpy(pObj->sourceDb, pCreate->sourceDB, TSDB_DB_FNAME_LEN); SDbObj *pSourceDb = mndAcquireDb(pMnode, pCreate->sourceDB); @@ -686,7 +687,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) { mError("stream:%s, failed to create since %s", createStreamReq.name, terrstr()); goto _OVER; } - mndTransSetDbName(pTrans, createStreamReq.sourceDB, streamObj.targetDb); // hack way + mndTransSetDbName(pTrans, createStreamReq.sourceDB, streamObj.targetDb); mInfo("trans:%d, used to create stream:%s", pTrans->id, createStreamReq.name); // create stb for stream diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 1aa3d55efc..0ea0eb400d 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -162,6 +162,8 @@ typedef struct { SQueryTableDataCond tableCond; int64_t recoverStartVer; int64_t recoverEndVer; + int64_t fillHistoryVer1; + int64_t fillHistoryVer2; SStreamState* pState; } SStreamTaskInfo; diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index feced8dc60..914373a600 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -569,8 +569,10 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc return TSDB_CODE_SUCCESS; } - pResult->info.groupId = pSrcBlock->info.groupId; - memcpy(pResult->info.parTbName, pSrcBlock->info.parTbName, TSDB_TABLE_NAME_LEN); + if (pResult != pSrcBlock) { + pResult->info.groupId = pSrcBlock->info.groupId; + memcpy(pResult->info.parTbName, pSrcBlock->info.parTbName, TSDB_TABLE_NAME_LEN); + } // if the source equals to the destination, it is to create a new column as the result of scalar // function or some operators. diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 058b9b1b44..a8869448d9 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -284,7 +284,6 @@ static bool doLoadBlockSMA(STableScanInfo* pTableScanInfo, SSDataBlock* pBlock, return true; } - static void doSetTagColumnData(STableScanInfo* pTableScanInfo, SSDataBlock* pBlock, SExecTaskInfo* pTaskInfo) { if (pTableScanInfo->pseudoSup.numOfExprs > 0) { SExprSupp* pSup = &pTableScanInfo->pseudoSup; @@ -737,7 +736,8 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SDataBlockDescNode* pDescNode = pTableScanNode->scan.node.pOutputDataBlockDesc; int32_t numOfCols = 0; - pInfo->pColMatchInfo = extractColMatchInfo(pTableScanNode->scan.pScanCols, pDescNode, &numOfCols, COL_MATCH_FROM_COL_ID); + pInfo->pColMatchInfo = + extractColMatchInfo(pTableScanNode->scan.pScanCols, pDescNode, &numOfCols, COL_MATCH_FROM_COL_ID); int32_t code = initQueryTableDataCond(&pInfo->cond, pTableScanNode); if (code != TSDB_CODE_SUCCESS) { @@ -1707,9 +1707,12 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { } #endif +#if 1 if (pTaskInfo->streamInfo.recoverStep == STREAM_RECOVER_STEP__PREPARE) { STableScanInfo* pTSInfo = pInfo->pTableScanOp->info; memcpy(&pTSInfo->cond, &pTaskInfo->streamInfo.tableCond, sizeof(SQueryTableDataCond)); + pTSInfo->cond.startVersion = -1; + pTSInfo->cond.endVersion = pTaskInfo->streamInfo.fillHistoryVer1; pTSInfo->scanTimes = 0; pTSInfo->currentGroupId = -1; pTaskInfo->streamInfo.recoverStep = STREAM_RECOVER_STEP__SCAN; @@ -1718,12 +1721,14 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) { if (pTaskInfo->streamInfo.recoverStep == STREAM_RECOVER_STEP__SCAN) { SSDataBlock* pBlock = doTableScan(pInfo->pTableScanOp); if (pBlock != NULL) { + calBlockTbName(&pInfo->tbnameCalSup, pBlock); + updateInfoFillBlockData(pInfo->pUpdateInfo, pBlock, pInfo->primaryTsIndex); return pBlock; } - // TODO fill in bloom filter pTaskInfo->streamInfo.recoverStep = STREAM_RECOVER_STEP__NONE; return NULL; } +#endif size_t total = taosArrayGetSize(pInfo->pBlockLists); // TODO: refactor @@ -2109,7 +2114,7 @@ SOperatorInfo* createRawScanOperatorInfo(SReadHandle* pHandle, SExecTaskInfo* pT pOperator->fpSet = createOperatorFpSet(NULL, doRawScan, NULL, NULL, destroyRawScanOperatorInfo, NULL, NULL, NULL); return pOperator; - _end: +_end: taosMemoryFree(pInfo); taosMemoryFree(pOperator); pTaskInfo->code = code; diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 505654d967..dc7b11758f 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -2667,8 +2667,8 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWi size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; - int32_t num = 0; - SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &num); + int32_t num = 0; + SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &num); initResultSizeInfo(&pOperator->resultInfo, 4096); int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { @@ -3149,6 +3149,7 @@ static void doStreamIntervalAggImpl(SOperatorInfo* pOperatorInfo, SSDataBlock* p static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { SStreamIntervalOperatorInfo* pInfo = pOperator->info; + SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SOperatorInfo* downstream = pOperator->pDownstream[0]; TSKEY maxTs = INT64_MIN; @@ -3191,6 +3192,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) { } else { deleteIntervalDiscBuf(pInfo->pState, pInfo->pPullDataMap, pInfo->twAggSup.maxTs - pInfo->twAggSup.deleteMark, &pInfo->interval, &pInfo->delKey); + streamStateCommit(pTaskInfo->streamInfo.pState); } return NULL; } else { @@ -4975,8 +4977,6 @@ SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, goto _error; } - - SInterval interval = {.interval = pNode->interval, .sliding = pNode->sliding, .intervalUnit = pNode->intervalUnit, @@ -5383,6 +5383,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) { deleteIntervalDiscBuf(pInfo->pState, NULL, pInfo->twAggSup.maxTs - pInfo->twAggSup.deleteMark, &pInfo->interval, &pInfo->delKey); doSetOperatorCompleted(pOperator); + streamStateCommit(pTaskInfo->streamInfo.pState); return NULL; } diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index 02b74c260b..d489cc044b 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -113,6 +113,13 @@ int32_t streamMetaAddSerializedTask(SStreamMeta* pMeta, int64_t startVer, char* ASSERT(0); goto FAIL; } + + if (pTask->fillHistory) { + // pipeline exec + // if finished, dispatch a stream-prepare-finished msg to downstream task + // set status normal + } + return 0; FAIL: diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c index 5304938195..f7252ed8a0 100644 --- a/source/libs/stream/src/streamTask.c +++ b/source/libs/stream/src/streamTask.c @@ -49,7 +49,7 @@ int32_t tDecodeStreamEpInfo(SDecoder* pDecoder, SStreamChildEpInfo* pInfo) { } int32_t tEncodeSStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) { - /*if (tStartEncode(pEncoder) < 0) return -1;*/ + if (tStartEncode(pEncoder) < 0) return -1; if (tEncodeI64(pEncoder, pTask->streamId) < 0) return -1; if (tEncodeI32(pEncoder, pTask->taskId) < 0) return -1; if (tEncodeI32(pEncoder, pTask->totalLevel) < 0) return -1; @@ -64,6 +64,10 @@ int32_t tEncodeSStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) { if (tEncodeI32(pEncoder, pTask->nodeId) < 0) return -1; if (tEncodeSEpSet(pEncoder, &pTask->epSet) < 0) return -1; + if (tEncodeI64(pEncoder, pTask->recoverSnapVer) < 0) return -1; + if (tEncodeI64(pEncoder, pTask->startVer) < 0) return -1; + if (tEncodeI8(pEncoder, pTask->fillHistory) < 0) return -1; + int32_t epSz = taosArrayGetSize(pTask->childEpInfo); if (tEncodeI32(pEncoder, epSz) < 0) return -1; for (int32_t i = 0; i < epSz; i++) { @@ -93,12 +97,12 @@ int32_t tEncodeSStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) { } if (tEncodeI64(pEncoder, pTask->triggerParam) < 0) return -1; - /*tEndEncode(pEncoder);*/ + tEndEncode(pEncoder); return pEncoder->pos; } int32_t tDecodeSStreamTask(SDecoder* pDecoder, SStreamTask* pTask) { - /*if (tStartDecode(pDecoder) < 0) return -1;*/ + if (tStartDecode(pDecoder) < 0) return -1; if (tDecodeI64(pDecoder, &pTask->streamId) < 0) return -1; if (tDecodeI32(pDecoder, &pTask->taskId) < 0) return -1; if (tDecodeI32(pDecoder, &pTask->totalLevel) < 0) return -1; @@ -113,6 +117,10 @@ int32_t tDecodeSStreamTask(SDecoder* pDecoder, SStreamTask* pTask) { if (tDecodeI32(pDecoder, &pTask->nodeId) < 0) return -1; if (tDecodeSEpSet(pDecoder, &pTask->epSet) < 0) return -1; + if (tDecodeI64(pDecoder, &pTask->recoverSnapVer) < 0) return -1; + if (tDecodeI64(pDecoder, &pTask->startVer) < 0) return -1; + if (tDecodeI8(pDecoder, &pTask->fillHistory) < 0) return -1; + int32_t epSz; if (tDecodeI32(pDecoder, &epSz) < 0) return -1; pTask->childEpInfo = taosArrayInit(epSz, sizeof(void*)); @@ -150,7 +158,7 @@ int32_t tDecodeSStreamTask(SDecoder* pDecoder, SStreamTask* pTask) { } if (tDecodeI64(pDecoder, &pTask->triggerParam) < 0) return -1; - /*tEndDecode(pDecoder);*/ + tEndDecode(pDecoder); return 0; } diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c index 5aadb599a3..80410568e5 100644 --- a/source/libs/stream/src/streamUpdate.c +++ b/source/libs/stream/src/streamUpdate.c @@ -14,6 +14,7 @@ */ #include "query.h" +#include "tdatablock.h" #include "tencode.h" #include "tstreamUpdate.h" #include "ttime.h" @@ -162,15 +163,42 @@ bool updateInfoIsTableInserted(SUpdateInfo *pInfo, int64_t tbUid) { return false; } +void updateInfoFillBlockData(SUpdateInfo *pInfo, SSDataBlock *pBlock, int32_t primaryTsCol) { + if (pBlock == NULL || pBlock->info.rows == 0) return; + TSKEY maxTs = -1; + int64_t tbUid = pBlock->info.uid; + + SColumnInfoData *pColDataInfo = taosArrayGet(pBlock->pDataBlock, primaryTsCol); + + for (int32_t i = 0; i < pBlock->info.rows; i++) { + TSKEY ts = ((TSKEY *)pColDataInfo->pData)[i]; + maxTs = TMAX(maxTs, ts); + SScalableBf *pSBf = getSBf(pInfo, ts); + if (pSBf) { + tScalableBfPut(pSBf, &ts, sizeof(TSKEY)); + } + } + TSKEY *pMaxTs = taosHashGet(pInfo->pMap, &tbUid, sizeof(int64_t)); + if (pMaxTs == NULL || *pMaxTs > tbUid) { + taosHashPut(pInfo->pMap, &tbUid, sizeof(int64_t), &maxTs, sizeof(TSKEY)); + } +} + bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) { - int32_t res = TSDB_CODE_FAILED; + int32_t res = TSDB_CODE_FAILED; + + SUpdateKey updateKey = { + .tbUid = tableId, + .ts = ts, + }; + TSKEY *pMapMaxTs = taosHashGet(pInfo->pMap, &tableId, sizeof(uint64_t)); uint64_t index = ((uint64_t)tableId) % pInfo->numBuckets; TSKEY maxTs = *(TSKEY *)taosArrayGet(pInfo->pTsBuckets, index); if (ts < maxTs - pInfo->watermark) { // this window has been closed. if (pInfo->pCloseWinSBF) { - res = tScalableBfPut(pInfo->pCloseWinSBF, &ts, sizeof(TSKEY)); + res = tScalableBfPut(pInfo->pCloseWinSBF, &updateKey, sizeof(SUpdateKey)); if (res == TSDB_CODE_SUCCESS) { return false; } else { @@ -183,7 +211,7 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) { SScalableBf *pSBf = getSBf(pInfo, ts); // pSBf may be a null pointer if (pSBf) { - res = tScalableBfPut(pSBf, &ts, sizeof(TSKEY)); + res = tScalableBfPut(pSBf, &updateKey, sizeof(SUpdateKey)); } int32_t size = taosHashGetSize(pInfo->pMap); diff --git a/source/util/src/tbloomfilter.c b/source/util/src/tbloomfilter.c index f3ccbb0aac..b9c96dd606 100644 --- a/source/util/src/tbloomfilter.c +++ b/source/util/src/tbloomfilter.c @@ -57,8 +57,10 @@ SBloomFilter *tBloomFilterInit(uint64_t expectedEntries, double errorRate) { // ln(2) = 0.693147180559945 pBF->hashFunctions = (uint32_t)ceil(lnRate / 0.693147180559945); - pBF->hashFn1 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_TIMESTAMP); - pBF->hashFn2 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_NCHAR); + /*pBF->hashFn1 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_TIMESTAMP);*/ + /*pBF->hashFn2 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_NCHAR);*/ + pBF->hashFn1 = taosFastHash; + pBF->hashFn2 = taosDJB2Hash; pBF->buffer = taosMemoryCalloc(pBF->numUnits, sizeof(uint64_t)); if (pBF->buffer == NULL) { tBloomFilterDestroy(pBF); @@ -144,4 +146,4 @@ _error: return NULL; } -bool tBloomFilterIsFull(const SBloomFilter *pBF) { return pBF->size >= pBF->expectedEntries; } \ No newline at end of file +bool tBloomFilterIsFull(const SBloomFilter *pBF) { return pBF->size >= pBF->expectedEntries; } diff --git a/source/util/src/thashutil.c b/source/util/src/thashutil.c index e646e9aa36..59f7d389c2 100644 --- a/source/util/src/thashutil.c +++ b/source/util/src/thashutil.c @@ -32,6 +32,23 @@ (h) ^= (h) >> 16; \ } while (0) +uint32_t taosFastHash(const char *key, uint32_t len) { + uint32_t result = 0x55555555; + for (uint32_t i = 0; i < len; i++) { + result ^= (uint8_t)key[i]; + result = ROTL32(result, 5); + } + return result; +} + +uint32_t taosDJB2Hash(const char *key, uint32_t len) { + uint32_t hash = 5381; + for (uint32_t i = 0; i < len; i++) { + hash = ((hash << 5) + hash) + (uint8_t)key[i]; /* hash * 33 + c */ + } + return hash; +} + uint32_t MurmurHash3_32(const char *key, uint32_t len) { const uint8_t *data = (const uint8_t *)key; const int32_t nblocks = len >> 2u; From 6c3cd3e19e57aa6042afff95f7d743cc96a52a26 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 21 Oct 2022 10:39:19 +0800 Subject: [PATCH 75/99] test: adjust log --- source/dnode/vnode/src/meta/metaCache.c | 2 +- source/dnode/vnode/src/tq/tqPush.c | 10 ++-- source/dnode/vnode/src/tq/tqStreamStateSnap.c | 14 ++--- source/dnode/vnode/src/tq/tqStreamTaskSnap.c | 14 ++--- source/dnode/vnode/src/tsdb/tsdbCommit.c | 58 +++++++++---------- source/dnode/vnode/src/tsdb/tsdbFS.c | 18 +++--- .../dnode/vnode/src/tsdb/tsdbReaderWriter.c | 34 +++++------ source/dnode/vnode/src/tsdb/tsdbSnapshot.c | 12 ++-- source/dnode/vnode/src/vnd/vnodeBufPool.c | 4 +- source/dnode/vnode/src/vnd/vnodeCommit.c | 2 +- source/dnode/vnode/src/vnd/vnodeSnapshot.c | 2 +- source/dnode/vnode/src/vnd/vnodeSvr.c | 6 +- source/libs/wal/src/walMeta.c | 6 +- source/libs/wal/src/walMgmt.c | 4 +- source/libs/wal/src/walWrite.c | 8 +-- tests/script/tsim/db/alter_replica_13.sim | 1 + 16 files changed, 98 insertions(+), 97 deletions(-) diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c index 6f19d43e69..356aa78c22 100644 --- a/source/dnode/vnode/src/meta/metaCache.c +++ b/source/dnode/vnode/src/meta/metaCache.c @@ -120,7 +120,7 @@ _err2: _err: taosMemoryFree(pCache); - metaError("vgId:%d meta open cache failed since %s", TD_VID(pMeta->pVnode), tstrerror(code)); + metaError("vgId:%d, meta open cache failed since %s", TD_VID(pMeta->pVnode), tstrerror(code)); return code; } diff --git a/source/dnode/vnode/src/tq/tqPush.c b/source/dnode/vnode/src/tq/tqPush.c index 5ffbc41eb5..35cb305042 100644 --- a/source/dnode/vnode/src/tq/tqPush.c +++ b/source/dnode/vnode/src/tq/tqPush.c @@ -213,12 +213,12 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_ #endif int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) { - tqDebug("vgId:%d tq push msg ver %" PRId64 ", type: %s", pTq->pVnode->config.vgId, ver, TMSG_INFO(msgType)); + tqDebug("vgId:%d, tq push msg ver %" PRId64 ", type: %s", pTq->pVnode->config.vgId, ver, TMSG_INFO(msgType)); if (msgType == TDMT_VND_SUBMIT) { // lock push mgr to avoid potential msg lost taosWLockLatch(&pTq->pushLock); - tqDebug("vgId:%d push handle num %d", pTq->pVnode->config.vgId, taosHashGetSize(pTq->pPushMgr)); + tqDebug("vgId:%d, push handle num %d", pTq->pVnode->config.vgId, taosHashGetSize(pTq->pPushMgr)); if (taosHashGetSize(pTq->pPushMgr) != 0) { SArray* cachedKeys = taosArrayInit(0, sizeof(void*)); SArray* cachedKeyLens = taosArrayInit(0, sizeof(size_t)); @@ -242,11 +242,11 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) STqHandle* pHandle = taosHashGet(pTq->pHandle, pPushEntry->subKey, strlen(pPushEntry->subKey)); if (pHandle == NULL) { - tqDebug("vgId:%d cannot find handle %s", pTq->pVnode->config.vgId, pPushEntry->subKey); + tqDebug("vgId:%d, cannot find handle %s", pTq->pVnode->config.vgId, pPushEntry->subKey); continue; } if (pPushEntry->dataRsp.reqOffset.version >= ver) { - tqDebug("vgId:%d push entry req version %" PRId64 ", while push version %" PRId64 ", skip", + tqDebug("vgId:%d, push entry req version %" PRId64 ", while push version %" PRId64 ", skip", pTq->pVnode->config.vgId, pPushEntry->dataRsp.reqOffset.version, ver); continue; } @@ -274,7 +274,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver) pRsp->blockNum++; } - tqDebug("vgId:%d tq handle push, subkey: %s, block num: %d", pTq->pVnode->config.vgId, pPushEntry->subKey, + tqDebug("vgId:%d, tq handle push, subkey: %s, block num: %d", pTq->pVnode->config.vgId, pPushEntry->subKey, pRsp->blockNum); if (pRsp->blockNum > 0) { // set offset diff --git a/source/dnode/vnode/src/tq/tqStreamStateSnap.c b/source/dnode/vnode/src/tq/tqStreamStateSnap.c index 21172134ba..b4a7ce7737 100644 --- a/source/dnode/vnode/src/tq/tqStreamStateSnap.c +++ b/source/dnode/vnode/src/tq/tqStreamStateSnap.c @@ -52,13 +52,13 @@ int32_t tqSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, STqSnapReader** p goto _err; } - tqInfo("vgId:%d vnode snapshot tq reader opened", TD_VID(pTq->pVnode)); + tqInfo("vgId:%d, vnode snapshot tq reader opened", TD_VID(pTq->pVnode)); *ppReader = pReader; return code; _err: - tqError("vgId:%d vnode snapshot tq reader open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, vnode snapshot tq reader open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); *ppReader = NULL; return code; } @@ -113,14 +113,14 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) { pHdr->size = vLen; memcpy(pHdr->data, pVal, vLen); - tqInfo("vgId:%d vnode snapshot tq read data, version:%" PRId64 " subKey: %s vLen:%d", TD_VID(pReader->pTq->pVnode), + tqInfo("vgId:%d, vnode snapshot tq read data, version:%" PRId64 " subKey: %s vLen:%d", TD_VID(pReader->pTq->pVnode), handle.snapshotVer, handle.subKey, vLen); _exit: return code; _err: - tqError("vgId:%d vnode snapshot tq read data failed since %s", TD_VID(pReader->pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, vnode snapshot tq read data failed since %s", TD_VID(pReader->pTq->pVnode), tstrerror(code)); return code; } @@ -154,7 +154,7 @@ int32_t tqSnapWriterOpen(STQ* pTq, int64_t sver, int64_t ever, STqSnapWriter** p return code; _err: - tqError("vgId:%d tq snapshot writer open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, tq snapshot writer open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); *ppWriter = NULL; return code; } @@ -182,7 +182,7 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) { return code; _err: - tqError("vgId:%d tq snapshot writer close failed since %s", TD_VID(pWriter->pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, tq snapshot writer close failed since %s", TD_VID(pWriter->pTq->pVnode), tstrerror(code)); return code; } @@ -204,6 +204,6 @@ int32_t tqSnapWrite(STqSnapWriter* pWriter, uint8_t* pData, uint32_t nData) { _err: tDecoderClear(pDecoder); - tqError("vgId:%d vnode snapshot tq write failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, vnode snapshot tq write failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); return code; } diff --git a/source/dnode/vnode/src/tq/tqStreamTaskSnap.c b/source/dnode/vnode/src/tq/tqStreamTaskSnap.c index 21172134ba..b4a7ce7737 100644 --- a/source/dnode/vnode/src/tq/tqStreamTaskSnap.c +++ b/source/dnode/vnode/src/tq/tqStreamTaskSnap.c @@ -52,13 +52,13 @@ int32_t tqSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, STqSnapReader** p goto _err; } - tqInfo("vgId:%d vnode snapshot tq reader opened", TD_VID(pTq->pVnode)); + tqInfo("vgId:%d, vnode snapshot tq reader opened", TD_VID(pTq->pVnode)); *ppReader = pReader; return code; _err: - tqError("vgId:%d vnode snapshot tq reader open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, vnode snapshot tq reader open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); *ppReader = NULL; return code; } @@ -113,14 +113,14 @@ int32_t tqSnapRead(STqSnapReader* pReader, uint8_t** ppData) { pHdr->size = vLen; memcpy(pHdr->data, pVal, vLen); - tqInfo("vgId:%d vnode snapshot tq read data, version:%" PRId64 " subKey: %s vLen:%d", TD_VID(pReader->pTq->pVnode), + tqInfo("vgId:%d, vnode snapshot tq read data, version:%" PRId64 " subKey: %s vLen:%d", TD_VID(pReader->pTq->pVnode), handle.snapshotVer, handle.subKey, vLen); _exit: return code; _err: - tqError("vgId:%d vnode snapshot tq read data failed since %s", TD_VID(pReader->pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, vnode snapshot tq read data failed since %s", TD_VID(pReader->pTq->pVnode), tstrerror(code)); return code; } @@ -154,7 +154,7 @@ int32_t tqSnapWriterOpen(STQ* pTq, int64_t sver, int64_t ever, STqSnapWriter** p return code; _err: - tqError("vgId:%d tq snapshot writer open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, tq snapshot writer open failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); *ppWriter = NULL; return code; } @@ -182,7 +182,7 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) { return code; _err: - tqError("vgId:%d tq snapshot writer close failed since %s", TD_VID(pWriter->pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, tq snapshot writer close failed since %s", TD_VID(pWriter->pTq->pVnode), tstrerror(code)); return code; } @@ -204,6 +204,6 @@ int32_t tqSnapWrite(STqSnapWriter* pWriter, uint8_t* pData, uint32_t nData) { _err: tDecoderClear(pDecoder); - tqError("vgId:%d vnode snapshot tq write failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); + tqError("vgId:%d, vnode snapshot tq write failed since %s", TD_VID(pTq->pVnode), tstrerror(code)); return code; } diff --git a/source/dnode/vnode/src/tsdb/tsdbCommit.c b/source/dnode/vnode/src/tsdb/tsdbCommit.c index 674cdc115f..578473c79a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCommit.c +++ b/source/dnode/vnode/src/tsdb/tsdbCommit.c @@ -145,7 +145,7 @@ int32_t tsdbBegin(STsdb *pTsdb) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -186,7 +186,7 @@ int32_t tsdbCommit(STsdb *pTsdb) { _exit: if (code) { tsdbEndCommit(&commith, code); - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -479,7 +479,7 @@ static int32_t tsdbOpenCommitIter(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -567,7 +567,7 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -619,7 +619,7 @@ int32_t tsdbWriteDataBlock(SDataFWriter *pWriter, SBlockData *pBlockData, SMapDa _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -662,7 +662,7 @@ int32_t tsdbWriteSttBlock(SDataFWriter *pWriter, SBlockData *pBlockData, SArray _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -702,7 +702,7 @@ static int32_t tsdbCommitSttBlk(SDataFWriter *pWriter, SDiskDataBuilder *pBuilde _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -738,7 +738,7 @@ static int32_t tsdbCommitFileDataEnd(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -764,7 +764,7 @@ static int32_t tsdbMoveCommitData(SCommitter *pCommitter, TABLEID toTable) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -791,7 +791,7 @@ static int32_t tsdbCommitFileData(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); tsdbDataFReaderClose(&pCommitter->dReader.pReader); tsdbDataFWriterClose(&pCommitter->dWriter.pWriter, 0); } @@ -829,7 +829,7 @@ static int32_t tsdbStartCommit(STsdb *pTsdb, SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -886,7 +886,7 @@ static int32_t tsdbCommitDataStart(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -945,7 +945,7 @@ static int32_t tsdbCommitData(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -1031,9 +1031,9 @@ static int32_t tsdbCommitDel(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } else { - tsdbDebug("vgId:%d commit del done, nDel:%" PRId64, TD_VID(pTsdb->pVnode), pMemTable->nDel); + tsdbDebug("vgId:%d, commit del done, nDel:%" PRId64, TD_VID(pTsdb->pVnode), pMemTable->nDel); } return code; } @@ -1056,9 +1056,9 @@ _exit: taosArrayDestroy(pCommitter->aTbDataP); pCommitter->aTbDataP = NULL; if (code || eno) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } else { - tsdbInfo("vgId:%d tsdb end commit", TD_VID(pTsdb->pVnode)); + tsdbInfo("vgId:%d, tsdb end commit", TD_VID(pTsdb->pVnode)); } return code; } @@ -1150,7 +1150,7 @@ static int32_t tsdbNextCommitRow(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1198,7 +1198,7 @@ static int32_t tsdbCommitAheadBlock(SCommitter *pCommitter, SDataBlk *pDataBlk) _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1285,7 +1285,7 @@ static int32_t tsdbCommitMergeBlock(SCommitter *pCommitter, SDataBlk *pDataBlk) _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1360,7 +1360,7 @@ static int32_t tsdbMergeTableData(SCommitter *pCommitter, TABLEID id) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1409,7 +1409,7 @@ static int32_t tsdbInitSttBlockBuilderIfNeed(SCommitter *pCommitter, TABLEID id) _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1453,7 +1453,7 @@ static int32_t tsdbAppendLastBlock(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1557,7 +1557,7 @@ static int32_t tsdbCommitTableData(SCommitter *pCommitter, TABLEID id) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1624,7 +1624,7 @@ static int32_t tsdbCommitFileDataImpl(SCommitter *pCommitter) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pCommitter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; @@ -1654,9 +1654,9 @@ int32_t tsdbFinishCommit(STsdb *pTsdb) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } else { - tsdbInfo("vgId:%d tsdb finish commit", TD_VID(pTsdb->pVnode)); + tsdbInfo("vgId:%d, tsdb finish commit", TD_VID(pTsdb->pVnode)); } return code; } @@ -1670,9 +1670,9 @@ int32_t tsdbRollbackCommit(STsdb *pTsdb) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } else { - tsdbInfo("vgId:%d tsdb rollback commit", TD_VID(pTsdb->pVnode)); + tsdbInfo("vgId:%d, tsdb rollback commit", TD_VID(pTsdb->pVnode)); } return code; } \ No newline at end of file diff --git a/source/dnode/vnode/src/tsdb/tsdbFS.c b/source/dnode/vnode/src/tsdb/tsdbFS.c index 4039520851..72d9c4f69e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS.c +++ b/source/dnode/vnode/src/tsdb/tsdbFS.c @@ -253,7 +253,7 @@ static int32_t tsdbScanAndTryFixFS(STsdb *pTsdb) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s, fid:%d", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code), + tsdbError("vgId:%d, %s failed at line %d since %s, fid:%d", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code), fid); } return code; @@ -428,7 +428,7 @@ static int32_t tsdbNewFileSet(STsdb *pTsdb, SDFileSet *pSetTo, SDFileSet *pSetFr _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -598,7 +598,7 @@ static int32_t tsdbMergeFileSet(STsdb *pTsdb, SDFileSet *pSetOld, SDFileSet *pSe _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -694,7 +694,7 @@ static int32_t tsdbFSApplyChange(STsdb *pTsdb, STsdbFS *pFS) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -731,7 +731,7 @@ int32_t tsdbFSCommit(STsdb *pTsdb) { _exit: tsdbFSDestroy(&fs); if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -746,7 +746,7 @@ int32_t tsdbFSRollback(STsdb *pTsdb) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(errno)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(errno)); } return code; } @@ -792,7 +792,7 @@ int32_t tsdbFSOpen(STsdb *pTsdb, int8_t rollback) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -903,7 +903,7 @@ int32_t tsdbFSCopy(STsdb *pTsdb, STsdbFS *pFS) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -1023,7 +1023,7 @@ int32_t tsdbFSPrepareCommit(STsdb *pTsdb, STsdbFS *pFSNew) { _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } diff --git a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c index 71024408c1..27beb22165 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c +++ b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c @@ -415,7 +415,7 @@ int32_t tsdbWriteBlockIdx(SDataFWriter *pWriter, SArray *aBlockIdx) { pHeadFile->size += size; _exit: - // tsdbTrace("vgId:%d write block idx, offset:%" PRId64 " size:%" PRId64 " nBlockIdx:%d", + // tsdbTrace("vgId:%d, write block idx, offset:%" PRId64 " size:%" PRId64 " nBlockIdx:%d", // TD_VID(pWriter->pTsdb->pVnode), // pHeadFile->offset, size, taosArrayGetSize(aBlockIdx)); return code; @@ -498,12 +498,12 @@ int32_t tsdbWriteSttBlk(SDataFWriter *pWriter, SArray *aSttBlk) { pSttFile->size += size; _exit: - tsdbTrace("vgId:%d tsdb write stt block, loffset:%" PRId64 " size:%" PRId64, TD_VID(pWriter->pTsdb->pVnode), + tsdbTrace("vgId:%d, tsdb write stt block, loffset:%" PRId64 " size:%" PRId64, TD_VID(pWriter->pTsdb->pVnode), pSttFile->offset, size); return code; _err: - tsdbError("vgId:%d tsdb write blockl failed since %s", TD_VID(pWriter->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, tsdb write blockl failed since %s", TD_VID(pWriter->pTsdb->pVnode), tstrerror(code)); return code; } @@ -539,7 +539,7 @@ static int32_t tsdbWriteBlockSma(SDataFWriter *pWriter, SBlockData *pBlockData, return code; _err: - tsdbError("vgId:%d tsdb write block sma failed since %s", TD_VID(pWriter->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, tsdb write block sma failed since %s", TD_VID(pWriter->pTsdb->pVnode), tstrerror(code)); return code; } @@ -601,13 +601,13 @@ int32_t tsdbWriteBlockData(SDataFWriter *pWriter, SBlockData *pBlockData, SBlock } _exit: - tsdbTrace("vgId:%d tsdb write block data, suid:%" PRId64 " uid:%" PRId64 " nRow:%d, offset:%" PRId64 " size:%d", + tsdbTrace("vgId:%d, tsdb write block data, suid:%" PRId64 " uid:%" PRId64 " nRow:%d, offset:%" PRId64 " size:%d", TD_VID(pWriter->pTsdb->pVnode), pBlockData->suid, pBlockData->uid, pBlockData->nRow, pBlkInfo->offset, pBlkInfo->szBlock); return code; _err: - tsdbError("vgId:%d tsdb write block data failed since %s", TD_VID(pWriter->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, tsdb write block data failed since %s", TD_VID(pWriter->pTsdb->pVnode), tstrerror(code)); return code; } @@ -732,7 +732,7 @@ int32_t tsdbWriteDiskData(SDataFWriter *pWriter, const SDiskData *pDiskData, SBl _exit: if (code) { - tsdbError("vgId:%d %s failed at %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at %d since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -882,7 +882,7 @@ int32_t tsdbDataFReaderOpen(SDataFReader **ppReader, STsdb *pTsdb, SDFileSet *pS _exit: if (code) { *ppReader = NULL; - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); if (pReader) { for (int32_t iStt = 0; iStt < pSet->nSttF; iStt++) tsdbCloseFile(&pReader->aSttFD[iStt]); @@ -995,7 +995,7 @@ int32_t tsdbReadSttBlk(SDataFReader *pReader, int32_t iStt, SArray *aSttBlk) { return code; _err: - tsdbError("vgId:%d read stt blk failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, read stt blk failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); return code; } @@ -1058,7 +1058,7 @@ int32_t tsdbReadBlockSma(SDataFReader *pReader, SDataBlk *pDataBlk, SArray *aCol return code; _err: - tsdbError("vgId:%d tsdb read block sma failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, tsdb read block sma failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); return code; } @@ -1177,7 +1177,7 @@ _exit: return code; _err: - tsdbError("vgId:%d tsdb read block data impl failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, tsdb read block data impl failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); return code; } @@ -1200,7 +1200,7 @@ int32_t tsdbReadDataBlockEx(SDataFReader *pReader, SDataBlk *pDataBlk, SBlockDat return code; _err: - tsdbError("vgId:%d tsdb read data block ex failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, tsdb read data block ex failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); return code; } @@ -1258,7 +1258,7 @@ int32_t tsdbReadDataBlock(SDataFReader *pReader, SDataBlk *pDataBlk, SBlockData return code; _err: - tsdbError("vgId:%d tsdb read data block failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); + tsdbError("vgId:%d, tsdb read data block failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); return code; } @@ -1271,7 +1271,7 @@ int32_t tsdbReadSttBlock(SDataFReader *pReader, int32_t iStt, SSttBlk *pSttBlk, _exit: if (code) { - tsdbError("vgId:%d %s failed at %d since %s", TD_VID(pReader->pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at %d since %s", TD_VID(pReader->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -1294,7 +1294,7 @@ int32_t tsdbReadSttBlockEx(SDataFReader *pReader, int32_t iStt, SSttBlk *pSttBlk _exit: if (code) { - tsdbError("vgId:%d %s failed at %d since %s", TD_VID(pReader->pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at %d since %s", TD_VID(pReader->pTsdb->pVnode), __func__, lino, tstrerror(code)); } return code; } @@ -1338,7 +1338,7 @@ _exit: taosMemoryFree(pDelFWriter); } *ppWriter = NULL; - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(errno)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(errno)); } else { *ppWriter = pDelFWriter; } @@ -1502,7 +1502,7 @@ int32_t tsdbDelFReaderOpen(SDelFReader **ppReader, SDelFile *pFile, STsdb *pTsdb _exit: if (code) { *ppReader = NULL; - tsdbError("vgId:%d %s failed at %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); } else { *ppReader = pDelFReader; } diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index f9d9349a1c..ec89bed17a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -174,7 +174,7 @@ static int32_t tsdbSnapReadOpenFile(STsdbSnapReader* pReader) { return code; _err: - tsdbError("vgId:%d vnode snapshot tsdb snap read open file failed since %s", TD_VID(pReader->pTsdb->pVnode), + tsdbError("vgId:%d, vnode snapshot tsdb snap read open file failed since %s", TD_VID(pReader->pTsdb->pVnode), tstrerror(code)); return code; } @@ -517,7 +517,7 @@ int32_t tsdbSnapReaderOpen(STsdb* pTsdb, int64_t sver, int64_t ever, int8_t type _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s, TSDB path: %s", TD_VID(pTsdb->pVnode), __func__, lino, + tsdbError("vgId:%d, %s failed at line %d since %s, TSDB path: %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code), pTsdb->path); *ppReader = NULL; @@ -738,7 +738,7 @@ static int32_t tsdbSnapWriteTableDataStart(STsdbSnapWriter* pWriter, TABLEID* pI return code; _err: - tsdbError("vgId:%d %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code)); + tsdbError("vgId:%d, %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code)); return code; } @@ -991,7 +991,7 @@ _exit: return code; _err: - tsdbError("vgId:%d %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code)); + tsdbError("vgId:%d, %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code)); return code; } @@ -1072,7 +1072,7 @@ _exit: return code; _err: - tsdbError("vgId:%d %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code)); + tsdbError("vgId:%d, %s failed since %s", TD_VID(pWriter->pTsdb->pVnode), __func__, tstrerror(code)); return code; } @@ -1338,7 +1338,7 @@ int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWr _exit: if (code) { - tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); + tsdbError("vgId:%d, %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); *ppWriter = NULL; if (pWriter) { diff --git a/source/dnode/vnode/src/vnd/vnodeBufPool.c b/source/dnode/vnode/src/vnd/vnodeBufPool.c index 682f2b4225..6ac2ce1c16 100644 --- a/source/dnode/vnode/src/vnd/vnodeBufPool.c +++ b/source/dnode/vnode/src/vnd/vnodeBufPool.c @@ -174,12 +174,12 @@ void vnodeBufPoolUnRef(SVBufPool *pPool) { if (pPool->node.size != size) { SVBufPool *pPoolT = NULL; if (vnodeBufPoolCreate(pVnode, size, &pPoolT) < 0) { - vWarn("vgId:%d try to change buf pools size from %" PRId64 " to %" PRId64 " since %s", TD_VID(pVnode), + vWarn("vgId:%d, try to change buf pools size from %" PRId64 " to %" PRId64 " since %s", TD_VID(pVnode), pPool->node.size, size, tstrerror(errno)); } else { vnodeBufPoolDestroy(pPool); pPool = pPoolT; - vDebug("vgId:%d change buf pools size from %" PRId64 " to %" PRId64, TD_VID(pVnode), pPool->node.size, size); + vDebug("vgId:%d, change buf pools size from %" PRId64 " to %" PRId64, TD_VID(pVnode), pPool->node.size, size); } } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 24b678b5eb..6f4364c0c7 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -293,7 +293,7 @@ int vnodeCommit(SVnode *pVnode) { _exit: if (code) { - vError("vgId:%d %s failed at line %d since %s", TD_VID(pVnode), __func__, lino, tstrerror(code)); + vError("vgId:%d, %s failed at line %d since %s", TD_VID(pVnode), __func__, lino, tstrerror(code)); } else { vInfo("vgId:%d, commit end", TD_VID(pVnode)); } diff --git a/source/dnode/vnode/src/vnd/vnodeSnapshot.c b/source/dnode/vnode/src/vnd/vnodeSnapshot.c index 9cbb1b8af4..e8cdf9513f 100644 --- a/source/dnode/vnode/src/vnd/vnodeSnapshot.c +++ b/source/dnode/vnode/src/vnd/vnodeSnapshot.c @@ -219,7 +219,7 @@ _exit: return code; _err: - vError("vgId:%d vnode snapshot read failed since %s", TD_VID(pReader->pVnode), tstrerror(code)); + vError("vgId:%d, vnode snapshot read failed since %s", TD_VID(pReader->pVnode), tstrerror(code)); return code; } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index d3d3a7ed95..c8089ead99 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -1089,18 +1089,18 @@ static int32_t vnodeProcessAlterConfigReq(SVnode *pVnode, int64_t version, void } if (pVnode->config.szBuf != req.buffer * 1024LL * 1024LL) { - vInfo("vgId:%d vnode buffer is changed from %" PRId64 " to %" PRId64, TD_VID(pVnode), pVnode->config.szBuf, + vInfo("vgId:%d, vnode buffer is changed from %" PRId64 " to %" PRId64, TD_VID(pVnode), pVnode->config.szBuf, (uint64_t)(req.buffer * 1024LL * 1024LL)); pVnode->config.szBuf = req.buffer * 1024LL * 1024LL; } if (pVnode->config.szCache != req.pages) { if (metaAlterCache(pVnode->pMeta, req.pages) < 0) { - vError("vgId:%d failed to change vnode pages from %d to %d failed since %s", TD_VID(pVnode), + vError("vgId:%d, failed to change vnode pages from %d to %d failed since %s", TD_VID(pVnode), pVnode->config.szCache, req.pages, tstrerror(errno)); return errno; } else { - vInfo("vgId:%d vnode pages is changed from %d to %d", TD_VID(pVnode), pVnode->config.szCache, req.pages); + vInfo("vgId:%d, vnode pages is changed from %d to %d", TD_VID(pVnode), pVnode->config.szCache, req.pages); pVnode->config.szCache = req.pages; } } diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 55de61eb74..a4c2be4661 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -528,7 +528,7 @@ int walCheckAndRepairIdxFile(SWal* pWal, int32_t fileIdx) { idxEntry.offset, fLogNameStr); goto _err; } - wWarn("vgId:%d wal idx append new entry %" PRId64 " %" PRId64, pWal->cfg.vgId, idxEntry.ver, idxEntry.offset); + wWarn("vgId:%d, wal idx append new entry %" PRId64 " %" PRId64, pWal->cfg.vgId, idxEntry.ver, idxEntry.offset); if (taosWriteFile(pIdxFile, &idxEntry, sizeof(SWalIdxEntry)) < 0) { wError("vgId:%d, failed to append file since %s. file:%s", pWal->cfg.vgId, terrstr(), fnameStr); goto _err; @@ -812,7 +812,7 @@ int walLoadMeta(SWal* pWal) { // find existing meta file int metaVer = walFindCurMetaVer(pWal); if (metaVer == -1) { - wDebug("vgId:%d wal find meta ver %d", pWal->cfg.vgId, metaVer); + wDebug("vgId:%d, wal find meta ver %d", pWal->cfg.vgId, metaVer); return -1; } char fnameStr[WAL_FILE_LEN]; @@ -822,7 +822,7 @@ int walLoadMeta(SWal* pWal) { taosStatFile(fnameStr, &fileSize, NULL); if (fileSize == 0) { taosRemoveFile(fnameStr); - wDebug("vgId:%d wal find empty meta ver %d", pWal->cfg.vgId, metaVer); + wDebug("vgId:%d, wal find empty meta ver %d", pWal->cfg.vgId, metaVer); return -1; } int size = (int)fileSize; diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index 29058cada1..0df1a6b387 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -138,12 +138,12 @@ SWal *walOpen(const char *path, SWalCfg *pCfg) { (void)walLoadMeta(pWal); if (walCheckAndRepairMeta(pWal) < 0) { - wError("vgId:%d cannot open wal since repair meta file failed", pWal->cfg.vgId); + wError("vgId:%d, cannot open wal since repair meta file failed", pWal->cfg.vgId); goto _err; } if (walCheckAndRepairIdx(pWal) < 0) { - wError("vgId:%d cannot open wal since repair idx file failed", pWal->cfg.vgId); + wError("vgId:%d, cannot open wal since repair idx file failed", pWal->cfg.vgId); goto _err; } diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 3354308c49..d665e13aaf 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -44,20 +44,20 @@ int32_t walRestoreFromSnapshot(SWal *pWal, int64_t ver) { walBuildLogName(pWal, pFileInfo->firstVer, fnameStr); if (taosRemoveFile(fnameStr) < 0) { terrno = TAOS_SYSTEM_ERROR(errno); - wError("vgId:%d restore from snapshot, cannot remove file %s since %s", pWal->cfg.vgId, fnameStr, terrstr()); + wError("vgId:%d, restore from snapshot, cannot remove file %s since %s", pWal->cfg.vgId, fnameStr, terrstr()); taosThreadMutexUnlock(&pWal->mutex); return -1; } - wInfo("vgId:%d restore from snapshot, remove file %s", pWal->cfg.vgId, fnameStr); + wInfo("vgId:%d, restore from snapshot, remove file %s", pWal->cfg.vgId, fnameStr); walBuildIdxName(pWal, pFileInfo->firstVer, fnameStr); if (taosRemoveFile(fnameStr) < 0) { terrno = TAOS_SYSTEM_ERROR(errno); - wError("vgId:%d cannot remove file %s since %s", pWal->cfg.vgId, fnameStr, terrstr()); + wError("vgId:%d, cannot remove file %s since %s", pWal->cfg.vgId, fnameStr, terrstr()); taosThreadMutexUnlock(&pWal->mutex); return -1; } - wInfo("vgId:%d restore from snapshot, remove file %s", pWal->cfg.vgId, fnameStr); + wInfo("vgId:%d, restore from snapshot, remove file %s", pWal->cfg.vgId, fnameStr); } } walRemoveMeta(pWal); diff --git a/tests/script/tsim/db/alter_replica_13.sim b/tests/script/tsim/db/alter_replica_13.sim index 1d06d3abb9..db64d4ede3 100644 --- a/tests/script/tsim/db/alter_replica_13.sim +++ b/tests/script/tsim/db/alter_replica_13.sim @@ -134,6 +134,7 @@ if $rows != 1 then return -1 endi +return 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 From 2953a8868b52acf852a402a2149649186987b955 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 21 Oct 2022 10:40:02 +0800 Subject: [PATCH 76/99] enh: alter db replica --- source/dnode/mgmt/mgmt_vnode/src/vmHandle.c | 21 +++++++++++++++++++-- source/dnode/mnode/impl/src/mndTrans.c | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index a121ff656e..b81e2d886d 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -267,7 +267,7 @@ _OVER: int32_t vmProcessAlterVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SAlterVnodeReplicaReq alterReq = {0}; - if (tSerializeSAlterVnodeReplicaReq(pMsg->pCont, pMsg->contLen, &alterReq) != 0) { + if (tDeserializeSAlterVnodeReplicaReq(pMsg->pCont, pMsg->contLen, &alterReq) != 0) { terrno = TSDB_CODE_INVALID_MSG; return -1; } @@ -283,6 +283,12 @@ int32_t vmProcessAlterVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, start to close vnode", vgId); + SWrapperCfg wrapperCfg = { + .dropped = pVnode->dropped, + .vgId = pVnode->vgId, + .vgVersion = pVnode->vgVersion, + }; + tstrncpy(wrapperCfg.path, pVnode->path, sizeof(wrapperCfg.path)); vmCloseVnode(pMgmt, pVnode); char path[TSDB_FILENAME_LEN] = {0}; @@ -295,11 +301,22 @@ int32_t vmProcessAlterVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } dInfo("vgId:%d, start to open vnode", vgId); - if (vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb) < 0) { + SVnode *pImpl = vnodeOpen(path, pMgmt->pTfs, pMgmt->msgCb); + if (pImpl == NULL) { dError("vgId:%d, failed to open vnode at %s since %s", vgId, path, terrstr()); return -1; } + if (vmOpenVnode(pMgmt, &wrapperCfg, pImpl) != 0) { + dError("vgId:%d, failed to open vnode mgmt since %s", vgId, terrstr()); + return -1; + } + + if (vnodeStart(pImpl) != 0) { + dError("vgId:%d, failed to start sync since %s", vgId, terrstr()); + return -1; + } + dInfo("vgId:%d, vnode config is altered", vgId); return 0; } diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index a64b07fdbd..5bbd64e04a 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -323,7 +323,7 @@ static SSdbRow *mndTransActionDecode(SSdbRaw *pRaw) { SDB_GET_INT32(pRaw, dataPos, &dataLen, _OVER) action.pRaw = taosMemoryMalloc(dataLen); if (action.pRaw == NULL) goto _OVER; - mTrace("raw:%p, is created", pData); + mTrace("raw:%p, is created", action.pRaw); SDB_GET_BINARY(pRaw, dataPos, (void *)action.pRaw, dataLen, _OVER); if (taosArrayPush(pTrans->redoActions, &action) == NULL) goto _OVER; action.pRaw = NULL; From e0b5b9263ebd7a8915eb30754508814474eb3fcd Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 21 Oct 2022 10:42:24 +0800 Subject: [PATCH 77/99] refactor: remove unused code --- include/libs/stream/tstream.h | 2 +- source/dnode/mnode/impl/src/mndScheduler.c | 3 +++ source/libs/stream/src/streamMeta.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/libs/stream/tstream.h b/include/libs/stream/tstream.h index 247293dbb6..2ab0dc828e 100644 --- a/include/libs/stream/tstream.h +++ b/include/libs/stream/tstream.h @@ -538,7 +538,7 @@ typedef struct SStreamMeta { SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandFunc); void streamMetaClose(SStreamMeta* streamMeta); -int32_t streamMetaAddTask(SStreamMeta* pMeta, SStreamTask* pTask); +// int32_t streamMetaAddTask(SStreamMeta* pMeta, SStreamTask* pTask); int32_t streamMetaAddSerializedTask(SStreamMeta* pMeta, int64_t startVer, char* msg, int32_t msgLen); int32_t streamMetaRemoveTask(SStreamMeta* pMeta, int32_t taskId); SStreamTask* streamMetaGetTask(SStreamMeta* pMeta, int32_t taskId); diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index 1c8ec0a302..e88d53df24 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -239,6 +239,7 @@ int32_t mndAddShuffleSinkTasksToStream(SMnode* pMnode, SStreamObj* pStream) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } + pTask->fillHistory = pStream->fillHistory; mndAddTaskToTaskSet(tasks, pTask); pTask->nodeId = pVgroup->vgId; @@ -270,6 +271,7 @@ int32_t mndAddFixedSinkTaskToStream(SMnode* pMnode, SStreamObj* pStream) { terrno = TSDB_CODE_OUT_OF_MEMORY; return -1; } + pTask->fillHistory = pStream->fillHistory; mndAddTaskToTaskSet(tasks, pTask); ASSERT(pStream->fixedSinkVg.vgId == pStream->fixedSinkVgId); @@ -356,6 +358,7 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { qDestroyQueryPlan(pPlan); return -1; } + pInnerTask->fillHistory = pStream->fillHistory; mndAddTaskToTaskSet(taskInnerLevel, pInnerTask); pInnerTask->childEpInfo = taosArrayInit(0, sizeof(void*)); diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index d489cc044b..84abab01e3 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -127,6 +127,7 @@ FAIL: return -1; } +#if 0 int32_t streamMetaAddTask(SStreamMeta* pMeta, SStreamTask* pTask) { void* buf = NULL; if (pMeta->expandFunc(pMeta->ahandle, pTask) < 0) { @@ -156,6 +157,7 @@ int32_t streamMetaAddTask(SStreamMeta* pMeta, SStreamTask* pTask) { return 0; } +#endif SStreamTask* streamMetaGetTask(SStreamMeta* pMeta, int32_t taskId) { SStreamTask** ppTask = (SStreamTask**)taosHashGet(pMeta->pTasks, &taskId, sizeof(int32_t)); From 416b257b5e33b423df99919c8e5484cd1a1576ee Mon Sep 17 00:00:00 2001 From: slzhou Date: Fri, 21 Oct 2022 10:54:11 +0800 Subject: [PATCH 78/99] fix: get next row from rb tree from last files when backward scaning --- source/dnode/vnode/src/tsdb/tsdbMergeTree.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 2f4fdfc5f8..62b9550744 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -530,6 +530,10 @@ static FORCE_INLINE int32_t tLDataIterCmprFn(const SRBTreeNode *p1, const SRBTre } } +static FORCE_INLINE int32_t tLDataIterDescCmprFn(const SRBTreeNode *p1, const SRBTreeNode *p2) { + return -1 * tLDataIterCmprFn(p1, p2); +} + int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFReader, uint64_t suid, uint64_t uid, STimeWindow *pTimeWindow, SVersionRange *pVerRange, SSttBlockLoadInfo *pBlockLoadInfo, bool destroyLoadInfo, const char *idStr) { @@ -541,8 +545,11 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader *pFRead } pMTree->idStr = idStr; - - tRBTreeCreate(&pMTree->rbt, tLDataIterCmprFn); + if (!pMTree->backward) { // asc + tRBTreeCreate(&pMTree->rbt, tLDataIterCmprFn); + } else { // desc + tRBTreeCreate(&pMTree->rbt, tLDataIterDescCmprFn); + } int32_t code = TSDB_CODE_SUCCESS; pMTree->pLoadInfo = pBlockLoadInfo; From ea6c2667626bf34e9646e4555777dd0df616d827 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 21 Oct 2022 11:03:03 +0800 Subject: [PATCH 79/99] test: add case for alter dnode --- tests/script/tsim/alter/dnode.sim | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/script/tsim/alter/dnode.sim b/tests/script/tsim/alter/dnode.sim index be3c385d45..8cfa86a88a 100644 --- a/tests/script/tsim/alter/dnode.sim +++ b/tests/script/tsim/alter/dnode.sim @@ -32,6 +32,26 @@ sql alter dnode 1 'rpcDebugFlag 131' sql alter dnode 1 'qDebugFlag 131' sql alter dnode 1 'metaDebugFlag 131' +sql alter dnode 1 'debugFlag' '135' +sql alter dnode 1 'dDebugFlag' '131' +sql alter dnode 1 'vDebugFlag' '131' +sql alter dnode 1 'mDebugFlag' '131' +sql alter dnode 1 'wDebugFlag' '131' +sql alter dnode 1 'sDebugFlag' '131' +sql alter dnode 1 'tsdbDebugFlag' '131' +sql alter dnode 1 'tqDebugFlag' '131' +sql alter dnode 1 'fsDebugFlag' '131' +sql alter dnode 1 'udfDebugFlag' '131' +sql alter dnode 1 'smaDebugFlag' '131' +sql alter dnode 1 'idxDebugFlag' '131' +sql alter dnode 1 'tdbDebugFlag' '131' +sql alter dnode 1 'tmrDebugFlag' '131' +sql alter dnode 1 'uDebugFlag' '131' +sql alter dnode 1 'smaDebugFlag' '131' +sql alter dnode 1 'rpcDebugFlag' '131' +sql alter dnode 1 'qDebugFlag' '131' +sql alter dnode 1 'metaDebugFlag' '131' + sql_error alter dnode 2 'wDebugFlag 135' sql_error alter dnode 2 'tmrDebugFlag 135' sql_error alter dnode 1 'monDebugFlag 131' @@ -39,6 +59,13 @@ sql_error alter dnode 1 'cqDebugFlag 131' sql_error alter dnode 1 'httpDebugFlag 131' sql_error alter dnode 1 'mqttDebugFlag 131' +sql_error alter dnode 2 'wDebugFlag' '135' +sql_error alter dnode 2 'tmrDebugFlag' '135' +sql_error alter dnode 1 'monDebugFlag' '131' +sql_error alter dnode 1 'cqDebugFlag' '131' +sql_error alter dnode 1 'httpDebugFlag' '131' +sql_error alter dnode 1 'mqttDebugFlag' '131' + print ======== step3 sql_error alter $hostname1 debugFlag 135 sql_error alter $hostname1 monDebugFlag 135 From 26d4af6968de6865060cf64e641c34b9f00e23e6 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 21 Oct 2022 11:42:30 +0800 Subject: [PATCH 80/99] fix: memory leak --- source/dnode/mnode/impl/src/mndScheduler.c | 1 + source/dnode/mnode/impl/src/mndStream.c | 2 ++ source/libs/stream/src/streamMeta.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/dnode/mnode/impl/src/mndScheduler.c b/source/dnode/mnode/impl/src/mndScheduler.c index e88d53df24..6c54d41818 100644 --- a/source/dnode/mnode/impl/src/mndScheduler.c +++ b/source/dnode/mnode/impl/src/mndScheduler.c @@ -425,6 +425,7 @@ int32_t mndScheduleStream(SMnode* pMnode, SStreamObj* pStream) { qDestroyQueryPlan(pPlan); return -1; } + pTask->fillHistory = pStream->fillHistory; mndAddTaskToTaskSet(taskSourceLevel, pTask); pTask->triggerParam = 0; diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 6fffdf9a59..3ff989e670 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -143,8 +143,10 @@ SSdbRow *mndStreamActionDecode(SSdbRaw *pRaw) { SDecoder decoder; tDecoderInit(&decoder, buf, tlen + 1); if (tDecodeSStreamObj(&decoder, pStream) < 0) { + tDecoderClear(&decoder); goto STREAM_DECODE_OVER; } + tDecoderClear(&decoder); terrno = TSDB_CODE_SUCCESS; diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index 84abab01e3..cc10f01469 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -94,7 +94,7 @@ int32_t streamMetaAddSerializedTask(SStreamMeta* pMeta, int64_t startVer, char* SDecoder decoder; tDecoderInit(&decoder, (uint8_t*)msg, msgLen); if (tDecodeSStreamTask(&decoder, pTask) < 0) { - ASSERT(0); + tDecoderClear(&decoder); goto FAIL; } tDecoderClear(&decoder); From d9beaeb3a36179a142b3d89a938c6c5cb85b1b44 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Fri, 21 Oct 2022 10:37:58 +0800 Subject: [PATCH 81/99] fix(stream):session window max_delay crash --- source/libs/executor/src/executorimpl.c | 15 ++++++++++----- source/libs/executor/src/timewindowoperator.c | 19 ++++++++++++------- source/libs/stream/src/streamState.c | 1 + source/libs/stream/test/CMakeLists.txt | 15 ++++++++++----- tests/script/tsim/stream/triggerSession0.sim | 2 +- 5 files changed, 34 insertions(+), 18 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index a6ca563d76..f703ebb355 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -469,7 +469,7 @@ static int32_t doCreateConstantValColumnInfo(SInputColumnInfoData* pInput, SFunc static int32_t doSetInputDataBlock(SExprSupp* pExprSup, SSDataBlock* pBlock, int32_t order, int32_t scanFlag, bool createDummyCol) { - int32_t code = TSDB_CODE_SUCCESS; + int32_t code = TSDB_CODE_SUCCESS; SqlFunctionCtx* pCtx = pExprSup->pCtx; for (int32_t i = 0; i < pExprSup->numOfExprs; ++i) { @@ -3036,7 +3036,8 @@ void cleanupExprSupp(SExprSupp* pSupp) { taosMemoryFree(pSupp->rowEntryInfoOffset); } -SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* pAggNode,SExecTaskInfo* pTaskInfo) { +SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SAggPhysiNode* pAggNode, + SExecTaskInfo* pTaskInfo) { SAggOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SAggOperatorInfo)); SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo)); if (pInfo == NULL || pOperator == NULL) { @@ -3055,9 +3056,9 @@ SOperatorInfo* createAggregateOperatorInfo(SOperatorInfo* downstream, SAggPhysiN size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; initResultSizeInfo(&pOperator->resultInfo, 4096); - int32_t num = 0; - SExprInfo* pExprInfo = createExprInfo(pAggNode->pAggFuncs, pAggNode->pGroupKeys, &num); - int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); + int32_t num = 0; + SExprInfo* pExprInfo = createExprInfo(pAggNode->pAggFuncs, pAggNode->pGroupKeys, &num); + int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; } @@ -4283,6 +4284,10 @@ int32_t buildSessionResultDataBlock(SOperatorInfo* pOperator, SStreamState* pSta void* pVal = NULL; int32_t code = streamStateSessionGet(pState, pKey, &pVal, &size); ASSERT(code == 0); + if (code == -1) { + // coverity scan + continue; + } SResultRow* pRow = (SResultRow*)pVal; doUpdateNumOfRows(pCtx, pRow, numOfExprs, rowEntryOffset); // no results, continue to check the next one diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 4ff5722748..823b457f89 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -2667,8 +2667,8 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SStateWi size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; - int32_t num = 0; - SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &num); + int32_t num = 0; + SExprInfo* pExprInfo = createExprInfo(pStateNode->window.pFuncs, NULL, &num); initResultSizeInfo(&pOperator->resultInfo, 4096); int32_t code = initAggInfo(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { @@ -3986,7 +3986,8 @@ int32_t closeSessionWindow(SSHashObj* pHashMap, STimeWindowAggSupp* pTwSup, SSHa return code; } } - tSimpleHashIterateRemove(pHashMap, &pWinInfo->sessionWin, sizeof(SSessionKey), &pIte, &iter); + SSessionKey* pKey = tSimpleHashGetKey(pIte, &keyLen); + tSimpleHashIterateRemove(pHashMap, pKey, sizeof(SSessionKey), &pIte, &iter); } } return TSDB_CODE_SUCCESS; @@ -4006,7 +4007,7 @@ int32_t getAllSessionWindow(SSHashObj* pHashMap, SSHashObj* pStUpdated) { void* pIte = NULL; int32_t iter = 0; while ((pIte = tSimpleHashIterate(pHashMap, pIte, &iter)) != NULL) { - SResultWindowInfo* pWinInfo = *(void**)pIte; + SResultWindowInfo* pWinInfo = pIte; saveResult(*pWinInfo, pStUpdated); } return TSDB_CODE_SUCCESS; @@ -4584,6 +4585,12 @@ static void doStreamStateAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl T_LONG_JMP(pTaskInfo->env, TSDB_CODE_QRY_OUT_OF_MEMORY); } } + + if (pInfo->twAggSup.calTrigger == STREAM_TRIGGER_WINDOW_CLOSE) { + SSessionKey key = curWin.winInfo.sessionWin; + key.win.ekey = key.win.skey; + tSimpleHashPut(pAggSup->pResultRows, &key, sizeof(SSessionKey), &curWin.winInfo, sizeof(SResultWindowInfo)); + } } } @@ -4974,8 +4981,6 @@ SOperatorInfo* createMergeAlignedIntervalOperatorInfo(SOperatorInfo* downstream, goto _error; } - - SInterval interval = {.interval = pNode->interval, .sliding = pNode->sliding, .intervalUnit = pNode->intervalUnit, @@ -5523,7 +5528,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys } } - size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; + size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES; code = initAggInfo(pSup, &pInfo->aggSup, pExprInfo, numOfCols, keyBufSize, pTaskInfo->id.str); if (code != TSDB_CODE_SUCCESS) { goto _error; diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c index 4b3affa9de..1c44af49b7 100644 --- a/source/libs/stream/src/streamState.c +++ b/source/libs/stream/src/streamState.c @@ -656,6 +656,7 @@ int32_t streamStateSessionGetKey(SStreamState* pState, const SSessionKey* key, S streamStateCurPrev(pState, pCur); } *curKey = resKey; + streamStateFreeCur(pCur); return res; } diff --git a/source/libs/stream/test/CMakeLists.txt b/source/libs/stream/test/CMakeLists.txt index 96209f6812..5a97ba45f6 100644 --- a/source/libs/stream/test/CMakeLists.txt +++ b/source/libs/stream/test/CMakeLists.txt @@ -9,12 +9,17 @@ AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} SOURCE_LIST) ADD_EXECUTABLE(streamUpdateTest "tstreamUpdateTest.cpp") TARGET_LINK_LIBRARIES( - streamUpdateTest - PUBLIC os util common gtest stream + streamUpdateTest + PUBLIC os util common gtest stream ) TARGET_INCLUDE_DIRECTORIES( - streamUpdateTest - PUBLIC "${TD_SOURCE_DIR}/include/libs/stream/" - PRIVATE "${TD_SOURCE_DIR}/source/libs/stream/inc" + streamUpdateTest + PUBLIC "${TD_SOURCE_DIR}/include/libs/stream/" + PRIVATE "${TD_SOURCE_DIR}/source/libs/stream/inc" +) + +add_test( + NAME streamUpdateTest + COMMAND streamUpdateTest ) \ No newline at end of file diff --git a/tests/script/tsim/stream/triggerSession0.sim b/tests/script/tsim/stream/triggerSession0.sim index 1bef439884..4c664cf7c7 100644 --- a/tests/script/tsim/stream/triggerSession0.sim +++ b/tests/script/tsim/stream/triggerSession0.sim @@ -5,7 +5,7 @@ sleep 50 sql connect print =============== create database -sql create database test vgroups 1 +sql create database test vgroups 1; sql select * from information_schema.ins_databases if $rows != 3 then return -1 From 5039648174cfe02bc756b07c1b2295ac6d55eace Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Fri, 21 Oct 2022 11:51:03 +0800 Subject: [PATCH 82/99] fix(shell): forbied tab feature on windows --- tools/shell/src/shellCommand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index a0ac8e07c7..5235030cf9 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -500,9 +500,11 @@ int32_t shellReadCommand(char *command) { } shellInsertChar(&cmd, utf8_array, count); pressOtherKey(c); +#ifndef WINDOWS } else if (c == TAB_KEY) { // press TAB key pressTabKey(&cmd); +#endif } else if (c < '\033') { pressOtherKey(c); // Ctrl keys. TODO: Implement ctrl combinations From 7b30eedec0b91cb33e4c393a299e4ab8e3cfa0ef Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 21 Oct 2022 13:24:51 +0800 Subject: [PATCH 83/99] avoid invalid read/write --- source/libs/transport/src/thttp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 2399891f6d..189af06d38 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -234,7 +234,15 @@ int32_t taosSendHttpReport(const char* server, uint16_t port, char* pCont, int32 cli->addr = tstrdup(server); cli->port = port; - uv_loop_t* loop = uv_default_loop(); + uv_loop_t* loop = taosMemoryMalloc(sizeof(uv_loop_t)); + int err = uv_loop_init(loop); + if (err != 0) { + uError("http-report failed to init uv_loop, reason: %s", uv_strerror(err)); + taosMemoryFree(loop); + terrno = TAOS_SYSTEM_ERROR(err); + destroyHttpClient(cli); + return -1; + } uv_tcp_init(loop, &cli->tcp); // set up timeout to avoid stuck; int32_t fd = taosCreateSocketWithTimeout(5); From fd06e0717d1baabdb4c79e1834a54739909c2be8 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 21 Oct 2022 13:28:13 +0800 Subject: [PATCH 84/99] avoid invalid read/write --- source/libs/transport/src/thttp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/transport/src/thttp.c b/source/libs/transport/src/thttp.c index 189af06d38..a583632765 100644 --- a/source/libs/transport/src/thttp.c +++ b/source/libs/transport/src/thttp.c @@ -241,7 +241,7 @@ int32_t taosSendHttpReport(const char* server, uint16_t port, char* pCont, int32 taosMemoryFree(loop); terrno = TAOS_SYSTEM_ERROR(err); destroyHttpClient(cli); - return -1; + return terrno; } uv_tcp_init(loop, &cli->tcp); // set up timeout to avoid stuck; @@ -266,5 +266,6 @@ int32_t taosSendHttpReport(const char* server, uint16_t port, char* pCont, int32 uv_run(loop, UV_RUN_DEFAULT); uv_loop_close(loop); + taosMemoryFree(loop); return terrno; } From 0e09ed7dcbb309c446f6c99beb9a03809e8da4f4 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Fri, 21 Oct 2022 13:32:15 +0800 Subject: [PATCH 85/99] Update compatibility.py --- tests/system-test/0-others/compatibility.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index 7539ddcbea..04cbcb4e54 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -97,8 +97,8 @@ class TDTestCase: tdLog.info(f"Base client version is {oldClientVersion}") tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}") - tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") - os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") + tdLog.info(f" LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") + os.system(f"LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") sleep(3) # # tdsqlF.query(f"select count(*) from {stb}") From c1bb99fec94ecafe697acbd9ba46d5d236793ac6 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Fri, 21 Oct 2022 15:17:56 +0800 Subject: [PATCH 86/99] Update compatibility.py --- tests/system-test/0-others/compatibility.py | 88 ++++++++++----------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/system-test/0-others/compatibility.py b/tests/system-test/0-others/compatibility.py index 04cbcb4e54..e81579a9e4 100644 --- a/tests/system-test/0-others/compatibility.py +++ b/tests/system-test/0-others/compatibility.py @@ -101,55 +101,55 @@ class TDTestCase: os.system(f"LD_LIBRARY_PATH=/usr/lib taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ") sleep(3) -# # tdsqlF.query(f"select count(*) from {stb}") -# # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) -# os.system("pkill taosd") -# sleep(1) + # tdsqlF.query(f"select count(*) from {stb}") + # tdsqlF.checkData(0,0,tableNumbers*recordNumbers1) + os.system("pkill taosd") + sleep(1) -# tdLog.printNoPrefix("==========step2:update new version ") -# self.buildTaosd(bPath) -# tdDnodes.start(1) -# sleep(1) -# tdsql=tdCom.newTdSql() -# print(tdsql) + tdLog.printNoPrefix("==========step2:update new version ") + self.buildTaosd(bPath) + tdDnodes.start(1) + sleep(1) + tdsql=tdCom.newTdSql() + print(tdsql) -# tdsql.query(f"SELECT SERVER_VERSION();") -# nowServerVersion=tdsql.queryResult[0][0] -# tdLog.info(f"New server version is {nowServerVersion}") -# tdsql.query(f"SELECT CLIENT_VERSION();") -# nowClientVersion=tdsql.queryResult[0][0] -# tdLog.info(f"New client version is {nowClientVersion}") + tdsql.query(f"SELECT SERVER_VERSION();") + nowServerVersion=tdsql.queryResult[0][0] + tdLog.info(f"New server version is {nowServerVersion}") + tdsql.query(f"SELECT CLIENT_VERSION();") + nowClientVersion=tdsql.queryResult[0][0] + tdLog.info(f"New client version is {nowClientVersion}") -# tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") -# tdsql.query(f"select count(*) from {stb}") -# tdsql.checkData(0,0,tableNumbers*recordNumbers1) -# os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") -# tdsql.query(f"select count(*) from {stb}") -# tdsql.checkData(0,0,tableNumbers*recordNumbers2) + tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}") + tdsql.query(f"select count(*) from {stb}") + tdsql.checkData(0,0,tableNumbers*recordNumbers1) + os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ") + tdsql.query(f"select count(*) from {stb}") + tdsql.checkData(0,0,tableNumbers*recordNumbers2) -# tdsql=tdCom.newTdSql() -# tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") -# tdsql.execute("drop database if exists db") -# tdsql.execute("create database db") -# tdsql.execute("use db") -# tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") -# tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") -# tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") -# tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") -# tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") -# tdsql.query("select * from db.ct3") -# tdsql.checkData(0,1,13) -# tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") -# tdsql.query("select * from db.ct4") -# tdsql.checkData(0,1,14) -# tdsql.query("describe information_schema.ins_databases;") -# qRows=tdsql.queryRows -# for i in range(qRows) : -# if tdsql.queryResult[i][0]=="retentions" : -# return True -# else: -# return False + tdsql=tdCom.newTdSql() + tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542") + tdsql.execute("drop database if exists db") + tdsql.execute("create database db") + tdsql.execute("use db") + tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);") + tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);") + tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);") + tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);") + tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);") + tdsql.query("select * from db.ct3") + tdsql.checkData(0,1,13) + tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);") + tdsql.query("select * from db.ct4") + tdsql.checkData(0,1,14) + tdsql.query("describe information_schema.ins_databases;") + qRows=tdsql.queryRows + for i in range(qRows) : + if tdsql.queryResult[i][0]=="retentions" : + return True + else: + return False def stop(self): tdSql.close() tdLog.success(f"{__file__} successfully executed") From 22a2f37fe5c334e7d65a6f1a3428484d3a5b754b Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Fri, 21 Oct 2022 15:50:08 +0800 Subject: [PATCH 87/99] fix: fix coverity errors --- source/libs/function/src/functionMgt.c | 6 +----- source/libs/function/src/tpercentile.c | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/source/libs/function/src/functionMgt.c b/source/libs/function/src/functionMgt.c index ca8ddbc60a..cfe8ee71ac 100644 --- a/source/libs/function/src/functionMgt.c +++ b/source/libs/function/src/functionMgt.c @@ -324,7 +324,7 @@ static SFunctionNode* createFunction(const char* pName, SNodeList* pParameterLis if (NULL == pFunc) { return NULL; } - strcpy(pFunc->functionName, pName); + snprintf(pFunc->functionName, sizeof(pFunc->functionName), "%s", pName); pFunc->pParameterList = pParameterList; if (TSDB_CODE_SUCCESS != getFuncInfo(pFunc)) { pFunc->pParameterList = NULL; @@ -402,10 +402,6 @@ static int32_t createMergeFunction(const SFunctionNode* pSrcFunc, const SFunctio if (TSDB_CODE_SUCCESS == code) { *pMergeFunc = pFunc; } else { - if (NULL != pFunc) { - pFunc->pParameterList = NULL; - nodesDestroyNode((SNode*)pFunc); - } nodesDestroyList(pParameterList); } diff --git a/source/libs/function/src/tpercentile.c b/source/libs/function/src/tpercentile.c index 62c5e4b28b..6a1427c63f 100644 --- a/source/libs/function/src/tpercentile.c +++ b/source/libs/function/src/tpercentile.c @@ -96,16 +96,19 @@ double findOnlyResult(tMemBucket *pMemBucket) { } int32_t groupId = getGroupId(pMemBucket->numOfSlots, i, pMemBucket->times); - SArray *list = *(SArray **)taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId)); - assert(list->size == 1); + SArray **pList = taosHashGet(pMemBucket->groupPagesMap, &groupId, sizeof(groupId)); + if (pList != NULL) { + SArray *list = *pList; + assert(list->size == 1); - int32_t *pageId = taosArrayGet(list, 0); - SFilePage *pPage = getBufPage(pMemBucket->pBuffer, *pageId); - assert(pPage->num == 1); + int32_t *pageId = taosArrayGet(list, 0); + SFilePage *pPage = getBufPage(pMemBucket->pBuffer, *pageId); + assert(pPage->num == 1); - double v = 0; - GET_TYPED_DATA(v, double, pMemBucket->type, pPage->data); - return v; + double v = 0; + GET_TYPED_DATA(v, double, pMemBucket->type, pPage->data); + return v; + } } return 0; From 1c26f1b53e4c274c6b31d1d4a0602b88352a4934 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 21 Oct 2022 16:13:55 +0800 Subject: [PATCH 88/99] fix(wal): reference --- source/dnode/mnode/impl/src/mndSubscribe.c | 2 +- source/libs/wal/src/walRef.c | 1 + source/libs/wal/src/walWrite.c | 21 ++++++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c index 739b8bbf01..eea79c5335 100644 --- a/source/dnode/mnode/impl/src/mndSubscribe.c +++ b/source/dnode/mnode/impl/src/mndSubscribe.c @@ -550,7 +550,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu // 6. execution if (mndTransPrepare(pMnode, pTrans) != 0) { - ASSERT(0); + mError("failed to prepare trans rebalance since %s", terrstr()); goto REB_FAIL; } diff --git a/source/libs/wal/src/walRef.c b/source/libs/wal/src/walRef.c index 2c45fbbdaf..119d0575d8 100644 --- a/source/libs/wal/src/walRef.c +++ b/source/libs/wal/src/walRef.c @@ -42,6 +42,7 @@ void walCloseRef(SWal *pWal, int64_t refId) { int32_t walRefVer(SWalRef *pRef, int64_t ver) { SWal *pWal = pRef->pWal; + wDebug("vgId:%d, wal ref version %" PRId64 ", refId %" PRId64, pWal->cfg.vgId, ver, pRef->refId); if (pRef->refVer != ver) { taosThreadMutexLock(&pWal->mutex); if (ver < pWal->vers.firstVer || ver > pWal->vers.lastVer) { diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 3354308c49..e6b4e9d8ff 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -257,6 +257,8 @@ static FORCE_INLINE int32_t walCheckAndRoll(SWal *pWal) { int32_t walBeginSnapshot(SWal *pWal, int64_t ver) { pWal->vers.verInSnapshotting = ver; + wDebug("vgId:%d, wal begin snapshot for version %" PRId64 ", first ver %" PRId64 ", last ver %" PRId64, + pWal->cfg.vgId, ver, pWal->vers.firstVer, pWal->vers.lastVer); // check file rolling if (pWal->cfg.retentionPeriod == 0) { taosThreadMutexLock(&pWal->mutex); @@ -273,6 +275,10 @@ int32_t walEndSnapshot(SWal *pWal) { int32_t code = 0; taosThreadMutexLock(&pWal->mutex); int64_t ver = pWal->vers.verInSnapshotting; + + wDebug("vgId:%d, wal end snapshot for version %" PRId64 ", first ver %" PRId64 ", last ver %" PRId64, pWal->cfg.vgId, + ver, pWal->vers.firstVer, pWal->vers.lastVer); + if (ver == -1) { code = -1; goto END; @@ -287,7 +293,8 @@ int32_t walEndSnapshot(SWal *pWal) { if (pIter == NULL) break; SWalRef *pRef = *(SWalRef **)pIter; if (pRef->refVer == -1) continue; - ver = TMIN(ver, pRef->refVer); + ver = TMIN(ver, pRef->refVer - 1); + wDebug("vgId:%d, wal found ref %" PRId64 ", refId %" PRId64, pWal->cfg.vgId, pRef->refVer, pRef->refId); } int deleteCnt = 0; @@ -298,8 +305,9 @@ int32_t walEndSnapshot(SWal *pWal) { SWalFileInfo *pInfo = taosArraySearch(pWal->fileInfoSet, &tmp, compareWalFileInfo, TD_LE); if (pInfo) { if (ver >= pInfo->lastVer) { - pInfo++; + pInfo--; } + wDebug("vgId:%d, begin remove from %" PRId64, pWal->cfg.vgId, pInfo->firstVer); // iterate files, until the searched result for (SWalFileInfo *iter = pWal->fileInfoSet->pData; iter < pInfo; iter++) { if ((pWal->cfg.retentionSize != -1 && newTotSize > pWal->cfg.retentionSize) || @@ -315,10 +323,12 @@ int32_t walEndSnapshot(SWal *pWal) { for (int i = 0; i < deleteCnt; i++) { pInfo = taosArrayGet(pWal->fileInfoSet, i); walBuildLogName(pWal, pInfo->firstVer, fnameStr); + wDebug("vgId:%d, remove file %s", pWal->cfg.vgId, fnameStr); if (taosRemoveFile(fnameStr) < 0) { goto UPDATE_META; } walBuildIdxName(pWal, pInfo->firstVer, fnameStr); + wDebug("vgId:%d, remove file %s", pWal->cfg.vgId, fnameStr); if (taosRemoveFile(fnameStr) < 0) { ASSERT(0); } @@ -409,7 +419,7 @@ END: } static int32_t walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) { - SWalIdxEntry entry = {.ver = ver, .offset = offset}; + SWalIdxEntry entry = {.ver = ver, .offset = offset}; SWalFileInfo *pFileInfo = walGetCurFileInfo(pWal); ASSERT(pFileInfo != NULL); ASSERT(pFileInfo->firstVer >= 0); @@ -424,7 +434,8 @@ static int32_t walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) { return -1; } - ASSERT(taosLSeekFile(pWal->pIdxFile, 0, SEEK_END) == idxOffset + sizeof(SWalIdxEntry) && "Offset of idx entries misaligned"); + ASSERT(taosLSeekFile(pWal->pIdxFile, 0, SEEK_END) == idxOffset + sizeof(SWalIdxEntry) && + "Offset of idx entries misaligned"); return 0; } @@ -432,7 +443,7 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy const void *body, int32_t bodyLen) { int64_t code = 0; - int64_t offset = walGetCurFileOffset(pWal); + int64_t offset = walGetCurFileOffset(pWal); SWalFileInfo *pFileInfo = walGetCurFileInfo(pWal); ASSERT(pFileInfo != NULL); From ca851f975066744066aa9d13b10d805a3a414458 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 21 Oct 2022 16:27:09 +0800 Subject: [PATCH 89/99] fix: enable adjust numOfVnodeFetchThreads --- source/common/src/tglobal.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 3edeeee49a..5025cbcac5 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -49,7 +49,7 @@ int32_t tsNumOfMnodeFetchThreads = 1; int32_t tsNumOfMnodeReadThreads = 1; int32_t tsNumOfVnodeQueryThreads = 4; int32_t tsNumOfVnodeStreamThreads = 2; -int32_t tsNumOfVnodeFetchThreads = 1; +int32_t tsNumOfVnodeFetchThreads = 4; int32_t tsNumOfVnodeWriteThreads = 2; int32_t tsNumOfVnodeSyncThreads = 2; int32_t tsNumOfVnodeRsmaThreads = 2; @@ -364,8 +364,9 @@ static int32_t taosAddServerCfg(SConfig *pCfg) { tsNumOfVnodeStreamThreads = TMAX(tsNumOfVnodeStreamThreads, 4); if (cfgAddInt32(pCfg, "numOfVnodeStreamThreads", tsNumOfVnodeStreamThreads, 4, 1024, 0) != 0) return -1; - // tsNumOfVnodeFetchThreads = 1; - // if (cfgAddInt32(pCfg, "numOfVnodeFetchThreads", tsNumOfVnodeFetchThreads, 1, 1, 0) != 0) return -1; + tsNumOfVnodeFetchThreads = tsNumOfCores / 4; + tsNumOfVnodeFetchThreads = TMAX(tsNumOfVnodeFetchThreads, 4); + if (cfgAddInt32(pCfg, "numOfVnodeFetchThreads", tsNumOfVnodeFetchThreads, 4, 1024, 0) != 0) return -1; tsNumOfVnodeWriteThreads = tsNumOfCores; tsNumOfVnodeWriteThreads = TMAX(tsNumOfVnodeWriteThreads, 1); @@ -487,15 +488,13 @@ static int32_t taosUpdateServerCfg(SConfig *pCfg) { pItem->stype = stype; } - /* - pItem = cfgGetItem(tsCfg, "numOfVnodeFetchThreads"); - if (pItem != NULL && pItem->stype == CFG_STYPE_DEFAULT) { - tsNumOfVnodeFetchThreads = numOfCores / 4; - tsNumOfVnodeFetchThreads = TMAX(tsNumOfVnodeFetchThreads, 4); - pItem->i32 = tsNumOfVnodeFetchThreads; - pItem->stype = stype; - } - */ + pItem = cfgGetItem(tsCfg, "numOfVnodeFetchThreads"); + if (pItem != NULL && pItem->stype == CFG_STYPE_DEFAULT) { + tsNumOfVnodeFetchThreads = numOfCores / 4; + tsNumOfVnodeFetchThreads = TMAX(tsNumOfVnodeFetchThreads, 4); + pItem->i32 = tsNumOfVnodeFetchThreads; + pItem->stype = stype; + } pItem = cfgGetItem(tsCfg, "numOfVnodeWriteThreads"); if (pItem != NULL && pItem->stype == CFG_STYPE_DEFAULT) { @@ -688,7 +687,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { tsNumOfMnodeReadThreads = cfgGetItem(pCfg, "numOfMnodeReadThreads")->i32; tsNumOfVnodeQueryThreads = cfgGetItem(pCfg, "numOfVnodeQueryThreads")->i32; tsNumOfVnodeStreamThreads = cfgGetItem(pCfg, "numOfVnodeStreamThreads")->i32; - // tsNumOfVnodeFetchThreads = cfgGetItem(pCfg, "numOfVnodeFetchThreads")->i32; + tsNumOfVnodeFetchThreads = cfgGetItem(pCfg, "numOfVnodeFetchThreads")->i32; tsNumOfVnodeWriteThreads = cfgGetItem(pCfg, "numOfVnodeWriteThreads")->i32; tsNumOfVnodeSyncThreads = cfgGetItem(pCfg, "numOfVnodeSyncThreads")->i32; tsNumOfVnodeRsmaThreads = cfgGetItem(pCfg, "numOfVnodeRsmaThreads")->i32; From 6fa1cf90db9b8af2fecb31344ea2be9ca176cc38 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 21 Oct 2022 16:51:33 +0800 Subject: [PATCH 90/99] fix: fix tsc query memory leak --- source/client/src/clientEnv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index b3c5565cfb..be0e6d50dc 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -338,7 +338,7 @@ void doDestroyRequest(void *p) { SRequestObj *pRequest = (SRequestObj *)p; - int64_t reqId = pRequest->self; + uint64_t reqId = pRequest->requestId; tscTrace("begin to destroy request %" PRIx64 " p:%p", reqId, pRequest); taosHashRemove(pRequest->pTscObj->pRequests, &pRequest->self, sizeof(pRequest->self)); From a80f382c5d85b497371cf0bcc84c79daa7ed2ead Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 21 Oct 2022 17:00:11 +0800 Subject: [PATCH 91/99] fix: fix tsc query memory leak --- source/libs/nodes/src/nodesUtilFuncs.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/source/libs/nodes/src/nodesUtilFuncs.c b/source/libs/nodes/src/nodesUtilFuncs.c index e647438800..aec4d0148a 100644 --- a/source/libs/nodes/src/nodesUtilFuncs.c +++ b/source/libs/nodes/src/nodesUtilFuncs.c @@ -190,28 +190,20 @@ int32_t nodesReleaseAllocator(int64_t allocatorId) { return TSDB_CODE_SUCCESS; } - SNodeAllocator* pAllocator = taosAcquireRef(g_allocatorReqRefPool, allocatorId); - if (NULL == pAllocator) { - return terrno; - } - - int32_t code = taosThreadMutexTryLock(&pAllocator->mutex); - if (EBUSY != code) { + if (NULL == g_pNodeAllocator) { nodesError("allocator id %" PRIx64 " release failed: The nodesReleaseAllocator function needs to be called after the nodesAcquireAllocator " "function is called!", allocatorId); - if (0 == code) { - taosThreadMutexUnlock(&pAllocator->mutex); - } return TSDB_CODE_FAILED; } - + SNodeAllocator* pAllocator = g_pNodeAllocator; g_pNodeAllocator = NULL; taosThreadMutexUnlock(&pAllocator->mutex); return taosReleaseRef(g_allocatorReqRefPool, allocatorId); } + int64_t nodesMakeAllocatorWeakRef(int64_t allocatorId) { if (allocatorId <= 0) { return 0; From f49d91ac1a53c4c2f0582454db2d9e09f9dae892 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 21 Oct 2022 17:11:22 +0800 Subject: [PATCH 92/99] fix(stream): decode bloom filter --- source/dnode/vnode/src/tq/tqStreamStateSnap.c | 2 +- source/libs/stream/src/streamUpdate.c | 8 ++++++-- source/util/src/tbloomfilter.c | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/source/dnode/vnode/src/tq/tqStreamStateSnap.c b/source/dnode/vnode/src/tq/tqStreamStateSnap.c index b4a7ce7737..92e5f8df7a 100644 --- a/source/dnode/vnode/src/tq/tqStreamStateSnap.c +++ b/source/dnode/vnode/src/tq/tqStreamStateSnap.c @@ -167,7 +167,7 @@ int32_t tqSnapWriterClose(STqSnapWriter** ppWriter, int8_t rollback) { if (rollback) { ASSERT(0); } else { - code = tdbCommit(pWriter->pTq->pMetaStore, &pWriter->txn); + code = tdbCommit(pWriter->pTq->pMetaDB, &pWriter->txn); if (code) goto _err; } diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c index 80410568e5..199892c241 100644 --- a/source/libs/stream/src/streamUpdate.c +++ b/source/libs/stream/src/streamUpdate.c @@ -175,11 +175,15 @@ void updateInfoFillBlockData(SUpdateInfo *pInfo, SSDataBlock *pBlock, int32_t pr maxTs = TMAX(maxTs, ts); SScalableBf *pSBf = getSBf(pInfo, ts); if (pSBf) { - tScalableBfPut(pSBf, &ts, sizeof(TSKEY)); + SUpdateKey updateKey = { + .tbUid = tbUid, + .ts = ts, + }; + tScalableBfPut(pSBf, &updateKey, sizeof(SUpdateKey)); } } TSKEY *pMaxTs = taosHashGet(pInfo->pMap, &tbUid, sizeof(int64_t)); - if (pMaxTs == NULL || *pMaxTs > tbUid) { + if (pMaxTs == NULL || *pMaxTs > maxTs) { taosHashPut(pInfo->pMap, &tbUid, sizeof(int64_t), &maxTs, sizeof(TSKEY)); } } diff --git a/source/util/src/tbloomfilter.c b/source/util/src/tbloomfilter.c index b9c96dd606..84a78f3477 100644 --- a/source/util/src/tbloomfilter.c +++ b/source/util/src/tbloomfilter.c @@ -137,8 +137,10 @@ SBloomFilter *tBloomFilterDecode(SDecoder *pDecoder) { if (tDecodeU64(pDecoder, pUnits + i) < 0) goto _error; } if (tDecodeDouble(pDecoder, &pBF->errorRate) < 0) goto _error; - pBF->hashFn1 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_TIMESTAMP); - pBF->hashFn2 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_NCHAR); + /*pBF->hashFn1 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_TIMESTAMP);*/ + /*pBF->hashFn2 = taosGetDefaultHashFunction(TSDB_DATA_TYPE_NCHAR);*/ + pBF->hashFn1 = taosFastHash; + pBF->hashFn2 = taosDJB2Hash; return pBF; _error: From 1b65cd2089cf3734ad1a21a05cac1b37d295419f Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Fri, 21 Oct 2022 17:24:06 +0800 Subject: [PATCH 93/99] fix: fix show create table crash issue --- include/libs/nodes/cmdnodes.h | 2 +- source/libs/command/src/command.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/libs/nodes/cmdnodes.h b/include/libs/nodes/cmdnodes.h index 0752512951..ae550e0c08 100644 --- a/include/libs/nodes/cmdnodes.h +++ b/include/libs/nodes/cmdnodes.h @@ -34,7 +34,7 @@ extern "C" { #define SHOW_CREATE_TB_RESULT_COLS 2 #define SHOW_CREATE_TB_RESULT_FIELD1_LEN (TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE) -#define SHOW_CREATE_TB_RESULT_FIELD2_LEN (TSDB_MAX_BINARY_LEN + VARSTR_HEADER_SIZE) +#define SHOW_CREATE_TB_RESULT_FIELD2_LEN (TSDB_MAX_ALLOWED_SQL_LEN * 3) #define SHOW_LOCAL_VARIABLES_RESULT_COLS 2 #define SHOW_LOCAL_VARIABLES_RESULT_FIELD1_LEN (TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE) diff --git a/source/libs/command/src/command.c b/source/libs/command/src/command.c index 095d2b093d..5ac5e0596f 100644 --- a/source/libs/command/src/command.c +++ b/source/libs/command/src/command.c @@ -496,7 +496,12 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p colDataAppend(pCol1, 0, buf1, false); SColumnInfoData* pCol2 = taosArrayGet(pBlock->pDataBlock, 1); - char buf2[SHOW_CREATE_TB_RESULT_FIELD2_LEN] = {0}; + char* buf2 = taosMemoryMalloc(SHOW_CREATE_TB_RESULT_FIELD2_LEN); + if (NULL == buf2) { + terrno = TSDB_CODE_TSC_OUT_OF_MEMORY; + return terrno; + } + int32_t len = 0; if (TSDB_SUPER_TABLE == pCfg->tableType) { @@ -512,6 +517,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, ") TAGS ("); code = appendTagValues(buf2, &len, pCfg); if (code) { + taosMemoryFree(buf2); return code; } len += sprintf(buf2 + VARSTR_HEADER_SIZE + len, ")"); @@ -527,6 +533,8 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p colDataAppend(pCol2, 0, buf2, false); + taosMemoryFree(buf2); + return TSDB_CODE_SUCCESS; } From 308c3cad1134c79c3d0e3aa38df3d4c91af79456 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Fri, 21 Oct 2022 15:36:03 +0800 Subject: [PATCH 94/99] feat(stream):change stream mode & add ci --- source/libs/executor/src/timewindowoperator.c | 5 + tests/script/tsim/stream/windowClose.sim | 98 ++++++++++++++++++- 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/source/libs/executor/src/timewindowoperator.c b/source/libs/executor/src/timewindowoperator.c index 13ec8505fd..e89cd5e537 100644 --- a/source/libs/executor/src/timewindowoperator.c +++ b/source/libs/executor/src/timewindowoperator.c @@ -4411,6 +4411,11 @@ SOperatorInfo* createStreamFinalSessionAggOperatorInfo(SOperatorInfo* downstream taosArrayPush(pInfo->pChildren, &pChildOp); } } + + if (!IS_FINAL_OP(pInfo) || numOfChild == 0) { + pInfo->twAggSup.calTrigger = STREAM_TRIGGER_AT_ONCE; + } + return pOperator; _error: diff --git a/tests/script/tsim/stream/windowClose.sim b/tests/script/tsim/stream/windowClose.sim index 0d435a9fbd..9fcdcfb959 100644 --- a/tests/script/tsim/stream/windowClose.sim +++ b/tests/script/tsim/stream/windowClose.sim @@ -5,7 +5,7 @@ sleep 50 sql connect print =============== create database -sql create database test vgroups 1 +sql create database test vgroups 1; sql select * from information_schema.ins_databases if $rows != 3 then return -1 @@ -29,4 +29,100 @@ if $rows != 0 then return -1 endi + +sql create database test1 vgroups 4; +sql use test1; +sql create stable st(ts timestamp, a int, b int) tags(t int); +sql create table t1 using st tags(1); +sql create table t2 using st tags(2); + +sql create stream stream2 trigger window_close into streamt2 as select _wstart, sum(a) from st interval(10s); +sql create stream stream3 trigger max_delay 1s into streamt3 as select _wstart, sum(a) from st interval(10s); +sql create stream stream4 trigger window_close into streamt4 as select _wstart, sum(a) from t1 interval(10s); +sql create stream stream5 trigger max_delay 1s into streamt5 as select _wstart, sum(a) from t1 interval(10s); +sql create stream stream6 trigger window_close into streamt6 as select _wstart, sum(a) from st session(ts, 10s); +sql create stream stream7 trigger max_delay 1s into streamt7 as select _wstart, sum(a) from st session(ts, 10s); +sql create stream stream8 trigger window_close into streamt8 as select _wstart, sum(a) from t1 session(ts, 10s); +sql create stream stream9 trigger max_delay 1s into streamt9 as select _wstart, sum(a) from t1 session(ts, 10s); +sql create stream stream10 trigger window_close into streamt10 as select _wstart, sum(a) from t1 state_window(b); +sql create stream stream11 trigger max_delay 1s into streamt11 as select _wstart, sum(a) from t1 state_window(b); + +sql insert into t1 values(1648791213000,1,1); +sql insert into t1 values(1648791213001,2,1); +sql insert into t1 values(1648791213002,3,1); + +sql insert into t1 values(1648791233000,4,2); + +$loop_count = 0 + +loop1: + +sleep 200 + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +sql select * from streamt2; + +if $rows != 1 then + print ======streamt2=$rows + return -1 +endi + +sql select * from streamt3; +if $rows != 2 then + print ======streamt3=$rows + goto loop1 +endi + +sql select * from streamt4; +if $rows != 1 then + print ======streamt4=$rows + return -1 +endi + +sql select * from streamt5; +if $rows != 2 then + print ======streamt5=$rows + goto loop1 +endi + +sql select * from streamt6; +if $rows != 1 then + print ======streamt6=$rows + return -1 +endi + +sql select * from streamt7; +if $rows != 2 then + print ======streamt7=$rows + goto loop1 +endi + +sql select * from streamt8; +if $rows != 1 then + print ======streamt8=$rows + return -1 +endi + +sql select * from streamt9; +if $rows != 2 then + print ======streamt9=$rows + goto loop1 +endi + +sql select * from streamt10; +if $rows != 1 then + print ======streamt10=$rows + return -1 +endi + +sql select * from streamt11; +if $rows != 2 then + print ======streamt11=$rows + goto loop1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT From 72b92e961974e9ec9fbea5664bee2ebee102a0d4 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Fri, 21 Oct 2022 10:14:16 +0000 Subject: [PATCH 95/99] test:recover testcase and environment --- tests/develop-test/fulltest.sh | 32 +- tests/parallel_test/run_case.sh | 3 +- tests/parallel_test/run_container.sh | 6 +- tests/script/jenkins/basic.txt | 841 +++++++++--------- tests/system-test/fulltest.sh | 1176 +++++++++++++------------- 5 files changed, 1024 insertions(+), 1034 deletions(-) diff --git a/tests/develop-test/fulltest.sh b/tests/develop-test/fulltest.sh index 4e782b3e02..69cade3855 100644 --- a/tests/develop-test/fulltest.sh +++ b/tests/develop-test/fulltest.sh @@ -2,19 +2,19 @@ set -e set -x -# python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py -# #python3 ./test.py -f 5-taos-tools/taosbenchmark/commandline.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py -# #python3 ./test.py -f 5-taos-tools/taosbenchmark/limit_offset_json.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py -# #python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_interlace.py -# python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py -# #python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_telnet_alltypes.py -# #python3 ./test.py -f 5-taos-tools/taosbenchmark/taosadapter_json.py -# #python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py +#python3 ./test.py -f 5-taos-tools/taosbenchmark/commandline.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/custom_col_tag.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/default_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/demo.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/insert_alltypes_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/invalid_commandline.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/json_tag.py +#python3 ./test.py -f 5-taos-tools/taosbenchmark/limit_offset_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/query_json.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py +#python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_interlace.py +python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py +#python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_telnet_alltypes.py +#python3 ./test.py -f 5-taos-tools/taosbenchmark/taosadapter_json.py +#python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 9972fdbf14..0519900a68 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -79,8 +79,7 @@ if [ $RET -ne 0 ]; then pwd fi -sleep 36000 - exit $RET + diff --git a/tests/parallel_test/run_container.sh b/tests/parallel_test/run_container.sh index 92ab8493a0..f58aaaf29d 100755 --- a/tests/parallel_test/run_container.sh +++ b/tests/parallel_test/run_container.sh @@ -68,7 +68,7 @@ if [ $ent -ne 0 ]; then CONTAINER_TESTDIR=/home/TDinternal/community SIM_DIR=/home/TDinternal/sim REP_MOUNT_PARAM="$INTERNAL_REPDIR:/home/TDinternal" - REP_MOUNT_LIB="$INTERNAL_REPDIR/debug/build/lib:/home/TDinternal/debug/build/lib" + REP_MOUNT_LIB="$INTERNAL_REPDIR/debug/build/lib:/home/TDinternal/debug/build/lib:ro" else # community edition @@ -76,7 +76,7 @@ else CONTAINER_TESTDIR=/home/TDengine SIM_DIR=/home/TDengine/sim REP_MOUNT_PARAM="$REPDIR:/home/TDengine" - REP_MOUNT_LIB="$REPDIR/debug/build/lib:/home/TDengine/debug/build/lib" + REP_MOUNT_LIB="$REPDIR/debug/build/lib:/home/TDengine/debug/build/lib:ro" fi @@ -114,7 +114,7 @@ docker run \ -v ${TMP_DIR}/thread_volume/$thread_no/coredump:$coredump_dir \ -v $WORKDIR/taos-connector-python/taos:/usr/local/lib/python3.8/site-packages/taos:ro \ -v $WORKDIR/taos-connector-python/taosrest:/usr/local/lib/python3.8/site-packages/taosrest:ro \ - --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" $extra_param + --rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" $extra_param ret=$? exit $ret diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index e87ede67ae..e07ec54182 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -1,458 +1,451 @@ -# #======================b1-start=============== +#======================b1-start=============== -# # ---- user ---- -# ./test.sh -f tsim/user/basic.sim -# ./test.sh -f tsim/user/password.sim -# ./test.sh -f tsim/user/privilege_db.sim -# ./test.sh -f tsim/user/privilege_sysinfo.sim +# ---- user ---- +./test.sh -f tsim/user/basic.sim +./test.sh -f tsim/user/password.sim +./test.sh -f tsim/user/privilege_db.sim +./test.sh -f tsim/user/privilege_sysinfo.sim -# # ---- db ---- -# ./test.sh -f tsim/db/alter_option.sim -# # unsupport ./test.sh -f tsim/db/alter_replica_13.sim -# # unsupport ./test.sh -f tsim/db/alter_replica_31.sim -# ./test.sh -f tsim/db/basic1.sim -# ./test.sh -f tsim/db/basic2.sim -# ./test.sh -f tsim/db/basic3.sim -# ./test.sh -f tsim/db/basic4.sim -# ./test.sh -f tsim/db/basic5.sim -# ./test.sh -f tsim/db/basic6.sim -# ./test.sh -f tsim/db/commit.sim -# ./test.sh -f tsim/db/create_all_options.sim -# ./test.sh -f tsim/db/delete_reuse1.sim -# ./test.sh -f tsim/db/delete_reuse2.sim -# ./test.sh -f tsim/db/delete_reusevnode.sim -# ./test.sh -f tsim/db/delete_reusevnode2.sim -# ./test.sh -f tsim/db/delete_writing1.sim -# ./test.sh -f tsim/db/delete_writing2.sim -# # unsupport ./test.sh -f tsim/db/dropdnodes.sim -# ./test.sh -f tsim/db/error1.sim -# ./test.sh -f tsim/db/keep.sim -# ./test.sh -f tsim/db/len.sim -# ./test.sh -f tsim/db/repeat.sim -# ./test.sh -f tsim/db/show_create_db.sim -# ./test.sh -f tsim/db/show_create_table.sim -# ./test.sh -f tsim/db/tables.sim -# ./test.sh -f tsim/db/taosdlog.sim +# ---- db ---- +./test.sh -f tsim/db/alter_option.sim +# unsupport ./test.sh -f tsim/db/alter_replica_13.sim +# unsupport ./test.sh -f tsim/db/alter_replica_31.sim +./test.sh -f tsim/db/basic1.sim +./test.sh -f tsim/db/basic2.sim +./test.sh -f tsim/db/basic3.sim +./test.sh -f tsim/db/basic4.sim +./test.sh -f tsim/db/basic5.sim +./test.sh -f tsim/db/basic6.sim +./test.sh -f tsim/db/commit.sim +./test.sh -f tsim/db/create_all_options.sim +./test.sh -f tsim/db/delete_reuse1.sim +./test.sh -f tsim/db/delete_reuse2.sim +./test.sh -f tsim/db/delete_reusevnode.sim +./test.sh -f tsim/db/delete_reusevnode2.sim +./test.sh -f tsim/db/delete_writing1.sim +./test.sh -f tsim/db/delete_writing2.sim +# unsupport ./test.sh -f tsim/db/dropdnodes.sim +./test.sh -f tsim/db/error1.sim +./test.sh -f tsim/db/keep.sim +./test.sh -f tsim/db/len.sim +./test.sh -f tsim/db/repeat.sim +./test.sh -f tsim/db/show_create_db.sim +./test.sh -f tsim/db/show_create_table.sim +./test.sh -f tsim/db/tables.sim +./test.sh -f tsim/db/taosdlog.sim -# # ---- dnode -# # unsupport ./test.sh -f tsim/dnode/balance_replica1.sim -# # unsupport ./test.sh -f tsim/dnode/balance_replica3.sim -# # unsupport ./test.sh -f tsim/dnode/balance1.sim -# # unsupport ./test.sh -f tsim/dnode/balance2.sim -# # unsupport ./test.sh -f tsim/dnode/balance3.sim -# # unsupport ./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 -# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim -# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica1.sim -# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim -# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim -# # unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim -# ./test.sh -f tsim/dnode/offline_reason.sim -# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim -# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim -# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim -# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v2.sim -# # unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v3.sim -# # unsupport ./test.sh -f tsim/dnode/vnode_clean.sim -# ./test.sh -f tsim/dnode/use_dropped_dnode.sim +# ---- dnode +# unsupport ./test.sh -f tsim/dnode/balance_replica1.sim +# unsupport ./test.sh -f tsim/dnode/balance_replica3.sim +# unsupport ./test.sh -f tsim/dnode/balance1.sim +# unsupport ./test.sh -f tsim/dnode/balance2.sim +# unsupport ./test.sh -f tsim/dnode/balance3.sim +# unsupport ./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 +# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim +# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica1.sim +# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim +# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim +# unsupport ./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica3.sim +./test.sh -f tsim/dnode/offline_reason.sim +# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica1.sim +# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_leader.sim +# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v1_follower.sim +# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v2.sim +# unsupport ./test.sh -f tsim/dnode/redistribute_vgroup_replica3_v3.sim +# unsupport ./test.sh -f tsim/dnode/vnode_clean.sim +./test.sh -f tsim/dnode/use_dropped_dnode.sim -# # ---- import ---- -# ./test.sh -f tsim/import/basic.sim -# ./test.sh -f tsim/import/commit.sim -# ./test.sh -f tsim/import/large.sim -# ./test.sh -f tsim/import/replica1.sim +# ---- import ---- +./test.sh -f tsim/import/basic.sim +./test.sh -f tsim/import/commit.sim +./test.sh -f tsim/import/large.sim +./test.sh -f tsim/import/replica1.sim -# # ---- insert ---- -# ./test.sh -f tsim/insert/backquote.sim -# ./test.sh -f tsim/insert/basic.sim -# ./test.sh -f tsim/insert/basic0.sim -# ./test.sh -f tsim/insert/basic1.sim -# ./test.sh -f tsim/insert/basic2.sim -# ./test.sh -f tsim/insert/commit-merge0.sim -# ./test.sh -f tsim/insert/insert_drop.sim -# ./test.sh -f tsim/insert/insert_select.sim -# ./test.sh -f tsim/insert/null.sim -# ./test.sh -f tsim/insert/query_block1_file.sim -# ./test.sh -f tsim/insert/query_block1_memory.sim -# ./test.sh -f tsim/insert/query_block2_file.sim -# ./test.sh -f tsim/insert/query_block2_memory.sim -# ./test.sh -f tsim/insert/query_file_memory.sim -# ./test.sh -f tsim/insert/query_multi_file.sim -# ./test.sh -f tsim/insert/tcp.sim -# ./test.sh -f tsim/insert/update0.sim -# ./test.sh -f tsim/insert/update1_sort_merge.sim +# ---- insert ---- +./test.sh -f tsim/insert/backquote.sim +./test.sh -f tsim/insert/basic.sim +./test.sh -f tsim/insert/basic0.sim +./test.sh -f tsim/insert/basic1.sim +./test.sh -f tsim/insert/basic2.sim +./test.sh -f tsim/insert/commit-merge0.sim +./test.sh -f tsim/insert/insert_drop.sim +./test.sh -f tsim/insert/insert_select.sim +./test.sh -f tsim/insert/null.sim +./test.sh -f tsim/insert/query_block1_file.sim +./test.sh -f tsim/insert/query_block1_memory.sim +./test.sh -f tsim/insert/query_block2_file.sim +./test.sh -f tsim/insert/query_block2_memory.sim +./test.sh -f tsim/insert/query_file_memory.sim +./test.sh -f tsim/insert/query_multi_file.sim +./test.sh -f tsim/insert/tcp.sim +./test.sh -f tsim/insert/update0.sim +./test.sh -f tsim/insert/update1_sort_merge.sim -# # ---- parser ---- -# ./test.sh -f tsim/parser/alter__for_community_version.sim -# ./test.sh -f tsim/parser/alter_column.sim -# ./test.sh -f tsim/parser/alter_stable.sim -# ./test.sh -f tsim/parser/alter.sim -# ./test.sh -f tsim/parser/alter1.sim -# ./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim -# ./test.sh -f tsim/parser/auto_create_tb.sim -# ./test.sh -f tsim/parser/between_and.sim -# ./test.sh -f tsim/parser/binary_escapeCharacter.sim -# ./test.sh -f tsim/parser/col_arithmetic_operation.sim -# ./test.sh -f tsim/parser/columnValue_bigint.sim -# ./test.sh -f tsim/parser/columnValue_bool.sim -# ./test.sh -f tsim/parser/columnValue_double.sim -# ./test.sh -f tsim/parser/columnValue_float.sim -# ./test.sh -f tsim/parser/columnValue_int.sim -# ./test.sh -f tsim/parser/columnValue_smallint.sim -# ./test.sh -f tsim/parser/columnValue_tinyint.sim -# ./test.sh -f tsim/parser/columnValue_unsign.sim -# ./test.sh -f tsim/parser/commit.sim -# ./test.sh -f tsim/parser/condition.sim -# ./test.sh -f tsim/parser/constCol.sim -# ./test.sh -f tsim/parser/create_db.sim -# ./test.sh -f tsim/parser/create_mt.sim -# ./test.sh -f tsim/parser/create_tb_with_tag_name.sim -# ./test.sh -f tsim/parser/create_tb.sim -# ./test.sh -f tsim/parser/dbtbnameValidate.sim -# ./test.sh -f tsim/parser/distinct.sim -# # TD-17623 ./test.sh -f tsim/parser/fill_stb.sim -# ./test.sh -f tsim/parser/fill_us.sim -# ./test.sh -f tsim/parser/fill.sim -# ./test.sh -f tsim/parser/first_last.sim -# ./test.sh -f tsim/parser/fourArithmetic-basic.sim -# ./test.sh -f tsim/parser/function.sim -# ./test.sh -f tsim/parser/groupby-basic.sim -# ./test.sh -f tsim/parser/groupby.sim -# ./test.sh -f tsim/parser/having_child.sim -# ./test.sh -f tsim/parser/having.sim -# ./test.sh -f tsim/parser/import_commit1.sim -# ./test.sh -f tsim/parser/import_commit2.sim -# ./test.sh -f tsim/parser/import_commit3.sim -# ./test.sh -f tsim/parser/import_file.sim -# ./test.sh -f tsim/parser/import.sim -# ./test.sh -f tsim/parser/insert_multiTbl.sim -# ./test.sh -f tsim/parser/insert_tb.sim -# # TD-18293 ./test.sh -f tsim/parser/interp.sim -# ./test.sh -f tsim/parser/join_manyblocks.sim -# ./test.sh -f tsim/parser/join_multitables.sim -# ./test.sh -f tsim/parser/join_multivnode.sim -# ./test.sh -f tsim/parser/join.sim -# ./test.sh -f tsim/parser/last_cache.sim -# ./test.sh -f tsim/parser/last_groupby.sim -# ./test.sh -f tsim/parser/lastrow.sim -# ./test.sh -f tsim/parser/lastrow2.sim -# ./test.sh -f tsim/parser/like.sim -# ./test.sh -f tsim/parser/limit.sim -# ./test.sh -f tsim/parser/limit1.sim -# # TD-17623 ./test.sh -f tsim/parser/limit2.sim -# ./test.sh -f tsim/parser/mixed_blocks.sim -# ./test.sh -f tsim/parser/nchar.sim -# ./test.sh -f tsim/parser/nestquery.sim -# ./test.sh -f tsim/parser/null_char.sim -# ./test.sh -f tsim/parser/precision_ns.sim -# ./test.sh -f tsim/parser/projection_limit_offset.sim -# ./test.sh -f tsim/parser/regex.sim -# ./test.sh -f tsim/parser/select_across_vnodes.sim -# ./test.sh -f tsim/parser/select_distinct_tag.sim -# ./test.sh -f tsim/parser/select_from_cache_disk.sim -# ./test.sh -f tsim/parser/select_with_tags.sim -# ./test.sh -f tsim/parser/selectResNum.sim -# ./test.sh -f tsim/parser/set_tag_vals.sim -# # TD-19572 ./test.sh -f tsim/parser/single_row_in_tb.sim -# ./test.sh -f tsim/parser/sliding.sim -# ./test.sh -f tsim/parser/slimit_alter_tags.sim -# ./test.sh -f tsim/parser/slimit.sim -# ./test.sh -f tsim/parser/slimit1.sim -# ./test.sh -f tsim/parser/stableOp.sim -# ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim -# ./test.sh -f tsim/parser/tags_filter.sim -# ./test.sh -f tsim/parser/tbnameIn.sim -# ./test.sh -f tsim/parser/timestamp.sim -# ./test.sh -f tsim/parser/top_groupby.sim -# ./test.sh -f tsim/parser/topbot.sim -# ./test.sh -f tsim/parser/union.sim -# ./test.sh -f tsim/parser/union_sysinfo.sim -# ./test.sh -f tsim/parser/where.sim +# ---- parser ---- +./test.sh -f tsim/parser/alter__for_community_version.sim +./test.sh -f tsim/parser/alter_column.sim +./test.sh -f tsim/parser/alter_stable.sim +./test.sh -f tsim/parser/alter.sim +./test.sh -f tsim/parser/alter1.sim +./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim +./test.sh -f tsim/parser/auto_create_tb.sim +./test.sh -f tsim/parser/between_and.sim +./test.sh -f tsim/parser/binary_escapeCharacter.sim +./test.sh -f tsim/parser/col_arithmetic_operation.sim +./test.sh -f tsim/parser/columnValue_bigint.sim +./test.sh -f tsim/parser/columnValue_bool.sim +./test.sh -f tsim/parser/columnValue_double.sim +./test.sh -f tsim/parser/columnValue_float.sim +./test.sh -f tsim/parser/columnValue_int.sim +./test.sh -f tsim/parser/columnValue_smallint.sim +./test.sh -f tsim/parser/columnValue_tinyint.sim +./test.sh -f tsim/parser/columnValue_unsign.sim +./test.sh -f tsim/parser/commit.sim +./test.sh -f tsim/parser/condition.sim +./test.sh -f tsim/parser/constCol.sim +./test.sh -f tsim/parser/create_db.sim +./test.sh -f tsim/parser/create_mt.sim +./test.sh -f tsim/parser/create_tb_with_tag_name.sim +./test.sh -f tsim/parser/create_tb.sim +./test.sh -f tsim/parser/dbtbnameValidate.sim +./test.sh -f tsim/parser/distinct.sim +# TD-17623 ./test.sh -f tsim/parser/fill_stb.sim +./test.sh -f tsim/parser/fill_us.sim +./test.sh -f tsim/parser/fill.sim +./test.sh -f tsim/parser/first_last.sim +./test.sh -f tsim/parser/fourArithmetic-basic.sim +./test.sh -f tsim/parser/function.sim +./test.sh -f tsim/parser/groupby-basic.sim +./test.sh -f tsim/parser/groupby.sim +./test.sh -f tsim/parser/having_child.sim +./test.sh -f tsim/parser/having.sim +./test.sh -f tsim/parser/import_commit1.sim +./test.sh -f tsim/parser/import_commit2.sim +./test.sh -f tsim/parser/import_commit3.sim +./test.sh -f tsim/parser/import_file.sim +./test.sh -f tsim/parser/import.sim +./test.sh -f tsim/parser/insert_multiTbl.sim +./test.sh -f tsim/parser/insert_tb.sim +# TD-18293 ./test.sh -f tsim/parser/interp.sim +./test.sh -f tsim/parser/join_manyblocks.sim +./test.sh -f tsim/parser/join_multitables.sim +./test.sh -f tsim/parser/join_multivnode.sim +./test.sh -f tsim/parser/join.sim +./test.sh -f tsim/parser/last_cache.sim +./test.sh -f tsim/parser/last_groupby.sim +./test.sh -f tsim/parser/lastrow.sim +./test.sh -f tsim/parser/lastrow2.sim +./test.sh -f tsim/parser/like.sim +./test.sh -f tsim/parser/limit.sim +./test.sh -f tsim/parser/limit1.sim +# TD-17623 ./test.sh -f tsim/parser/limit2.sim +./test.sh -f tsim/parser/mixed_blocks.sim +./test.sh -f tsim/parser/nchar.sim +./test.sh -f tsim/parser/nestquery.sim +./test.sh -f tsim/parser/null_char.sim +./test.sh -f tsim/parser/precision_ns.sim +./test.sh -f tsim/parser/projection_limit_offset.sim +./test.sh -f tsim/parser/regex.sim +./test.sh -f tsim/parser/select_across_vnodes.sim +./test.sh -f tsim/parser/select_distinct_tag.sim +./test.sh -f tsim/parser/select_from_cache_disk.sim +./test.sh -f tsim/parser/select_with_tags.sim +./test.sh -f tsim/parser/selectResNum.sim +./test.sh -f tsim/parser/set_tag_vals.sim +# TD-19572 ./test.sh -f tsim/parser/single_row_in_tb.sim +./test.sh -f tsim/parser/sliding.sim +./test.sh -f tsim/parser/slimit_alter_tags.sim +./test.sh -f tsim/parser/slimit.sim +./test.sh -f tsim/parser/slimit1.sim +./test.sh -f tsim/parser/stableOp.sim +./test.sh -f tsim/parser/tags_dynamically_specifiy.sim +./test.sh -f tsim/parser/tags_filter.sim +./test.sh -f tsim/parser/tbnameIn.sim +./test.sh -f tsim/parser/timestamp.sim +./test.sh -f tsim/parser/top_groupby.sim +./test.sh -f tsim/parser/topbot.sim +./test.sh -f tsim/parser/union.sim +./test.sh -f tsim/parser/union_sysinfo.sim +./test.sh -f tsim/parser/where.sim -# # ---- query ---- -# ./test.sh -f tsim/query/charScalarFunction.sim -# ./test.sh -f tsim/query/explain.sim -# ./test.sh -f tsim/query/interval-offset.sim -# ./test.sh -f tsim/query/interval.sim -# ./test.sh -f tsim/query/scalarFunction.sim -# ./test.sh -f tsim/query/scalarNull.sim -# ./test.sh -f tsim/query/session.sim -# ./test.sh -f tsim/query/udf.sim +# ---- query ---- +./test.sh -f tsim/query/charScalarFunction.sim +./test.sh -f tsim/query/explain.sim +./test.sh -f tsim/query/interval-offset.sim +./test.sh -f tsim/query/interval.sim +./test.sh -f tsim/query/scalarFunction.sim +./test.sh -f tsim/query/scalarNull.sim +./test.sh -f tsim/query/session.sim +./test.sh -f tsim/query/udf.sim -# # ---- qnode -# ./test.sh -f tsim/qnode/basic1.sim +# ---- qnode +./test.sh -f tsim/qnode/basic1.sim -# # ---- snode ---- -# # unsupport ./test.sh -f tsim/snode/basic1.sim +# ---- snode ---- +# unsupport ./test.sh -f tsim/snode/basic1.sim -# # ---- bnode -# ./test.sh -f tsim/bnode/basic1.sim +# ---- mnode +./test.sh -f tsim/mnode/basic1.sim +./test.sh -f tsim/mnode/basic2.sim +./test.sh -f tsim/mnode/basic3.sim +./test.sh -f tsim/mnode/basic4.sim +./test.sh -f tsim/mnode/basic5.sim -# # ---- mnode -# ./test.sh -f tsim/mnode/basic1.sim -# ./test.sh -f tsim/mnode/basic2.sim -# ./test.sh -f tsim/mnode/basic3.sim -# ./test.sh -f tsim/mnode/basic4.sim -# ./test.sh -f tsim/mnode/basic5.sim +# ---- show ---- +./test.sh -f tsim/show/basic.sim -# # ---- show ---- -# ./test.sh -f tsim/show/basic.sim +# ---- table ---- +./test.sh -f tsim/table/autocreate.sim +./test.sh -f tsim/table/basic1.sim +./test.sh -f tsim/table/basic2.sim +./test.sh -f tsim/table/basic3.sim +./test.sh -f tsim/table/bigint.sim +./test.sh -f tsim/table/binary.sim +./test.sh -f tsim/table/bool.sim +./test.sh -f tsim/table/column_name.sim +./test.sh -f tsim/table/column_num.sim +./test.sh -f tsim/table/column_value.sim +./test.sh -f tsim/table/column2.sim +./test.sh -f tsim/table/createmulti.sim +./test.sh -f tsim/table/date.sim +./test.sh -f tsim/table/db.table.sim +./test.sh -f tsim/table/delete_reuse1.sim +./test.sh -f tsim/table/delete_reuse2.sim +./test.sh -f tsim/table/delete_writing.sim +./test.sh -f tsim/table/describe.sim +./test.sh -f tsim/table/double.sim +./test.sh -f tsim/table/float.sim +./test.sh -f tsim/table/hash.sim +./test.sh -f tsim/table/int.sim +./test.sh -f tsim/table/limit.sim +./test.sh -f tsim/table/smallint.sim +./test.sh -f tsim/table/table_len.sim +./test.sh -f tsim/table/table.sim +./test.sh -f tsim/table/tinyint.sim +./test.sh -f tsim/table/vgroup.sim -# # ---- table ---- -# ./test.sh -f tsim/table/autocreate.sim -# ./test.sh -f tsim/table/basic1.sim -# ./test.sh -f tsim/table/basic2.sim -# ./test.sh -f tsim/table/basic3.sim -# ./test.sh -f tsim/table/bigint.sim -# ./test.sh -f tsim/table/binary.sim -# ./test.sh -f tsim/table/bool.sim -# ./test.sh -f tsim/table/column_name.sim -# ./test.sh -f tsim/table/column_num.sim -# ./test.sh -f tsim/table/column_value.sim -# ./test.sh -f tsim/table/column2.sim -# ./test.sh -f tsim/table/createmulti.sim -# ./test.sh -f tsim/table/date.sim -# ./test.sh -f tsim/table/db.table.sim -# ./test.sh -f tsim/table/delete_reuse1.sim -# ./test.sh -f tsim/table/delete_reuse2.sim -# ./test.sh -f tsim/table/delete_writing.sim -# ./test.sh -f tsim/table/describe.sim -# ./test.sh -f tsim/table/double.sim -# ./test.sh -f tsim/table/float.sim -# ./test.sh -f tsim/table/hash.sim -# ./test.sh -f tsim/table/int.sim -# ./test.sh -f tsim/table/limit.sim -# ./test.sh -f tsim/table/smallint.sim -# ./test.sh -f tsim/table/table_len.sim -# ./test.sh -f tsim/table/table.sim -# ./test.sh -f tsim/table/tinyint.sim -# ./test.sh -f tsim/table/vgroup.sim +# ---- stream +./test.sh -f tsim/stream/basic0.sim -v +./test.sh -f tsim/stream/basic1.sim +./test.sh -f tsim/stream/basic2.sim +./test.sh -f tsim/stream/drop_stream.sim +./test.sh -f tsim/stream/distributeInterval0.sim +./test.sh -f tsim/stream/distributeIntervalRetrive0.sim +./test.sh -f tsim/stream/distributeSession0.sim +./test.sh -f tsim/stream/session0.sim +./test.sh -f tsim/stream/session1.sim +./test.sh -f tsim/stream/state0.sim +./test.sh -f tsim/stream/triggerInterval0.sim +./test.sh -f tsim/stream/triggerSession0.sim +./test.sh -f tsim/stream/partitionby.sim +./test.sh -f tsim/stream/partitionby1.sim +# unsupport ./test.sh -f tsim/stream/schedSnode.sim +./test.sh -f tsim/stream/windowClose.sim +./test.sh -f tsim/stream/ignoreExpiredData.sim +./test.sh -f tsim/stream/sliding.sim +./test.sh -f tsim/stream/partitionbyColumnInterval.sim +#./test.sh -f tsim/stream/partitionbyColumnSession.sim +#./test.sh -f tsim/stream/partitionbyColumnState.sim +#./test.sh -f tsim/stream/deleteInterval.sim +#./test.sh -f tsim/stream/deleteSession.sim +#./test.sh -f tsim/stream/deleteState.sim +#./test.sh -f tsim/stream/fillIntervalDelete0.sim +#./test.sh -f tsim/stream/fillIntervalDelete1.sim +./test.sh -f tsim/stream/fillIntervalLinear.sim +#./test.sh -f tsim/stream/fillIntervalPartitionBy.sim +./test.sh -f tsim/stream/fillIntervalPrevNext.sim +./test.sh -f tsim/stream/fillIntervalValue.sim -# # ---- stream -# ./test.sh -f tsim/stream/basic0.sim -# ./test.sh -f tsim/stream/basic1.sim -# ./test.sh -f tsim/stream/basic2.sim -# ./test.sh -f tsim/stream/drop_stream.sim -# ./test.sh -f tsim/stream/distributeInterval0.sim -# ./test.sh -f tsim/stream/distributeIntervalRetrive0.sim -# ./test.sh -f tsim/stream/distributeSession0.sim -# ./test.sh -f tsim/stream/session0.sim -# ./test.sh -f tsim/stream/session1.sim -# ./test.sh -f tsim/stream/state0.sim -# ./test.sh -f tsim/stream/triggerInterval0.sim -# ./test.sh -f tsim/stream/triggerSession0.sim -# ./test.sh -f tsim/stream/partitionby.sim -# ./test.sh -f tsim/stream/partitionby1.sim -# # unsupport ./test.sh -f tsim/stream/schedSnode.sim -# ./test.sh -f tsim/stream/windowClose.sim -# ./test.sh -f tsim/stream/ignoreExpiredData.sim -# ./test.sh -f tsim/stream/sliding.sim -# #./test.sh -f tsim/stream/partitionbyColumnInterval.sim -# #./test.sh -f tsim/stream/partitionbyColumnSession.sim -# #./test.sh -f tsim/stream/partitionbyColumnState.sim -# #./test.sh -f tsim/stream/deleteInterval.sim -# #./test.sh -f tsim/stream/deleteSession.sim -# #./test.sh -f tsim/stream/deleteState.sim +# ---- transaction ---- +./test.sh -f tsim/trans/lossdata1.sim +./test.sh -f tsim/trans/create_db.sim -# # ---- transaction ---- -# ./test.sh -f tsim/trans/lossdata1.sim -# ./test.sh -f tsim/trans/create_db.sim +# ---- tmq +./test.sh -f tsim/tmq/basic1.sim +./test.sh -f tsim/tmq/basic2.sim +./test.sh -f tsim/tmq/basic3.sim +./test.sh -f tsim/tmq/basic4.sim +./test.sh -f tsim/tmq/basic1Of2Cons.sim +./test.sh -f tsim/tmq/basic2Of2Cons.sim +./test.sh -f tsim/tmq/basic3Of2Cons.sim +./test.sh -f tsim/tmq/basic4Of2Cons.sim +./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim +./test.sh -f tsim/tmq/topic.sim +./test.sh -f tsim/tmq/snapshot.sim +./test.sh -f tsim/tmq/snapshot1.sim -# # ---- tmq -# ./test.sh -f tsim/tmq/basic1.sim -# ./test.sh -f tsim/tmq/basic2.sim -# ./test.sh -f tsim/tmq/basic3.sim -# ./test.sh -f tsim/tmq/basic4.sim -# ./test.sh -f tsim/tmq/basic1Of2Cons.sim -# ./test.sh -f tsim/tmq/basic2Of2Cons.sim -# ./test.sh -f tsim/tmq/basic3Of2Cons.sim -# ./test.sh -f tsim/tmq/basic4Of2Cons.sim -# ./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim -# ./test.sh -f tsim/tmq/topic.sim -# ./test.sh -f tsim/tmq/snapshot.sim -# ./test.sh -f tsim/tmq/snapshot1.sim +# --- stable ---- +./test.sh -f tsim/stable/alter_comment.sim +./test.sh -f tsim/stable/alter_count.sim +./test.sh -f tsim/stable/alter_import.sim +./test.sh -f tsim/stable/alter_insert1.sim +./test.sh -f tsim/stable/alter_insert2.sim +./test.sh -f tsim/stable/alter_metrics.sim +./test.sh -f tsim/stable/column_add.sim +./test.sh -f tsim/stable/column_drop.sim +./test.sh -f tsim/stable/column_modify.sim +./test.sh -f tsim/stable/disk.sim +./test.sh -f tsim/stable/dnode3.sim +./test.sh -f tsim/stable/metrics.sim +./test.sh -f tsim/stable/refcount.sim +./test.sh -f tsim/stable/tag_add.sim +./test.sh -f tsim/stable/tag_drop.sim +./test.sh -f tsim/stable/tag_filter.sim +./test.sh -f tsim/stable/tag_modify.sim +./test.sh -f tsim/stable/tag_rename.sim +./test.sh -f tsim/stable/values.sim +./test.sh -f tsim/stable/vnode3.sim -# # --- stable ---- -# ./test.sh -f tsim/stable/alter_comment.sim -# ./test.sh -f tsim/stable/alter_count.sim -# ./test.sh -f tsim/stable/alter_import.sim -# ./test.sh -f tsim/stable/alter_insert1.sim -# ./test.sh -f tsim/stable/alter_insert2.sim -# ./test.sh -f tsim/stable/alter_metrics.sim -# ./test.sh -f tsim/stable/column_add.sim -# ./test.sh -f tsim/stable/column_drop.sim -# ./test.sh -f tsim/stable/column_modify.sim -# ./test.sh -f tsim/stable/disk.sim -# ./test.sh -f tsim/stable/dnode3.sim -# ./test.sh -f tsim/stable/metrics.sim -# ./test.sh -f tsim/stable/refcount.sim -# ./test.sh -f tsim/stable/tag_add.sim -# ./test.sh -f tsim/stable/tag_drop.sim -# ./test.sh -f tsim/stable/tag_filter.sim -# ./test.sh -f tsim/stable/tag_modify.sim -# ./test.sh -f tsim/stable/tag_rename.sim -# ./test.sh -f tsim/stable/values.sim -# ./test.sh -f tsim/stable/vnode3.sim +# --- sma +./test.sh -f tsim/sma/drop_sma.sim +./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim +# temp disable +./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim +./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim -# # --- for multi process mode -# ./test.sh -f tsim/user/basic.sim -m -# ./test.sh -f tsim/db/basic3.sim -m -# ./test.sh -f tsim/db/error1.sim -m -# ./test.sh -f tsim/insert/backquote.sim -m -# # unsupport ./test.sh -f tsim/parser/fourArithmetic-basic.sim -m -# ./test.sh -f tsim/query/interval-offset.sim -m -# # unsupport ./test.sh -f tsim/tmq/basic3.sim -m -# ./test.sh -f tsim/stable/vnode3.sim -m -# ./test.sh -f tsim/qnode/basic1.sim -m -# # unsupport ./test.sh -f tsim/mnode/basic1.sim -m +# --- valgrind ---- +./test.sh -f tsim/valgrind/checkError1.sim +./test.sh -f tsim/valgrind/checkError2.sim +./test.sh -f tsim/valgrind/checkError3.sim +./test.sh -f tsim/valgrind/checkError4.sim +./test.sh -f tsim/valgrind/checkError5.sim +./test.sh -f tsim/valgrind/checkError6.sim +./test.sh -f tsim/valgrind/checkError7.sim +./test.sh -f tsim/valgrind/checkError8.sim +./test.sh -f tsim/valgrind/checkUdf.sim -# # --- sma -# ./test.sh -f tsim/sma/drop_sma.sim -# ./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim -# # temp disable -# ./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim -# ./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim +# --- vnode ---- +# unsupport ./test.sh -f tsim/vnode/replica3_basic.sim +# unsupport ./test.sh -f tsim/vnode/replica3_repeat.sim +# unsupport ./test.sh -f tsim/vnode/replica3_vgroup.sim +# unsupport ./test.sh -f tsim/vnode/replica3_many.sim +# unsupport ./test.sh -f tsim/vnode/replica3_import.sim +# unsupport ./test.sh -f tsim/vnode/stable_balance_replica1.sim +# unsupport ./test.sh -f tsim/vnode/stable_dnode2_stop.sim +./test.sh -f tsim/vnode/stable_dnode2.sim +./test.sh -f tsim/vnode/stable_dnode3.sim +./test.sh -f tsim/vnode/stable_replica3_dnode6.sim +./test.sh -f tsim/vnode/stable_replica3_vnode3.sim -# # --- valgrind ---- -# ./test.sh -f tsim/valgrind/checkError1.sim -# ./test.sh -f tsim/valgrind/checkError2.sim -# ./test.sh -f tsim/valgrind/checkError3.sim -# ./test.sh -f tsim/valgrind/checkError4.sim -# ./test.sh -f tsim/valgrind/checkError5.sim -# ./test.sh -f tsim/valgrind/checkError6.sim -# ./test.sh -f tsim/valgrind/checkError7.sim -# ./test.sh -f tsim/valgrind/checkError8.sim -# ./test.sh -f tsim/valgrind/checkUdf.sim +# --- sync +./test.sh -f tsim/sync/3Replica1VgElect.sim +./test.sh -f tsim/sync/3Replica5VgElect.sim +./test.sh -f tsim/sync/oneReplica1VgElect.sim +./test.sh -f tsim/sync/oneReplica5VgElect.sim -# # --- vnode ---- -# # unsupport ./test.sh -f tsim/vnode/replica3_basic.sim -# # unsupport ./test.sh -f tsim/vnode/replica3_repeat.sim -# # unsupport ./test.sh -f tsim/vnode/replica3_vgroup.sim -# # unsupport ./test.sh -f tsim/vnode/replica3_many.sim -# # unsupport ./test.sh -f tsim/vnode/replica3_import.sim -# # unsupport ./test.sh -f tsim/vnode/stable_balance_replica1.sim -# # unsupport ./test.sh -f tsim/vnode/stable_dnode2_stop.sim -# ./test.sh -f tsim/vnode/stable_dnode2.sim -# ./test.sh -f tsim/vnode/stable_dnode3.sim -# ./test.sh -f tsim/vnode/stable_replica3_dnode6.sim -# ./test.sh -f tsim/vnode/stable_replica3_vnode3.sim +# --- catalog ---- +./test.sh -f tsim/catalog/alterInCurrent.sim -# # --- sync -# ./test.sh -f tsim/sync/3Replica1VgElect.sim -# ./test.sh -f tsim/sync/3Replica5VgElect.sim -# ./test.sh -f tsim/sync/oneReplica1VgElect.sim -# ./test.sh -f tsim/sync/oneReplica5VgElect.sim +# --- scalar ---- +./test.sh -f tsim/scalar/in.sim +./test.sh -f tsim/scalar/scalar.sim +./test.sh -f tsim/scalar/filter.sim +./test.sh -f tsim/scalar/caseWhen.sim -# # --- catalog ---- -# ./test.sh -f tsim/catalog/alterInCurrent.sim +# ---- alter ---- +./test.sh -f tsim/alter/cached_schema_after_alter.sim +./test.sh -f tsim/alter/dnode.sim +./test.sh -f tsim/alter/table.sim -# # --- scalar ---- -# ./test.sh -f tsim/scalar/in.sim -# ./test.sh -f tsim/scalar/scalar.sim -# ./test.sh -f tsim/scalar/filter.sim -# ./test.sh -f tsim/scalar/caseWhen.sim +# ---- cache ---- +./test.sh -f tsim/cache/new_metrics.sim +./test.sh -f tsim/cache/restart_table.sim +./test.sh -f tsim/cache/restart_metrics.sim -# # ---- alter ---- -# ./test.sh -f tsim/alter/cached_schema_after_alter.sim -# ./test.sh -f tsim/alter/dnode.sim -# ./test.sh -f tsim/alter/table.sim +# ---- column ---- +./test.sh -f tsim/column/commit.sim +./test.sh -f tsim/column/metrics.sim +./test.sh -f tsim/column/table.sim -# # ---- cache ---- -# ./test.sh -f tsim/cache/new_metrics.sim -# ./test.sh -f tsim/cache/restart_table.sim -# ./test.sh -f tsim/cache/restart_metrics.sim +# ---- compress ---- +./test.sh -f tsim/compress/commitlog.sim +./test.sh -f tsim/compress/compress2.sim +./test.sh -f tsim/compress/compress.sim +./test.sh -f tsim/compress/uncompress.sim -# # ---- column ---- -# ./test.sh -f tsim/column/commit.sim -# ./test.sh -f tsim/column/metrics.sim -# ./test.sh -f tsim/column/table.sim +# ---- compute ---- +./test.sh -f tsim/compute/avg.sim +./test.sh -f tsim/compute/block_dist.sim +./test.sh -f tsim/compute/bottom.sim +./test.sh -f tsim/compute/count.sim +./test.sh -f tsim/compute/diff.sim +./test.sh -f tsim/compute/diff2.sim +./test.sh -f tsim/compute/first.sim +./test.sh -f tsim/compute/interval.sim +./test.sh -f tsim/compute/last_row.sim +./test.sh -f tsim/compute/last.sim +./test.sh -f tsim/compute/leastsquare.sim +./test.sh -f tsim/compute/max.sim +./test.sh -f tsim/compute/min.sim +./test.sh -f tsim/compute/null.sim +./test.sh -f tsim/compute/percentile.sim +./test.sh -f tsim/compute/stddev.sim +./test.sh -f tsim/compute/sum.sim +./test.sh -f tsim/compute/top.sim -# # ---- compress ---- -# ./test.sh -f tsim/compress/commitlog.sim -# ./test.sh -f tsim/compress/compress2.sim -# ./test.sh -f tsim/compress/compress.sim -# ./test.sh -f tsim/compress/uncompress.sim +# ---- field ---- +./test.sh -f tsim/field/2.sim +./test.sh -f tsim/field/3.sim +./test.sh -f tsim/field/4.sim +./test.sh -f tsim/field/5.sim +./test.sh -f tsim/field/6.sim +./test.sh -f tsim/field/binary.sim +./test.sh -f tsim/field/bigint.sim +./test.sh -f tsim/field/bool.sim +./test.sh -f tsim/field/double.sim +./test.sh -f tsim/field/float.sim +./test.sh -f tsim/field/int.sim +./test.sh -f tsim/field/single.sim +./test.sh -f tsim/field/smallint.sim +./test.sh -f tsim/field/tinyint.sim +./test.sh -f tsim/field/unsigined_bigint.sim -# # ---- compute ---- -# ./test.sh -f tsim/compute/avg.sim -# ./test.sh -f tsim/compute/block_dist.sim -# ./test.sh -f tsim/compute/bottom.sim -# ./test.sh -f tsim/compute/count.sim -# ./test.sh -f tsim/compute/diff.sim -# ./test.sh -f tsim/compute/diff2.sim -# ./test.sh -f tsim/compute/first.sim -# ./test.sh -f tsim/compute/interval.sim -# ./test.sh -f tsim/compute/last_row.sim -# ./test.sh -f tsim/compute/last.sim -# ./test.sh -f tsim/compute/leastsquare.sim -# ./test.sh -f tsim/compute/max.sim -# ./test.sh -f tsim/compute/min.sim -# ./test.sh -f tsim/compute/null.sim -# ./test.sh -f tsim/compute/percentile.sim -# ./test.sh -f tsim/compute/stddev.sim -# ./test.sh -f tsim/compute/sum.sim -# ./test.sh -f tsim/compute/top.sim +# ---- vector ---- +./test.sh -f tsim/vector/metrics_field.sim +./test.sh -f tsim/vector/metrics_mix.sim +./test.sh -f tsim/vector/metrics_query.sim +./test.sh -f tsim/vector/metrics_tag.sim +./test.sh -f tsim/vector/metrics_time.sim +./test.sh -f tsim/vector/multi.sim +./test.sh -f tsim/vector/single.sim +./test.sh -f tsim/vector/table_field.sim +./test.sh -f tsim/vector/table_mix.sim +./test.sh -f tsim/vector/table_query.sim +./test.sh -f tsim/vector/table_time.sim -# # ---- field ---- -# ./test.sh -f tsim/field/2.sim -# ./test.sh -f tsim/field/3.sim -# ./test.sh -f tsim/field/4.sim -# ./test.sh -f tsim/field/5.sim -# ./test.sh -f tsim/field/6.sim -# ./test.sh -f tsim/field/binary.sim -# ./test.sh -f tsim/field/bigint.sim -# ./test.sh -f tsim/field/bool.sim -# ./test.sh -f tsim/field/double.sim -# ./test.sh -f tsim/field/float.sim -# ./test.sh -f tsim/field/int.sim -# ./test.sh -f tsim/field/single.sim -# ./test.sh -f tsim/field/smallint.sim -# ./test.sh -f tsim/field/tinyint.sim -# ./test.sh -f tsim/field/unsigined_bigint.sim +# ---- wal ---- +./test.sh -f tsim/wal/kill.sim -# # ---- vector ---- -# ./test.sh -f tsim/vector/metrics_field.sim -# ./test.sh -f tsim/vector/metrics_mix.sim -# ./test.sh -f tsim/vector/metrics_query.sim -# ./test.sh -f tsim/vector/metrics_tag.sim -# ./test.sh -f tsim/vector/metrics_time.sim -# ./test.sh -f tsim/vector/multi.sim -# ./test.sh -f tsim/vector/single.sim -# ./test.sh -f tsim/vector/table_field.sim -# ./test.sh -f tsim/vector/table_mix.sim -# ./test.sh -f tsim/vector/table_query.sim -# ./test.sh -f tsim/vector/table_time.sim +# ---- tag ---- +./test.sh -f tsim/tag/3.sim +./test.sh -f tsim/tag/4.sim +./test.sh -f tsim/tag/5.sim +./test.sh -f tsim/tag/6.sim +./test.sh -f tsim/tag/add.sim +./test.sh -f tsim/tag/bigint.sim +./test.sh -f tsim/tag/binary_binary.sim +./test.sh -f tsim/tag/binary.sim +./test.sh -f tsim/tag/bool_binary.sim +./test.sh -f tsim/tag/bool_int.sim +./test.sh -f tsim/tag/bool.sim +./test.sh -f tsim/tag/change.sim +./test.sh -f tsim/tag/column.sim +./test.sh -f tsim/tag/commit.sim +./test.sh -f tsim/tag/create.sim +./test.sh -f tsim/tag/delete.sim +./test.sh -f tsim/tag/double.sim +./test.sh -f tsim/tag/filter.sim +./test.sh -f tsim/tag/float.sim +./test.sh -f tsim/tag/int_binary.sim +./test.sh -f tsim/tag/int_float.sim +./test.sh -f tsim/tag/int.sim +./test.sh -f tsim/tag/set.sim +./test.sh -f tsim/tag/smallint.sim +./test.sh -f tsim/tag/tinyint.sim +./test.sh -f tsim/tag/drop_tag.sim -# # ---- wal ---- -# ./test.sh -f tsim/wal/kill.sim -# # ---- tag ---- -# ./test.sh -f tsim/tag/3.sim -# ./test.sh -f tsim/tag/4.sim -# ./test.sh -f tsim/tag/5.sim -# ./test.sh -f tsim/tag/6.sim -# ./test.sh -f tsim/tag/add.sim -# ./test.sh -f tsim/tag/bigint.sim -# ./test.sh -f tsim/tag/binary_binary.sim -# ./test.sh -f tsim/tag/binary.sim -# ./test.sh -f tsim/tag/bool_binary.sim -# ./test.sh -f tsim/tag/bool_int.sim -# ./test.sh -f tsim/tag/bool.sim -# ./test.sh -f tsim/tag/change.sim -# ./test.sh -f tsim/tag/column.sim -# ./test.sh -f tsim/tag/commit.sim -# ./test.sh -f tsim/tag/create.sim -# ./test.sh -f tsim/tag/delete.sim -# ./test.sh -f tsim/tag/double.sim -# ./test.sh -f tsim/tag/filter.sim -# ./test.sh -f tsim/tag/float.sim -# ./test.sh -f tsim/tag/int_binary.sim -# ./test.sh -f tsim/tag/int_float.sim -# ./test.sh -f tsim/tag/int.sim -# ./test.sh -f tsim/tag/set.sim -# ./test.sh -f tsim/tag/smallint.sim -# ./test.sh -f tsim/tag/tinyint.sim - -# #======================b1-end=============== +#======================b1-end=============== diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index e4a801cc1c..a89b41cac6 100644 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -2,613 +2,611 @@ set -e set -x -# python3 ./test.py -f 0-others/taosShell.py -# python3 ./test.py -f 0-others/taosShellError.py -# python3 ./test.py -f 0-others/taosShellNetChk.py -# python3 ./test.py -f 0-others/telemetry.py -# python3 ./test.py -f 0-others/taosdMonitor.py -# python3 ./test.py -f 0-others/udfTest.py -# python3 ./test.py -f 0-others/udf_create.py -# python3 ./test.py -f 0-others/udf_restart_taosd.py -# python3 ./test.py -f 0-others/cachemodel.py -# python3 ./test.py -f 0-others/udf_cfg1.py -# python3 ./test.py -f 0-others/udf_cfg2.py +python3 ./test.py -f 0-others/taosShell.py +python3 ./test.py -f 0-others/taosShellError.py +python3 ./test.py -f 0-others/taosShellNetChk.py +python3 ./test.py -f 0-others/telemetry.py +python3 ./test.py -f 0-others/taosdMonitor.py +python3 ./test.py -f 0-others/udfTest.py +python3 ./test.py -f 0-others/udf_create.py +python3 ./test.py -f 0-others/udf_restart_taosd.py +python3 ./test.py -f 0-others/cachemodel.py +python3 ./test.py -f 0-others/udf_cfg1.py +python3 ./test.py -f 0-others/udf_cfg2.py -# python3 ./test.py -f 0-others/sysinfo.py -# python3 ./test.py -f 0-others/user_control.py -# python3 ./test.py -f 0-others/fsync.py +python3 ./test.py -f 0-others/sysinfo.py +python3 ./test.py -f 0-others/user_control.py +python3 ./test.py -f 0-others/fsync.py python3 ./test.py -f 0-others/compatibility.py -# python3 ./test.py -f 1-insert/alter_database.py -# python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py -# python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py -# python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py -# python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py -# python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py -# python3 ./test.py -f 1-insert/alter_stable.py -# python3 ./test.py -f 1-insert/alter_table.py -# python3 ./test.py -f 1-insert/insertWithMoreVgroup.py -# python3 ./test.py -f 1-insert/table_comment.py -# python3 ./test.py -f 1-insert/time_range_wise.py -# python3 ./test.py -f 1-insert/block_wise.py -# python3 ./test.py -f 1-insert/create_retentions.py -# python3 ./test.py -f 1-insert/table_param_ttl.py -# python3 ./test.py -f 1-insert/mutil_stage.py -# python3 ./test.py -f 1-insert/table_param_ttl.py -R -# python3 ./test.py -f 1-insert/update_data_muti_rows.py -# python3 ./test.py -f 1-insert/db_tb_name_check.py -# python3 ./test.py -f 1-insert/database_pre_suf.py -# python3 ./test.py -f 0-others/show.py -# python3 ./test.py -f 2-query/abs.py -# python3 ./test.py -f 2-query/abs.py -R -# python3 ./test.py -f 2-query/and_or_for_byte.py -# python3 ./test.py -f 2-query/and_or_for_byte.py -R -# python3 ./test.py -f 2-query/apercentile.py -# python3 ./test.py -f 2-query/apercentile.py -R -# python3 ./test.py -f 2-query/arccos.py -# python3 ./test.py -f 2-query/arccos.py -R -# python3 ./test.py -f 2-query/arcsin.py -# python3 ./test.py -f 2-query/arcsin.py -R -# python3 ./test.py -f 2-query/arctan.py -# python3 ./test.py -f 2-query/arctan.py -R -# python3 ./test.py -f 2-query/avg.py -# python3 ./test.py -f 2-query/avg.py -R -# python3 ./test.py -f 2-query/between.py -# python3 ./test.py -f 2-query/between.py -R -# python3 ./test.py -f 2-query/bottom.py -# python3 ./test.py -f 2-query/bottom.py -R -# python3 ./test.py -f 2-query/cast.py -# python3 ./test.py -f 2-query/cast.py -R -# python3 ./test.py -f 2-query/ceil.py -# python3 ./test.py -f 2-query/ceil.py -R -# python3 ./test.py -f 2-query/char_length.py -# python3 ./test.py -f 2-query/char_length.py -R -# python3 ./test.py -f 2-query/check_tsdb.py -# python3 ./test.py -f 2-query/check_tsdb.py -R -# python3 ./test.py -f 2-query/concat.py -# python3 ./test.py -f 2-query/concat.py -R -# python3 ./test.py -f 2-query/concat_ws.py -# python3 ./test.py -f 2-query/concat_ws.py -R -# python3 ./test.py -f 2-query/concat_ws2.py -# python3 ./test.py -f 2-query/concat_ws2.py -R -# python3 ./test.py -f 2-query/cos.py -# python3 ./test.py -f 2-query/cos.py -R -# python3 ./test.py -f 2-query/count_partition.py -# python3 ./test.py -f 2-query/count_partition.py -R -# python3 ./test.py -f 2-query/count.py -# python3 ./test.py -f 2-query/count.py -R -# python3 ./test.py -f 2-query/db.py -# python3 ./test.py -f 2-query/db.py -R -# python3 ./test.py -f 2-query/diff.py -# python3 ./test.py -f 2-query/diff.py -R -# python3 ./test.py -f 2-query/distinct.py -# python3 ./test.py -f 2-query/distinct.py -R -# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -R -# python3 ./test.py -f 2-query/distribute_agg_avg.py -# python3 ./test.py -f 2-query/distribute_agg_avg.py -R -# python3 ./test.py -f 2-query/distribute_agg_count.py -# python3 ./test.py -f 2-query/distribute_agg_count.py -R -# python3 ./test.py -f 2-query/distribute_agg_max.py -# python3 ./test.py -f 2-query/distribute_agg_max.py -R -# python3 ./test.py -f 2-query/distribute_agg_min.py -# python3 ./test.py -f 2-query/distribute_agg_min.py -R -# python3 ./test.py -f 2-query/distribute_agg_spread.py -# python3 ./test.py -f 2-query/distribute_agg_spread.py -R -# python3 ./test.py -f 2-query/distribute_agg_stddev.py -# python3 ./test.py -f 2-query/distribute_agg_stddev.py -R -# python3 ./test.py -f 2-query/distribute_agg_sum.py -# python3 ./test.py -f 2-query/distribute_agg_sum.py -R -# python3 ./test.py -f 2-query/explain.py -# python3 ./test.py -f 2-query/explain.py -R -# python3 ./test.py -f 2-query/first.py -# python3 ./test.py -f 2-query/first.py -R -# python3 ./test.py -f 2-query/floor.py -# python3 ./test.py -f 2-query/floor.py -R -# python3 ./test.py -f 2-query/function_null.py -# python3 ./test.py -f 2-query/function_null.py -R -# python3 ./test.py -f 2-query/function_stateduration.py -# python3 ./test.py -f 2-query/function_stateduration.py -R -# python3 ./test.py -f 2-query/histogram.py -# python3 ./test.py -f 2-query/histogram.py -R -# python3 ./test.py -f 2-query/hyperloglog.py -# python3 ./test.py -f 2-query/hyperloglog.py -R -# python3 ./test.py -f 2-query/interp.py -# python3 ./test.py -f 2-query/interp.py -R -# python3 ./test.py -f 2-query/irate.py -# python3 ./test.py -f 2-query/irate.py -R -# python3 ./test.py -f 2-query/join.py -# python3 ./test.py -f 2-query/join.py -R -# python3 ./test.py -f 2-query/last_row.py -# python3 ./test.py -f 2-query/last_row.py -R -# python3 ./test.py -f 2-query/last.py -# python3 ./test.py -f 2-query/last.py -R -# python3 ./test.py -f 2-query/leastsquares.py -# python3 ./test.py -f 2-query/leastsquares.py -R -# python3 ./test.py -f 2-query/length.py -# python3 ./test.py -f 2-query/length.py -R -# python3 ./test.py -f 2-query/log.py -# # python3 ./test.py -f 2-query/log.py -R -# python3 ./test.py -f 2-query/lower.py -# python3 ./test.py -f 2-query/lower.py -R -# python3 ./test.py -f 2-query/ltrim.py -# python3 ./test.py -f 2-query/ltrim.py -R -# python3 ./test.py -f 2-query/mavg.py -# python3 ./test.py -f 2-query/mavg.py -R -# python3 ./test.py -f 2-query/max_partition.py -# python3 ./test.py -f 2-query/max_partition.py -R -# python3 ./test.py -f 2-query/max.py -# python3 ./test.py -f 2-query/max.py -R -# python3 ./test.py -f 2-query/min.py -# python3 ./test.py -f 2-query/min.py -R -# python3 ./test.py -f 2-query/Now.py -# python3 ./test.py -f 2-query/Now.py -R -# python3 ./test.py -f 2-query/percentile.py -# python3 ./test.py -f 2-query/percentile.py -R -# python3 ./test.py -f 2-query/pow.py -# python3 ./test.py -f 2-query/pow.py -R -# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -R -# python3 ./test.py -f 2-query/round.py -# python3 ./test.py -f 2-query/round.py -R -# python3 ./test.py -f 2-query/rtrim.py -# python3 ./test.py -f 2-query/rtrim.py -R -# python3 ./test.py -f 2-query/sample.py -# python3 ./test.py -f 2-query/sample.py -R -# python3 ./test.py -f 2-query/sin.py -# python3 ./test.py -f 2-query/sin.py -R -# python3 ./test.py -f 2-query/smaTest.py -# python3 ./test.py -f 2-query/smaTest.py -R -# python3 ./test.py -f 2-query/sml.py -# python3 ./test.py -f 2-query/sml.py -R -# python3 ./test.py -f 2-query/spread.py -# python3 ./test.py -f 2-query/spread.py -R -# python3 ./test.py -f 2-query/sqrt.py -# python3 ./test.py -f 2-query/sqrt.py -R -# python3 ./test.py -f 2-query/statecount.py -# python3 ./test.py -f 2-query/statecount.py -R -# python3 ./test.py -f 2-query/stateduration.py -# python3 ./test.py -f 2-query/stateduration.py -R -# python3 ./test.py -f 2-query/substr.py -# python3 ./test.py -f 2-query/substr.py -R -# python3 ./test.py -f 2-query/sum.py -# python3 ./test.py -f 2-query/sum.py -R -# python3 ./test.py -f 2-query/tail.py -# python3 ./test.py -f 2-query/tail.py -R -# python3 ./test.py -f 2-query/tan.py -# # python3 ./test.py -f 2-query/tan.py -R -# python3 ./test.py -f 2-query/Timediff.py -# python3 ./test.py -f 2-query/Timediff.py -R -# python3 ./test.py -f 2-query/timetruncate.py -# # python3 ./test.py -f 2-query/timetruncate.py -R -# python3 ./test.py -f 2-query/timezone.py -# python3 ./test.py -f 2-query/timezone.py -R -# python3 ./test.py -f 2-query/To_iso8601.py -# python3 ./test.py -f 2-query/To_iso8601.py -R -# python3 ./test.py -f 2-query/To_unixtimestamp.py -# python3 ./test.py -f 2-query/To_unixtimestamp.py -R -# python3 ./test.py -f 2-query/Today.py -# # python3 ./test.py -f 2-query/Today.py -R -# python3 ./test.py -f 2-query/top.py -# python3 ./test.py -f 2-query/top.py -R -# python3 ./test.py -f 2-query/tsbsQuery.py -# python3 ./test.py -f 2-query/tsbsQuery.py -R -# python3 ./test.py -f 2-query/ttl_comment.py -# python3 ./test.py -f 2-query/ttl_comment.py -R -# python3 ./test.py -f 2-query/twa.py -# python3 ./test.py -f 2-query/twa.py -R -# python3 ./test.py -f 2-query/union.py -# python3 ./test.py -f 2-query/union.py -R -# python3 ./test.py -f 2-query/unique.py -# python3 ./test.py -f 2-query/unique.py -R -# python3 ./test.py -f 2-query/upper.py -# python3 ./test.py -f 2-query/upper.py -R -# python3 ./test.py -f 2-query/varchar.py -# python3 ./test.py -f 2-query/varchar.py -R +python3 ./test.py -f 1-insert/alter_database.py +python3 ./test.py -f 1-insert/influxdb_line_taosc_insert.py +python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py +python3 ./test.py -f 1-insert/opentsdb_json_taosc_insert.py +python3 ./test.py -f 1-insert/test_stmt_muti_insert_query.py +python3 ./test.py -f 1-insert/test_stmt_set_tbname_tag.py +python3 ./test.py -f 1-insert/alter_stable.py +python3 ./test.py -f 1-insert/alter_table.py +python3 ./test.py -f 1-insert/insertWithMoreVgroup.py +python3 ./test.py -f 1-insert/table_comment.py +python3 ./test.py -f 1-insert/time_range_wise.py +python3 ./test.py -f 1-insert/block_wise.py +python3 ./test.py -f 1-insert/create_retentions.py +python3 ./test.py -f 1-insert/table_param_ttl.py +python3 ./test.py -f 1-insert/mutil_stage.py +python3 ./test.py -f 1-insert/table_param_ttl.py -R +python3 ./test.py -f 1-insert/update_data_muti_rows.py +python3 ./test.py -f 1-insert/db_tb_name_check.py +python3 ./test.py -f 1-insert/database_pre_suf.py +python3 ./test.py -f 0-others/show.py +python3 ./test.py -f 2-query/abs.py +python3 ./test.py -f 2-query/abs.py -R +python3 ./test.py -f 2-query/and_or_for_byte.py +python3 ./test.py -f 2-query/and_or_for_byte.py -R +python3 ./test.py -f 2-query/apercentile.py +python3 ./test.py -f 2-query/apercentile.py -R +python3 ./test.py -f 2-query/arccos.py +python3 ./test.py -f 2-query/arccos.py -R +python3 ./test.py -f 2-query/arcsin.py +python3 ./test.py -f 2-query/arcsin.py -R +python3 ./test.py -f 2-query/arctan.py +python3 ./test.py -f 2-query/arctan.py -R +python3 ./test.py -f 2-query/avg.py +python3 ./test.py -f 2-query/avg.py -R +python3 ./test.py -f 2-query/between.py +python3 ./test.py -f 2-query/between.py -R +python3 ./test.py -f 2-query/bottom.py +python3 ./test.py -f 2-query/bottom.py -R +python3 ./test.py -f 2-query/cast.py +python3 ./test.py -f 2-query/cast.py -R +python3 ./test.py -f 2-query/ceil.py +python3 ./test.py -f 2-query/ceil.py -R +python3 ./test.py -f 2-query/char_length.py +python3 ./test.py -f 2-query/char_length.py -R +python3 ./test.py -f 2-query/check_tsdb.py +python3 ./test.py -f 2-query/check_tsdb.py -R +python3 ./test.py -f 2-query/concat.py +python3 ./test.py -f 2-query/concat.py -R +python3 ./test.py -f 2-query/concat_ws.py +python3 ./test.py -f 2-query/concat_ws.py -R +python3 ./test.py -f 2-query/concat_ws2.py +python3 ./test.py -f 2-query/concat_ws2.py -R +python3 ./test.py -f 2-query/cos.py +python3 ./test.py -f 2-query/cos.py -R +python3 ./test.py -f 2-query/count_partition.py +python3 ./test.py -f 2-query/count_partition.py -R +python3 ./test.py -f 2-query/count.py +python3 ./test.py -f 2-query/count.py -R +python3 ./test.py -f 2-query/db.py +python3 ./test.py -f 2-query/db.py -R +python3 ./test.py -f 2-query/diff.py +python3 ./test.py -f 2-query/diff.py -R +python3 ./test.py -f 2-query/distinct.py +python3 ./test.py -f 2-query/distinct.py -R +python3 ./test.py -f 2-query/distribute_agg_apercentile.py +python3 ./test.py -f 2-query/distribute_agg_apercentile.py -R +python3 ./test.py -f 2-query/distribute_agg_avg.py +python3 ./test.py -f 2-query/distribute_agg_avg.py -R +python3 ./test.py -f 2-query/distribute_agg_count.py +python3 ./test.py -f 2-query/distribute_agg_count.py -R +python3 ./test.py -f 2-query/distribute_agg_max.py +python3 ./test.py -f 2-query/distribute_agg_max.py -R +python3 ./test.py -f 2-query/distribute_agg_min.py +python3 ./test.py -f 2-query/distribute_agg_min.py -R +python3 ./test.py -f 2-query/distribute_agg_spread.py +python3 ./test.py -f 2-query/distribute_agg_spread.py -R +python3 ./test.py -f 2-query/distribute_agg_stddev.py +python3 ./test.py -f 2-query/distribute_agg_stddev.py -R +python3 ./test.py -f 2-query/distribute_agg_sum.py +python3 ./test.py -f 2-query/distribute_agg_sum.py -R +python3 ./test.py -f 2-query/explain.py +python3 ./test.py -f 2-query/explain.py -R +python3 ./test.py -f 2-query/first.py +python3 ./test.py -f 2-query/first.py -R +python3 ./test.py -f 2-query/floor.py +python3 ./test.py -f 2-query/floor.py -R +python3 ./test.py -f 2-query/function_null.py +python3 ./test.py -f 2-query/function_null.py -R +python3 ./test.py -f 2-query/function_stateduration.py +python3 ./test.py -f 2-query/function_stateduration.py -R +python3 ./test.py -f 2-query/histogram.py +python3 ./test.py -f 2-query/histogram.py -R +python3 ./test.py -f 2-query/hyperloglog.py +python3 ./test.py -f 2-query/hyperloglog.py -R +python3 ./test.py -f 2-query/interp.py +python3 ./test.py -f 2-query/interp.py -R +python3 ./test.py -f 2-query/irate.py +python3 ./test.py -f 2-query/irate.py -R +python3 ./test.py -f 2-query/join.py +python3 ./test.py -f 2-query/join.py -R +python3 ./test.py -f 2-query/last_row.py +python3 ./test.py -f 2-query/last_row.py -R +python3 ./test.py -f 2-query/last.py +python3 ./test.py -f 2-query/last.py -R +python3 ./test.py -f 2-query/leastsquares.py +python3 ./test.py -f 2-query/leastsquares.py -R +python3 ./test.py -f 2-query/length.py +python3 ./test.py -f 2-query/length.py -R +python3 ./test.py -f 2-query/log.py +python3 ./test.py -f 2-query/log.py -R +python3 ./test.py -f 2-query/lower.py +python3 ./test.py -f 2-query/lower.py -R +python3 ./test.py -f 2-query/ltrim.py +python3 ./test.py -f 2-query/ltrim.py -R +python3 ./test.py -f 2-query/mavg.py +python3 ./test.py -f 2-query/mavg.py -R +python3 ./test.py -f 2-query/max_partition.py +python3 ./test.py -f 2-query/max_partition.py -R +python3 ./test.py -f 2-query/max.py +python3 ./test.py -f 2-query/max.py -R +python3 ./test.py -f 2-query/min.py +python3 ./test.py -f 2-query/min.py -R +python3 ./test.py -f 2-query/Now.py +python3 ./test.py -f 2-query/Now.py -R +python3 ./test.py -f 2-query/percentile.py +python3 ./test.py -f 2-query/percentile.py -R +python3 ./test.py -f 2-query/pow.py +python3 ./test.py -f 2-query/pow.py -R +python3 ./test.py -f 2-query/query_cols_tags_and_or.py +python3 ./test.py -f 2-query/query_cols_tags_and_or.py -R +python3 ./test.py -f 2-query/round.py +python3 ./test.py -f 2-query/round.py -R +python3 ./test.py -f 2-query/rtrim.py +python3 ./test.py -f 2-query/rtrim.py -R +python3 ./test.py -f 2-query/sample.py +python3 ./test.py -f 2-query/sample.py -R +python3 ./test.py -f 2-query/sin.py +python3 ./test.py -f 2-query/sin.py -R +python3 ./test.py -f 2-query/smaTest.py +python3 ./test.py -f 2-query/smaTest.py -R +python3 ./test.py -f 2-query/sml.py +python3 ./test.py -f 2-query/sml.py -R +python3 ./test.py -f 2-query/spread.py +python3 ./test.py -f 2-query/spread.py -R +python3 ./test.py -f 2-query/sqrt.py +python3 ./test.py -f 2-query/sqrt.py -R +python3 ./test.py -f 2-query/statecount.py +python3 ./test.py -f 2-query/statecount.py -R +python3 ./test.py -f 2-query/stateduration.py +python3 ./test.py -f 2-query/stateduration.py -R +python3 ./test.py -f 2-query/substr.py +python3 ./test.py -f 2-query/substr.py -R +python3 ./test.py -f 2-query/sum.py +python3 ./test.py -f 2-query/sum.py -R +python3 ./test.py -f 2-query/tail.py +python3 ./test.py -f 2-query/tail.py -R +python3 ./test.py -f 2-query/tan.py +python3 ./test.py -f 2-query/tan.py -R +python3 ./test.py -f 2-query/Timediff.py +python3 ./test.py -f 2-query/Timediff.py -R +python3 ./test.py -f 2-query/timetruncate.py +# python3 ./test.py -f 2-query/timetruncate.py -R +python3 ./test.py -f 2-query/timezone.py +python3 ./test.py -f 2-query/timezone.py -R +python3 ./test.py -f 2-query/To_iso8601.py +python3 ./test.py -f 2-query/To_iso8601.py -R +python3 ./test.py -f 2-query/To_unixtimestamp.py +python3 ./test.py -f 2-query/To_unixtimestamp.py -R +python3 ./test.py -f 2-query/Today.py +# python3 ./test.py -f 2-query/Today.py -R +python3 ./test.py -f 2-query/top.py +python3 ./test.py -f 2-query/top.py -R +python3 ./test.py -f 2-query/tsbsQuery.py +python3 ./test.py -f 2-query/tsbsQuery.py -R +python3 ./test.py -f 2-query/ttl_comment.py +python3 ./test.py -f 2-query/ttl_comment.py -R +python3 ./test.py -f 2-query/twa.py +python3 ./test.py -f 2-query/twa.py -R +python3 ./test.py -f 2-query/union.py +python3 ./test.py -f 2-query/union.py -R +python3 ./test.py -f 2-query/unique.py +python3 ./test.py -f 2-query/unique.py -R +python3 ./test.py -f 2-query/upper.py +python3 ./test.py -f 2-query/upper.py -R +python3 ./test.py -f 2-query/varchar.py +python3 ./test.py -f 2-query/varchar.py -R -# python3 ./test.py -f 1-insert/update_data.py +python3 ./test.py -f 1-insert/update_data.py -# python3 ./test.py -f 1-insert/delete_data.py +python3 ./test.py -f 1-insert/delete_data.py -# python3 ./test.py -f 2-query/join2.py -# python3 ./test.py -f 2-query/union1.py -# python3 ./test.py -f 2-query/concat2.py +python3 ./test.py -f 2-query/join2.py +python3 ./test.py -f 2-query/union1.py +python3 ./test.py -f 2-query/concat2.py -# python3 ./test.py -f 2-query/json_tag.py +python3 ./test.py -f 2-query/json_tag.py # python3 ./test.py -f 2-query/nestedQuery.py # TD-15983 subquery output duplicate name column. # Please Xiangyang Guo modify the following script # python3 ./test.py -f 2-query/nestedQuery_str.py -# python3 ./test.py -f 2-query/stablity.py +python3 ./test.py -f 2-query/stablity.py -# python3 ./test.py -f 2-query/elapsed.py -# python3 ./test.py -f 2-query/csum.py -# python3 ./test.py -f 2-query/function_diff.py -# python3 ./test.py -f 2-query/queryQnode.py +python3 ./test.py -f 2-query/elapsed.py +python3 ./test.py -f 2-query/csum.py +python3 ./test.py -f 2-query/function_diff.py +python3 ./test.py -f 2-query/queryQnode.py -# python3 ./test.py -f 6-cluster/5dnode1mnode.py -# python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode1mnode.py +python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeStop.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeStopLoop.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateDb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateDb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateDbRep3.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopDnodeCreateStb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopMnodeCreateStb.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeSep1VnodeStopVnodeCreateStb.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 5 -M 3 -# # python3 ./test.py -f 6-cluster/5dnode3mnodeRestartMnodeInsertData.py -N 5 -M 3 -# # python3 ./test.py -f 6-cluster/5dnode3mnodeRestartVnodeInsertData.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertData.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartMnodeInsertData.py -N 5 -M 3 +# python3 ./test.py -f 6-cluster/5dnode3mnodeRestartVnodeInsertData.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 6 -M 3 -C 5 -# # BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py -# # python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 -# python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeAdd1Ddnoe.py -N 6 -M 3 -C 5 +# BUG python3 ./test.py -f 6-cluster/5dnode3mnodeStopInsert.py +python3 ./test.py -f 6-cluster/5dnode3mnodeDrop.py -N 5 +python3 test.py -f 6-cluster/5dnode3mnodeStopConnect.py -N 5 -M 3 + +python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 +python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 + +# vnode case +python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1 +python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1 +python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_force_stop_all_dnodes.py -N 4 -M 1 +python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_all_vnode.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_follower.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_leader.py -N 4 -M 1 +python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_all_dnodes.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync_force_stop.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader_forece_stop.py -N 4 -M 1 +python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_mnode3_insertdatas_querys.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower_force_stop.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader_force_stop.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader.py -N 4 -M 1 +python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1 +# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups_stopOne.py -N 4 -M 1 + +python3 ./test.py -f 7-tmq/create_wrong_topic.py +python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3 +python3 ./test.py -f 7-tmq/basic5.py +python3 ./test.py -f 7-tmq/subscribeDb.py +python3 ./test.py -f 7-tmq/subscribeDb0.py +python3 ./test.py -f 7-tmq/subscribeDb1.py +python3 ./test.py -f 7-tmq/subscribeDb2.py +python3 ./test.py -f 7-tmq/subscribeDb3.py +python3 ./test.py -f 7-tmq/subscribeDb4.py +python3 ./test.py -f 7-tmq/subscribeStb.py +python3 ./test.py -f 7-tmq/subscribeStb0.py +python3 ./test.py -f 7-tmq/subscribeStb1.py +python3 ./test.py -f 7-tmq/subscribeStb2.py +python3 ./test.py -f 7-tmq/subscribeStb3.py +python3 ./test.py -f 7-tmq/subscribeStb4.py +python3 ./test.py -f 7-tmq/db.py +python3 ./test.py -f 7-tmq/tmqError.py +python3 ./test.py -f 7-tmq/schema.py +python3 ./test.py -f 7-tmq/stbFilter.py +python3 ./test.py -f 7-tmq/tmqCheckData.py +python3 ./test.py -f 7-tmq/tmqCheckData1.py +#python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 5 +python3 ./test.py -f 7-tmq/tmqConsumerGroup.py +python3 ./test.py -f 7-tmq/tmqShow.py +python3 ./test.py -f 7-tmq/tmqAlterSchema.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb1.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py +python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py +python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py +python3 ./test.py -f 7-tmq/tmqDnodeRestart.py +python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py +python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py +python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py +python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py +python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py +python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py +python3 ./test.py -f 7-tmq/tmqDropStb.py +python3 ./test.py -f 7-tmq/tmqDropStbCtb.py +python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot0.py +python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot1.py +python3 ./test.py -f 7-tmq/tmqUdf.py +python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot0.py +python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot1.py +python3 ./test.py -f 7-tmq/stbTagFilter-1ctb.py +python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py +python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py +python3 ./test.py -f 7-tmq/tmq_taosx.py +python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py + +python3 ./test.py -f 99-TDcase/TD-19201.py + +#------------querPolicy 2----------- + +python3 ./test.py -f 2-query/between.py -Q 2 +python3 ./test.py -f 2-query/distinct.py -Q 2 +python3 ./test.py -f 2-query/varchar.py -Q 2 +python3 ./test.py -f 2-query/ltrim.py -Q 2 +python3 ./test.py -f 2-query/rtrim.py -Q 2 +python3 ./test.py -f 2-query/length.py -Q 2 +python3 ./test.py -f 2-query/char_length.py -Q 2 +python3 ./test.py -f 2-query/upper.py -Q 2 +python3 ./test.py -f 2-query/lower.py -Q 2 +python3 ./test.py -f 2-query/join.py -Q 2 +python3 ./test.py -f 2-query/join2.py -Q 2 +python3 ./test.py -f 2-query/cast.py -Q 2 +python3 ./test.py -f 2-query/substr.py -Q 2 +python3 ./test.py -f 2-query/union.py -Q 2 +python3 ./test.py -f 2-query/union1.py -Q 2 +python3 ./test.py -f 2-query/concat.py -Q 2 +python3 ./test.py -f 2-query/concat2.py -Q 2 +python3 ./test.py -f 2-query/concat_ws.py -Q 2 +python3 ./test.py -f 2-query/concat_ws2.py -Q 2 +#python3 ./test.py -f 2-query/check_tsdb.py -Q 2 +python3 ./test.py -f 2-query/spread.py -Q 2 +python3 ./test.py -f 2-query/hyperloglog.py -Q 2 +python3 ./test.py -f 2-query/explain.py -Q 2 +python3 ./test.py -f 2-query/leastsquares.py -Q 2 +python3 ./test.py -f 2-query/timezone.py -Q 2 +python3 ./test.py -f 2-query/Now.py -Q 2 +python3 ./test.py -f 2-query/Today.py -Q 2 +python3 ./test.py -f 2-query/max.py -Q 2 +python3 ./test.py -f 2-query/min.py -Q 2 +python3 ./test.py -f 2-query/count.py -Q 2 +python3 ./test.py -f 2-query/last.py -Q 2 +python3 ./test.py -f 2-query/first.py -Q 2 +python3 ./test.py -f 2-query/To_iso8601.py -Q 2 +python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 2 +python3 ./test.py -f 2-query/timetruncate.py -Q 2 +python3 ./test.py -f 2-query/diff.py -Q 2 +python3 ./test.py -f 2-query/Timediff.py -Q 2 +python3 ./test.py -f 2-query/json_tag.py -Q 2 +python3 ./test.py -f 2-query/top.py -Q 2 +python3 ./test.py -f 2-query/bottom.py -Q 2 +python3 ./test.py -f 2-query/percentile.py -Q 2 +python3 ./test.py -f 2-query/apercentile.py -Q 2 +python3 ./test.py -f 2-query/abs.py -Q 2 +python3 ./test.py -f 2-query/ceil.py -Q 2 +python3 ./test.py -f 2-query/floor.py -Q 2 +python3 ./test.py -f 2-query/round.py -Q 2 +python3 ./test.py -f 2-query/log.py -Q 2 +python3 ./test.py -f 2-query/pow.py -Q 2 +python3 ./test.py -f 2-query/sqrt.py -Q 2 +python3 ./test.py -f 2-query/sin.py -Q 2 +python3 ./test.py -f 2-query/cos.py -Q 2 +python3 ./test.py -f 2-query/tan.py -Q 2 +python3 ./test.py -f 2-query/arcsin.py -Q 2 +python3 ./test.py -f 2-query/arccos.py -Q 2 +python3 ./test.py -f 2-query/arctan.py -Q 2 +python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 2 +python3 ./test.py -f 2-query/interp.py -Q 2 + +# python3 ./test.py -f 2-query/nestedQuery.py -Q 2 +# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2 + +python3 ./test.py -f 2-query/avg.py -Q 2 +# python3 ./test.py -f 2-query/elapsed.py -Q 2 +python3 ./test.py -f 2-query/csum.py -Q 2 +#python3 ./test.py -f 2-query/mavg.py -Q 2 +python3 ./test.py -f 2-query/sample.py -Q 2 +python3 ./test.py -f 2-query/function_diff.py -Q 2 +python3 ./test.py -f 2-query/unique.py -Q 2 +python3 ./test.py -f 2-query/stateduration.py -Q 2 +python3 ./test.py -f 2-query/function_stateduration.py -Q 2 +python3 ./test.py -f 2-query/statecount.py -Q 2 +python3 ./test.py -f 2-query/tail.py -Q 2 +python3 ./test.py -f 2-query/ttl_comment.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_count.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_max.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_min.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 2 +python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 2 +python3 ./test.py -f 2-query/twa.py -Q 2 +python3 ./test.py -f 2-query/irate.py -Q 2 +python3 ./test.py -f 2-query/function_null.py -Q 2 +python3 ./test.py -f 2-query/count_partition.py -Q 2 +python3 ./test.py -f 2-query/max_partition.py -Q 2 +python3 ./test.py -f 2-query/last_row.py -Q 2 +python3 ./test.py -f 2-query/tsbsQuery.py -Q 2 +#------------querPolicy 3----------- + +python3 ./test.py -f 2-query/between.py -Q 3 +python3 ./test.py -f 2-query/distinct.py -Q 3 +python3 ./test.py -f 2-query/varchar.py -Q 3 +python3 ./test.py -f 2-query/ltrim.py -Q 3 +python3 ./test.py -f 2-query/rtrim.py -Q 3 +python3 ./test.py -f 2-query/length.py -Q 3 +python3 ./test.py -f 2-query/char_length.py -Q 3 +python3 ./test.py -f 2-query/upper.py -Q 3 +python3 ./test.py -f 2-query/lower.py -Q 3 +python3 ./test.py -f 2-query/join.py -Q 3 +python3 ./test.py -f 2-query/join2.py -Q 3 +python3 ./test.py -f 2-query/cast.py -Q 3 +python3 ./test.py -f 2-query/substr.py -Q 3 +python3 ./test.py -f 2-query/union.py -Q 3 +python3 ./test.py -f 2-query/union1.py -Q 3 +python3 ./test.py -f 2-query/concat.py -Q 3 +python3 ./test.py -f 2-query/concat2.py -Q 3 +python3 ./test.py -f 2-query/concat_ws.py -Q 3 +python3 ./test.py -f 2-query/concat_ws2.py -Q 3 +#python3 ./test.py -f 2-query/check_tsdb.py -Q 3 +python3 ./test.py -f 2-query/spread.py -Q 3 +python3 ./test.py -f 2-query/hyperloglog.py -Q 3 +python3 ./test.py -f 2-query/explain.py -Q 3 +python3 ./test.py -f 2-query/leastsquares.py -Q 3 +python3 ./test.py -f 2-query/timezone.py -Q 3 +python3 ./test.py -f 2-query/Now.py -Q 3 +python3 ./test.py -f 2-query/Today.py -Q 3 +python3 ./test.py -f 2-query/max.py -Q 3 +python3 ./test.py -f 2-query/min.py -Q 3 +python3 ./test.py -f 2-query/count.py -Q 3 +#python3 ./test.py -f 2-query/last.py -Q 3 +python3 ./test.py -f 2-query/first.py -Q 3 +python3 ./test.py -f 2-query/To_iso8601.py -Q 3 +python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 3 +python3 ./test.py -f 2-query/timetruncate.py -Q 3 +python3 ./test.py -f 2-query/diff.py -Q 3 +python3 ./test.py -f 2-query/Timediff.py -Q 3 +python3 ./test.py -f 2-query/json_tag.py -Q 3 +python3 ./test.py -f 2-query/top.py -Q 3 +python3 ./test.py -f 2-query/bottom.py -Q 3 +python3 ./test.py -f 2-query/percentile.py -Q 3 +python3 ./test.py -f 2-query/apercentile.py -Q 3 +python3 ./test.py -f 2-query/abs.py -Q 3 +python3 ./test.py -f 2-query/ceil.py -Q 3 +python3 ./test.py -f 2-query/floor.py -Q 3 +python3 ./test.py -f 2-query/round.py -Q 3 +python3 ./test.py -f 2-query/log.py -Q 3 +python3 ./test.py -f 2-query/pow.py -Q 3 +python3 ./test.py -f 2-query/sqrt.py -Q 3 +python3 ./test.py -f 2-query/sin.py -Q 3 +python3 ./test.py -f 2-query/cos.py -Q 3 +python3 ./test.py -f 2-query/tan.py -Q 3 +python3 ./test.py -f 2-query/arcsin.py -Q 3 +python3 ./test.py -f 2-query/arccos.py -Q 3 +python3 ./test.py -f 2-query/arctan.py -Q 3 +python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 3 +# python3 ./test.py -f 2-query/nestedQuery.py -Q 3 +# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 3 +# python3 ./test.py -f 2-query/avg.py -Q 3 +# python3 ./test.py -f 2-query/elapsed.py -Q 3 +python3 ./test.py -f 2-query/csum.py -Q 3 +#python3 ./test.py -f 2-query/mavg.py -Q 3 +python3 ./test.py -f 2-query/sample.py -Q 3 +python3 ./test.py -f 2-query/function_diff.py -Q 3 +python3 ./test.py -f 2-query/unique.py -Q 3 +python3 ./test.py -f 2-query/stateduration.py -Q 3 +python3 ./test.py -f 2-query/function_stateduration.py -Q 3 +python3 ./test.py -f 2-query/statecount.py -Q 3 +python3 ./test.py -f 2-query/tail.py -Q 3 +python3 ./test.py -f 2-query/ttl_comment.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_count.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_max.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_min.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 3 +python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 3 +python3 ./test.py -f 2-query/twa.py -Q 3 +python3 ./test.py -f 2-query/irate.py -Q 3 +python3 ./test.py -f 2-query/function_null.py -Q 3 +python3 ./test.py -f 2-query/count_partition.py -Q 3 +python3 ./test.py -f 2-query/max_partition.py -Q 3 +python3 ./test.py -f 2-query/last_row.py -Q 3 +python3 ./test.py -f 2-query/tsbsQuery.py -Q 3 +python3 ./test.py -f 2-query/sml.py -Q 3 +python3 ./test.py -f 2-query/interp.py -Q 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeRecreateMnode.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeStopFollowerLeader.py -N 5 -M 3 -# python3 ./test.py -f 6-cluster/5dnode3mnodeStop2Follower.py -N 5 -M 3 - -# # vnode case -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_force_stop_all_dnodes.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_all_vnode.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_follower.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_leader.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_all_dnodes.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync_force_stop.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader_forece_stop.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_mnode3_insertdatas_querys.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower_force_stop.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_follower.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader_force_stop.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_querydatas_stop_leader.py -N 4 -M 1 -# python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1 -# # python3 test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups_stopOne.py -N 4 -M 1 - -# python3 ./test.py -f 7-tmq/create_wrong_topic.py -# python3 ./test.py -f 7-tmq/dropDbR3ConflictTransaction.py -N 3 -# python3 ./test.py -f 7-tmq/basic5.py -# python3 ./test.py -f 7-tmq/subscribeDb.py -# python3 ./test.py -f 7-tmq/subscribeDb0.py -# python3 ./test.py -f 7-tmq/subscribeDb1.py -# python3 ./test.py -f 7-tmq/subscribeDb2.py -# python3 ./test.py -f 7-tmq/subscribeDb3.py -# #python3 ./test.py -f 7-tmq/subscribeDb4.py -# python3 ./test.py -f 7-tmq/subscribeStb.py -# python3 ./test.py -f 7-tmq/subscribeStb0.py -# python3 ./test.py -f 7-tmq/subscribeStb1.py -# python3 ./test.py -f 7-tmq/subscribeStb2.py -# python3 ./test.py -f 7-tmq/subscribeStb3.py -# python3 ./test.py -f 7-tmq/subscribeStb4.py -# python3 ./test.py -f 7-tmq/db.py -# python3 ./test.py -f 7-tmq/tmqError.py -# python3 ./test.py -f 7-tmq/schema.py -# python3 ./test.py -f 7-tmq/stbFilter.py -# python3 ./test.py -f 7-tmq/tmqCheckData.py -# python3 ./test.py -f 7-tmq/tmqCheckData1.py -# #python3 ./test.py -f 7-tmq/tmq3mnodeSwitch.py -N 5 -# python3 ./test.py -f 7-tmq/tmqConsumerGroup.py -# #python3 ./test.py -f 7-tmq/tmqShow.py -# python3 ./test.py -f 7-tmq/tmqAlterSchema.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb.py -# # python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-1ctb-funcNFilter.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb-funcNFilter.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb-mutilVg-mutilCtb.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-1ctb-funcNFilter.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb-funcNFilter.py -# python3 ./test.py -f 7-tmq/tmqConsFromTsdb1-mutilVg-mutilCtb.py -# python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py -# python3 ./test.py -f 7-tmq/tmqDnodeRestart.py -# python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py -# python3 ./test.py -f 7-tmq/tmqUpdateWithConsume.py -# python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot0.py -# python3 ./test.py -f 7-tmq/tmqUpdate-multiCtb-snapshot1.py -# python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py -# python3 ./test.py -f 7-tmq/tmqDelete-multiCtb.py -# python3 ./test.py -f 7-tmq/tmqDropStb.py -# python3 ./test.py -f 7-tmq/tmqDropStbCtb.py -# python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot0.py -# python3 ./test.py -f 7-tmq/tmqDropNtb-snapshot1.py -# python3 ./test.py -f 7-tmq/tmqUdf.py -# python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot0.py -# python3 ./test.py -f 7-tmq/tmqUdf-multCtb-snapshot1.py -# python3 ./test.py -f 7-tmq/stbTagFilter-1ctb.py -# python3 ./test.py -f 7-tmq/dataFromTsdbNWal.py -# python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py -# python3 ./test.py -f 7-tmq/tmq_taosx.py -# python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py - -# python3 ./test.py -f 99-TDcase/TD-19201.py - -# #------------querPolicy 2----------- - -# python3 ./test.py -f 2-query/between.py -Q 2 -# python3 ./test.py -f 2-query/distinct.py -Q 2 -# python3 ./test.py -f 2-query/varchar.py -Q 2 -# python3 ./test.py -f 2-query/ltrim.py -Q 2 -# python3 ./test.py -f 2-query/rtrim.py -Q 2 -# python3 ./test.py -f 2-query/length.py -Q 2 -# python3 ./test.py -f 2-query/char_length.py -Q 2 -# python3 ./test.py -f 2-query/upper.py -Q 2 -# python3 ./test.py -f 2-query/lower.py -Q 2 -# python3 ./test.py -f 2-query/join.py -Q 2 -# python3 ./test.py -f 2-query/join2.py -Q 2 -# python3 ./test.py -f 2-query/cast.py -Q 2 -# python3 ./test.py -f 2-query/substr.py -Q 2 -# python3 ./test.py -f 2-query/union.py -Q 2 -# python3 ./test.py -f 2-query/union1.py -Q 2 -# python3 ./test.py -f 2-query/concat.py -Q 2 -# python3 ./test.py -f 2-query/concat2.py -Q 2 -# python3 ./test.py -f 2-query/concat_ws.py -Q 2 -# python3 ./test.py -f 2-query/concat_ws2.py -Q 2 -# #python3 ./test.py -f 2-query/check_tsdb.py -Q 2 -# python3 ./test.py -f 2-query/spread.py -Q 2 -# python3 ./test.py -f 2-query/hyperloglog.py -Q 2 -# python3 ./test.py -f 2-query/explain.py -Q 2 -# python3 ./test.py -f 2-query/leastsquares.py -Q 2 -# python3 ./test.py -f 2-query/timezone.py -Q 2 -# python3 ./test.py -f 2-query/Now.py -Q 2 -# python3 ./test.py -f 2-query/Today.py -Q 2 -# python3 ./test.py -f 2-query/max.py -Q 2 -# python3 ./test.py -f 2-query/min.py -Q 2 -# python3 ./test.py -f 2-query/count.py -Q 2 -# python3 ./test.py -f 2-query/last.py -Q 2 -# python3 ./test.py -f 2-query/first.py -Q 2 -# python3 ./test.py -f 2-query/To_iso8601.py -Q 2 -# python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 2 -# python3 ./test.py -f 2-query/timetruncate.py -Q 2 -# python3 ./test.py -f 2-query/diff.py -Q 2 -# python3 ./test.py -f 2-query/Timediff.py -Q 2 -# python3 ./test.py -f 2-query/json_tag.py -Q 2 -# python3 ./test.py -f 2-query/top.py -Q 2 -# python3 ./test.py -f 2-query/bottom.py -Q 2 -# python3 ./test.py -f 2-query/percentile.py -Q 2 -# python3 ./test.py -f 2-query/apercentile.py -Q 2 -# python3 ./test.py -f 2-query/abs.py -Q 2 -# python3 ./test.py -f 2-query/ceil.py -Q 2 -# python3 ./test.py -f 2-query/floor.py -Q 2 -# python3 ./test.py -f 2-query/round.py -Q 2 -# python3 ./test.py -f 2-query/log.py -Q 2 -# python3 ./test.py -f 2-query/pow.py -Q 2 -# python3 ./test.py -f 2-query/sqrt.py -Q 2 -# python3 ./test.py -f 2-query/sin.py -Q 2 -# python3 ./test.py -f 2-query/cos.py -Q 2 -# python3 ./test.py -f 2-query/tan.py -Q 2 -# python3 ./test.py -f 2-query/arcsin.py -Q 2 -# python3 ./test.py -f 2-query/arccos.py -Q 2 -# python3 ./test.py -f 2-query/arctan.py -Q 2 -# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 2 -# python3 ./test.py -f 2-query/interp.py -Q 2 - -# # python3 ./test.py -f 2-query/nestedQuery.py -Q 2 -# # python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2 - -# python3 ./test.py -f 2-query/avg.py -Q 2 -# # python3 ./test.py -f 2-query/elapsed.py -Q 2 -# python3 ./test.py -f 2-query/csum.py -Q 2 -# #python3 ./test.py -f 2-query/mavg.py -Q 2 -# python3 ./test.py -f 2-query/sample.py -Q 2 -# python3 ./test.py -f 2-query/function_diff.py -Q 2 -# python3 ./test.py -f 2-query/unique.py -Q 2 -# python3 ./test.py -f 2-query/stateduration.py -Q 2 -# python3 ./test.py -f 2-query/function_stateduration.py -Q 2 -# python3 ./test.py -f 2-query/statecount.py -Q 2 -# python3 ./test.py -f 2-query/tail.py -Q 2 -# python3 ./test.py -f 2-query/ttl_comment.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_count.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_max.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_min.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 2 -# python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 2 -# python3 ./test.py -f 2-query/twa.py -Q 2 -# python3 ./test.py -f 2-query/irate.py -Q 2 -# python3 ./test.py -f 2-query/function_null.py -Q 2 -# python3 ./test.py -f 2-query/count_partition.py -Q 2 -# python3 ./test.py -f 2-query/max_partition.py -Q 2 -# python3 ./test.py -f 2-query/last_row.py -Q 2 -# python3 ./test.py -f 2-query/tsbsQuery.py -Q 2 -# #------------querPolicy 3----------- - -# python3 ./test.py -f 2-query/between.py -Q 3 -# python3 ./test.py -f 2-query/distinct.py -Q 3 -# python3 ./test.py -f 2-query/varchar.py -Q 3 -# python3 ./test.py -f 2-query/ltrim.py -Q 3 -# python3 ./test.py -f 2-query/rtrim.py -Q 3 -# python3 ./test.py -f 2-query/length.py -Q 3 -# python3 ./test.py -f 2-query/char_length.py -Q 3 -# python3 ./test.py -f 2-query/upper.py -Q 3 -# python3 ./test.py -f 2-query/lower.py -Q 3 -# python3 ./test.py -f 2-query/join.py -Q 3 -# python3 ./test.py -f 2-query/join2.py -Q 3 -# python3 ./test.py -f 2-query/cast.py -Q 3 -# python3 ./test.py -f 2-query/substr.py -Q 3 -# python3 ./test.py -f 2-query/union.py -Q 3 -# python3 ./test.py -f 2-query/union1.py -Q 3 -# python3 ./test.py -f 2-query/concat.py -Q 3 -# python3 ./test.py -f 2-query/concat2.py -Q 3 -# python3 ./test.py -f 2-query/concat_ws.py -Q 3 -# python3 ./test.py -f 2-query/concat_ws2.py -Q 3 -# #python3 ./test.py -f 2-query/check_tsdb.py -Q 3 -# python3 ./test.py -f 2-query/spread.py -Q 3 -# python3 ./test.py -f 2-query/hyperloglog.py -Q 3 -# python3 ./test.py -f 2-query/explain.py -Q 3 -# python3 ./test.py -f 2-query/leastsquares.py -Q 3 -# python3 ./test.py -f 2-query/timezone.py -Q 3 -# python3 ./test.py -f 2-query/Now.py -Q 3 -# python3 ./test.py -f 2-query/Today.py -Q 3 -# python3 ./test.py -f 2-query/max.py -Q 3 -# python3 ./test.py -f 2-query/min.py -Q 3 -# python3 ./test.py -f 2-query/count.py -Q 3 -# #python3 ./test.py -f 2-query/last.py -Q 3 -# python3 ./test.py -f 2-query/first.py -Q 3 -# python3 ./test.py -f 2-query/To_iso8601.py -Q 3 -# python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 3 -# python3 ./test.py -f 2-query/timetruncate.py -Q 3 -# python3 ./test.py -f 2-query/diff.py -Q 3 -# python3 ./test.py -f 2-query/Timediff.py -Q 3 -# python3 ./test.py -f 2-query/json_tag.py -Q 3 -# python3 ./test.py -f 2-query/top.py -Q 3 -# python3 ./test.py -f 2-query/bottom.py -Q 3 -# python3 ./test.py -f 2-query/percentile.py -Q 3 -# python3 ./test.py -f 2-query/apercentile.py -Q 3 -# python3 ./test.py -f 2-query/abs.py -Q 3 -# python3 ./test.py -f 2-query/ceil.py -Q 3 -# python3 ./test.py -f 2-query/floor.py -Q 3 -# python3 ./test.py -f 2-query/round.py -Q 3 -# python3 ./test.py -f 2-query/log.py -Q 3 -# python3 ./test.py -f 2-query/pow.py -Q 3 -# python3 ./test.py -f 2-query/sqrt.py -Q 3 -# python3 ./test.py -f 2-query/sin.py -Q 3 -# python3 ./test.py -f 2-query/cos.py -Q 3 -# python3 ./test.py -f 2-query/tan.py -Q 3 -# python3 ./test.py -f 2-query/arcsin.py -Q 3 -# python3 ./test.py -f 2-query/arccos.py -Q 3 -# python3 ./test.py -f 2-query/arctan.py -Q 3 -# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 3 -# # python3 ./test.py -f 2-query/nestedQuery.py -Q 3 -# # python3 ./test.py -f 2-query/nestedQuery_str.py -Q 3 -# # python3 ./test.py -f 2-query/avg.py -Q 3 -# # python3 ./test.py -f 2-query/elapsed.py -Q 3 -# python3 ./test.py -f 2-query/csum.py -Q 3 -# #python3 ./test.py -f 2-query/mavg.py -Q 3 -# python3 ./test.py -f 2-query/sample.py -Q 3 -# python3 ./test.py -f 2-query/function_diff.py -Q 3 -# python3 ./test.py -f 2-query/unique.py -Q 3 -# python3 ./test.py -f 2-query/stateduration.py -Q 3 -# python3 ./test.py -f 2-query/function_stateduration.py -Q 3 -# python3 ./test.py -f 2-query/statecount.py -Q 3 -# python3 ./test.py -f 2-query/tail.py -Q 3 -# python3 ./test.py -f 2-query/ttl_comment.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_count.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_max.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_min.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 3 -# python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 3 -# python3 ./test.py -f 2-query/twa.py -Q 3 -# python3 ./test.py -f 2-query/irate.py -Q 3 -# python3 ./test.py -f 2-query/function_null.py -Q 3 -# python3 ./test.py -f 2-query/count_partition.py -Q 3 -# python3 ./test.py -f 2-query/max_partition.py -Q 3 -# python3 ./test.py -f 2-query/last_row.py -Q 3 -# python3 ./test.py -f 2-query/tsbsQuery.py -Q 3 -# python3 ./test.py -f 2-query/sml.py -Q 3 -# python3 ./test.py -f 2-query/interp.py -Q 3 - - -# #------------querPolicy 4----------- - -# python3 ./test.py -f 2-query/between.py -Q 4 -# python3 ./test.py -f 2-query/distinct.py -Q 4 -# python3 ./test.py -f 2-query/varchar.py -Q 4 -# python3 ./test.py -f 2-query/ltrim.py -Q 4 -# python3 ./test.py -f 2-query/rtrim.py -Q 4 -# python3 ./test.py -f 2-query/length.py -Q 4 -# python3 ./test.py -f 2-query/char_length.py -Q 4 -# python3 ./test.py -f 2-query/upper.py -Q 4 -# python3 ./test.py -f 2-query/lower.py -Q 4 -# python3 ./test.py -f 2-query/join.py -Q 4 -# python3 ./test.py -f 2-query/join2.py -Q 4 -# python3 ./test.py -f 2-query/cast.py -Q 4 -# python3 ./test.py -f 2-query/substr.py -Q 4 -# python3 ./test.py -f 2-query/union.py -Q 4 -# python3 ./test.py -f 2-query/union1.py -Q 4 -# python3 ./test.py -f 2-query/concat.py -Q 4 -# python3 ./test.py -f 2-query/concat2.py -Q 4 -# python3 ./test.py -f 2-query/concat_ws.py -Q 4 -# python3 ./test.py -f 2-query/concat_ws2.py -Q 4 -# #python3 ./test.py -f 2-query/check_tsdb.py -Q 4 -# python3 ./test.py -f 2-query/spread.py -Q 4 -# python3 ./test.py -f 2-query/hyperloglog.py -Q 4 -# python3 ./test.py -f 2-query/explain.py -Q 4 -# python3 ./test.py -f 2-query/leastsquares.py -Q 4 -# python3 ./test.py -f 2-query/timezone.py -Q 4 -# python3 ./test.py -f 2-query/Now.py -Q 4 -# python3 ./test.py -f 2-query/Today.py -Q 4 -# python3 ./test.py -f 2-query/max.py -Q 4 -# python3 ./test.py -f 2-query/min.py -Q 4 -# python3 ./test.py -f 2-query/count.py -Q 4 -# #python3 ./test.py -f 2-query/last.py -Q 4 -# python3 ./test.py -f 2-query/first.py -Q 4 -# python3 ./test.py -f 2-query/To_iso8601.py -Q 4 -# python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 4 -# python3 ./test.py -f 2-query/timetruncate.py -Q 4 -# python3 ./test.py -f 2-query/diff.py -Q 4 -# python3 ./test.py -f 2-query/Timediff.py -Q 4 -# python3 ./test.py -f 2-query/json_tag.py -Q 4 -# python3 ./test.py -f 2-query/top.py -Q 4 -# python3 ./test.py -f 2-query/bottom.py -Q 4 -# python3 ./test.py -f 2-query/percentile.py -Q 4 -# python3 ./test.py -f 2-query/apercentile.py -Q 4 -# python3 ./test.py -f 2-query/abs.py -Q 4 -# python3 ./test.py -f 2-query/ceil.py -Q 4 -# python3 ./test.py -f 2-query/floor.py -Q 4 -# python3 ./test.py -f 2-query/round.py -Q 4 -# python3 ./test.py -f 2-query/log.py -Q 4 -# python3 ./test.py -f 2-query/pow.py -Q 4 -# python3 ./test.py -f 2-query/sqrt.py -Q 4 -# python3 ./test.py -f 2-query/sin.py -Q 4 -# python3 ./test.py -f 2-query/cos.py -Q 4 -# python3 ./test.py -f 2-query/tan.py -Q 4 -# python3 ./test.py -f 2-query/arcsin.py -Q 4 -# python3 ./test.py -f 2-query/arccos.py -Q 4 -# python3 ./test.py -f 2-query/arctan.py -Q 4 -# python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4 -# # python3 ./test.py -f 2-query/nestedQuery.py -Q 4 -# # python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4 -# # python3 ./test.py -f 2-query/avg.py -Q 4 -# # python3 ./test.py -f 2-query/elapsed.py -Q 4 -# python3 ./test.py -f 2-query/csum.py -Q 4 -# #python3 ./test.py -f 2-query/mavg.py -Q 4 -# python3 ./test.py -f 2-query/sample.py -Q 4 -# python3 ./test.py -f 2-query/function_diff.py -Q 4 -# python3 ./test.py -f 2-query/unique.py -Q 4 -# python3 ./test.py -f 2-query/stateduration.py -Q 4 -# python3 ./test.py -f 2-query/function_stateduration.py -Q 4 -# python3 ./test.py -f 2-query/statecount.py -Q 4 -# python3 ./test.py -f 2-query/tail.py -Q 4 -# python3 ./test.py -f 2-query/ttl_comment.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_max.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_min.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 4 -# python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 4 -# python3 ./test.py -f 2-query/twa.py -Q 4 -# python3 ./test.py -f 2-query/irate.py -Q 4 -# python3 ./test.py -f 2-query/function_null.py -Q 4 -# python3 ./test.py -f 2-query/count_partition.py -Q 4 -# python3 ./test.py -f 2-query/max_partition.py -Q 4 -# python3 ./test.py -f 2-query/last_row.py -Q 4 -# python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 -# #python3 ./test.py -f 2-query/sml.py -Q 4 -# python3 ./test.py -f 2-query/interp.py -Q 4 +#------------querPolicy 4----------- +python3 ./test.py -f 2-query/between.py -Q 4 +python3 ./test.py -f 2-query/distinct.py -Q 4 +python3 ./test.py -f 2-query/varchar.py -Q 4 +python3 ./test.py -f 2-query/ltrim.py -Q 4 +python3 ./test.py -f 2-query/rtrim.py -Q 4 +python3 ./test.py -f 2-query/length.py -Q 4 +python3 ./test.py -f 2-query/char_length.py -Q 4 +python3 ./test.py -f 2-query/upper.py -Q 4 +python3 ./test.py -f 2-query/lower.py -Q 4 +python3 ./test.py -f 2-query/join.py -Q 4 +python3 ./test.py -f 2-query/join2.py -Q 4 +python3 ./test.py -f 2-query/cast.py -Q 4 +python3 ./test.py -f 2-query/substr.py -Q 4 +python3 ./test.py -f 2-query/union.py -Q 4 +python3 ./test.py -f 2-query/union1.py -Q 4 +python3 ./test.py -f 2-query/concat.py -Q 4 +python3 ./test.py -f 2-query/concat2.py -Q 4 +python3 ./test.py -f 2-query/concat_ws.py -Q 4 +python3 ./test.py -f 2-query/concat_ws2.py -Q 4 +#python3 ./test.py -f 2-query/check_tsdb.py -Q 4 +python3 ./test.py -f 2-query/spread.py -Q 4 +python3 ./test.py -f 2-query/hyperloglog.py -Q 4 +python3 ./test.py -f 2-query/explain.py -Q 4 +python3 ./test.py -f 2-query/leastsquares.py -Q 4 +python3 ./test.py -f 2-query/timezone.py -Q 4 +python3 ./test.py -f 2-query/Now.py -Q 4 +python3 ./test.py -f 2-query/Today.py -Q 4 +python3 ./test.py -f 2-query/max.py -Q 4 +python3 ./test.py -f 2-query/min.py -Q 4 +python3 ./test.py -f 2-query/count.py -Q 4 +#python3 ./test.py -f 2-query/last.py -Q 4 +python3 ./test.py -f 2-query/first.py -Q 4 +python3 ./test.py -f 2-query/To_iso8601.py -Q 4 +python3 ./test.py -f 2-query/To_unixtimestamp.py -Q 4 +python3 ./test.py -f 2-query/timetruncate.py -Q 4 +python3 ./test.py -f 2-query/diff.py -Q 4 +python3 ./test.py -f 2-query/Timediff.py -Q 4 +python3 ./test.py -f 2-query/json_tag.py -Q 4 +python3 ./test.py -f 2-query/top.py -Q 4 +python3 ./test.py -f 2-query/bottom.py -Q 4 +python3 ./test.py -f 2-query/percentile.py -Q 4 +python3 ./test.py -f 2-query/apercentile.py -Q 4 +python3 ./test.py -f 2-query/abs.py -Q 4 +python3 ./test.py -f 2-query/ceil.py -Q 4 +python3 ./test.py -f 2-query/floor.py -Q 4 +python3 ./test.py -f 2-query/round.py -Q 4 +python3 ./test.py -f 2-query/log.py -Q 4 +python3 ./test.py -f 2-query/pow.py -Q 4 +python3 ./test.py -f 2-query/sqrt.py -Q 4 +python3 ./test.py -f 2-query/sin.py -Q 4 +python3 ./test.py -f 2-query/cos.py -Q 4 +python3 ./test.py -f 2-query/tan.py -Q 4 +python3 ./test.py -f 2-query/arcsin.py -Q 4 +python3 ./test.py -f 2-query/arccos.py -Q 4 +python3 ./test.py -f 2-query/arctan.py -Q 4 +python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4 +# python3 ./test.py -f 2-query/nestedQuery.py -Q 4 +# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4 +# python3 ./test.py -f 2-query/avg.py -Q 4 +# python3 ./test.py -f 2-query/elapsed.py -Q 4 +python3 ./test.py -f 2-query/csum.py -Q 4 +#python3 ./test.py -f 2-query/mavg.py -Q 4 +python3 ./test.py -f 2-query/sample.py -Q 4 +python3 ./test.py -f 2-query/function_diff.py -Q 4 +python3 ./test.py -f 2-query/unique.py -Q 4 +python3 ./test.py -f 2-query/stateduration.py -Q 4 +python3 ./test.py -f 2-query/function_stateduration.py -Q 4 +python3 ./test.py -f 2-query/statecount.py -Q 4 +python3 ./test.py -f 2-query/tail.py -Q 4 +python3 ./test.py -f 2-query/ttl_comment.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_count.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_max.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_min.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_sum.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_spread.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_apercentile.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_avg.py -Q 4 +python3 ./test.py -f 2-query/distribute_agg_stddev.py -Q 4 +python3 ./test.py -f 2-query/twa.py -Q 4 +python3 ./test.py -f 2-query/irate.py -Q 4 +python3 ./test.py -f 2-query/function_null.py -Q 4 +python3 ./test.py -f 2-query/count_partition.py -Q 4 +python3 ./test.py -f 2-query/max_partition.py -Q 4 +python3 ./test.py -f 2-query/last_row.py -Q 4 +python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 +#python3 ./test.py -f 2-query/sml.py -Q 4 +python3 ./test.py -f 2-query/interp.py -Q 4 From 94e83965c2b9e7f37f29450463d92edacb966c17 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Fri, 21 Oct 2022 18:15:44 +0800 Subject: [PATCH 96/99] Update fulltest.sh --- tests/system-test/fulltest.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index a89b41cac6..3d6c2ecb94 100644 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -610,3 +610,4 @@ python3 ./test.py -f 2-query/last_row.py -Q 4 python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 #python3 ./test.py -f 2-query/sml.py -Q 4 python3 ./test.py -f 2-query/interp.py -Q 4 + From 9c9dddce70558f1bdeedb7b50274c2679c69a74e Mon Sep 17 00:00:00 2001 From: haoranchen Date: Fri, 21 Oct 2022 18:16:25 +0800 Subject: [PATCH 97/99] Update run_case.sh --- tests/parallel_test/run_case.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 0519900a68..e0b905375a 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -81,5 +81,3 @@ fi exit $RET - - From e7014c3e89f6383f1dc8bdcda28185d061dc50c8 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 21 Oct 2022 18:20:08 +0800 Subject: [PATCH 98/99] rm invalid read --- source/libs/transport/src/trans.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index c82af0d0e9..3ef388c0a6 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -43,7 +43,7 @@ void* rpcOpen(const SRpcInit* pInit) { return NULL; } if (pInit->label) { - tstrncpy(pRpc->label, pInit->label, TSDB_LABEL_LEN); + tstrncpy(pRpc->label, pInit->label, sizeof(pRpc->label)); } pRpc->compressSize = pInit->compressSize; @@ -79,7 +79,7 @@ void* rpcOpen(const SRpcInit* pInit) { } pRpc->parent = pInit->parent; if (pInit->user) { - memcpy(pRpc->user, pInit->user, strlen(pInit->user)); + tstrncpy(pRpc->user, pInit->user, sizeof(pRpc->user)); } int64_t refId = transAddExHandle(transGetInstMgt(), pRpc); @@ -91,7 +91,7 @@ void rpcClose(void* arg) { tInfo("start to close rpc"); transRemoveExHandle(transGetInstMgt(), (int64_t)arg); transReleaseExHandle(transGetInstMgt(), (int64_t)arg); - tInfo("rpc is closed"); + tInfo("end to close rpc"); return; } void rpcCloseImpl(void* arg) { From b9597470675840d882962ccaa3651d2808a08672 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Fri, 21 Oct 2022 18:43:25 +0800 Subject: [PATCH 99/99] Update fulltest.sh --- tests/system-test/fulltest.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 3d6c2ecb94..a89b41cac6 100644 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -610,4 +610,3 @@ python3 ./test.py -f 2-query/last_row.py -Q 4 python3 ./test.py -f 2-query/tsbsQuery.py -Q 4 #python3 ./test.py -f 2-query/sml.py -Q 4 python3 ./test.py -f 2-query/interp.py -Q 4 -