From 1cba56860434f9053026523b132aeaa236b7afe6 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Fri, 11 Nov 2022 15:22:00 +0800 Subject: [PATCH 01/49] fix(query): report error if certain function query stable has duplicate timestamps TD-19892 --- source/libs/executor/src/executorimpl.c | 6 +++- source/libs/function/src/builtins.c | 4 +-- source/libs/function/src/builtinsimpl.c | 41 +++++++++++++++++++------ 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 7d662f8784..5d4986186e 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -653,7 +653,11 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc pfCtx->pDstBlock = pResult; } - numOfRows = pfCtx->fpSet.process(pfCtx); + int32_t code = pfCtx->fpSet.process(pfCtx); + if (code != TSDB_CODE_SUCCESS) { + return code; + } + numOfRows = pResInfo->numOfRes; } else if (fmIsAggFunc(pfCtx->functionId)) { // selective value output should be set during corresponding function execution if (fmIsSelectValueFunc(pfCtx->functionId)) { diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index d3f03e8e9c..69b0ff1096 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2640,8 +2640,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "diff", .type = FUNCTION_TYPE_DIFF, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_KEEP_ORDER_FUNC | - FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC, + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | + FUNC_MGT_KEEP_ORDER_FUNC | FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC, .translateFunc = translateDiff, .getEnvFunc = getDiffFuncEnv, .initFunc = diffFunctionSetup, diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 6eb57c1a18..3f9fe46acd 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -3325,6 +3325,7 @@ bool diffFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) { SDiffInfo* pDiffInfo = GET_ROWCELL_INTERBUF(pResInfo); pDiffInfo->hasPrev = false; pDiffInfo->prev.i64 = 0; + pDiffInfo->prevTs = -1; if (pCtx->numOfParams > 1) { pDiffInfo->ignoreNegative = pCtx->param[1].param.i; // TODO set correct param } else { @@ -3335,7 +3336,7 @@ bool diffFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) { return true; } -static void doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv) { +static void doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv, int64_t ts) { switch (type) { case TSDB_DATA_TYPE_BOOL: pDiffInfo->prev.i64 = *(bool*)pv ? 1 : 0; @@ -3362,11 +3363,13 @@ static void doSetPrevVal(SDiffInfo* pDiffInfo, int32_t type, const char* pv) { default: ASSERT(0); } + pDiffInfo->prevTs = ts; } static void doHandleDiff(SDiffInfo* pDiffInfo, int32_t type, const char* pv, SColumnInfoData* pOutput, int32_t pos, - int32_t order) { + int32_t order, int64_t ts) { int32_t factor = (order == TSDB_ORDER_ASC) ? 1 : -1; + pDiffInfo->prevTs = ts; switch (type) { case TSDB_DATA_TYPE_INT: { int32_t v = *(int32_t*)pv; @@ -3450,6 +3453,8 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { SColumnInfoData* pInputCol = pInput->pData[0]; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; + int32_t numOfElems = 0; int32_t startOffset = pCtx->offset; @@ -3471,7 +3476,10 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { char* pv = colDataGetData(pInputCol, i); if (pDiffInfo->hasPrev) { - doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order); + if (tsList[i] == pDiffInfo->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } + doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order, tsList[i]); // handle selectivity if (pCtx->subsidiaries.num > 0) { appendSelectivityValue(pCtx, i, pos); @@ -3479,7 +3487,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { numOfElems++; } else { - doSetPrevVal(pDiffInfo, pInputCol->info.type, pv); + doSetPrevVal(pDiffInfo, pInputCol->info.type, pv, tsList[i]); } pDiffInfo->hasPrev = true; @@ -3501,7 +3509,10 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { // there is a row of previous data block to be handled in the first place. if (pDiffInfo->hasPrev) { - doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order); + if (tsList[i] == pDiffInfo->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } + doHandleDiff(pDiffInfo, pInputCol->info.type, pv, pOutput, pos, pCtx->order, tsList[i]); // handle selectivity if (pCtx->subsidiaries.num > 0) { appendSelectivityValue(pCtx, i, pos); @@ -3509,15 +3520,15 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) { numOfElems++; } else { - doSetPrevVal(pDiffInfo, pInputCol->info.type, pv); + doSetPrevVal(pDiffInfo, pInputCol->info.type, pv, tsList[i]); } pDiffInfo->hasPrev = true; } } - // initial value is not set yet - return numOfElems; + pResInfo->numOfRes = numOfElems; + return TSDB_CODE_SUCCESS; } int32_t getTopBotInfoSize(int64_t numOfItems) { return sizeof(STopBotRes) + numOfItems * sizeof(STopBotResItem); } @@ -6137,6 +6148,9 @@ int32_t derivativeFunction(SqlFunctionCtx* pCtx) { if (!pDerivInfo->valueSet) { // initial value is not set yet pDerivInfo->valueSet = true; } else { + if (tsList[i] == pDerivInfo->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } double r = ((v - pDerivInfo->prevValue) * pDerivInfo->tsWindow) / (tsList[i] - pDerivInfo->prevTs); if (pDerivInfo->ignoreNegative && r < 0) { } else { @@ -6175,6 +6189,9 @@ int32_t derivativeFunction(SqlFunctionCtx* pCtx) { if (!pDerivInfo->valueSet) { // initial value is not set yet pDerivInfo->valueSet = true; } else { + if (tsList[i] == pDerivInfo->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } double r = ((pDerivInfo->prevValue - v) * pDerivInfo->tsWindow) / (pDerivInfo->prevTs - tsList[i]); if (pDerivInfo->ignoreNegative && r < 0) { } else { @@ -6202,7 +6219,9 @@ int32_t derivativeFunction(SqlFunctionCtx* pCtx) { } } - return numOfElems; + pResInfo->numOfRes = numOfElems; + + return TSDB_CODE_SUCCESS; } bool getIrateFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv) { @@ -6267,11 +6286,15 @@ int32_t irateFunction(SqlFunctionCtx* pCtx) { pRateInfo->lastKey = tsList[i]; continue; + } else if (tsList[i] == pRateInfo->lastKey) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; } if ((INT64_MIN == pRateInfo->firstKey) || tsList[i] > pRateInfo->firstKey) { pRateInfo->firstValue = v; pRateInfo->firstKey = tsList[i]; + } else if (tsList[i] == pRateInfo->firstKey) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; } } From eec1b0bfb0bfe8d2417d3cd3d4302169e0c2f169 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Fri, 11 Nov 2022 15:22:00 +0800 Subject: [PATCH 02/49] fix(query): report error if certain function query stable has duplicate timestamps TD-19892 --- source/libs/function/src/builtins.c | 8 +++++--- source/libs/function/src/builtinsimpl.c | 27 ++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 69b0ff1096..38c022fc6f 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2653,7 +2653,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "statecount", .type = FUNCTION_TYPE_STATE_COUNT, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC, + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | + FUNC_MGT_FORBID_STREAM_FUNC, .translateFunc = translateStateCount, .getEnvFunc = getStateFuncEnv, .initFunc = functionSetup, @@ -2664,7 +2665,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "stateduration", .type = FUNCTION_TYPE_STATE_DURATION, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | FUNC_MGT_FORBID_STREAM_FUNC, + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | + FUNC_MGT_FORBID_STREAM_FUNC, .translateFunc = translateStateDuration, .getEnvFunc = getStateFuncEnv, .initFunc = functionSetup, @@ -2675,7 +2677,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "csum", .type = FUNCTION_TYPE_CSUM, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateCsum, .getEnvFunc = getCsumFuncEnv, diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 3f9fe46acd..60befbfba8 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -190,6 +190,8 @@ typedef struct SStateInfo { int64_t count; int64_t durationStart; }; + int64_t prevTs; + bool isPrevTsSet; } SStateInfo; typedef enum { @@ -4879,6 +4881,7 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) { SStateInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; @@ -4891,7 +4894,15 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) { } for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { + if (pInfo->isPrevTsSet == true && tsList[i] == pInfo->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } else { + pInfo->prevTs = tsList[i]; + } + + pInfo->isPrevTsSet = true; numOfElems++; + if (colDataIsNull_f(pInputCol->nullbitmap, i)) { colDataAppendNULL(pOutput, i); // handle selectivity @@ -4917,7 +4928,8 @@ int32_t stateCountFunction(SqlFunctionCtx* pCtx) { } } - return numOfElems; + pResInfo->numOfRes = numOfElems; + return TSDB_CODE_SUCCESS; } int32_t stateDurationFunction(SqlFunctionCtx* pCtx) { @@ -4940,11 +4952,19 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) { int8_t op = getStateOpType(varDataVal(pCtx->param[1].param.pz)); if (STATE_OPER_INVALID == op) { - return 0; + return TSDB_CODE_INVALID_PARA; } for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { + if (pInfo->isPrevTsSet == true && tsList[i] == pInfo->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } else { + pInfo->prevTs = tsList[i]; + } + + pInfo->isPrevTsSet = true; numOfElems++; + if (colDataIsNull_f(pInputCol->nullbitmap, i)) { colDataAppendNULL(pOutput, i); // handle selectivity @@ -4974,7 +4994,8 @@ int32_t stateDurationFunction(SqlFunctionCtx* pCtx) { } } - return numOfElems; + pResInfo->numOfRes = numOfElems; + return TSDB_CODE_SUCCESS; } bool getCsumFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { From 2b53f7be8417c95bcfb2daab201063b90c1fcaf4 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Fri, 11 Nov 2022 15:22:00 +0800 Subject: [PATCH 03/49] fix(query): report error if certain function query stable has duplicate timestamps TD-19892 --- source/libs/function/src/builtins.c | 5 +++-- source/libs/function/src/builtinsimpl.c | 29 +++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/source/libs/function/src/builtins.c b/source/libs/function/src/builtins.c index 38c022fc6f..cfd94479cb 100644 --- a/source/libs/function/src/builtins.c +++ b/source/libs/function/src/builtins.c @@ -2677,7 +2677,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "csum", .type = FUNCTION_TYPE_CSUM, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_CUMULATIVE_FUNC | FUNC_MGT_KEEP_ORDER_FUNC, .translateFunc = translateCsum, .getEnvFunc = getCsumFuncEnv, @@ -2690,7 +2690,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { { .name = "mavg", .type = FUNCTION_TYPE_MAVG, - .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC, + .classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | + FUNC_MGT_FORBID_STREAM_FUNC, .translateFunc = translateMavg, .getEnvFunc = getMavgFuncEnv, .initFunc = mavgFunctionSetup, diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 60befbfba8..f23333a6d8 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -48,6 +48,9 @@ typedef struct SSumRes { double dsum; }; int16_t type; + int64_t prevTs; // used for csum only + bool isPrevTsSet; //used for csum only + } SSumRes; typedef struct SAvgRes { @@ -207,6 +210,8 @@ typedef enum { typedef struct SMavgInfo { int32_t pos; double sum; + int64_t prevTs; + bool isPrevTsSet; int32_t numOfPoints; bool pointsMeet; double points[]; @@ -5008,6 +5013,7 @@ int32_t csumFunction(SqlFunctionCtx* pCtx) { SSumRes* pSumRes = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; SColumnInfoData* pOutput = (SColumnInfoData*)pCtx->pOutput; @@ -5016,6 +5022,13 @@ int32_t csumFunction(SqlFunctionCtx* pCtx) { int32_t type = pInputCol->info.type; int32_t startOffset = pCtx->offset; for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { + if (pSumRes->isPrevTsSet == true && tsList[i] == pSumRes->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } else { + pSumRes->prevTs = tsList[i]; + } + pSumRes->isPrevTsSet = true; + int32_t pos = startOffset + numOfElems; if (colDataIsNull_f(pInputCol->nullbitmap, i)) { // colDataAppendNULL(pOutput, i); @@ -5053,7 +5066,8 @@ int32_t csumFunction(SqlFunctionCtx* pCtx) { numOfElems++; } - return numOfElems; + pResInfo->numOfRes = numOfElems; + return TSDB_CODE_SUCCESS; } bool getMavgFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) { @@ -5069,6 +5083,8 @@ bool mavgFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo) { SMavgInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo); pInfo->pos = 0; pInfo->sum = 0; + pInfo->prevTs = -1; + pInfo->isPrevTsSet = false; pInfo->numOfPoints = pCtx->param[1].param.i; if (pInfo->numOfPoints < 1 || pInfo->numOfPoints > MAVG_MAX_POINTS_NUM) { return false; @@ -5083,6 +5099,7 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { SMavgInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo); SInputColumnInfoData* pInput = &pCtx->input; + TSKEY* tsList = (int64_t*)pInput->pPTS->pData; SColumnInfoData* pInputCol = pInput->pData[0]; SColumnInfoData* pTsOutput = pCtx->pTsOutput; @@ -5092,6 +5109,13 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { int32_t type = pInputCol->info.type; int32_t startOffset = pCtx->offset; for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; i += 1) { + if (pInfo->isPrevTsSet == true && tsList[i] == pInfo->prevTs) { + return TSDB_CODE_FUNC_DUP_TIMESTAMP; + } else { + pInfo->prevTs = tsList[i]; + } + pInfo->isPrevTsSet = true; + int32_t pos = startOffset + numOfElems; if (colDataIsNull_f(pInputCol->nullbitmap, i)) { // colDataAppendNULL(pOutput, i); @@ -5136,7 +5160,8 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) { } } - return numOfElems; + pResInfo->numOfRes = numOfElems; + return TSDB_CODE_SUCCESS; } static SSampleInfo* getSampleOutputInfo(SqlFunctionCtx* pCtx) { From 5b51f97a48038ca6b9f8d70f246862ba11bf4f96 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 14 Nov 2022 16:52:39 +0800 Subject: [PATCH 04/49] more optimize --- source/dnode/vnode/src/inc/tsdb.h | 17 +++++------- source/dnode/vnode/src/tsdb/tsdbMemTable.c | 31 ++++++++++++++-------- source/dnode/vnode/src/tsdb/tsdbUtil.c | 20 +++++++------- 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index ba9d68ee7f..c6e2842c32 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -108,8 +108,8 @@ static FORCE_INLINE int64_t tsdbLogicToFileSize(int64_t lSize, int32_t szPage) { #define TSDBROW_KEY(ROW) ((TSDBKEY){.version = TSDBROW_VERSION(ROW), .ts = TSDBROW_TS(ROW)}) #define tsdbRowFromTSRow(VERSION, TSROW) ((TSDBROW){.type = 0, .version = (VERSION), .pTSRow = (TSROW)}) #define tsdbRowFromBlockData(BLOCKDATA, IROW) ((TSDBROW){.type = 1, .pBlockData = (BLOCKDATA), .iRow = (IROW)}) -void tsdbRowGetColVal(TSDBROW *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal); -int32_t tPutTSDBRow(uint8_t *p, TSDBROW *pRow); +void tsdbRowGetColVal(TSDBROW *pRow, STSchema *pTSchema, int32_t iCol, SColVal *pColVal); +// int32_t tPutTSDBRow(uint8_t *p, TSDBROW *pRow); int32_t tsdbRowCmprFn(const void *p1, const void *p2); // SRowIter void tRowIterInit(SRowIter *pIter, TSDBROW *pRow, STSchema *pTSchema); @@ -333,6 +333,8 @@ struct SVersionRange { typedef struct SMemSkipListNode SMemSkipListNode; struct SMemSkipListNode { int8_t level; + int64_t version; + STSRow *pTSRow; SMemSkipListNode *forwards[0]; }; typedef struct SMemSkipList { @@ -772,14 +774,6 @@ static FORCE_INLINE int32_t tsdbKeyCmprFn(const void *p1, const void *p2) { #define SL_NODE_FORWARD(n, l) ((n)->forwards[l]) #define SL_NODE_BACKWARD(n, l) ((n)->forwards[(n)->level + (l)]) -#define SL_NODE_DATA(n) (&SL_NODE_BACKWARD(n, (n)->level)) - -static FORCE_INLINE int32_t tGetTSDBRow(uint8_t *p, TSDBROW *pRow) { - int32_t n = tGetI64(p, &pRow->version); - pRow->pTSRow = (STSRow *)(p + n); - n += pRow->pTSRow->len; - return n; -} static FORCE_INLINE TSDBROW *tsdbTbDataIterGet(STbDataIter *pIter) { if (pIter == NULL) return NULL; @@ -798,8 +792,9 @@ static FORCE_INLINE TSDBROW *tsdbTbDataIterGet(STbDataIter *pIter) { } } - tGetTSDBRow((uint8_t *)SL_NODE_DATA(pIter->pNode), &pIter->row); pIter->pRow = &pIter->row; + pIter->pRow->version = pIter->pNode->version; + pIter->pRow->pTSRow = pIter->pNode->pTSRow; return pIter->pRow; } diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index 654afe1b6a..998409f34e 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -21,7 +21,6 @@ #define SL_NODE_SIZE(l) (sizeof(SMemSkipListNode) + sizeof(SMemSkipListNode *) * (l)*2) #define SL_NODE_FORWARD(n, l) ((n)->forwards[l]) #define SL_NODE_BACKWARD(n, l) ((n)->forwards[(n)->level + (l)]) -#define SL_NODE_DATA(n) (&SL_NODE_BACKWARD(n, (n)->level)) #define SL_MOVE_BACKWARD 0x1 #define SL_MOVE_FROM_POS 0x2 @@ -394,7 +393,7 @@ _err: static void tbDataMovePosTo(STbData *pTbData, SMemSkipListNode **pos, TSDBKEY *pKey, int32_t flags) { SMemSkipListNode *px; SMemSkipListNode *pn; - TSDBKEY *pTKey; + TSDBKEY tKey = {0}; int32_t backward = flags & SL_MOVE_BACKWARD; int32_t fromPos = flags & SL_MOVE_FROM_POS; @@ -413,9 +412,10 @@ static void tbDataMovePosTo(STbData *pTbData, SMemSkipListNode **pos, TSDBKEY *p for (int8_t iLevel = pTbData->sl.level - 1; iLevel >= 0; iLevel--) { pn = SL_NODE_BACKWARD(px, iLevel); while (pn != pTbData->sl.pHead) { - pTKey = (TSDBKEY *)SL_NODE_DATA(pn); + tKey.version = pn->version; + tKey.ts = pn->pTSRow->ts; - int32_t c = tsdbKeyCmprFn(pTKey, pKey); + int32_t c = tsdbKeyCmprFn(&tKey, pKey); if (c <= 0) { break; } else { @@ -442,7 +442,10 @@ static void tbDataMovePosTo(STbData *pTbData, SMemSkipListNode **pos, TSDBKEY *p for (int8_t iLevel = pTbData->sl.level - 1; iLevel >= 0; iLevel--) { pn = SL_NODE_FORWARD(px, iLevel); while (pn != pTbData->sl.pTail) { - int32_t c = tsdbKeyCmprFn(SL_NODE_DATA(pn), pKey); + tKey.version = pn->version; + tKey.ts = pn->pTSRow->ts; + + int32_t c = tsdbKeyCmprFn(&tKey, pKey); if (c >= 0) { break; } else { @@ -467,8 +470,8 @@ static FORCE_INLINE int8_t tsdbMemSkipListRandLevel(SMemSkipList *pSl) { return level; } -static int32_t tbDataDoPut(SMemTable *pMemTable, STbData *pTbData, SMemSkipListNode **pos, TSDBROW *pRow, - int8_t forward) { +static int32_t tbDataDoPut(SMemTable *pMemTable, STbData *pTbData, SMemSkipListNode **pos, int64_t version, + STSRow *pRow, int8_t forward) { int32_t code = 0; int8_t level; SMemSkipListNode *pNode; @@ -477,13 +480,19 @@ static int32_t tbDataDoPut(SMemTable *pMemTable, STbData *pTbData, SMemSkipListN // node level = tsdbMemSkipListRandLevel(&pTbData->sl); ASSERT(pPool != NULL); - pNode = (SMemSkipListNode *)vnodeBufPoolMalloc(pPool, SL_NODE_SIZE(level) + tPutTSDBRow(NULL, pRow)); + pNode = (SMemSkipListNode *)vnodeBufPoolMalloc(pPool, SL_NODE_SIZE(level)); if (pNode == NULL) { code = TSDB_CODE_OUT_OF_MEMORY; goto _exit; } pNode->level = level; - tPutTSDBRow((uint8_t *)SL_NODE_DATA(pNode), pRow); + pNode->version = version; + pNode->pTSRow = vnodeBufPoolMalloc(pPool, pRow->len); + if (NULL == pNode->pTSRow) { + code = TSDB_CODE_OUT_OF_MEMORY; + goto _exit; + } + memcpy(pNode->pTSRow, pRow, pRow->len); for (int8_t iLevel = level - 1; iLevel >= 0; iLevel--) { SMemSkipListNode *pn = pos[iLevel]; @@ -549,7 +558,7 @@ static int32_t tsdbInsertTableDataImpl(SMemTable *pMemTable, STbData *pTbData, i key.ts = row.pTSRow->ts; nRow++; tbDataMovePosTo(pTbData, pos, &key, SL_MOVE_BACKWARD); - code = tbDataDoPut(pMemTable, pTbData, pos, &row, 0); + code = tbDataDoPut(pMemTable, pTbData, pos, version, row.pTSRow, 0); if (code) { goto _err; } @@ -570,7 +579,7 @@ static int32_t tsdbInsertTableDataImpl(SMemTable *pMemTable, STbData *pTbData, i if (SL_NODE_FORWARD(pos[0], 0) != pTbData->sl.pTail) { tbDataMovePosTo(pTbData, pos, &key, SL_MOVE_FROM_POS); } - code = tbDataDoPut(pMemTable, pTbData, pos, &row, 1); + code = tbDataDoPut(pMemTable, pTbData, pos, version, row.pTSRow, 1); if (code) { goto _err; } diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index 755a551e20..0aa2c6ab83 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -565,15 +565,15 @@ void tsdbRowGetColVal(TSDBROW *pRow, STSchema *pTSchema, int32_t iCol, SColVal * } } -int32_t tPutTSDBRow(uint8_t *p, TSDBROW *pRow) { - int32_t n = 0; +// int32_t tPutTSDBRow(uint8_t *p, TSDBROW *pRow) { +// int32_t n = 0; - n += tPutI64(p, pRow->version); - if (p) memcpy(p + n, pRow->pTSRow, pRow->pTSRow->len); - n += pRow->pTSRow->len; +// n += tPutI64(p, pRow->version); +// if (p) memcpy(p + n, pRow->pTSRow, pRow->pTSRow->len); +// n += pRow->pTSRow->len; - return n; -} +// return n; +// } int32_t tsdbRowCmprFn(const void *p1, const void *p2) { return tsdbKeyCmprFn(&TSDBROW_KEY((TSDBROW *)p1), &TSDBROW_KEY((TSDBROW *)p2)); @@ -1084,7 +1084,7 @@ static int32_t tBlockDataAppendTPRow(SBlockData *pBlockData, STSRow *pRow, STSch cv.flag = CV_FLAG_VALUE; if (IS_VAR_DATA_TYPE(pTColumn->type)) { - void *pData = (char*)pRow + *(int32_t *)(pRow->data + pTColumn->offset - sizeof(TSKEY)); + void *pData = (char *)pRow + *(int32_t *)(pRow->data + pTColumn->offset - sizeof(TSKEY)); cv.value.nData = varDataLen(pData); cv.value.pData = varDataVal(pData); } else { @@ -1106,7 +1106,7 @@ static int32_t tBlockDataAppendTPRow(SBlockData *pBlockData, STSRow *pRow, STSch cv.flag = CV_FLAG_VALUE; if (IS_VAR_DATA_TYPE(pTColumn->type)) { - void *pData = (char*)pRow + *(int32_t *)(pRow->data + pTColumn->offset - sizeof(TSKEY)); + void *pData = (char *)pRow + *(int32_t *)(pRow->data + pTColumn->offset - sizeof(TSKEY)); cv.value.nData = varDataLen(pData); cv.value.pData = varDataVal(pData); } else { @@ -1151,7 +1151,7 @@ static int32_t tBlockDataAppendKVRow(SBlockData *pBlockData, STSRow *pRow, STSch ASSERT(pTColumn->type == pColData->type); SColVal cv = {.cid = pTColumn->colId, .type = pTColumn->type}; - TDRowValT vt = TD_VTYPE_NONE; // default is NONE + TDRowValT vt = TD_VTYPE_NONE; // default is NONE SKvRowIdx *pKvIdx = NULL; while (kvIter < nKvCols) { From cf56c38e7a49f601ad72b2e23cd34f1bdd6c3c2f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 14 Nov 2022 17:10:25 +0800 Subject: [PATCH 05/49] fix(query): fix errors found by asan. --- source/common/src/tdatablock.c | 7 ++++++- source/dnode/vnode/src/tsdb/tsdbRead.c | 2 +- source/libs/executor/src/tsimplehash.c | 8 +++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index e8d5989e4d..0e8001708b 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -277,7 +277,12 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int pColumnInfoData->varmeta.allocLen = len + oldLen; } - memcpy(pColumnInfoData->pData + oldLen, pSource->pData, len); + if (pSource->pData != NULL) { + memcpy(pColumnInfoData->pData + oldLen, pSource->pData, len); + } else { + ASSERT(len == 0); + } + pColumnInfoData->varmeta.length = len + oldLen; } else { if (finalNumOfRows > (*capacity)) { diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index c157faecb1..af368d33e0 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -3219,7 +3219,7 @@ int32_t doMergeRowsInBuf(SIterInfo* pIter, uint64_t uid, int64_t ts, SArray* pDe static int32_t doMergeRowsInFileBlockImpl(SBlockData* pBlockData, int32_t rowIndex, int64_t key, SRowMerger* pMerger, SVersionRange* pVerRange, int32_t step) { - while (pBlockData->aTSKEY[rowIndex] == key && rowIndex < pBlockData->nRow && rowIndex >= 0) { + while (rowIndex < pBlockData->nRow && rowIndex >= 0 && pBlockData->aTSKEY[rowIndex] == key) { if (pBlockData->aVersion[rowIndex] > pVerRange->maxVer || pBlockData->aVersion[rowIndex] < pVerRange->minVer) { rowIndex += step; continue; diff --git a/source/libs/executor/src/tsimplehash.c b/source/libs/executor/src/tsimplehash.c index a5168d24ba..9fbe94200c 100644 --- a/source/libs/executor/src/tsimplehash.c +++ b/source/libs/executor/src/tsimplehash.c @@ -189,7 +189,7 @@ int32_t tSimpleHashPut(SSHashObj *pHashObj, const void *key, size_t keyLen, cons } while (pNode) { - if ((*(pHashObj->equalFp))(GET_SHASH_NODE_KEY(pNode, pNode->dataLen), key, keyLen) == 0) { + if ((keyLen == pNode->keyLen) && (*(pHashObj->equalFp))(GET_SHASH_NODE_KEY(pNode, pNode->dataLen), key, keyLen) == 0) { break; } pNode = pNode->next; @@ -213,10 +213,12 @@ int32_t tSimpleHashPut(SSHashObj *pHashObj, const void *key, size_t keyLen, cons static FORCE_INLINE SHNode *doSearchInEntryList(SSHashObj *pHashObj, const void *key, size_t keyLen, int32_t index) { SHNode *pNode = pHashObj->hashList[index]; while (pNode) { - if ((*(pHashObj->equalFp))(GET_SHASH_NODE_KEY(pNode, pNode->dataLen), key, keyLen) == 0) { + const char* p = GET_SHASH_NODE_KEY(pNode, pNode->dataLen); + ASSERT(keyLen > 0); + + if (pNode->keyLen == keyLen && ((*(pHashObj->equalFp))(p, key, keyLen) == 0)) { break; } - pNode = pNode->next; } From 10921cc09a512cf7ea1de8b71db488231b8bc3c7 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 14 Nov 2022 17:13:22 +0800 Subject: [PATCH 06/49] more opt --- source/dnode/vnode/src/tsdb/tsdbMemTable.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index 998409f34e..55c7576155 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -262,30 +262,27 @@ void tsdbTbDataIterOpen(STbData *pTbData, TSDBKEY *pFrom, int8_t backward, STbDa } bool tsdbTbDataIterNext(STbDataIter *pIter) { - SMemSkipListNode *pHead = pIter->pTbData->sl.pHead; - SMemSkipListNode *pTail = pIter->pTbData->sl.pTail; - pIter->pRow = NULL; if (pIter->backward) { - ASSERT(pIter->pNode != pTail); + ASSERT(pIter->pNode != pIter->pTbData->sl.pTail); - if (pIter->pNode == pHead) { + if (pIter->pNode == pIter->pTbData->sl.pHead) { return false; } pIter->pNode = SL_NODE_BACKWARD(pIter->pNode, 0); - if (pIter->pNode == pHead) { + if (pIter->pNode == pIter->pTbData->sl.pHead) { return false; } } else { - ASSERT(pIter->pNode != pHead); + ASSERT(pIter->pNode != pIter->pTbData->sl.pHead); - if (pIter->pNode == pTail) { + if (pIter->pNode == pIter->pTbData->sl.pTail) { return false; } pIter->pNode = SL_NODE_FORWARD(pIter->pNode, 0); - if (pIter->pNode == pTail) { + if (pIter->pNode == pIter->pTbData->sl.pTail) { return false; } } From 21ba6fa328c250705b3914adeb2046a68590b70a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 14 Nov 2022 17:25:20 +0800 Subject: [PATCH 07/49] test: add asan case --- tests/parallel_test/cases.task | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 48215b1d47..a8e36e98ee 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -181,12 +181,12 @@ ,,,script,./test.sh -f tsim/show/basic.sim ,,y,script,./test.sh -f tsim/table/autocreate.sim ,,y,script,./test.sh -f tsim/table/basic1.sim -,,,script,./test.sh -f tsim/table/basic2.sim +,,y,script,./test.sh -f tsim/table/basic2.sim ,,y,script,./test.sh -f tsim/table/basic3.sim ,,y,script,./test.sh -f tsim/table/bigint.sim ,,y,script,./test.sh -f tsim/table/binary.sim ,,y,script,./test.sh -f tsim/table/bool.sim -,,,script,./test.sh -f tsim/table/column_name.sim +,,y,script,./test.sh -f tsim/table/column_name.sim ,,y,script,./test.sh -f tsim/table/column_num.sim ,,y,script,./test.sh -f tsim/table/column_value.sim ,,y,script,./test.sh -f tsim/table/column2.sim @@ -208,6 +208,7 @@ ,,y,script,./test.sh -f tsim/table/tinyint.sim ,,y,script,./test.sh -f tsim/table/vgroup.sim ,,,script,./test.sh -f tsim/stream/basic0.sim -g +,,,script,./test.sh -f tsim/stream/basic1.sim ,,y,script,./test.sh -f tsim/stream/basic2.sim ,,,script,./test.sh -f tsim/stream/drop_stream.sim ,,y,script,./test.sh -f tsim/stream/fillHistoryBasic1.sim From 6aefbbf3b22a7576d32a9007e4344651edc9fec0 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 14 Nov 2022 17:32:09 +0800 Subject: [PATCH 08/49] more optimize --- source/dnode/vnode/src/tsdb/tsdbMemTable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index 55c7576155..ddf2949607 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -18,7 +18,8 @@ #define MEM_MIN_HASH 1024 #define SL_MAX_LEVEL 5 -#define SL_NODE_SIZE(l) (sizeof(SMemSkipListNode) + sizeof(SMemSkipListNode *) * (l)*2) +// sizeof(SMemSkipListNode) + sizeof(SMemSkipListNode *) * (l) * 2 +#define SL_NODE_SIZE(l) (sizeof(SMemSkipListNode) + ((l) << 4)) #define SL_NODE_FORWARD(n, l) ((n)->forwards[l]) #define SL_NODE_BACKWARD(n, l) ((n)->forwards[(n)->level + (l)]) From 2f0dad7b1c3bef5f71849374394891bc3ac657d4 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 14 Nov 2022 18:11:33 +0800 Subject: [PATCH 09/49] test: add asan case --- tests/parallel_test/cases.task | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 7ff3eb89e7..1174f46e65 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -138,7 +138,7 @@ ,,y,script,./test.sh -f tsim/parser/mixed_blocks.sim ,,y,script,./test.sh -f tsim/parser/nchar.sim ,,,script,./test.sh -f tsim/parser/nestquery.sim -,,,script,./test.sh -f tsim/parser/null_char.sim +,,y,script,./test.sh -f tsim/parser/null_char.sim ,,y,script,./test.sh -f tsim/parser/precision_ns.sim ,,,script,./test.sh -f tsim/parser/projection_limit_offset.sim ,,y,script,./test.sh -f tsim/parser/regex.sim @@ -147,7 +147,7 @@ ,,y,script,./test.sh -f tsim/parser/select_from_cache_disk.sim ,,y,script,./test.sh -f tsim/parser/select_with_tags.sim ,,y,script,./test.sh -f tsim/parser/selectResNum.sim -,,,script,./test.sh -f tsim/parser/set_tag_vals.sim +,,y,script,./test.sh -f tsim/parser/set_tag_vals.sim ,,y,script,./test.sh -f tsim/parser/single_row_in_tb.sim ,,,script,./test.sh -f tsim/parser/sliding.sim ,,y,script,./test.sh -f tsim/parser/slimit_alter_tags.sim @@ -178,7 +178,7 @@ ,,,script,./test.sh -f tsim/mnode/basic3.sim ,,,script,./test.sh -f tsim/mnode/basic4.sim ,,,script,./test.sh -f tsim/mnode/basic5.sim -,,,script,./test.sh -f tsim/show/basic.sim +,,y,script,./test.sh -f tsim/show/basic.sim ,,y,script,./test.sh -f tsim/table/autocreate.sim ,,y,script,./test.sh -f tsim/table/basic1.sim ,,y,script,./test.sh -f tsim/table/basic2.sim @@ -193,9 +193,9 @@ ,,y,script,./test.sh -f tsim/table/createmulti.sim ,,y,script,./test.sh -f tsim/table/date.sim ,,y,script,./test.sh -f tsim/table/db.table.sim -,,,script,./test.sh -f tsim/table/delete_reuse1.sim -,,,script,./test.sh -f tsim/table/delete_reuse2.sim -,,,script,./test.sh -f tsim/table/delete_writing.sim +,,y,script,./test.sh -f tsim/table/delete_reuse1.sim +,,y,script,./test.sh -f tsim/table/delete_reuse2.sim +,,y,script,./test.sh -f tsim/table/delete_writing.sim ,,y,script,./test.sh -f tsim/table/describe.sim ,,y,script,./test.sh -f tsim/table/double.sim ,,y,script,./test.sh -f tsim/table/float.sim @@ -203,7 +203,7 @@ ,,y,script,./test.sh -f tsim/table/int.sim ,,y,script,./test.sh -f tsim/table/limit.sim ,,y,script,./test.sh -f tsim/table/smallint.sim -,,,script,./test.sh -f tsim/table/table_len.sim +,,y,script,./test.sh -f tsim/table/table_len.sim ,,y,script,./test.sh -f tsim/table/table.sim ,,y,script,./test.sh -f tsim/table/tinyint.sim ,,y,script,./test.sh -f tsim/table/vgroup.sim From b2f9eeb5bbc2a09c9123bd27eec29bfc516d39f3 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 14 Nov 2022 18:49:11 +0800 Subject: [PATCH 10/49] fix(query): fill operator memory leak fixed --- source/libs/executor/src/tfill.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index ddd948a6dd..c41376b2dc 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -513,6 +513,22 @@ void* taosDestroyFillInfo(SFillInfo* pFillInfo) { // taosMemoryFreeClear(pFillInfo->pTags[i].tagVal); // } + // free pFillCol + if (pFillInfo->pFillCol) { + for (int32_t i = 0; i < pFillInfo->numOfCols; i++) { + SFillColInfo* pCol = &pFillInfo->pFillCol[i]; + if (!pCol->notFillCol) { + if (pCol->fillVal.nType == TSDB_DATA_TYPE_VARBINARY || pCol->fillVal.nType == TSDB_DATA_TYPE_VARCHAR || + pCol->fillVal.nType == TSDB_DATA_TYPE_NCHAR || pCol->fillVal.nType == TSDB_DATA_TYPE_JSON) { + if (pCol->fillVal.pz) { + taosMemoryFree(pCol->fillVal.pz); + pCol->fillVal.pz = NULL; + } + } + } + } + } + taosMemoryFreeClear(pFillInfo->pTags); taosMemoryFreeClear(pFillInfo->pFillCol); taosMemoryFreeClear(pFillInfo); From 7c8b2867cee0d21259419f564243fd507bdebc2b Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Mon, 14 Nov 2022 19:23:42 +0800 Subject: [PATCH 11/49] enh(stream): add stream task info into information schema --- include/common/systable.h | 1 + include/common/tmsg.h | 1 + source/common/src/systable.c | 12 ++- source/dnode/mnode/impl/src/mndShow.c | 2 + source/dnode/mnode/impl/src/mndStream.c | 108 +++++++++++++++++++++++- source/libs/wal/src/walMeta.c | 6 +- source/libs/wal/src/walWrite.c | 1 + 7 files changed, 127 insertions(+), 4 deletions(-) diff --git a/include/common/systable.h b/include/common/systable.h index 8b29525db3..57f85f16bc 100644 --- a/include/common/systable.h +++ b/include/common/systable.h @@ -46,6 +46,7 @@ extern "C" { #define TSDB_INS_TABLE_SUBSCRIPTIONS "ins_subscriptions" #define TSDB_INS_TABLE_TOPICS "ins_topics" #define TSDB_INS_TABLE_STREAMS "ins_streams" +#define TSDB_INS_TABLE_STREAM_TASKS "ins_stream_tasks" #define TSDB_PERFORMANCE_SCHEMA_DB "performance_schema" #define TSDB_PERFS_TABLE_SMAS "perf_smas" diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 99c5c72e2f..3281bca96a 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -119,6 +119,7 @@ typedef enum _mgmt_table { TSDB_MGMT_TABLE_QUERIES, TSDB_MGMT_TABLE_VNODES, TSDB_MGMT_TABLE_APPS, + TSDB_MGMT_TABLE_STREAM_TASKS, TSDB_MGMT_TABLE_MAX, } EShowType; diff --git a/source/common/src/systable.c b/source/common/src/systable.c index d3d006ab35..c3a1f9f67e 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -134,7 +134,7 @@ static const SSysDbTableSchema userStbsSchema[] = { }; static const SSysDbTableSchema streamSchema[] = { - {.name = "stream_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "stream_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "create_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = false}, {.name = "sql", .bytes = TSDB_SHOW_SQL_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "status", .bytes = 20 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, @@ -145,6 +145,15 @@ static const SSysDbTableSchema streamSchema[] = { {.name = "trigger", .bytes = 20 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, }; +static const SSysDbTableSchema streamTaskSchema[] = { + {.name = "stream_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "task_id", .bytes = 8, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "node_type", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "node_id", .bytes = 8, .type = TSDB_DATA_TYPE_INT, .sysInfo = false}, + {.name = "level", .bytes = 20 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, + {.name = "status", .bytes = 20 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, +}; + static const SSysDbTableSchema userTblsSchema[] = { {.name = "table_name", .bytes = SYSTABLE_SCH_TABLE_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, {.name = "db_name", .bytes = SYSTABLE_SCH_DB_NAME_LEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = false}, @@ -287,6 +296,7 @@ static const SSysTableMeta infosMeta[] = { {TSDB_INS_TABLE_TOPICS, topicSchema, tListLen(topicSchema), false}, {TSDB_INS_TABLE_SUBSCRIPTIONS, subscriptionSchema, tListLen(subscriptionSchema), false}, {TSDB_INS_TABLE_STREAMS, streamSchema, tListLen(streamSchema), false}, + {TSDB_INS_TABLE_STREAM_TASKS, streamTaskSchema, tListLen(streamTaskSchema), false}, {TSDB_INS_TABLE_VNODES, vnodesSchema, tListLen(vnodesSchema), true}, }; diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index b0af98b933..20c2ebb0a4 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -106,6 +106,8 @@ static int32_t convertToRetrieveType(char *name, int32_t len) { type = TSDB_MGMT_TABLE_STREAMS; } else if (strncasecmp(name, TSDB_PERFS_TABLE_APPS, len) == 0) { type = TSDB_MGMT_TABLE_APPS; + } else if (strncasecmp(name, TSDB_INS_TABLE_STREAM_TASKS, len) == 0) { + type = TSDB_MGMT_TABLE_STREAM_TASKS; } else { // ASSERT(0); } diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 594c13f957..c649180285 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -41,6 +41,8 @@ static int32_t mndProcessStreamMetaReq(SRpcMsg *pReq); static int32_t mndGetStreamMeta(SRpcMsg *pReq, SShowObj *pShow, STableMetaRsp *pMeta); static int32_t mndRetrieveStream(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); static void mndCancelGetNextStream(SMnode *pMnode, void *pIter); +static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows); +static void mndCancelGetNextStreamTask(SMnode *pMnode, void *pIter); int32_t mndInitStream(SMnode *pMnode) { SSdbTable table = { @@ -62,6 +64,8 @@ int32_t mndInitStream(SMnode *pMnode) { mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_STREAMS, mndRetrieveStream); mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_STREAMS, mndCancelGetNextStream); + mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_STREAM_TASKS, mndRetrieveStreamTask); + mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_STREAM_TASKS, mndCancelGetNextStreamTask); return sdbSetTable(pMnode->pSdb, table); } @@ -891,7 +895,7 @@ static int32_t mndRetrieveStream(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB SName n; int32_t cols = 0; - char streamName[TSDB_DB_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + char streamName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; STR_WITH_MAXSIZE_TO_VARSTR(streamName, mndGetDbStr(pStream->name), sizeof(streamName)); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)streamName, false); @@ -953,3 +957,105 @@ static void mndCancelGetNextStream(SMnode *pMnode, void *pIter) { SSdb *pSdb = pMnode->pSdb; sdbCancelFetch(pSdb, pIter); } + +static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity) { + SMnode *pMnode = pReq->info.node; + SSdb *pSdb = pMnode->pSdb; + int32_t numOfRows = 0; + SStreamObj *pStream = NULL; + + while (numOfRows < rowsCapacity) { + pShow->pIter = sdbFetch(pSdb, SDB_STREAM, pShow->pIter, (void **)&pStream); + if (pShow->pIter == NULL) break; + + // lock + taosRLockLatch(&pStream->lock); + // count task num + int32_t sz = taosArrayGetSize(pStream->tasks); + int32_t count = 0; + for (int32_t i = 0; i < sz; i++) { + SArray *pLevel = taosArrayGetP(pStream->tasks, i); + count += taosArrayGetSize(pLevel); + } + + if (numOfRows + count > rowsCapacity) { + blockDataEnsureCapacity(pBlock, numOfRows + count); + } + // add row for each task + for (int32_t i = 0; i < sz; i++) { + SArray *pLevel = taosArrayGetP(pStream->tasks, i); + int32_t levelCnt = taosArrayGetSize(pLevel); + for (int32_t j = 0; j < levelCnt; j++) { + SStreamTask *pTask = taosArrayGetP(pLevel, j); + + SColumnInfoData *pColInfo; + int32_t cols = 0; + + // stream name + char streamName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; + STR_WITH_MAXSIZE_TO_VARSTR(streamName, mndGetDbStr(pStream->name), sizeof(streamName)); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)streamName, false); + + // task id + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)&pTask->taskId, false); + + // node type + char nodeType[20 + VARSTR_HEADER_SIZE] = {0}; + varDataSetLen(nodeType, 5); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + if (pTask->nodeId > 0) { + memcpy(varDataVal(nodeType), "vnode", 5); + } else { + memcpy(varDataVal(nodeType), "snode", 5); + } + colDataAppend(pColInfo, numOfRows, nodeType, false); + + // node id + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + int32_t nodeId = TMAX(pTask->nodeId, 0); + colDataAppend(pColInfo, numOfRows, (const char *)&nodeId, false); + + // level + char level[20 + VARSTR_HEADER_SIZE] = {0}; + if (pTask->taskLevel == TASK_LEVEL__SOURCE) { + memcpy(varDataVal(level), "source", 6); + varDataSetLen(level, 6); + } else if (pTask->taskLevel == TASK_LEVEL__AGG) { + memcpy(varDataVal(level), "agg", 3); + varDataSetLen(level, 3); + } else if (pTask->taskLevel == TASK_LEVEL__SINK) { + memcpy(varDataVal(level), "sink", 4); + varDataSetLen(level, 4); + } else if (pTask->taskLevel == TASK_LEVEL__SINK) { + } + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)&level, false); + + // status + char status[20 + VARSTR_HEADER_SIZE] = {0}; + char status2[20] = {0}; + strcpy(status, "normal"); + STR_WITH_MAXSIZE_TO_VARSTR(status, status2, sizeof(status)); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, numOfRows, (const char *)&status, false); + + numOfRows++; + } + } + + // unlock + taosRUnLockLatch(&pStream->lock); + + sdbRelease(pSdb, pStream); + } + + pShow->numOfRows += numOfRows; + return numOfRows; +} + +static void mndCancelGetNextStreamTask(SMnode *pMnode, void *pIter) { + SSdb *pSdb = pMnode->pSdb; + sdbCancelFetch(pSdb, pIter); +} diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 1c6e1a2e17..6cac4b6093 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -124,8 +124,8 @@ static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal, int32_t fileIdx) { goto _err; } - char* candidate = NULL; - char* haystack = buf; + char* candidate = NULL; + char* haystack = buf; int64_t pos = 0; SWalCkHead* logContent = NULL; @@ -414,8 +414,10 @@ int walCheckAndRepairMeta(SWal* pWal) { } ASSERT(pFileInfo->fileSize == 0); // remove the empty wal log, and its idx + wInfo("vgId:%d, wal remove empty file %s", pWal->cfg.vgId, fnameStr); taosRemoveFile(fnameStr); walBuildIdxName(pWal, pFileInfo->firstVer, fnameStr); + wInfo("vgId:%d, wal remove empty file %s", pWal->cfg.vgId, fnameStr); taosRemoveFile(fnameStr); // remove its meta entry taosArrayRemove(pWal->fileInfoSet, fileIdx); diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 7ced5fae39..216dd5fcb1 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -407,6 +407,7 @@ int32_t walRollImpl(SWal *pWal) { } walBuildLogName(pWal, newFileFirstVer, fnameStr); pLogFile = taosOpenFile(fnameStr, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND); + wDebug("vgId:%d, wal create new file for write:%s", pWal->cfg.vgId, fnameStr); if (pLogFile == NULL) { terrno = TAOS_SYSTEM_ERROR(errno); code = -1; From 344395b05a151f59b9008d1ce06b8fea60fe7dfd Mon Sep 17 00:00:00 2001 From: Xuefeng Tan <1172915550@qq.com> Date: Mon, 14 Nov 2022 20:57:29 +0800 Subject: [PATCH 12/49] fix(taosAdapter): fix log output (#18127) --- cmake/taosadapter_CMakeLists.txt.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 79d54f522e..cc46ef9938 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG 0d5663d + GIT_TAG ff7de07 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From 6b473b7e18ce335aec7ab6bf05cc5a2cf060905f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 14 Nov 2022 21:10:02 +0800 Subject: [PATCH 13/49] test: asan case --- tests/parallel_test/cases.task | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1174f46e65..fac4210d88 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -68,7 +68,7 @@ ,,y,script,./test.sh -f tsim/insert/basic0.sim ,,y,script,./test.sh -f tsim/insert/basic1.sim ,,y,script,./test.sh -f tsim/insert/basic2.sim -,,,script,./test.sh -f tsim/insert/commit-merge0.sim +,,y,script,./test.sh -f tsim/insert/commit-merge0.sim ,,y,script,./test.sh -f tsim/insert/insert_drop.sim ,,y,script,./test.sh -f tsim/insert/insert_select.sim ,,y,script,./test.sh -f tsim/insert/null.sim @@ -109,7 +109,7 @@ ,,y,script,./test.sh -f tsim/parser/dbtbnameValidate.sim ,,y,script,./test.sh -f tsim/parser/distinct.sim ,,y,script,./test.sh -f tsim/parser/fill_us.sim -,,,script,./test.sh -f tsim/parser/fill.sim +,,y,script,./test.sh -f tsim/parser/fill.sim ,,y,script,./test.sh -f tsim/parser/first_last.sim ,,y,script,./test.sh -f tsim/parser/fourArithmetic-basic.sim ,,,script,./test.sh -f tsim/parser/function.sim From 7622361ea51c7038182b0192a73916c1280dbfa7 Mon Sep 17 00:00:00 2001 From: Pan YANG Date: Tue, 15 Nov 2022 00:28:36 +0800 Subject: [PATCH 14/49] docs: add media links --- docs/en/05-get-started/discord.svg | 7 +++++++ docs/en/05-get-started/github.svg | 6 ++++++ docs/en/05-get-started/index.md | 20 +++++++++++++++++- docs/en/05-get-started/linkedin.svg | 6 ++++++ docs/en/05-get-started/twitter.svg | 7 +++++++ docs/en/05-get-started/youtube.svg | 11 ++++++++++ docs/zh/05-get-started/channel.webp | Bin 0 -> 12650 bytes docs/zh/05-get-started/index.md | 21 +++++++++++++++---- docs/zh/05-get-started/official-account.webp | Bin 0 -> 11686 bytes docs/zh/05-get-started/tdengine.webp | Bin 24678 -> 0 bytes docs/zh/05-get-started/xiaot.webp | Bin 0 -> 12592 bytes 11 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 docs/en/05-get-started/discord.svg create mode 100644 docs/en/05-get-started/github.svg create mode 100644 docs/en/05-get-started/linkedin.svg create mode 100644 docs/en/05-get-started/twitter.svg create mode 100644 docs/en/05-get-started/youtube.svg create mode 100644 docs/zh/05-get-started/channel.webp create mode 100644 docs/zh/05-get-started/official-account.webp delete mode 100644 docs/zh/05-get-started/tdengine.webp create mode 100644 docs/zh/05-get-started/xiaot.webp diff --git a/docs/en/05-get-started/discord.svg b/docs/en/05-get-started/discord.svg new file mode 100644 index 0000000000..8218e3c3ca --- /dev/null +++ b/docs/en/05-get-started/discord.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/docs/en/05-get-started/github.svg b/docs/en/05-get-started/github.svg new file mode 100644 index 0000000000..493832ceb7 --- /dev/null +++ b/docs/en/05-get-started/github.svg @@ -0,0 +1,6 @@ + + + diff --git a/docs/en/05-get-started/index.md b/docs/en/05-get-started/index.md index a6b6721383..fec734b64d 100644 --- a/docs/en/05-get-started/index.md +++ b/docs/en/05-get-started/index.md @@ -3,6 +3,12 @@ title: Get Started description: This article describes how to install TDengine and test its performance. --- +import github from './github.svg' +import discord from './discord.svg' +import twitter from './twitter.svg' +import youtube from './youtube.svg' +import linkedin from './linkedin.svg' + You can install and run TDengine on Linux/Windows/macOS machines as well as Docker containers. You can also deploy TDengine as a managed service with TDengine Cloud. The full package of TDengine includes the TDengine Server (`taosd`), TDengine Client (`taosc`), taosAdapter for connecting with third-party systems and providing a RESTful interface, a command-line interface, and some tools. In addition to connectors for multiple languages, TDengine also provides a [RESTful interface](/reference/rest-api) through [taosAdapter](/reference/taosadapter). @@ -12,4 +18,16 @@ import DocCardList from '@theme/DocCardList'; import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; -``` \ No newline at end of file +``` + +### Join TDengine Community + + + + + + + + + +
Star GitHub

Star GitHub

Join Discord

Join Discord

Follow Twitter

Follow Twitter

Subscribe YouTube

Subscribe YouTube

Follow LinkedIn

Follow LinkedIn

diff --git a/docs/en/05-get-started/linkedin.svg b/docs/en/05-get-started/linkedin.svg new file mode 100644 index 0000000000..969c6f03af --- /dev/null +++ b/docs/en/05-get-started/linkedin.svg @@ -0,0 +1,6 @@ + + + diff --git a/docs/en/05-get-started/twitter.svg b/docs/en/05-get-started/twitter.svg new file mode 100644 index 0000000000..4825aa4ed0 --- /dev/null +++ b/docs/en/05-get-started/twitter.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/docs/en/05-get-started/youtube.svg b/docs/en/05-get-started/youtube.svg new file mode 100644 index 0000000000..20747b8b6a --- /dev/null +++ b/docs/en/05-get-started/youtube.svg @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/docs/zh/05-get-started/channel.webp b/docs/zh/05-get-started/channel.webp new file mode 100644 index 0000000000000000000000000000000000000000..8dba93d411d09f1b98e5d72f69cc98c78af5ddb1 GIT binary patch literal 12650 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%0A+}p$bzEd zQl!xeTzfkeE0bM0NaD(vhb&< zitFtZFPnKrGRD)f+$cmh3z#c%bZ%Wo)YB&E*cB_oyW~Km49YEI%iIG1?7rQ!%%?cN z(P!^Y8?C}7RPyT7g}e1pHczCCGq-6ce$pxg4ptp51V};zVi)cCd{ldsyiM}$*Xz${ zHw_dBtS6EN{4duf_YmV^V zH6fu!GWtwLkH~THy`*2Cm0g}{xM)Wgw4QzmAYS*uQ%Fxc`2?19-o~hb;0EO@A@F}J zbAYZu)|b4)Ui+v?=Z^g{Z}KQmy7o1Ny_tq z)bzQEP#Oat#}Nu2LyQbTRZTcJduw1Ah?gKD@?b`$%***a^O>ARRX|WvTiI)3jiwXo zgz(huWOqZ@PjdAr7sa>wbE89^8;8G;W}sAW9!?-Jn_{~eDC{LjWCuGkh5y5s=091D z1vsXs+ILPQT1R?8F?)uK^4Gfqp*KS49ps6?eo6Q_XUevt&O@<}sXNi!s@a-k%VYc? zHU?3ys6bYC6i!4#iF;N^f(mVQB_rkgX2ABwbP7Pj3Wy!wf6c)`leKH*?%L=}X)DO)YPc3Ss-dCI1G|Y_bq4&|>eZVLRd1A~?cMQv<(l3+4Wb zmb}rw3|)JDQE@{Jxq^UtEwMPwl%}r1kQ%2!C_Xo;6qxALMN_@Xd~V3`-KWb{bjGr{ z>CF0KX=FUo`-+f;dy@JA*?rXCqeydaKR=&AA6)9)!Z{o9;RDrjsfT7(FVj;q2*ImrUIXKG1wmi4(yzTVW9_T=R)_@Ju(ff<5a!NdBDQD8M!?c$%eu0$9^aNN z)f^#q{+cvFLix~`fB%#dZ6Twm*( z*<4SkV{~RY4R1_FimPZ4d-flj&`}U0 z(DLUHM(rUT7?jXsvjb;(a2yw~HHgXyPCtZETm~1WLDaD!aI@JMcpS&90Tf2i^b0J( zQ`3XH8ta`g%wwmW`aErL2Mw+UU!tdD(HS1WZ$rLITp|bMywt5K`%3(`nYsnp0Ox-3 zuj{@NUs|UvJW36>?v7zH8Uc^c&6MWuM-LqPf{mvRkJCUoOjI@`*>Q|8p(E$?om1zS z`)!-E1bQf+{3uM1^6AcH%Dj(v#G~BCSaV3m3R&%CtEgm&(S9Zp$>!zh98GOZKpi9iQd+BV!mUwy}|7Idz~Y5 zJRQ1Wxk^;j0QOpiX$#?}4J(P;fH^UTfWM1-_~JJ!-D<&T+CyhEH+N#p>e(f|A*Uz` z3KB?fk9IpZ(FoUEdpN@XC6YSrbb{Zg!Xy`B^;}$Y_nCxxMH@r}{w`;mUGJn2fPItv z8*ihm#+iMV?83TRU@wOZzYh-xq*-i&D;Xr*6I+n*v!mT1{Vg2g)9%b7?B&0^7Z5`>sL$S0nl^pS^e0u$sBz+Dl@aS8{zle{fjI z9;vQSU3LI}?^JRuZ_Vsv8Yzzr6#>k@ts`z9?n=)SP1GV{zy!e;Y@no{ z71U(nz1&y!bQChFT;E50KDDlcm{RGSj7!qj(7mKc?2l7NHkG5BTCm{-ZT2JM%qrjO2J%Wawk?3AW{P|6`XwEwkO`AYhcQUhxrK1u0n$Z>3NX8l> z0)0!6*R*{cgY1;LB`JlyGQyXOGk^G&XtFkSwDa1$5e*`vs8Se)o0f~am=^Id6e2AI z6kCE18Bo{Nu1WduwazU`pz0@!7MGiem@^(p-!ZtM1EiTgPesX!@VGYOUY1IU)q2<{ zTc@7br#F^sHe*)|b5U3@p91JDWOe75lFO_ZwAL=kT!N$3W^ebI;&)O#$776f?!Pwf za%?xwS#sxjG*%aF8AwlUe<+J#utD1eVYk0UGS4Yoc$Dp5y*xgx>(9^(jz+N_^w)P# zI4f#rbZ^zuekqo^qF-27bSCmz-(UCYP3rIty8?nlVQ_8<}jV^i^bP zqn(%MxB%ZRtP<7HvE_PiN|M&qUpQg0lM1cGIY53BuZK;C(k=S%Ss=;CQmPts04>oO z51d&1!$o260;dpGybcU3L9BKR8*~LRHJkv6`oG<&VkeIOYY~a1JOHNmZlS!*3|=aPNXds%iL<+h$`j`wc3O@1?$dJfzEV zu@@}YZuI3Pq|hdaGT{9ySf3s3uJTFN`H1@$r087cvywmPqTxZBKneyH>@riyQX_fj z&-jvtpjz*%u5f3OhWz>}gp?j%x-3gR*JycpXD1+Sd_})YkM&s}XYoz*JC9+2_5yz{ z(=K^~Q-(SsH~vqt;1jz;vGxgG5DX&U75ulmeDd#AH`MlOlfO$n%qbyq`hGk6EB6+= zJo#pNJn4ww_{M55$FsShOAzICGxj;CPo3Q{X&AwHF@(Y7mdlW!aO9I9W zZ$EE;*y>(`+Js&Rbo!rKu5Cl1rcEsQIFFsoE_T5HiT3*7d!jd<9u%=&)!2Ue_?^C} zYhZ>4xe3$l=lWhJ>3tes!C2X~y}xsP;*!SwB)4iihbn@$88m5)IJ#4=Vg=7lHi}+8 zmmg!K4zc~FcQOOEqk-?0pJ*(YWY;YV%)5+4mV7BRAaX?LV34}UQK)xz2B<`BJ_iB8 zF3;Q&c}dF8Pc#bTILF|tR&ojaOQJE;%1NLoVf-i1k>^zJPH)$~;?JpH8IGsOe#{NKUaFW4->Gdj z=3YuZwo_vI6BYeJ*5!?9ZYpIaZWIux0*6DOfBnq?dSh!ea(s$aVlLhvgNPGG*}34c zss)fNS`RGBahpNP%CpOgGg;`Whq+RyA(y<~hlAM==rXZZQ<1)=ttSEONb9ppRDwkJRQB3QAKN8_dlCSr{r z7{QgA4Rl)OxZ10jCabS9Ef)(j3uKnEHmxisnZ3wBDWT%bMJ926FT#tARJ^#jM?s5F zQxFs|o2E|H>NPca@I0XzAyZY-HP}ryA>rC1IMS`NClG^yB#(ODJm?9%7maYEpV)w| zsK!Y`M&2~acOHqLNI8YNb37`l08!S{hzdNve8EmT`}3_7X7%=^b&?#~prh(@^pGSs zrhUj5hJ>!hRPwC^M0=w7Xa`=)VW4aN#kmp{vmno|G*Te49lOrnqzukZ)r_lXoe-EC zI55^2@yWG9Cp)_WLDcwLq^z#;U0GkShv!<}B{`3q{uK#SmUV@4^P4$1iE%i2VuHbL zkr0P&9-dPqB&Li^qI>DJWQxo1h0k`wqLj%cs`ijPzHX}?@Xiw07n^66iU7!-rfpdf zUz3GJh|wb6?om8LH%d2ddy@m0kO0CjSE?{Yv3c#}y`E&{)sk3Pf}nOM(@|1Rg9L1c zr~&mBM5=zMJ~yh9r_%sNu!?~`x+(n{0=nwV;;BfyR~8~s&{7EUna6GKI8NH9q{}(N zVxI2g>A}ftCWGE*Aza7qPm>rFj1(JMQz#xOVQn&jr$MWGKpnSUz=?1EQ&{p?5TAsR Y@|UA=C`^`i?e6IRT79jv)5(hf0N>oP)c^nh literal 0 HcmV?d00001 diff --git a/docs/zh/05-get-started/index.md b/docs/zh/05-get-started/index.md index dec4d800bc..092523a556 100644 --- a/docs/zh/05-get-started/index.md +++ b/docs/zh/05-get-started/index.md @@ -3,7 +3,9 @@ title: 立即开始 description: '快速设置 TDengine 环境并体验其高效写入和查询' --- -import xiaot from './tdengine.webp' +import xiaot from './xiaot.webp' +import channel from './channel.webp' +import official_account from './official-account.webp' TDengine 完整的软件包包括服务端(taosd)、用于与第三方系统对接并提供 RESTful 接口的 taosAdapter、应用驱动(taosc)、命令行程序 (CLI,taos) 和一些工具软件。TDengine 除了提供多种语言的连接器之外,还通过 [taosAdapter](../reference/taosadapter) 提供 [RESTful 接口](../connector/rest-api)。 @@ -16,8 +18,19 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; ``` -### 开发者技术交流群 +### 加入 TDengine 官方社区 -微信扫描下面二维码,加“小 T”为好友,即可加入“物联网大数据技术前沿群”,与大家共同交流物联网大数据技术应用、TDengine 使用问题和技巧等话题。 +微信扫描以下二维码,学习了解 TDengine 的最新技术,与大家共同交流物联网大数据技术应用、TDengine 使用问题和技巧等话题。 -小 T 的二维码 + + + + + + + + + + + +
小 T 的二维码TDengine 微信视频号TDengine 微信公众号
加入“物联网大数据技术前沿群”
与大家进行技术交流
关注 TDengine 微信视频号
收看技术直播与教学视频
关注 TDengine 微信公众号
阅读核心技术与行业案例文章
diff --git a/docs/zh/05-get-started/official-account.webp b/docs/zh/05-get-started/official-account.webp new file mode 100644 index 0000000000000000000000000000000000000000..fcbc3107fc51ca5474be653302db777de7d1e775 GIT binary patch literal 11686 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 A6#xJL diff --git a/docs/zh/05-get-started/xiaot.webp b/docs/zh/05-get-started/xiaot.webp new file mode 100644 index 0000000000000000000000000000000000000000..91b3b3ef681a590c8526c92e91e58596a09a4085 GIT binary patch literal 12592 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 Date: Tue, 15 Nov 2022 09:11:26 +0800 Subject: [PATCH 15/49] fix:applying non-zero offset in tqSink.c --- source/dnode/vnode/src/tq/tqSink.c | 6 ++++- tests/script/tsim/stream/basic1.sim | 35 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tq/tqSink.c b/source/dnode/vnode/src/tq/tqSink.c index f782411084..b2624d1bc1 100644 --- a/source/dnode/vnode/src/tq/tqSink.c +++ b/source/dnode/vnode/src/tq/tqSink.c @@ -31,7 +31,11 @@ int32_t tqBuildDeleteReq(SVnode* pVnode, const char* stbFullName, const SSDataBl int64_t ts = *(int64_t*)colDataGetData(pTsCol, row); int64_t groupId = *(int64_t*)colDataGetData(pGidCol, row); char* name; - void* varTbName = colDataGetVarData(pTbNameCol, row); + void* varTbName = NULL; + if (!colDataIsNull(pTbNameCol, totRow, row, NULL)) { + varTbName = colDataGetVarData(pTbNameCol, row); + } + if (varTbName != NULL && varTbName != (void*)-1) { name = taosMemoryCalloc(1, TSDB_TABLE_NAME_LEN); memcpy(name, varDataVal(varTbName), varDataLen(varTbName)); diff --git a/tests/script/tsim/stream/basic1.sim b/tests/script/tsim/stream/basic1.sim index bb6604687c..bc076a194b 100644 --- a/tests/script/tsim/stream/basic1.sim +++ b/tests/script/tsim/stream/basic1.sim @@ -751,5 +751,40 @@ if $rows != 0 then endi +sql insert into t1 values(1648791223000,2,2,3,1.0); +sql insert into t1 values(1648791223000,10,2,3,1.0); +sql insert into t1 values(1648791233000,10,2,3,1.0); + +$loop_count = 0 +loop16: +sleep 200 +sql select * from streamt4; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 2 then + print =====rows=$rows + goto loop16 +endi + +sql insert into t1 values(1648791233000,2,2,3,1.0); + +$loop_count = 0 +loop17: +sleep 200 +sql select * from streamt4; + +$loop_count = $loop_count + 1 +if $loop_count == 10 then + return -1 +endi + +if $rows != 1 then + print =====rows=$rows + goto loop17 +endi system sh/exec.sh -n dnode1 -s stop -x SIGINT From 4ae870bd81d78040f074a969d0c050a96133ac37 Mon Sep 17 00:00:00 2001 From: Pan YANG Date: Tue, 15 Nov 2022 09:24:20 +0800 Subject: [PATCH 16/49] docs: resolve ambiguous taosadapter heading --- docs/zh/14-reference/04-taosadapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/14-reference/04-taosadapter.md b/docs/zh/14-reference/04-taosadapter.md index ec023afd71..4e1e7b7ace 100644 --- a/docs/zh/14-reference/04-taosadapter.md +++ b/docs/zh/14-reference/04-taosadapter.md @@ -32,7 +32,7 @@ taosAdapter 提供以下功能: taosAdapter 是 TDengine 服务端软件 的一部分,如果您使用 TDengine server 您不需要任何额外的步骤来安装 taosAdapter。您可以从[涛思数据官方网站](https://taosdata.com/cn/all-downloads/)下载 TDengine server 安装包。如果需要将 taosAdapter 分离部署在 TDengine server 之外的服务器上,则应该在该服务器上安装完整的 TDengine 来安装 taosAdapter。如果您需要使用源代码编译生成 taosAdapter,您可以参考[构建 taosAdapter](https://github.com/taosdata/taosadapter/blob/3.0/BUILD-CN.md)文档。 -### start/stop taosAdapter +### 启动/停止 taosAdapter 在 Linux 系统上 taosAdapter 服务默认由 systemd 管理。使用命令 `systemctl start taosadapter` 可以启动 taosAdapter 服务。使用命令 `systemctl stop taosadapter` 可以停止 taosAdapter 服务。 From 14b4adc6ce79038ba9890c1f451fce260d57ff17 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Tue, 15 Nov 2022 09:39:17 +0800 Subject: [PATCH 17/49] fix: memory leak --- source/libs/scalar/src/filter.c | 24 ++--- source/libs/scalar/src/scalar.c | 149 +++++++++++++++++--------------- 2 files changed, 91 insertions(+), 82 deletions(-) diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index df9a818fee..f5376eaf9e 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -248,9 +248,9 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) { } } -// if (optr == OP_TYPE_JSON_CONTAINS && type == TSDB_DATA_TYPE_JSON) { -// return 28; -// } + // if (optr == OP_TYPE_JSON_CONTAINS && type == TSDB_DATA_TYPE_JSON) { + // return 28; + // } switch (type) { case TSDB_DATA_TYPE_BOOL: @@ -1087,7 +1087,7 @@ int32_t filterAddUnitImpl(SFilterInfo *info, uint8_t optr, SFilterFieldId *left, if (tmp == NULL) { return TSDB_CODE_OUT_OF_MEMORY; } - info->units = (SFilterUnit*)tmp; + info->units = (SFilterUnit *)tmp; memset(info->units + psize, 0, sizeof(*info->units) * FILTER_DEFAULT_UNIT_SIZE); } @@ -1169,7 +1169,7 @@ int32_t fltAddGroupUnitFromNode(SFilterInfo *info, SNode *tree, SArray *group) { SScalarParam out = {.columnData = taosMemoryCalloc(1, sizeof(SColumnInfoData))}; out.columnData->info.type = type; - out.columnData->info.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes; //reserved space for simple_copy + out.columnData->info.bytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes; // reserved space for simple_copy for (int32_t i = 0; i < listNode->pNodeList->length; ++i) { SValueNode *valueNode = (SValueNode *)cell->pNode; @@ -1191,7 +1191,7 @@ int32_t fltAddGroupUnitFromNode(SFilterInfo *info, SNode *tree, SArray *group) { filterAddField(info, NULL, (void **)&out.columnData->pData, FLD_TYPE_VALUE, &right, len, true); out.columnData->pData = NULL; } else { - void *data = taosMemoryCalloc(1, tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes); //reserved space for simple_copy + void *data = taosMemoryCalloc(1, tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes); // reserved space for simple_copy if (NULL == data) { FLT_ERR_RET(TSDB_CODE_QRY_OUT_OF_MEMORY); } @@ -1633,11 +1633,11 @@ void filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t options) SValueNode *var = (SValueNode *)field->desc; SDataType *dType = &var->node.resType; - //if (dType->type == TSDB_DATA_TYPE_VALUE_ARRAY) { - // qDebug("VAL%d => [type:TS][val:[%" PRIi64 "] - [%" PRId64 "]]", i, *(int64_t *)field->data, - // *(((int64_t *)field->data) + 1)); - //} else { - qDebug("VAL%d => [type:%d][val:%" PRIx64 "]", i, dType->type, var->datum.i); // TODO + // if (dType->type == TSDB_DATA_TYPE_VALUE_ARRAY) { + // qDebug("VAL%d => [type:TS][val:[%" PRIi64 "] - [%" PRId64 "]]", i, *(int64_t *)field->data, + // *(((int64_t *)field->data) + 1)); + // } else { + qDebug("VAL%d => [type:%d][val:%" PRIx64 "]", i, dType->type, var->datum.i); // TODO //} } else if (field->data) { qDebug("VAL%d => [type:NIL][val:NIL]", i); // TODO @@ -1719,7 +1719,7 @@ void filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t options) ctx->isrange); if (ctx->isrange) { SFilterRangeNode *r = ctx->rs; - int32_t tlen = 0; + int32_t tlen = 0; while (r) { char str[256] = {0}; if (FILTER_GET_FLAG(r->ra.sflag, RANGE_FLG_NULL)) { diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index fa71009365..00d6ea21a4 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -23,12 +23,13 @@ int32_t scalarGetOperatorParamNum(EOperatorType type) { int32_t sclConvertToTsValueNode(int8_t precision, SValueNode *valueNode) { char *timeStr = valueNode->datum.p; - int32_t code = - convertStringToTimestamp(valueNode->node.resType.type, valueNode->datum.p, precision, &valueNode->datum.i); + int64_t value = 0; + int32_t code = convertStringToTimestamp(valueNode->node.resType.type, valueNode->datum.p, precision, &value); if (code != TSDB_CODE_SUCCESS) { return code; } taosMemoryFree(timeStr); + valueNode->datum.i = value; valueNode->typeData = valueNode->datum.i; valueNode->node.resType.type = TSDB_DATA_TYPE_TIMESTAMP; @@ -61,7 +62,7 @@ int32_t sclCreateColumnInfoData(SDataType *pType, int32_t numOfRows, SScalarPara return TSDB_CODE_SUCCESS; } -int32_t sclConvertValueToSclParam(SValueNode* pValueNode, SScalarParam* out, int32_t* overflow) { +int32_t sclConvertValueToSclParam(SValueNode *pValueNode, SScalarParam *out, int32_t *overflow) { SScalarParam in = {.numOfRows = 1}; int32_t code = sclCreateColumnInfoData(&pValueNode->node.resType, 1, &in); if (code != TSDB_CODE_SUCCESS) { @@ -78,7 +79,7 @@ int32_t sclConvertValueToSclParam(SValueNode* pValueNode, SScalarParam* out, int } int32_t sclExtendResRows(SScalarParam *pDst, SScalarParam *pSrc, SArray *pBlockList) { - SSDataBlock* pb = taosArrayGetP(pBlockList, 0); + SSDataBlock *pb = taosArrayGetP(pBlockList, 0); SScalarParam *pLeft = taosMemoryCalloc(1, sizeof(SScalarParam)); if (NULL == pLeft) { sclError("calloc %d failed", (int32_t)sizeof(SScalarParam)); @@ -90,7 +91,7 @@ int32_t sclExtendResRows(SScalarParam *pDst, SScalarParam *pSrc, SArray *pBlockL if (pDst->numOfRows < pb->info.rows) { colInfoDataEnsureCapacity(pDst->columnData, pb->info.rows, true); } - + _bin_scalar_fn_t OperatorFn = getBinScalarOperatorFn(OP_TYPE_ASSIGN); OperatorFn(pLeft, pSrc, pDst, TSDB_ORDER_ASC); @@ -566,7 +567,7 @@ _return: SCL_RET(code); } -int32_t sclGetNodeRes(SNode* node, SScalarCtx *ctx, SScalarParam **res) { +int32_t sclGetNodeRes(SNode *node, SScalarCtx *ctx, SScalarParam **res) { if (NULL == node) { return TSDB_CODE_SUCCESS; } @@ -576,48 +577,53 @@ int32_t sclGetNodeRes(SNode* node, SScalarCtx *ctx, SScalarParam **res) { if (NULL == *res) { SCL_ERR_RET(TSDB_CODE_OUT_OF_MEMORY); } - + SCL_ERR_RET(sclInitParam(node, *res, ctx, &rowNum)); return TSDB_CODE_SUCCESS; } -int32_t sclWalkCaseWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCell, SScalarParam *pCase, SScalarParam *pElse, SScalarParam *pComp, SScalarParam *output, int32_t rowIdx, int32_t totalRows, bool *complete) { - SNode *node = NULL; - SWhenThenNode* pWhenThen = NULL; - SScalarParam *pWhen = NULL; - SScalarParam *pThen = NULL; - int32_t code = 0; +int32_t sclWalkCaseWhenList(SScalarCtx *ctx, SNodeList *pList, struct SListCell *pCell, SScalarParam *pCase, + SScalarParam *pElse, SScalarParam *pComp, SScalarParam *output, int32_t rowIdx, + int32_t totalRows, bool *complete) { + SNode *node = NULL; + SWhenThenNode *pWhenThen = NULL; + SScalarParam *pWhen = NULL; + SScalarParam *pThen = NULL; + int32_t code = 0; + + for (SListCell *cell = pCell; (NULL != cell ? (node = cell->pNode, true) : (node = NULL, false)); + cell = cell->pNext) { + pWhenThen = (SWhenThenNode *)node; - for (SListCell* cell = pCell; (NULL != cell ? (node = cell->pNode, true) : (node = NULL, false)); cell = cell->pNext) { - pWhenThen = (SWhenThenNode*)node; - SCL_ERR_RET(sclGetNodeRes(pWhenThen->pWhen, ctx, &pWhen)); SCL_ERR_RET(sclGetNodeRes(pWhenThen->pThen, ctx, &pThen)); - + vectorCompareImpl(pCase, pWhen, pComp, rowIdx, 1, TSDB_ORDER_ASC, OP_TYPE_EQUAL); - - bool *equal = (bool*)colDataGetData(pComp->columnData, rowIdx); + + bool *equal = (bool *)colDataGetData(pComp->columnData, rowIdx); if (*equal) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0))); + colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), + colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0))); if (0 == rowIdx && 1 == pCase->numOfRows && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); *complete = true; } - + goto _return; } } if (pElse) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0))); + colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), + colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0))); if (0 == rowIdx && 1 == pCase->numOfRows && 1 == pElse->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); *complete = true; } - + goto _return; } @@ -629,7 +635,7 @@ int32_t sclWalkCaseWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* } _return: - + sclFreeParam(pWhen); sclFreeParam(pThen); taosMemoryFree(pWhen); @@ -638,32 +644,34 @@ _return: SCL_RET(code); } -int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCell, SScalarParam *pElse, SScalarParam *output, - int32_t rowIdx, int32_t totalRows, bool *complete, bool preSingle) { - SNode *node = NULL; - SWhenThenNode* pWhenThen = NULL; - SScalarParam *pWhen = NULL; - SScalarParam *pThen = NULL; - int32_t code = 0; +int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList *pList, struct SListCell *pCell, SScalarParam *pElse, + SScalarParam *output, int32_t rowIdx, int32_t totalRows, bool *complete, bool preSingle) { + SNode *node = NULL; + SWhenThenNode *pWhenThen = NULL; + SScalarParam *pWhen = NULL; + SScalarParam *pThen = NULL; + int32_t code = 0; - for (SListCell* cell = pCell; (NULL != cell ? (node = cell->pNode, true) : (node = NULL, false)); cell = cell->pNext) { - pWhenThen = (SWhenThenNode*)node; + for (SListCell *cell = pCell; (NULL != cell ? (node = cell->pNode, true) : (node = NULL, false)); + cell = cell->pNext) { + pWhenThen = (SWhenThenNode *)node; pWhen = NULL; pThen = NULL; - + SCL_ERR_JRET(sclGetNodeRes(pWhenThen->pWhen, ctx, &pWhen)); SCL_ERR_JRET(sclGetNodeRes(pWhenThen->pThen, ctx, &pThen)); - bool *whenValue = (bool*)colDataGetData(pWhen->columnData, (pWhen->numOfRows > 1 ? rowIdx : 0)); - + bool *whenValue = (bool *)colDataGetData(pWhen->columnData, (pWhen->numOfRows > 1 ? rowIdx : 0)); + if (*whenValue) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0))); + colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), + colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0))); if (preSingle && 0 == rowIdx && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); *complete = true; } - + goto _return; } @@ -674,13 +682,14 @@ int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCe } if (pElse) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0))); + colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), + colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0))); if (preSingle && 0 == rowIdx && 1 == pElse->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); *complete = true; } - + goto _return; } @@ -860,14 +869,14 @@ _return: } int32_t sclExecCaseWhen(SCaseWhenNode *node, SScalarCtx *ctx, SScalarParam *output) { - int32_t code = 0; + int32_t code = 0; SScalarParam *pCase = NULL; SScalarParam *pElse = NULL; SScalarParam *pWhen = NULL; SScalarParam *pThen = NULL; SScalarParam comp = {0}; - int32_t rowNum = 1; - bool complete = false; + int32_t rowNum = 1; + bool complete = false; if (NULL == node->pWhenThenList || node->pWhenThenList->length <= 0) { sclError("invalid whenThen list"); @@ -875,24 +884,24 @@ int32_t sclExecCaseWhen(SCaseWhenNode *node, SScalarCtx *ctx, SScalarParam *outp } if (ctx->pBlockList) { - SSDataBlock* pb = taosArrayGetP(ctx->pBlockList, 0); + SSDataBlock *pb = taosArrayGetP(ctx->pBlockList, 0); rowNum = pb->info.rows; output->numOfRows = pb->info.rows; } SCL_ERR_JRET(sclCreateColumnInfoData(&node->node.resType, rowNum, output)); - + SCL_ERR_JRET(sclGetNodeRes(node->pCase, ctx, &pCase)); SCL_ERR_JRET(sclGetNodeRes(node->pElse, ctx, &pElse)); SDataType compType = {0}; compType.type = TSDB_DATA_TYPE_BOOL; compType.bytes = tDataTypes[compType.type].bytes; - + SCL_ERR_JRET(sclCreateColumnInfoData(&compType, rowNum, &comp)); - SNode* tnode = NULL; - SWhenThenNode* pWhenThen = (SWhenThenNode*)node->pWhenThenList->pHead->pNode; + SNode *tnode = NULL; + SWhenThenNode *pWhenThen = (SWhenThenNode *)node->pWhenThenList->pHead->pNode; SCL_ERR_JRET(sclGetNodeRes(pWhenThen->pWhen, ctx, &pWhen)); SCL_ERR_JRET(sclGetNodeRes(pWhenThen->pThen, ctx, &pThen)); @@ -903,17 +912,19 @@ int32_t sclExecCaseWhen(SCaseWhenNode *node, SScalarCtx *ctx, SScalarParam *outp if (pCase) { vectorCompare(pCase, pWhen, &comp, TSDB_ORDER_ASC, OP_TYPE_EQUAL); - + for (int32_t i = 0; i < rowNum; ++i) { - bool *equal = (bool*)colDataGetData(comp.columnData, (comp.numOfRows > 1 ? i : 0)); + bool *equal = (bool *)colDataGetData(comp.columnData, (comp.numOfRows > 1 ? i : 0)); if (*equal) { - colDataAppend(output->columnData, i, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? i : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? i : 0))); + colDataAppend(output->columnData, i, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? i : 0)), + colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? i : 0))); if (0 == i && 1 == pCase->numOfRows && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && rowNum > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); break; } } else { - SCL_ERR_JRET(sclWalkCaseWhenList(ctx, node->pWhenThenList, node->pWhenThenList->pHead->pNext, pCase, pElse, &comp, output, i, rowNum, &complete)); + SCL_ERR_JRET(sclWalkCaseWhenList(ctx, node->pWhenThenList, node->pWhenThenList->pHead->pNext, pCase, pElse, + &comp, output, i, rowNum, &complete)); if (complete) { break; } @@ -921,15 +932,17 @@ int32_t sclExecCaseWhen(SCaseWhenNode *node, SScalarCtx *ctx, SScalarParam *outp } } else { for (int32_t i = 0; i < rowNum; ++i) { - bool *whenValue = (bool*)colDataGetData(pWhen->columnData, (pWhen->numOfRows > 1 ? i : 0)); + bool *whenValue = (bool *)colDataGetData(pWhen->columnData, (pWhen->numOfRows > 1 ? i : 0)); if (*whenValue) { - colDataAppend(output->columnData, i, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? i : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? i : 0))); + colDataAppend(output->columnData, i, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? i : 0)), + colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? i : 0))); if (0 == i && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && rowNum > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); break; } } else { - SCL_ERR_JRET(sclWalkWhenList(ctx, node->pWhenThenList, node->pWhenThenList->pHead->pNext, pElse, output, i, rowNum, &complete, (pWhen->numOfRows == 1 && pThen->numOfRows == 1))); + SCL_ERR_JRET(sclWalkWhenList(ctx, node->pWhenThenList, node->pWhenThenList->pHead->pNext, pElse, output, i, + rowNum, &complete, (pWhen->numOfRows == 1 && pThen->numOfRows == 1))); if (complete) { break; } @@ -965,7 +978,6 @@ _return: SCL_RET(code); } - EDealRes sclRewriteNullInOptr(SNode **pNode, SScalarCtx *ctx, EOperatorType opType) { if (opType <= OP_TYPE_CALC_MAX) { SValueNode *res = (SValueNode *)nodesMakeNode(QUERY_NODE_VALUE); @@ -1089,8 +1101,7 @@ EDealRes sclRewriteNonConstOperator(SNode **pNode, SScalarCtx *ctx) { EDealRes sclRewriteFunction(SNode **pNode, SScalarCtx *ctx) { SFunctionNode *node = (SFunctionNode *)*pNode; SNode *tnode = NULL; - if ((!fmIsScalarFunc(node->funcId) && (!ctx->dual)) || - fmIsUserDefinedFunc(node->funcId)) { + if ((!fmIsScalarFunc(node->funcId) && (!ctx->dual)) || fmIsUserDefinedFunc(node->funcId)) { return DEAL_RES_CONTINUE; } @@ -1229,20 +1240,20 @@ EDealRes sclRewriteOperator(SNode **pNode, SScalarCtx *ctx) { return DEAL_RES_CONTINUE; } -EDealRes sclRewriteCaseWhen(SNode** pNode, SScalarCtx *ctx) { +EDealRes sclRewriteCaseWhen(SNode **pNode, SScalarCtx *ctx) { SCaseWhenNode *node = (SCaseWhenNode *)*pNode; if ((!SCL_IS_CONST_NODE(node->pCase)) || (!SCL_IS_CONST_NODE(node->pElse))) { return DEAL_RES_CONTINUE; } - SNode* tnode = NULL; + SNode *tnode = NULL; FOREACH(tnode, node->pWhenThenList) { - SWhenThenNode* pWhenThen = (SWhenThenNode*)tnode; + SWhenThenNode *pWhenThen = (SWhenThenNode *)tnode; if (!SCL_IS_CONST_NODE(pWhenThen->pWhen) || !SCL_IS_CONST_NODE(pWhenThen->pThen)) { return DEAL_RES_CONTINUE; } - } + } SScalarParam output = {0}; ctx->code = sclExecCaseWhen(node, ctx, &output); @@ -1275,13 +1286,12 @@ EDealRes sclRewriteCaseWhen(SNode** pNode, SScalarCtx *ctx) { } nodesDestroyNode(*pNode); - *pNode = (SNode*)res; + *pNode = (SNode *)res; sclFreeParam(&output); return DEAL_RES_CONTINUE; } - EDealRes sclConstantsRewriter(SNode **pNode, void *pContext) { SScalarCtx *ctx = (SScalarCtx *)pContext; @@ -1408,9 +1418,9 @@ EDealRes sclWalkTarget(SNode *pNode, SScalarCtx *ctx) { return DEAL_RES_CONTINUE; } -EDealRes sclWalkCaseWhen(SNode* pNode, SScalarCtx *ctx) { +EDealRes sclWalkCaseWhen(SNode *pNode, SScalarCtx *ctx) { SCaseWhenNode *node = (SCaseWhenNode *)pNode; - SScalarParam output = {0}; + SScalarParam output = {0}; ctx->code = sclExecCaseWhen(node, ctx, &output); if (ctx->code) { @@ -1425,11 +1435,10 @@ EDealRes sclWalkCaseWhen(SNode* pNode, SScalarCtx *ctx) { return DEAL_RES_CONTINUE; } - EDealRes sclCalcWalker(SNode *pNode, void *pContext) { - if (QUERY_NODE_VALUE == nodeType(pNode) || QUERY_NODE_NODE_LIST == nodeType(pNode) - || QUERY_NODE_COLUMN == nodeType(pNode) || QUERY_NODE_LEFT_VALUE == nodeType(pNode) - || QUERY_NODE_WHEN_THEN == nodeType(pNode)) { + if (QUERY_NODE_VALUE == nodeType(pNode) || QUERY_NODE_NODE_LIST == nodeType(pNode) || + QUERY_NODE_COLUMN == nodeType(pNode) || QUERY_NODE_LEFT_VALUE == nodeType(pNode) || + QUERY_NODE_WHEN_THEN == nodeType(pNode)) { return DEAL_RES_CONTINUE; } From f59318a1f1e4ec10e83eb6b03b00c7fd188a99b5 Mon Sep 17 00:00:00 2001 From: Pan YANG Date: Tue, 15 Nov 2022 09:57:10 +0800 Subject: [PATCH 18/49] fix: skip bug of Docusaurus --- docs/zh/05-get-started/01-docker.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/zh/05-get-started/01-docker.md b/docs/zh/05-get-started/01-docker.md index e772447db0..c6ae07c7c1 100644 --- a/docs/zh/05-get-started/01-docker.md +++ b/docs/zh/05-get-started/01-docker.md @@ -4,6 +4,9 @@ title: 通过 Docker 快速体验 TDengine description: 使用 Docker 快速体验 TDengine 的高效写入和查询 --- +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + 本节首先介绍如何通过 Docker 快速体验 TDengine,然后介绍如何在 Docker 环境下体验 TDengine 的写入和查询功能。如果你不熟悉 Docker,请使用[安装包的方式快速体验](../../get-started/package/)。如果您希望为 TDengine 贡献代码或对内部技术实现感兴趣,请参考 [TDengine GitHub 主页](https://github.com/taosdata/TDengine)下载源码构建和安装。 ## 启动 TDengine From 3562011b93edec561180bd8547d3a10e0aeea08d Mon Sep 17 00:00:00 2001 From: wade zhang <95411902+gccgdb1234@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:27:45 +0800 Subject: [PATCH 19/49] Update 02-database.md --- docs/zh/12-taos-sql/02-database.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/zh/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md index c76311f008..f1e7b0a385 100644 --- a/docs/zh/12-taos-sql/02-database.md +++ b/docs/zh/12-taos-sql/02-database.md @@ -142,7 +142,7 @@ SHOW CREATE DATABASE db_name; ### 查看数据库参数 ```sql -SHOW DATABASES \G; +select * from information_schema.ins_databases \G; ``` 会列出系统中所有数据库的配置参数,并且每行只显示一个参数。 From 5b8d0ae83715b59239efa608c741f3877fa966c2 Mon Sep 17 00:00:00 2001 From: wade zhang <95411902+gccgdb1234@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:28:09 +0800 Subject: [PATCH 20/49] Update 02-database.md --- docs/en/12-taos-sql/02-database.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md index 5a84bbf370..1aab3971e5 100644 --- a/docs/en/12-taos-sql/02-database.md +++ b/docs/en/12-taos-sql/02-database.md @@ -142,7 +142,7 @@ The preceding SQL statement can be used in migration scenarios. This command can ### View Database Configuration ```sql -SHOW DATABASES \G; +select * from information_schema.ins_databases \G; ``` The preceding SQL statement shows the value of each parameter for the specified database. One value is displayed per line. From 0d003bbb5d23d11854f03fdcc8492f314bb392ef Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 10:30:54 +0800 Subject: [PATCH 21/49] fix: memory in smworker.c --- source/dnode/mgmt/mgmt_snode/src/smWorker.c | 1 + tests/parallel_test/cases.task | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source/dnode/mgmt/mgmt_snode/src/smWorker.c b/source/dnode/mgmt/mgmt_snode/src/smWorker.c index 1381d4c391..f6942c8114 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smWorker.c +++ b/source/dnode/mgmt/mgmt_snode/src/smWorker.c @@ -122,6 +122,7 @@ void smStopWorker(SSnodeMgmt *pMgmt) { for (int32_t i = 0; i < taosArrayGetSize(pMgmt->writeWroker); i++) { SMultiWorker *pWorker = taosArrayGetP(pMgmt->writeWroker, i); tMultiWorkerCleanup(pWorker); + taosMemoryFree(pWorker); } taosArrayDestroy(pMgmt->writeWroker); tSingleWorkerCleanup(&pMgmt->streamWorker); diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index fac4210d88..bb2e101c06 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -98,7 +98,7 @@ ,,y,script,./test.sh -f tsim/parser/columnValue_int.sim ,,y,script,./test.sh -f tsim/parser/columnValue_smallint.sim ,,y,script,./test.sh -f tsim/parser/columnValue_tinyint.sim -,,,script,./test.sh -f tsim/parser/columnValue_unsign.sim +,,y,script,./test.sh -f tsim/parser/columnValue_unsign.sim ,,y,script,./test.sh -f tsim/parser/commit.sim ,,y,script,./test.sh -f tsim/parser/condition.sim ,,y,script,./test.sh -f tsim/parser/constCol.sim @@ -172,7 +172,7 @@ ,,,script,./test.sh -f tsim/query/session.sim ,,,script,./test.sh -f tsim/query/udf.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim -,,,script,./test.sh -f tsim/snode/basic1.sim +,,y,script,./test.sh -f tsim/snode/basic1.sim ,,,script,./test.sh -f tsim/mnode/basic1.sim ,,,script,./test.sh -f tsim/mnode/basic2.sim ,,,script,./test.sh -f tsim/mnode/basic3.sim @@ -208,12 +208,12 @@ ,,y,script,./test.sh -f tsim/table/tinyint.sim ,,y,script,./test.sh -f tsim/table/vgroup.sim ,,,script,./test.sh -f tsim/stream/basic0.sim -g -,,,script,./test.sh -f tsim/stream/basic1.sim +,,y,script,./test.sh -f tsim/stream/basic1.sim ,,y,script,./test.sh -f tsim/stream/basic2.sim ,,,script,./test.sh -f tsim/stream/drop_stream.sim ,,y,script,./test.sh -f tsim/stream/fillHistoryBasic1.sim ,,y,script,./test.sh -f tsim/stream/fillHistoryBasic2.sim -,,,script,./test.sh -f tsim/stream/fillHistoryBasic3.sim +,,y,script,./test.sh -f tsim/stream/fillHistoryBasic3.sim ,,y,script,./test.sh -f tsim/stream/distributeInterval0.sim ,,,script,./test.sh -f tsim/stream/distributeIntervalRetrive0.sim ,,,script,./test.sh -f tsim/stream/distributeSession0.sim @@ -222,11 +222,11 @@ ,,,script,./test.sh -f tsim/stream/state0.sim ,,,script,./test.sh -f tsim/stream/triggerInterval0.sim ,,,script,./test.sh -f tsim/stream/triggerSession0.sim -,,,script,./test.sh -f tsim/stream/partitionby.sim -,,,script,./test.sh -f tsim/stream/partitionby1.sim +,,y,script,./test.sh -f tsim/stream/partitionby.sim +,,y,script,./test.sh -f tsim/stream/partitionby1.sim ,,y,script,./test.sh -f tsim/stream/schedSnode.sim ,,,script,./test.sh -f tsim/stream/windowClose.sim -,,,script,./test.sh -f tsim/stream/ignoreExpiredData.sim +,,y,script,./test.sh -f tsim/stream/ignoreExpiredData.sim ,,y,script,./test.sh -f tsim/stream/sliding.sim ,,,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim ,,,script,./test.sh -f tsim/stream/partitionbyColumnSession.sim From 6fdaa442ada74ea72968eeb67b28e96ca7869e1a Mon Sep 17 00:00:00 2001 From: wade zhang <95411902+gccgdb1234@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:32:21 +0800 Subject: [PATCH 22/49] Update 02-database.md --- docs/en/12-taos-sql/02-database.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/12-taos-sql/02-database.md b/docs/en/12-taos-sql/02-database.md index 1aab3971e5..a12406fe43 100644 --- a/docs/en/12-taos-sql/02-database.md +++ b/docs/en/12-taos-sql/02-database.md @@ -142,7 +142,7 @@ The preceding SQL statement can be used in migration scenarios. This command can ### View Database Configuration ```sql -select * from information_schema.ins_databases \G; +SELECT * FROM INFORMATION_SCHEMA.INS_DATABASES WHERE NAME='DBNAME' \G; ``` The preceding SQL statement shows the value of each parameter for the specified database. One value is displayed per line. From 49b6b8752d42ed091cf03a7fe16b10065585a1b0 Mon Sep 17 00:00:00 2001 From: wade zhang <95411902+gccgdb1234@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:32:56 +0800 Subject: [PATCH 23/49] Update 02-database.md --- docs/zh/12-taos-sql/02-database.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/12-taos-sql/02-database.md b/docs/zh/12-taos-sql/02-database.md index f1e7b0a385..3918f240b4 100644 --- a/docs/zh/12-taos-sql/02-database.md +++ b/docs/zh/12-taos-sql/02-database.md @@ -142,10 +142,10 @@ SHOW CREATE DATABASE db_name; ### 查看数据库参数 ```sql -select * from information_schema.ins_databases \G; +SELECT * FROM INFORMATION_SCHEMA.INS_DATABASES WHERE NAME='DBNAME' \G; ``` -会列出系统中所有数据库的配置参数,并且每行只显示一个参数。 +会列出指定数据库的配置参数,并且每行只显示一个参数。 ## 删除过期数据 From 18eec5f351ece19d1573d2ab65068ff651905dd4 Mon Sep 17 00:00:00 2001 From: Pan YANG Date: Tue, 15 Nov 2022 10:35:04 +0800 Subject: [PATCH 24/49] fix: skip bug of Docusaurus --- docs/en/05-get-started/01-docker.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/en/05-get-started/01-docker.md b/docs/en/05-get-started/01-docker.md index ac273daba4..0f9d79d34f 100644 --- a/docs/en/05-get-started/01-docker.md +++ b/docs/en/05-get-started/01-docker.md @@ -3,6 +3,9 @@ sidebar_label: Docker title: Quick Install on Docker --- +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + This document describes how to install TDengine in a Docker container and perform queries and inserts. - The easiest way to explore TDengine is through [TDengine Cloud](http://cloud.tdengine.com). From a6a76adcbdd23738e336439f0bed6a2429c337fc Mon Sep 17 00:00:00 2001 From: Pan YANG Date: Tue, 15 Nov 2022 11:34:06 +0800 Subject: [PATCH 25/49] docs: fix bugs of style and import --- docs/en/05-get-started/01-docker.md | 3 -- docs/en/05-get-started/index.md | 10 +++---- docs/zh/05-get-started/01-docker.md | 3 -- docs/zh/05-get-started/index.md | 12 ++++---- docs/zh/14-reference/07-tdinsight/index.mdx | 33 ++++++++++++--------- 5 files changed, 30 insertions(+), 31 deletions(-) diff --git a/docs/en/05-get-started/01-docker.md b/docs/en/05-get-started/01-docker.md index 0f9d79d34f..ac273daba4 100644 --- a/docs/en/05-get-started/01-docker.md +++ b/docs/en/05-get-started/01-docker.md @@ -3,9 +3,6 @@ sidebar_label: Docker title: Quick Install on Docker --- -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; - This document describes how to install TDengine in a Docker container and perform queries and inserts. - The easiest way to explore TDengine is through [TDengine Cloud](http://cloud.tdengine.com). diff --git a/docs/en/05-get-started/index.md b/docs/en/05-get-started/index.md index fec734b64d..373fa6e811 100644 --- a/docs/en/05-get-started/index.md +++ b/docs/en/05-get-started/index.md @@ -24,10 +24,10 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; - - - - - + + + + +
Star GitHub

Star GitHub

Join Discord

Join Discord

Follow Twitter

Follow Twitter

Subscribe YouTube

Subscribe YouTube

Follow LinkedIn

Follow LinkedIn

Star GitHub

Star GitHub

Join Discord

Join Discord

Follow Twitter

Follow Twitter

Subscribe YouTube

Subscribe YouTube

Follow LinkedIn

Follow LinkedIn

diff --git a/docs/zh/05-get-started/01-docker.md b/docs/zh/05-get-started/01-docker.md index c6ae07c7c1..e772447db0 100644 --- a/docs/zh/05-get-started/01-docker.md +++ b/docs/zh/05-get-started/01-docker.md @@ -4,9 +4,6 @@ title: 通过 Docker 快速体验 TDengine description: 使用 Docker 快速体验 TDengine 的高效写入和查询 --- -import Tabs from "@theme/Tabs"; -import TabItem from "@theme/TabItem"; - 本节首先介绍如何通过 Docker 快速体验 TDengine,然后介绍如何在 Docker 环境下体验 TDengine 的写入和查询功能。如果你不熟悉 Docker,请使用[安装包的方式快速体验](../../get-started/package/)。如果您希望为 TDengine 贡献代码或对内部技术实现感兴趣,请参考 [TDengine GitHub 主页](https://github.com/taosdata/TDengine)下载源码构建和安装。 ## 启动 TDengine diff --git a/docs/zh/05-get-started/index.md b/docs/zh/05-get-started/index.md index 092523a556..253eeeac01 100644 --- a/docs/zh/05-get-started/index.md +++ b/docs/zh/05-get-started/index.md @@ -24,13 +24,13 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; - - - + + + - - - + + +
小 T 的二维码TDengine 微信视频号TDengine 微信公众号小 T 的二维码TDengine 微信视频号TDengine 微信公众号
加入“物联网大数据技术前沿群”
与大家进行技术交流
关注 TDengine 微信视频号
收看技术直播与教学视频
关注 TDengine 微信公众号
阅读核心技术与行业案例文章
加入“物联网大数据技术前沿群”
与大家进行技术交流
关注 TDengine 微信视频号
收看技术直播与教学视频
关注 TDengine 微信公众号
阅读核心技术与行业案例文章
diff --git a/docs/zh/14-reference/07-tdinsight/index.mdx b/docs/zh/14-reference/07-tdinsight/index.mdx index ecd6362143..7f4c46a636 100644 --- a/docs/zh/14-reference/07-tdinsight/index.mdx +++ b/docs/zh/14-reference/07-tdinsight/index.mdx @@ -4,6 +4,9 @@ sidebar_label: TDinsight description: 基于Grafana的TDengine零依赖监控解决方案 --- +import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + TDinsight 是使用监控数据库和 [Grafana] 对 TDengine 进行监控的解决方案。 TDengine 通过 [taosKeeper](../taosKeeper) 将服务器的 CPU、内存、硬盘空间、带宽、请求数、磁盘读写速度、慢查询等信息定时写入指定数据库,并对重要的系统操作(比如登录、创建、删除数据库等)以及各种错误报警信息进行记录。通过 [Grafana] 和 [TDengine 数据源插件](https://github.com/taosdata/grafanaplugin/releases),TDinsight 将集群状态、节点信息、插入及查询请求、资源使用情况等进行可视化展示,同时还支持 vnode、dnode、mnode 节点状态异常告警,为开发者实时监控 TDengine 集群运行状态提供了便利。本文将指导用户安装 Grafana 服务器并通过 `TDinsight.sh` 安装脚本自动安装 TDengine 数据源插件及部署 TDinsight 可视化面板。 @@ -41,6 +44,7 @@ sudo apt-get install grafana ``` ### 在 CentOS / RHEL 上安装 Grafana + @@ -127,20 +131,20 @@ Install and configure TDinsight dashboard in Grafana on Ubuntu 18.04/20.04 syste 大多数命令行选项都可以通过环境变量获得同样的效果。 -| 短选项 | 长选项 | 环境变量 | 说明 | -| ------ | -------------------------- | ---------------------------- | --------------------------------------------------------------------------- | -| -v | --plugin-version | TDENGINE_PLUGIN_VERSION | TDengine 数据源插件版本,默认使用最新版。 | -| -P | --grafana-provisioning-dir | GF_PROVISIONING_DIR | Grafana 配置目录,默认为`/etc/grafana/provisioning/` | -| -G | --grafana-plugins-dir | GF_PLUGINS_DIR | Grafana 插件目录,默认为`/var/lib/grafana/plugins`。 | -| -O | --grafana-org-id | GF_ORG_ID | Grafana 组织 ID,默认为 1。 | -| -n | --tdengine-ds-name | TDENGINE_DS_NAME | TDengine 数据源名称,默认为 TDengine。 | -| -a | --tdengine-api | TDENGINE_API | TDengine REST API 端点。默认为`http://127.0.0.1:6041`。 | -| -u | --tdengine-user | TDENGINE_USER | TDengine 用户名。 [默认值:root] | -| -p | --tdengine-密码 | TDENGINE_PASSWORD | TDengine 密码。 [默认:taosdata] | -| -i | --tdinsight-uid | TDINSIGHT_DASHBOARD_UID | TDinsight 仪表盘`uid`。 [默认值:tdinsight] | -| -t | --tdinsight-title | TDINSIGHT_DASHBOARD_TITLE | TDinsight 仪表盘标题。 [默认:TDinsight] | -| -e | --tdinsight-可编辑 | TDINSIGHT_DASHBOARD_EDITABLE | 如果配置仪表盘可以编辑。 [默认值:false] | -| -E | --external-notifier | EXTERNAL_NOTIFIER | 将外部通知程序 uid 应用于 TDinsight 仪表盘。 | +| 短选项 | 长选项 | 环境变量 | 说明 | +| ------ | -------------------------- | ---------------------------- | ------------------------------------------------------- | +| -v | --plugin-version | TDENGINE_PLUGIN_VERSION | TDengine 数据源插件版本,默认使用最新版。 | +| -P | --grafana-provisioning-dir | GF_PROVISIONING_DIR | Grafana 配置目录,默认为`/etc/grafana/provisioning/` | +| -G | --grafana-plugins-dir | GF_PLUGINS_DIR | Grafana 插件目录,默认为`/var/lib/grafana/plugins`。 | +| -O | --grafana-org-id | GF_ORG_ID | Grafana 组织 ID,默认为 1。 | +| -n | --tdengine-ds-name | TDENGINE_DS_NAME | TDengine 数据源名称,默认为 TDengine。 | +| -a | --tdengine-api | TDENGINE_API | TDengine REST API 端点。默认为`http://127.0.0.1:6041`。 | +| -u | --tdengine-user | TDENGINE_USER | TDengine 用户名。 [默认值:root] | +| -p | --tdengine-密码 | TDENGINE_PASSWORD | TDengine 密码。 [默认:taosdata] | +| -i | --tdinsight-uid | TDINSIGHT_DASHBOARD_UID | TDinsight 仪表盘`uid`。 [默认值:tdinsight] | +| -t | --tdinsight-title | TDINSIGHT_DASHBOARD_TITLE | TDinsight 仪表盘标题。 [默认:TDinsight] | +| -e | --tdinsight-可编辑 | TDINSIGHT_DASHBOARD_EDITABLE | 如果配置仪表盘可以编辑。 [默认值:false] | +| -E | --external-notifier | EXTERNAL_NOTIFIER | 将外部通知程序 uid 应用于 TDinsight 仪表盘。 | 假设您在主机 `tdengine` 上启动 TDengine 数据库,HTTP API 端口为 `6041`,用户为 `root1`,密码为 `pass5ord`。执行脚本: @@ -196,6 +200,7 @@ sudo grafana-cli \ [plugins] allow_loading_unsigned_plugins = tdengine-datasource ``` + ::: ### 启动 Grafana 服务 From d985cb714f86e91a844c557eaca3fd3e5b87de71 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 15 Nov 2022 11:38:01 +0800 Subject: [PATCH 26/49] fix: fix asan issues --- source/libs/scalar/src/filter.c | 4 ++++ source/libs/scalar/src/scalar.c | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/source/libs/scalar/src/filter.c b/source/libs/scalar/src/filter.c index be085e6cbd..0f67947b1c 100644 --- a/source/libs/scalar/src/filter.c +++ b/source/libs/scalar/src/filter.c @@ -336,6 +336,10 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) { __compar_fn_t filterGetCompFunc(int32_t type, int32_t optr) { return gDataCompare[filterGetCompFuncIdx(type, optr)]; } __compar_fn_t filterGetCompFuncEx(int32_t lType, int32_t rType, int32_t optr) { + if (TSDB_DATA_TYPE_NULL == rType) { + return NULL; + } + switch (lType) { case TSDB_DATA_TYPE_TINYINT: { if (IS_SIGNED_NUMERIC_TYPE(rType) || IS_FLOAT_TYPE(rType)) { diff --git a/source/libs/scalar/src/scalar.c b/source/libs/scalar/src/scalar.c index fa71009365..3644855094 100644 --- a/source/libs/scalar/src/scalar.c +++ b/source/libs/scalar/src/scalar.c @@ -599,7 +599,9 @@ int32_t sclWalkCaseWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* bool *equal = (bool*)colDataGetData(pComp->columnData, rowIdx); if (*equal) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0))); + bool isNull = colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)); + char *pData = isNull ? NULL : colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)); + colDataAppend(output->columnData, rowIdx, pData, isNull); if (0 == rowIdx && 1 == pCase->numOfRows && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); @@ -611,7 +613,9 @@ int32_t sclWalkCaseWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* } if (pElse) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0))); + bool isNull = colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)); + char *pData = isNull ? NULL : colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)); + colDataAppend(output->columnData, rowIdx, pData, isNull); if (0 == rowIdx && 1 == pCase->numOfRows && 1 == pElse->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); @@ -657,7 +661,9 @@ int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCe bool *whenValue = (bool*)colDataGetData(pWhen->columnData, (pWhen->numOfRows > 1 ? rowIdx : 0)); if (*whenValue) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0))); + bool isNull = colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)); + char *pData = isNull ? NULL : colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)); + colDataAppend(output->columnData, rowIdx, pData, isNull); if (preSingle && 0 == rowIdx && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); @@ -674,7 +680,9 @@ int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCe } if (pElse) { - colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0))); + bool isNull = colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)); + char *pData = isNull ? NULL : colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)); + colDataAppend(output->columnData, rowIdx, pData, isNull); if (preSingle && 0 == rowIdx && 1 == pElse->numOfRows && totalRows > 1) { SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList)); From efde22f081ada7ac5f2e8ab07f0278c847a433fb Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 15 Nov 2022 11:59:29 +0800 Subject: [PATCH 27/49] fix: memory leak --- include/common/tmsg.h | 1 + source/common/src/tmsg.c | 1 + source/dnode/mnode/impl/src/mndSubscribe.c | 1 + source/dnode/vnode/src/inc/tq.h | 3 +-- source/dnode/vnode/src/tq/tq.c | 8 +++++--- source/dnode/vnode/src/tq/tqMeta.c | 4 ++-- source/libs/executor/src/executor.c | 18 ++++++++++-------- source/libs/wal/src/walMgmt.c | 8 ++++++++ source/libs/wal/src/walWrite.c | 2 +- 9 files changed, 30 insertions(+), 16 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 3281bca96a..afe54bce0b 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2627,6 +2627,7 @@ typedef struct { int32_t tEncodeSTqCheckInfo(SEncoder* pEncoder, const STqCheckInfo* pInfo); int32_t tDecodeSTqCheckInfo(SDecoder* pDecoder, STqCheckInfo* pInfo); +void tDeleteSTqCheckInfo(STqCheckInfo* pInfo); typedef struct { char topic[TSDB_TOPIC_FNAME_LEN]; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index bd8e34a395..fd445ff2ae 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -5903,6 +5903,7 @@ int32_t tDecodeSTqCheckInfo(SDecoder *pDecoder, STqCheckInfo *pInfo) { } return 0; } +void tDeleteSTqCheckInfo(STqCheckInfo *pInfo) { taosArrayDestroy(pInfo->colIdList); } int32_t tEncodeDeleteRes(SEncoder *pCoder, const SDeleteRes *pRes) { int32_t nUid = taosArrayGetSize(pRes->uidList); diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c index 71e0b09e02..14adeb0080 100644 --- a/source/dnode/mnode/impl/src/mndSubscribe.c +++ b/source/dnode/mnode/impl/src/mndSubscribe.c @@ -235,6 +235,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR taosHashPut(pHash, &pVgEp->vgId, sizeof(int32_t), &outputVg, sizeof(SMqRebOutputVg)); mInfo("mq rebalance: remove vgId:%d from consumer:%" PRId64, pVgEp->vgId, consumerId); } + taosArrayDestroy(pConsumerEp->vgs); taosHashRemove(pOutput->pSub->consumerHash, &consumerId, sizeof(int64_t)); // put into removed taosArrayPush(pOutput->removedConsumers, &consumerId); diff --git a/source/dnode/vnode/src/inc/tq.h b/source/dnode/vnode/src/inc/tq.h index ef54adf0d6..8ae1c8720c 100644 --- a/source/dnode/vnode/src/inc/tq.h +++ b/source/dnode/vnode/src/inc/tq.h @@ -88,8 +88,7 @@ typedef struct { STqExecTb execTb; STqExecDb execDb; }; - int32_t numOfCols; // number of out pout column, temporarily used - SSchemaWrapper* pSchemaWrapper; // columns that are involved in query + int32_t numOfCols; // number of out pout column, temporarily used } STqExecHandle; typedef struct { diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index f75dce8231..eafbd8464d 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -55,6 +55,7 @@ static void destroySTqHandle(void* data) { STqHandle* pData = (STqHandle*)data; qDestroyTask(pData->execHandle.task); if (pData->execHandle.subType == TOPIC_SUB_TYPE__COLUMN) { + taosMemoryFreeClear(pData->execHandle.execCol.qmsg); } else if (pData->execHandle.subType == TOPIC_SUB_TYPE__DB) { tqCloseReader(pData->execHandle.pExecReader); walCloseReader(pData->pWalReader); @@ -80,7 +81,6 @@ STQ* tqOpen(const char* path, SVnode* pVnode) { pTq->pVnode = pVnode; pTq->pHandle = taosHashInit(64, MurmurHash3_32, true, HASH_ENTRY_LOCK); - taosHashSetFreeFp(pTq->pHandle, destroySTqHandle); taosInitRWLatch(&pTq->pushLock); @@ -88,6 +88,7 @@ STQ* tqOpen(const char* path, SVnode* pVnode) { taosHashSetFreeFp(pTq->pPushMgr, tqPushEntryFree); pTq->pCheckInfo = taosHashInit(64, MurmurHash3_32, true, HASH_ENTRY_LOCK); + taosHashSetFreeFp(pTq->pCheckInfo, (FDelete)tDeleteSTqCheckInfo); if (tqMetaOpen(pTq) < 0) { ASSERT(0); @@ -779,6 +780,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL } if (req.newConsumerId == -1) { tqError("vgId:%d, tq invalid rebalance request, new consumerId %" PRId64 "", req.vgId, req.newConsumerId); + taosMemoryFree(req.qmsg); return 0; } STqHandle tqHandle = {0}; @@ -815,8 +817,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL req.qmsg = NULL; pHandle->execHandle.task = - qCreateQueueExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle, &pHandle->execHandle.numOfCols, - &pHandle->execHandle.pSchemaWrapper); + qCreateQueueExecTaskInfo(pHandle->execHandle.execCol.qmsg, &handle, &pHandle->execHandle.numOfCols, NULL); ASSERT(pHandle->execHandle.task); void* scanner = NULL; qExtractStreamScanner(pHandle->execHandle.task, &scanner); @@ -864,6 +865,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t version, char* msg, int32_t msgL atomic_store_32(&pHandle->epoch, -1); atomic_store_64(&pHandle->consumerId, req.newConsumerId); atomic_add_fetch_32(&pHandle->epoch, 1); + taosMemoryFree(req.qmsg); if (tqMetaSaveHandle(pTq, req.subKey, pHandle) < 0) { // TODO ASSERT(0); diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c index 27c491c86b..b021c5ee7f 100644 --- a/source/dnode/vnode/src/tq/tqMeta.c +++ b/source/dnode/vnode/src/tq/tqMeta.c @@ -305,8 +305,8 @@ int32_t tqMetaRestoreHandle(STQ* pTq) { }; if (handle.execHandle.subType == TOPIC_SUB_TYPE__COLUMN) { - handle.execHandle.task = qCreateQueueExecTaskInfo( - handle.execHandle.execCol.qmsg, &reader, &handle.execHandle.numOfCols, &handle.execHandle.pSchemaWrapper); + handle.execHandle.task = + qCreateQueueExecTaskInfo(handle.execHandle.execCol.qmsg, &reader, &handle.execHandle.numOfCols, NULL); ASSERT(handle.execHandle.task); void* scanner = NULL; qExtractStreamScanner(handle.execHandle.task, &scanner); diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 428af19a6c..e561b6e124 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -246,7 +246,9 @@ qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* readers, int32_t* n } } - *pSchema = tCloneSSchemaWrapper(((SExecTaskInfo*)pTaskInfo)->schemaInfo.qsw); + if (pSchema) { + *pSchema = tCloneSSchemaWrapper(((SExecTaskInfo*)pTaskInfo)->schemaInfo.qsw); + } return pTaskInfo; } @@ -659,7 +661,7 @@ int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t* useconds) { return pTaskInfo->code; } -int32_t qAppendTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo *pInfo) { +int32_t qAppendTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo* pInfo) { taosWLockLatch(&pTaskInfo->stopInfo.lock); taosArrayPush(pTaskInfo->stopInfo.pStopInfo, pInfo); taosWUnLockLatch(&pTaskInfo->stopInfo.lock); @@ -680,7 +682,7 @@ int32_t stopInfoComp(void const* lp, void const* rp) { return 0; } -void qRemoveTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo *pInfo) { +void qRemoveTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo* pInfo) { taosWLockLatch(&pTaskInfo->stopInfo.lock); int32_t idx = taosArraySearchIdx(pTaskInfo->stopInfo.pStopInfo, pInfo, stopInfoComp, TD_EQ); if (idx >= 0) { @@ -696,8 +698,8 @@ void qStopTaskOperators(SExecTaskInfo* pTaskInfo) { int32_t num = taosArrayGetSize(pTaskInfo->stopInfo.pStopInfo); for (int32_t i = 0; i < num; ++i) { - SExchangeOpStopInfo *pStop = taosArrayGet(pTaskInfo->stopInfo.pStopInfo, i); - SExchangeInfo* pExchangeInfo = taosAcquireRef(exchangeObjRefPool, pStop->refId); + SExchangeOpStopInfo* pStop = taosArrayGet(pTaskInfo->stopInfo.pStopInfo, i); + SExchangeInfo* pExchangeInfo = taosAcquireRef(exchangeObjRefPool, pStop->refId); if (pExchangeInfo) { tsem_post(&pExchangeInfo->ready); taosReleaseRef(exchangeObjRefPool, pStop->refId); @@ -715,11 +717,11 @@ int32_t qAsyncKillTask(qTaskInfo_t qinfo) { } qDebug("%s execTask async killed", GET_TASKID(pTaskInfo)); - + setTaskKilled(pTaskInfo); qStopTaskOperators(pTaskInfo); - + return TSDB_CODE_SUCCESS; } @@ -1178,4 +1180,4 @@ void qProcessRspMsg(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) { pSendInfo->fp(pSendInfo->param, &buf, pMsg->code); rpcFreeCont(pMsg->pCont); destroySendMsgInfo(pSendInfo); -} \ No newline at end of file +} diff --git a/source/libs/wal/src/walMgmt.c b/source/libs/wal/src/walMgmt.c index 1a70a3038f..b78d5ca6c1 100644 --- a/source/libs/wal/src/walMgmt.c +++ b/source/libs/wal/src/walMgmt.c @@ -203,6 +203,14 @@ void walClose(SWal *pWal) { pWal->pIdxFile = NULL; taosArrayDestroy(pWal->fileInfoSet); pWal->fileInfoSet = NULL; + + void *pIter = NULL; + while (1) { + pIter = taosHashIterate(pWal->pRefHash, pIter); + if (pIter == NULL) break; + SWalRef *pRef = *(SWalRef **)pIter; + taosMemoryFree(pRef); + } taosHashCleanup(pWal->pRefHash); taosThreadMutexUnlock(&pWal->mutex); diff --git a/source/libs/wal/src/walWrite.c b/source/libs/wal/src/walWrite.c index 216dd5fcb1..7c3b4cba30 100644 --- a/source/libs/wal/src/walWrite.c +++ b/source/libs/wal/src/walWrite.c @@ -26,7 +26,7 @@ int32_t walRestoreFromSnapshot(SWal *pWal, int64_t ver) { while (1) { pIter = taosHashIterate(pWal->pRefHash, pIter); if (pIter == NULL) break; - SWalRef *pRef = (SWalRef *)pIter; + SWalRef *pRef = *(SWalRef **)pIter; if (pRef->refVer != -1 && pRef->refVer <= ver) { taosHashCancelIterate(pWal->pRefHash, pIter); taosThreadMutexUnlock(&pWal->mutex); From 3bc7916ba3917daecde2550edbacba7bcd4dbaed Mon Sep 17 00:00:00 2001 From: Pan YANG Date: Tue, 15 Nov 2022 12:19:56 +0800 Subject: [PATCH 28/49] docs: optimize media icons --- docs/en/05-get-started/discord.svg | 2 +- docs/en/05-get-started/github.svg | 4 ++-- docs/en/05-get-started/index.md | 22 +++++++++++----------- docs/en/05-get-started/linkedin.svg | 2 +- docs/en/05-get-started/twitter.svg | 2 +- docs/en/05-get-started/youtube.svg | 2 +- docs/zh/05-get-started/index.md | 12 ++++++------ 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/en/05-get-started/discord.svg b/docs/en/05-get-started/discord.svg index 8218e3c3ca..99c02b6fb0 100644 --- a/docs/en/05-get-started/discord.svg +++ b/docs/en/05-get-started/discord.svg @@ -1,4 +1,4 @@ - + + diff --git a/docs/en/05-get-started/index.md b/docs/en/05-get-started/index.md index 373fa6e811..d80ec02268 100644 --- a/docs/en/05-get-started/index.md +++ b/docs/en/05-get-started/index.md @@ -3,11 +3,11 @@ title: Get Started description: This article describes how to install TDengine and test its performance. --- -import github from './github.svg' -import discord from './discord.svg' -import twitter from './twitter.svg' -import youtube from './youtube.svg' -import linkedin from './linkedin.svg' +import GitHubSVG from './github.svg' +import DiscordSVG from './discord.svg' +import TwitterSVG from './twitter.svg' +import YouTubeSVG from './youtube.svg' +import LinkedInSVG from './linkedin.svg' You can install and run TDengine on Linux/Windows/macOS machines as well as Docker containers. You can also deploy TDengine as a managed service with TDengine Cloud. @@ -23,11 +23,11 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; ### Join TDengine Community - - - - - - + + + + + +
Star GitHub

Star GitHub

Join Discord

Join Discord

Follow Twitter

Follow Twitter

Subscribe YouTube

Subscribe YouTube

Follow LinkedIn

Follow LinkedIn

Star GitHub

Join Discord

Follow Twitter

Subscribe YouTube

Follow LinkedIn

diff --git a/docs/en/05-get-started/linkedin.svg b/docs/en/05-get-started/linkedin.svg index 969c6f03af..1eb6754f63 100644 --- a/docs/en/05-get-started/linkedin.svg +++ b/docs/en/05-get-started/linkedin.svg @@ -1,4 +1,4 @@ - + + +
-
小 T 的二维码 -TDengine 微信视频号 -TDengine 微信公众号 +小 T 的二维码 +TDengine 微信视频号 +TDengine 微信公众号 -加入“物联网大数据技术前沿群”
与大家进行技术交流 -关注 TDengine 微信视频号
收看技术直播与教学视频 -关注 TDengine 微信公众号
阅读核心技术与行业案例文章 +加入“物联网大数据技术前沿群”
与大家进行技术交流 +关注 TDengine 微信视频号
收看技术直播与教学视频 +关注 TDengine 微信公众号
阅读核心技术与行业案例文章 From 2da3cabd58526bc60c12a102ec05f18153762474 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 10:30:54 +0800 Subject: [PATCH 29/49] fix: memory in smworker.c --- source/dnode/mgmt/mgmt_snode/src/smWorker.c | 1 + tests/parallel_test/cases.task | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/dnode/mgmt/mgmt_snode/src/smWorker.c b/source/dnode/mgmt/mgmt_snode/src/smWorker.c index 1381d4c391..f6942c8114 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smWorker.c +++ b/source/dnode/mgmt/mgmt_snode/src/smWorker.c @@ -122,6 +122,7 @@ void smStopWorker(SSnodeMgmt *pMgmt) { for (int32_t i = 0; i < taosArrayGetSize(pMgmt->writeWroker); i++) { SMultiWorker *pWorker = taosArrayGetP(pMgmt->writeWroker, i); tMultiWorkerCleanup(pWorker); + taosMemoryFree(pWorker); } taosArrayDestroy(pMgmt->writeWroker); tSingleWorkerCleanup(&pMgmt->streamWorker); diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index fac4210d88..2e9b942df4 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -98,7 +98,7 @@ ,,y,script,./test.sh -f tsim/parser/columnValue_int.sim ,,y,script,./test.sh -f tsim/parser/columnValue_smallint.sim ,,y,script,./test.sh -f tsim/parser/columnValue_tinyint.sim -,,,script,./test.sh -f tsim/parser/columnValue_unsign.sim +,,y,script,./test.sh -f tsim/parser/columnValue_unsign.sim ,,y,script,./test.sh -f tsim/parser/commit.sim ,,y,script,./test.sh -f tsim/parser/condition.sim ,,y,script,./test.sh -f tsim/parser/constCol.sim @@ -140,7 +140,7 @@ ,,,script,./test.sh -f tsim/parser/nestquery.sim ,,y,script,./test.sh -f tsim/parser/null_char.sim ,,y,script,./test.sh -f tsim/parser/precision_ns.sim -,,,script,./test.sh -f tsim/parser/projection_limit_offset.sim +,,y,script,./test.sh -f tsim/parser/projection_limit_offset.sim ,,y,script,./test.sh -f tsim/parser/regex.sim ,,y,script,./test.sh -f tsim/parser/select_across_vnodes.sim ,,y,script,./test.sh -f tsim/parser/select_distinct_tag.sim @@ -172,7 +172,7 @@ ,,,script,./test.sh -f tsim/query/session.sim ,,,script,./test.sh -f tsim/query/udf.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim -,,,script,./test.sh -f tsim/snode/basic1.sim +,,y,script,./test.sh -f tsim/snode/basic1.sim ,,,script,./test.sh -f tsim/mnode/basic1.sim ,,,script,./test.sh -f tsim/mnode/basic2.sim ,,,script,./test.sh -f tsim/mnode/basic3.sim @@ -208,12 +208,12 @@ ,,y,script,./test.sh -f tsim/table/tinyint.sim ,,y,script,./test.sh -f tsim/table/vgroup.sim ,,,script,./test.sh -f tsim/stream/basic0.sim -g -,,,script,./test.sh -f tsim/stream/basic1.sim +,,y,script,./test.sh -f tsim/stream/basic1.sim ,,y,script,./test.sh -f tsim/stream/basic2.sim ,,,script,./test.sh -f tsim/stream/drop_stream.sim ,,y,script,./test.sh -f tsim/stream/fillHistoryBasic1.sim ,,y,script,./test.sh -f tsim/stream/fillHistoryBasic2.sim -,,,script,./test.sh -f tsim/stream/fillHistoryBasic3.sim +,,y,script,./test.sh -f tsim/stream/fillHistoryBasic3.sim ,,y,script,./test.sh -f tsim/stream/distributeInterval0.sim ,,,script,./test.sh -f tsim/stream/distributeIntervalRetrive0.sim ,,,script,./test.sh -f tsim/stream/distributeSession0.sim @@ -222,11 +222,11 @@ ,,,script,./test.sh -f tsim/stream/state0.sim ,,,script,./test.sh -f tsim/stream/triggerInterval0.sim ,,,script,./test.sh -f tsim/stream/triggerSession0.sim -,,,script,./test.sh -f tsim/stream/partitionby.sim -,,,script,./test.sh -f tsim/stream/partitionby1.sim +,,y,script,./test.sh -f tsim/stream/partitionby.sim +,,y,script,./test.sh -f tsim/stream/partitionby1.sim ,,y,script,./test.sh -f tsim/stream/schedSnode.sim ,,,script,./test.sh -f tsim/stream/windowClose.sim -,,,script,./test.sh -f tsim/stream/ignoreExpiredData.sim +,,y,script,./test.sh -f tsim/stream/ignoreExpiredData.sim ,,y,script,./test.sh -f tsim/stream/sliding.sim ,,,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim ,,,script,./test.sh -f tsim/stream/partitionbyColumnSession.sim From a57efc49b4520a566f539a6e3c139023e017c82a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 13:43:30 +0800 Subject: [PATCH 30/49] fix: memory leak of sync timer --- source/dnode/mnode/impl/src/mndSync.c | 1 + source/libs/sync/inc/syncInt.h | 2 +- source/libs/sync/src/syncMain.c | 34 ++++++++------------------- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndSync.c b/source/dnode/mnode/impl/src/mndSync.c index 450d7a30ed..4dd7e070b3 100644 --- a/source/dnode/mnode/impl/src/mndSync.c +++ b/source/dnode/mnode/impl/src/mndSync.c @@ -349,6 +349,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) { } rpcFreeCont(req.pCont); + req.pCont = NULL; if (code != 0) { mError("trans:%d, failed to propose, code:0x%x", pMgmt->transId, code); return code; diff --git a/source/libs/sync/inc/syncInt.h b/source/libs/sync/inc/syncInt.h index e81f63d871..485186fda6 100644 --- a/source/libs/sync/inc/syncInt.h +++ b/source/libs/sync/inc/syncInt.h @@ -70,7 +70,7 @@ typedef struct SSyncTimer { uint64_t counter; int32_t timerMS; SRaftId destId; - void* pData; + SSyncHbTimerData hbData; } SSyncTimer; typedef struct SElectTimer { diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index e802f60f30..4fa4b7e49f 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -385,7 +385,7 @@ bool syncIsReadyForRead(int64_t rid) { if (!pSyncNode->pLogStore->syncLogIsEmpty(pSyncNode->pLogStore)) { SSyncRaftEntry* pEntry = NULL; int32_t code = pSyncNode->pLogStore->syncLogGetEntry( - pSyncNode->pLogStore, pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore), &pEntry); + pSyncNode->pLogStore, pSyncNode->pLogStore->syncLogLastIndex(pSyncNode->pLogStore), &pEntry); if (code == 0 && pEntry != NULL) { if (pEntry->originalRpcType == TDMT_SYNC_NOOP && pEntry->term == pSyncNode->pRaftStore->currentTerm) { ready = true; @@ -442,7 +442,9 @@ int32_t syncNodeLeaderTransferTo(SSyncNode* pSyncNode, SNodeInfo newLeader) { pMsg->newLeaderId.vgId = pSyncNode->vgId; pMsg->newNodeInfo = newLeader; - return syncNodePropose(pSyncNode, &rpcMsg, false); + int32_t ret = syncNodePropose(pSyncNode, &rpcMsg, false); + rpcFreeCont(rpcMsg.pCont); + return ret; } SSyncState syncGetState(int64_t rid) { @@ -645,13 +647,12 @@ static int32_t syncHbTimerInit(SSyncNode* pSyncNode, SSyncTimer* pSyncTimer, SRa static int32_t syncHbTimerStart(SSyncNode* pSyncNode, SSyncTimer* pSyncTimer) { int32_t ret = 0; if (syncIsInit()) { - SSyncHbTimerData* pData = taosMemoryMalloc(sizeof(SSyncHbTimerData)); + SSyncHbTimerData* pData = &pSyncTimer->hbData; pData->pSyncNode = pSyncNode; pData->pTimer = pSyncTimer; pData->destId = pSyncTimer->destId; pData->logicClock = pSyncTimer->logicClock; - pSyncTimer->pData = pData; taosTmrReset(pSyncTimer->timerCb, pSyncTimer->timerMS, pData, syncEnv()->pTimerManager, &pSyncTimer->pTimer); } else { sError("vgId:%d, start ctrl hb timer error, sync env is stop", pSyncNode->vgId); @@ -664,7 +665,6 @@ static int32_t syncHbTimerStop(SSyncNode* pSyncNode, SSyncTimer* pSyncTimer) { atomic_add_fetch_64(&pSyncTimer->logicClock, 1); taosTmrStop(pSyncTimer->pTimer); pSyncTimer->pTimer = NULL; - // taosMemoryFree(pSyncTimer->pData); return ret; } @@ -1086,15 +1086,8 @@ int32_t syncNodeStartElectTimer(SSyncNode* pSyncNode, int32_t ms) { int32_t ret = 0; if (syncIsInit()) { pSyncNode->electTimerMS = ms; - - SElectTimer* pElectTimer = taosMemoryMalloc(sizeof(SElectTimer)); - pElectTimer->logicClock = pSyncNode->electTimerLogicClock; - pElectTimer->pSyncNode = pSyncNode; - pElectTimer->pData = NULL; - - taosTmrReset(pSyncNode->FpElectTimerCB, pSyncNode->electTimerMS, pElectTimer, syncEnv()->pTimerManager, + taosTmrReset(pSyncNode->FpElectTimerCB, pSyncNode->electTimerMS, pSyncNode, syncEnv()->pTimerManager, &pSyncNode->pElectTimer); - } else { sError("vgId:%d, start elect timer error, sync env is stop", pSyncNode->vgId); } @@ -1827,20 +1820,17 @@ static void syncNodeEqPingTimer(void* param, void* tmrId) { } static void syncNodeEqElectTimer(void* param, void* tmrId) { + SSyncNode* pNode = param; + if (!syncIsInit()) return; - - SElectTimer* pElectTimer = param; - SSyncNode* pNode = pElectTimer->pSyncNode; - if (pNode == NULL) return; if (pNode->syncEqMsg == NULL) return; SRpcMsg rpcMsg = {0}; - int32_t code = syncBuildTimeout(&rpcMsg, SYNC_TIMEOUT_ELECTION, pElectTimer->logicClock, pNode->electTimerMS, pNode); - + int32_t code = + syncBuildTimeout(&rpcMsg, SYNC_TIMEOUT_ELECTION, pNode->electTimerLogicClock, pNode->electTimerMS, pNode); if (code != 0) { sError("failed to build elect msg"); - taosMemoryFree(pElectTimer); return; } @@ -1851,12 +1841,8 @@ static void syncNodeEqElectTimer(void* param, void* tmrId) { if (code != 0) { sError("failed to sync enqueue elect msg since %s", terrstr()); rpcFreeCont(rpcMsg.pCont); - taosMemoryFree(pElectTimer); - return; } - taosMemoryFree(pElectTimer); - #if 0 // reset timer ms if (syncIsInit() && pNode->electBaseLine > 0) { From 6c1361ef80e436aa3ecc03526d700e93a0833e69 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Tue, 15 Nov 2022 13:59:00 +0800 Subject: [PATCH 31/49] fix: null pointer check when invoke memcpy --- source/libs/executor/src/tsimplehash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/tsimplehash.c b/source/libs/executor/src/tsimplehash.c index 9fbe94200c..484d917069 100644 --- a/source/libs/executor/src/tsimplehash.c +++ b/source/libs/executor/src/tsimplehash.c @@ -93,7 +93,7 @@ static SHNode *doCreateHashNode(const void *key, size_t keyLen, const void *data pNewNode->keyLen = keyLen; pNewNode->dataLen = dataLen; pNewNode->next = NULL; - memcpy(GET_SHASH_NODE_DATA(pNewNode), data, dataLen); + if (data) memcpy(GET_SHASH_NODE_DATA(pNewNode), data, dataLen); memcpy(GET_SHASH_NODE_KEY(pNewNode, dataLen), key, keyLen); return pNewNode; } @@ -203,7 +203,7 @@ int32_t tSimpleHashPut(SSHashObj *pHashObj, const void *key, size_t keyLen, cons pNewNode->next = pHashObj->hashList[slot]; pHashObj->hashList[slot] = pNewNode; atomic_add_fetch_64(&pHashObj->size, 1); - } else { // update data + } else if (data) { // update data memcpy(GET_SHASH_NODE_DATA(pNode), data, dataLen); } From b0ea0c0d7939e00fab03129dd034a92bd91162ce Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 14:04:44 +0800 Subject: [PATCH 32/49] test: add asan case --- tests/parallel_test/cases.task | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 2e9b942df4..2369b238ea 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -242,8 +242,8 @@ ,,y,script,./test.sh -f tsim/stream/fillIntervalValue.sim ,,y,script,./test.sh -f tsim/trans/lossdata1.sim ,,y,script,./test.sh -f tsim/trans/create_db.sim -,,,script,./test.sh -f tsim/tmq/basic1.sim -,,,script,./test.sh -f tsim/tmq/basic2.sim +,,y,script,./test.sh -f tsim/tmq/basic1.sim +,,y,script,./test.sh -f tsim/tmq/basic2.sim ,,,script,./test.sh -f tsim/tmq/basic3.sim ,,,script,./test.sh -f tsim/tmq/basic4.sim ,,,script,./test.sh -f tsim/tmq/basic1Of2Cons.sim From ccd3bb20a74aa56efbf6f01844b0248f66885bd4 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 15 Nov 2022 14:10:46 +0800 Subject: [PATCH 33/49] fix: reset cache when table is dropped --- source/dnode/vnode/src/tq/tqRead.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/dnode/vnode/src/tq/tqRead.c b/source/dnode/vnode/src/tq/tqRead.c index 48e69f8f4d..45873f2744 100644 --- a/source/dnode/vnode/src/tq/tqRead.c +++ b/source/dnode/vnode/src/tq/tqRead.c @@ -425,6 +425,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { tqWarn("cannot found tsschema for table: uid:%" PRId64 " (suid:%" PRId64 "), version %d, possibly dropped table", pReader->msgIter.uid, pReader->msgIter.suid, pReader->cachedSchemaVer); /*ASSERT(0);*/ + pReader->cachedSchemaSuid = 0; terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND; return -1; } @@ -435,6 +436,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) { tqWarn("cannot found schema wrapper for table: suid:%" PRId64 ", version %d, possibly dropped table", pReader->msgIter.uid, pReader->cachedSchemaVer); /*ASSERT(0);*/ + pReader->cachedSchemaSuid = 0; terrno = TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND; return -1; } From 76cd3122d1e848ce12cc78ac3a8e6f945e666b00 Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Tue, 15 Nov 2022 14:28:20 +0800 Subject: [PATCH 34/49] fix: memory leak --- source/common/src/tmsg.c | 4 ++++ source/dnode/mnode/impl/src/mndSubscribe.c | 4 ++++ source/dnode/vnode/src/tq/tq.c | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index fd445ff2ae..4485e8df0c 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -6027,9 +6027,13 @@ int32_t tDecodeSMqDataRsp(SDecoder *pDecoder, SMqDataRsp *pRsp) { void tDeleteSMqDataRsp(SMqDataRsp *pRsp) { taosArrayDestroy(pRsp->blockDataLen); + pRsp->blockDataLen = NULL; taosArrayDestroyP(pRsp->blockData, (FDelete)taosMemoryFree); + pRsp->blockData = NULL; taosArrayDestroyP(pRsp->blockSchema, (FDelete)tDeleteSSchemaWrapper); + pRsp->blockSchema = NULL; taosArrayDestroyP(pRsp->blockTbName, (FDelete)taosMemoryFree); + pRsp->blockTbName = NULL; } int32_t tEncodeSTaosxRsp(SEncoder *pEncoder, const STaosxRsp *pRsp) { diff --git a/source/dnode/mnode/impl/src/mndSubscribe.c b/source/dnode/mnode/impl/src/mndSubscribe.c index 14adeb0080..fd79846104 100644 --- a/source/dnode/mnode/impl/src/mndSubscribe.c +++ b/source/dnode/mnode/impl/src/mndSubscribe.c @@ -471,8 +471,12 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu pConsumerNew->updateType = CONSUMER_UPDATE__TOUCH; mndReleaseConsumer(pMnode, pConsumerOld); if (mndSetConsumerCommitLogs(pMnode, pTrans, pConsumerNew) != 0) { + tDeleteSMqConsumerObj(pConsumerNew); + taosMemoryFree(pConsumerNew); goto REB_FAIL; } + tDeleteSMqConsumerObj(pConsumerNew); + taosMemoryFree(pConsumerNew); } // 3.2 set new consumer consumerNum = taosArrayGetSize(pOutput->newConsumers); diff --git a/source/dnode/vnode/src/tq/tq.c b/source/dnode/vnode/src/tq/tq.c index eafbd8464d..1cc771dbb4 100644 --- a/source/dnode/vnode/src/tq/tq.c +++ b/source/dnode/vnode/src/tq/tq.c @@ -68,6 +68,7 @@ static void destroySTqHandle(void* data) { static void tqPushEntryFree(void* data) { STqPushEntry* p = *(void**)data; + tDeleteSMqDataRsp(&p->dataRsp); taosMemoryFree(p); } @@ -576,8 +577,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) { return 0; } } - taosWUnLockLatch(&pTq->pushLock); #endif + taosWUnLockLatch(&pTq->pushLock); if (tqSendDataRsp(pTq, pMsg, pReq, &dataRsp) < 0) { code = -1; From 82baf3aa76a4b30733b2a7ae6ff171e2a4d6be17 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 15 Nov 2022 14:37:10 +0800 Subject: [PATCH 35/49] fix test cases --- tests/system-test/2-query/csum.py | 32 +- tests/system-test/2-query/function_diff.py | 26 +- tests/system-test/2-query/irate.py | 2 +- tests/system-test/2-query/mavg.py | 21 +- tests/system-test/2-query/max_partition.py | 12 +- tests/system-test/2-query/nestedQuery.py | 3924 ++++++++++---------- tests/system-test/2-query/stablity.py | 3072 +++++++-------- tests/system-test/2-query/stablity_1.py | 58 +- 8 files changed, 3574 insertions(+), 3573 deletions(-) diff --git a/tests/system-test/2-query/csum.py b/tests/system-test/2-query/csum.py index e933eb54cb..1e6b26ada0 100644 --- a/tests/system-test/2-query/csum.py +++ b/tests/system-test/2-query/csum.py @@ -24,7 +24,7 @@ from util.cases import * from util.sql import * from util.dnodes import * - +msec_per_min=60 * 1000 class TDTestCase: def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) @@ -54,7 +54,7 @@ class TDTestCase: if tdSql.queryRows == 0: tdSql.query(self.csum_query_form( - col=col, alias=alias, table_expr=table_expr, condition=condition + col=col, alias=alias, table_expr=table_expr.replace("csum", "ts, csum"), condition=condition )) print(f"case in {line}: ", end='') tdSql.checkRows(0) @@ -132,7 +132,7 @@ class TDTestCase: pre_result = np.array(pre_result, dtype = 'int64') pre_csum = np.cumsum(pre_result)[offset_val:] tdSql.query(self.csum_query_form( - col=col, alias=alias, table_expr=table_expr, condition=condition + col=col, alias=alias, table_expr=table_expr.replace("csum", "ts,csum"), condition=condition )) for i in range(tdSql.queryRows): @@ -163,7 +163,7 @@ class TDTestCase: self.checkcsum(**case6) # case7~8: nested query - case7 = {"table_expr": "(select c1 from db.stb1 order by ts, tbname )"} + case7 = {"table_expr": "(select ts,c1 from db.stb1 order by ts, tbname )"} self.checkcsum(**case7) case8 = {"table_expr": "(select csum(c1) c1 from db.t1)"} self.checkcsum(**case8) @@ -315,19 +315,19 @@ class TDTestCase: for j in range(data_row): tdSql.execute( f"insert into t{i} values (" - f"{basetime + (j+1)*10}, {random.randint(-200, -1)}, {random.uniform(200, -1)}, {basetime + random.randint(-200, -1)}, " + f"{basetime + (j+1)*10 + i * msec_per_min}, {random.randint(-200, -1)}, {random.uniform(200, -1)}, {basetime + random.randint(-200, -1)}, " f"'binary_{j}', {random.uniform(-200, -1)}, {random.choice([0,1])}, {random.randint(-200,-1)}, " f"{random.randint(-200, -1)}, {random.randint(-127, -1)}, 'nchar_{j}' )" ) tdSql.execute( f"insert into t{i} values (" - f"{basetime - (j+1) * 10}, {random.randint(1, 200)}, {random.uniform(1, 200)}, {basetime - random.randint(1, 200)}, " + f"{basetime - (j+1) * 10 + i * msec_per_min}, {random.randint(1, 200)}, {random.uniform(1, 200)}, {basetime - random.randint(1, 200)}, " f"'binary_{j}_1', {random.uniform(1, 200)}, {random.choice([0, 1])}, {random.randint(1,200)}, " f"{random.randint(1,200)}, {random.randint(1,127)}, 'nchar_{j}_1' )" ) tdSql.execute( - f"insert into tt{i} values ( {basetime-(j+1) * 10}, {random.randint(1, 200)} )" + f"insert into tt{i} values ( {basetime-(j+1) * 10 + i * msec_per_min}, {random.randint(1, 200)} )" ) pass @@ -366,26 +366,26 @@ class TDTestCase: tdLog.printNoPrefix("######## insert only NULL test:") for i in range(tbnum): - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime - 5})") - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime + 5})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime - 5 + i * msec_per_min})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime + 5 + i * msec_per_min})") self.csum_current_query() self.csum_error_query() tdLog.printNoPrefix("######## insert data in the range near the max(bigint/double):") self.csum_test_table(tbnum) tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 1) * 10}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") + f"({nowtime - (per_table_rows + 1) * 10 + i * msec_per_min}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 2) * 10}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") + f"({nowtime - (per_table_rows + 2) * 10 + i * msec_per_min}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") self.csum_current_query() self.csum_error_query() tdLog.printNoPrefix("######## insert data in the range near the min(bigint/double):") self.csum_test_table(tbnum) tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 1) * 10}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {1-2**63})") + f"({nowtime - (per_table_rows + 1) * 10 + i * msec_per_min}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {1-2**63})") tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 2) * 10}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {512-2**63})") + f"({nowtime - (per_table_rows + 2) * 10 + i * msec_per_min}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {512-2**63})") self.csum_current_query() self.csum_error_query() @@ -398,9 +398,9 @@ class TDTestCase: tdLog.printNoPrefix("######## insert data mix with NULL test:") for i in range(tbnum): - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime})") - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime-(per_table_rows+3)*10})") - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime+(per_table_rows+3)*10})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime + i * msec_per_min})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime-(per_table_rows+3)*10 + i * msec_per_min})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime+(per_table_rows+3)*10 + i * msec_per_min})") self.csum_current_query() self.csum_error_query() diff --git a/tests/system-test/2-query/function_diff.py b/tests/system-test/2-query/function_diff.py index 4abef03037..c3f3789a69 100644 --- a/tests/system-test/2-query/function_diff.py +++ b/tests/system-test/2-query/function_diff.py @@ -24,7 +24,7 @@ from util.cases import * from util.sql import * from util.dnodes import * - +msec_per_min=60*1000 class TDTestCase: def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) @@ -312,19 +312,19 @@ class TDTestCase: for j in range(data_row): tdSql.execute( f"insert into db.t{i} values (" - f"{basetime + (j+1)*10}, {random.randint(-200, -1)}, {random.uniform(200, -1)}, {basetime + random.randint(-200, -1)}, " + f"{basetime + (j+1)*10 + i* msec_per_min}, {random.randint(-200, -1)}, {random.uniform(200, -1)}, {basetime + random.randint(-200, -1)}, " f"'binary_{j}', {random.uniform(-200, -1)}, {random.choice([0,1])}, {random.randint(-200,-1)}, " f"{random.randint(-200, -1)}, {random.randint(-127, -1)}, 'nchar_{j}' )" ) tdSql.execute( f"insert into db.t{i} values (" - f"{basetime - (j+1) * 10}, {random.randint(1, 200)}, {random.uniform(1, 200)}, {basetime - random.randint(1, 200)}, " + f"{basetime - (j+1) * 10 + i* msec_per_min}, {random.randint(1, 200)}, {random.uniform(1, 200)}, {basetime - random.randint(1, 200)}, " f"'binary_{j}_1', {random.uniform(1, 200)}, {random.choice([0, 1])}, {random.randint(1,200)}, " f"{random.randint(1,200)}, {random.randint(1,127)}, 'nchar_{j}_1' )" ) tdSql.execute( - f"insert into db.tt{i} values ( {basetime-(j+1) * 10}, {random.randint(1, 200)} )" + f"insert into db.tt{i} values ( {basetime-(j+1) * 10 + i* msec_per_min}, {random.randint(1, 200)} )" ) pass @@ -394,26 +394,26 @@ class TDTestCase: tdLog.printNoPrefix("######## insert only NULL test:") for i in range(tbnum): - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime - 5})") - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime + 5})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime - 5 + i* msec_per_min})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime + 5 + i* msec_per_min})") self.diff_current_query() self.diff_error_query() tdLog.printNoPrefix("######## insert data in the range near the max(bigint/double):") self.diff_test_table(tbnum) tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 1) * 10}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") + f"({nowtime - (per_table_rows + 1) * 10 + i* msec_per_min}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 2) * 10}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") + f"({nowtime - (per_table_rows + 2) * 10 + i* msec_per_min}, {2**31-1}, {3.4*10**38}, {1.7*10**308}, {2**63-1})") self.diff_current_query() self.diff_error_query() tdLog.printNoPrefix("######## insert data in the range near the min(bigint/double):") self.diff_test_table(tbnum) tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 1) * 10}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {1-2**63})") + f"({nowtime - (per_table_rows + 1) * 10 + i* msec_per_min}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {1-2**63})") tdSql.execute(f"insert into db.t1(ts, c1,c2,c5,c7) values " - f"({nowtime - (per_table_rows + 2) * 10}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {512-2**63})") + f"({nowtime - (per_table_rows + 2) * 10 + i* msec_per_min}, {1-2**31}, {-3.4*10**38}, {-1.7*10**308}, {512-2**63})") self.diff_current_query() self.diff_error_query() @@ -426,9 +426,9 @@ class TDTestCase: tdLog.printNoPrefix("######## insert data mix with NULL test:") for i in range(tbnum): - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime})") - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime-(per_table_rows+3)*10})") - tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime+(per_table_rows+3)*10})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime + i* msec_per_min})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime-(per_table_rows+3)*10 + i* msec_per_min})") + tdSql.execute(f"insert into db.t{i}(ts) values ({nowtime+(per_table_rows+3)*10 + i* msec_per_min})") self.diff_current_query() self.diff_error_query() diff --git a/tests/system-test/2-query/irate.py b/tests/system-test/2-query/irate.py index cee595d186..8aa2b3d420 100644 --- a/tests/system-test/2-query/irate.py +++ b/tests/system-test/2-query/irate.py @@ -34,7 +34,7 @@ class TDTestCase: ts = self.ts for row in range(rownums): - ts = self.ts + time_step*row + ts = self.ts + (time_step) * row + tbnum * 60 * 1000 c1 = random.randint(0,1000) c2 = random.randint(0,100000) c3 = random.randint(0,125) diff --git a/tests/system-test/2-query/mavg.py b/tests/system-test/2-query/mavg.py index ec4a087a8e..f76980106d 100644 --- a/tests/system-test/2-query/mavg.py +++ b/tests/system-test/2-query/mavg.py @@ -26,6 +26,7 @@ from util.sql import * from util.dnodes import * dbname = 'db' +msec_per_min = 60 * 1000 class TDTestCase: def init(self, conn, logSql, replicaVar=1): self.replicaVar = int(replicaVar) @@ -327,7 +328,7 @@ class TDTestCase: self.checkmavg(**case6) # case7~8: nested query - case7 = {"table_expr": f"(select c1 from {dbname}.stb1)"} + case7 = {"table_expr": f"(select ts, c1 from {dbname}.stb1)"} self.checkmavg(**case7) # case8 = {"table_expr": f"(select _c0, mavg(c1, 1) c1 from {dbname}.stb1 group by tbname)"} # self.checkmavg(**case8) @@ -568,19 +569,19 @@ class TDTestCase: for j in range(data_row): tdSql.execute( f"insert into {dbname}.t{i} values (" - f"{basetime + (j+1)*10}, {random.randint(-200, -1)}, {random.uniform(200, -1)}, {basetime + random.randint(-200, -1)}, " + f"{basetime + (j+1)*10 + i * msec_per_min}, {random.randint(-200, -1)}, {random.uniform(200, -1)}, {basetime + random.randint(-200, -1)}, " f"'binary_{j}', {random.uniform(-200, -1)}, {random.choice([0,1])}, {random.randint(-200,-1)}, " f"{random.randint(-200, -1)}, {random.randint(-127, -1)}, 'nchar_{j}' )" ) tdSql.execute( f"insert into {dbname}.t{i} values (" - f"{basetime - (j+1) * 10}, {random.randint(1, 200)}, {random.uniform(1, 200)}, {basetime - random.randint(1, 200)}, " + f"{basetime - (j+1) * 10 + i * msec_per_min}, {random.randint(1, 200)}, {random.uniform(1, 200)}, {basetime - random.randint(1, 200)}, " f"'binary_{j}_1', {random.uniform(1, 200)}, {random.choice([0, 1])}, {random.randint(1,200)}, " f"{random.randint(1,200)}, {random.randint(1,127)}, 'nchar_{j}_1' )" ) tdSql.execute( - f"insert into {dbname}.tt{i} values ( {basetime-(j+1) * 10}, {random.randint(1, 200)} )" + f"insert into {dbname}.tt{i} values ( {basetime-(j+1) * 10 + i * msec_per_min}, {random.randint(1, 200)} )" ) pass @@ -619,8 +620,8 @@ class TDTestCase: tdLog.printNoPrefix("######## insert only NULL test:") for i in range(tbnum): - tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime - 5})") - tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime + 5})") + tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime - 5 + i * msec_per_min})") + tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime + 5 + i * msec_per_min})") self.mavg_current_query() self.mavg_error_query() @@ -651,9 +652,9 @@ class TDTestCase: tdLog.printNoPrefix("######## insert data mix with NULL test:") for i in range(tbnum): - tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime})") - tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime-(per_table_rows+3)*10})") - tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime+(per_table_rows+3)*10})") + tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime + i * msec_per_min})") + tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime-(per_table_rows+3)*10 + i * msec_per_min})") + tdSql.execute(f"insert into {dbname}.t{i}(ts) values ({nowtime+(per_table_rows+3)*10 + i * msec_per_min})") self.mavg_current_query() self.mavg_error_query() @@ -676,7 +677,7 @@ class TDTestCase: tdSql.checkRows(4) def mavg_support_stable(self): - tdSql.query(f" select mavg(1,3) from {dbname}.stb1 ") + tdSql.query(f"select mavg(1,3) from {dbname}.stb1 ") tdSql.checkRows(68) tdSql.checkData(0,0,1.000000000) tdSql.query(f"select mavg(c1,3) from {dbname}.stb1 partition by tbname ") diff --git a/tests/system-test/2-query/max_partition.py b/tests/system-test/2-query/max_partition.py index a9b7a14eb0..b14bc649dd 100644 --- a/tests/system-test/2-query/max_partition.py +++ b/tests/system-test/2-query/max_partition.py @@ -20,15 +20,15 @@ class TDTestCase: for i in range(tb_nums): tbname = f"{dbname}.sub_{stb_name}_{i}" - ts = self.ts + i*10000 + ts = self.ts + i*1000*120 tdSql.execute(f"create table {tbname} using {dbname}.{stb_name} tags ({ts} , {i} , {i}*10 ,{i}*1.0,{i}*1.0 , 1 , 2, 'true', 'binary_{i}' ,'nchar_{i}',{i},{i},10,20 )") for row in range(row_nums): - ts = self.ts + row*1000 + ts = ts + row*1000 tdSql.execute(f"insert into {tbname} values({ts} , {row} , {row} , {row} , {row} , 1 , 2 , 'true' , 'binary_{row}' , 'nchar_{row}' , {row} , {row} , 1 ,2 )") for null in range(5): - ts = self.ts + row_nums*1000 + null*1000 + ts = ts + row_nums*1000 + null*1000 tdSql.execute(f"insert into {tbname} values({ts} , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL )") def basic_query(self, dbname="db"): @@ -160,13 +160,13 @@ class TDTestCase: tdSql.query(f"select tbname , count(c1) from {dbname}.stb partition by tbname interval(10s) slimit 5 soffset 1 ") tdSql.query(f"select tbname , max(c1) from {dbname}.stb partition by tbname interval(10s)") - tdSql.checkRows(self.row_nums*2) + tdSql.checkRows(self.row_nums*10) tdSql.query(f"select unique(c1) from {dbname}.stb partition by tbname order by tbname") tdSql.query(f"select tbname , count(c1) from {dbname}.sub_stb_1 partition by tbname interval(10s)") tdSql.checkData(0,0,'sub_stb_1') - tdSql.checkData(0,1,self.row_nums) + tdSql.checkData(0,1, 4) tdSql.query(f"select c1 , mavg(c1 ,2 ) from {dbname}.stb partition by c1") tdSql.checkRows(90) @@ -193,7 +193,7 @@ class TDTestCase: tdSql.query(f"select c1 , DERIVATIVE(c1,2,1) from {dbname}.stb partition by c1 order by c1") tdSql.checkRows(90) # bug need fix - tdSql.checkData(0,1,None) + tdSql.checkData(0,1,0.0) tdSql.query(f"select tbname , max(c1) from {dbname}.stb partition by tbname order by tbname slimit 5 soffset 0 ") diff --git a/tests/system-test/2-query/nestedQuery.py b/tests/system-test/2-query/nestedQuery.py index b1008efa86..034ab8dcdc 100755 --- a/tests/system-test/2-query/nestedQuery.py +++ b/tests/system-test/2-query/nestedQuery.py @@ -24,10 +24,10 @@ from util.dnodes import tdDnodes from util.dnodes import * class TDTestCase: - updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 , + 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, replicaVar=1): self.replicaVar = int(replicaVar) tdLog.debug("start to execute %s" % __file__) @@ -36,13 +36,13 @@ class TDTestCase: 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 = 15 - + self.db_nest = "nest" self.dropandcreateDB_random("%s" %self.db_nest, 1) - + # regular column select #q_select= ['ts' , '*' , 'q_int', 'q_bigint' , 'q_bigint' , 'q_smallint' , 'q_tinyint' , 'q_bool' , 'q_binary' , 'q_nchar' ,'q_float' , 'q_double' ,'q_ts '] 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 '] @@ -55,11 +55,11 @@ class TDTestCase: 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' , + 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' , + 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 @@ -70,13 +70,13 @@ class TDTestCase: self.s_s_select= ['tbname' , '_rowts' , '_c0', '_C0' ] self.unionall_or_union= [ ' union ' , ' union all ' ] - # regular column where + # 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_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_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\' ', @@ -89,38 +89,38 @@ class TDTestCase: '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_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_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_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)' , + 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_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_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_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\' ) ',] @@ -132,30 +132,30 @@ class TDTestCase: '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_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_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)'] #TD-6201,'t1.t_bool between 0 and 1 or t2.q_bool between 0 and 1'] - 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)' , + 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_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)'] - + # self.t_u_where = ['t1.ts < now +1s'] # 超级表tag不支持,暂时注掉 # self.t_u_or_where = ['(t1.q_bool in (0 , 1))'] #超级表tag不支持,暂时注掉 - # regular and tag column where + # regular and tag column where self.qt_where = self.q_where + self.t_where #self.qt_where = self.q_where #超级表tag不支持,暂时注掉 self.qt_u_where = self.q_u_where + self.t_u_where @@ -171,88 +171,88 @@ class TDTestCase: 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 + # 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', + + 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 , 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', + 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.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.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.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', + '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', + 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.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', + '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', + 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.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 '] + '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', + + 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 ' , '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', + 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_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_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_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 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', + 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_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 '] - + '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', @@ -278,15 +278,15 @@ class TDTestCase: 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 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 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'] + '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', @@ -299,7 +299,7 @@ class TDTestCase: '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' ] @@ -308,8 +308,8 @@ class TDTestCase: # 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' ] - - # aggregate function include [all:count(*)\avg\sum\stddev ||regualr:twa\irate\leastsquares ||group by tbname:twa\irate\] + + # aggregate function include [all:count(*)\avg\sum\stddev ||regualr:twa\irate\leastsquares ||group by tbname:twa\irate\] # select function include [all: min\max\first(*)\last(*)\top\bottom\apercentile\last_row(*)(not with interval)\interp(*)(FILL) ||regualr: percentile] # calculation function include [all:spread\+-*/ ||regualr:diff\derivative ||group by tbname:diff\derivative\] # **_ns_** express is not support stable, therefore, separated from regular tables @@ -319,7 +319,7 @@ class TDTestCase: # calc_select_all calc_select_regular calc_select_in_ts calc_select_fill calc_select_not_interval # select function include [all: min\max\first(*)\last(*)\top\bottom\apercentile\last_row(*)(not with interval)\interp(*)(FILL) ||regualr: percentile] - + 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)' , @@ -327,7 +327,7 @@ class TDTestCase: '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_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)' , @@ -335,8 +335,8 @@ class TDTestCase: '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)', + '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)' , @@ -351,25 +351,25 @@ class TDTestCase: 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_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_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_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_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)'] - + '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)' , @@ -378,11 +378,11 @@ class TDTestCase: '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\''] @@ -417,21 +417,21 @@ class TDTestCase: '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)' , + '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_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_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_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_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)' , @@ -440,20 +440,20 @@ class TDTestCase: '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_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_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_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)'] + '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)' , @@ -461,7 +461,7 @@ class TDTestCase: '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\'' , @@ -495,7 +495,7 @@ class TDTestCase: 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)'] + '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)' , @@ -543,13 +543,13 @@ class TDTestCase: '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)' ] - + '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)' ] + # calc_calculate_all calc_calculate_regular calc_calculate_groupbytbname # calculation function include [all:spread\+-*/ ||regualr:diff\derivative ||group by tbname:diff\derivative\] - 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)' , + 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_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)' , @@ -560,7 +560,7 @@ class TDTestCase: '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)' , @@ -597,17 +597,17 @@ class TDTestCase: '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() - print(self.cur1) + self.cur1 = self.conn1.cursor() + print(self.cur1) self.cur1.execute("use %s ;" %self.db_nest) sql = 'select * from stable_1 limit 5;' self.cur1.execute(sql) - + def data_matrix_equal(self, sql1,row1_s,row1_e,col1_s,col1_e, sql2,row2_s,row2_e,col2_s,col2_e): # ----row1_start----col1_start---- - # - - - - 是一个矩阵内的数据相等- - - - # - - - - - - - - - - - - - - - - + # - - - - 是一个矩阵内的数据相等- - - + # - - - - - - - - - - - - - - - - # ----row1_end------col1_end------ self.sql1 = sql1 list1 =[] @@ -619,9 +619,9 @@ class TDTestCase: #print("data=%s" %(tdSql.getData(i1,j1))) list1.append(tdSql.getData(i1,j1)) print("=====list1-------list1---=%s" %set(list1)) - + tdSql.execute("reset query cache;") - self.sql2 = sql2 + self.sql2 = sql2 list2 =[] tdSql.query(sql2) for i2 in range(row2_s-1,row2_e): @@ -630,8 +630,8 @@ class TDTestCase: #print("jjjj222=%d"%j2) #print("data=%s" %(tdSql.getData(i2,j2))) list2.append(tdSql.getData(i2,j2)) - print("=====list2-------list2---=%s" %set(list2)) - + print("=====list2-------list2---=%s" %set(list2)) + if (list1 == list2) and len(list2)>0: # print(("=====matrix===sql1.list1:'%s',sql2.list2:'%s'") %(list1,list2)) tdLog.info(("===matrix===sql1:'%s' matrix_result = sql2:'%s' matrix_result") %(sql1,sql2)) @@ -657,7 +657,7 @@ class TDTestCase: print(("=====matrix_error===sql1.list1:'%s',sql2.list2:'%s'") %(list1,list2)) tdLog.info(("sql1:'%s' matrix_result != sql2:'%s' matrix_result") %(sql1,sql2)) return tdSql.checkEqual(list1,list2) - + def restartDnodes(self): pass # tdDnodes.stop(1) @@ -681,7 +681,7 @@ class TDTestCase: 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) ,\ @@ -693,35 +693,35 @@ class TDTestCase: 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', '0' , '0' , '0' , '0' , 0 , 'binary1' , 'nchar1' , '0' , '0' ,'0') ;''') - 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_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', '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''') - 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_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' ,'0') ;''') # tdSql.execute('''create table stable_2_2 using stable_2 tags('stable_2_2' , '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''') # tdSql.execute('''create table stable_null_data_1 using stable_null_data tags('stable_null_data_1', '0' , '0' , '0' , '0' , 0 , '0' , '0' , '0' , '0' ,'0') ;''') - - 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))) + 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 \ @@ -747,106 +747,106 @@ class TDTestCase: 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): + for i in range(1, num_random*n + 1): 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() , + '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() , + '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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*2, 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() , + '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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*2 +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() , + '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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*4, 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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*4 +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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*4 +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) + + def explain_sql(self,sql): + # #执行sql解析 + sql = "explain " + sql + tdLog.info(sql) tdSql.query(sql) #pass - + def data_check(self,sql,mark='mark') : tdLog.info("========mark==%s==="% mark); try: @@ -854,60 +854,60 @@ class TDTestCase: 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)) - + + 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)'] + 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)'] + '(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 + 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)'] + '(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)'] + '(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) + 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)'] + '(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)', @@ -915,224 +915,224 @@ class TDTestCase: '(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)'] + '(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(1, 1000) + math_functions = mathlist + num = random.randint(1, 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)'] + '(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)'] + '(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("'","") - + 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)'] - + '(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("'","") + 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) + + 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)) - + 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)'] - + '(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("'","") + 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("'","") + 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'] - + 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) - + + normalized = random.randint(0, 1) + i = random.randint(1,3) if i == 1: - bin_type = 'user_input' + 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_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_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("}\"","}'") - + 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("}\"","}'") - + 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("}\"","}'") - + 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("}\"","}'") - + 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 ts1 , floor(asct1) from ( select " - sql += "%s as asct1, " % math_fun_1 - sql += "%s as asct2, " % math_fun_2 + sql = "select ts1 , floor(asct1) from ( select " + sql += "%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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(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 = "select count(asct1) from ( select " + sql += "%s as asct1 " % math_fun_1 sql += " from regular_table_1 where " sql += "%s " % random.choice(self.q_where) sql += ");" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 ts , abs(asct1) from ( select " - sql += "%s as asct1, " % math_fun_1 + sql += "%s as asct1, " % math_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%s " % random.choice(self.unionall_or_union) sql += "select ts , asct2 from ( select " - sql += "%s as asct2, " % math_fun_2 + sql += "%s as asct2, " % math_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.q_where) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) - self.explain_sql(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']): + 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 += "%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 += "%s " % random.choice(self.unionall_or_union) sql += "select count(asct2) from ( select " - sql += "%s as asct2 " % math_fun_2 + sql += "%s as asct2 " % math_fun_2 sql += " from regular_table_1 where " - sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) - + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) + self.cur1.execute(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']) \ @@ -1141,20 +1141,20 @@ class TDTestCase: sql += "%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 += "%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 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -1164,14 +1164,14 @@ class TDTestCase: 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 select " % random.choice(self.unionall_or_union) sql += "%s as asct2 ," % math_fun_2 - sql += "%s as asct1 " % math_fun_1 + sql += "%s as asct1 " % math_fun_1 sql += " from regular_table_2 where " sql += "%s " % random.choice(self.q_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -1181,35 +1181,35 @@ class TDTestCase: sql += "%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 select " % random.choice(self.unionall_or_union) sql += "%s as asct2 " % math_fun_2 sql += " from regular_table_2 where " sql += "%s " % random.choice(self.q_where) - sql += " order by asct1 asc " + sql += " order by asct1 asc " sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) @@ -1217,32 +1217,32 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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, " % math_fun_1 sql += "%s as asct1, " % random.choice(self.q_select) - sql += "%s as asct2, " % random.choice(self.q_select) + sql += "%s as asct2, " % random.choice(self.q_select) sql += "%s " % math_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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) @@ -1254,9 +1254,9 @@ class TDTestCase: sql += " from ( select * from regular_table_1 ) where " sql += "%s " % random.choice(self.q_where) sql += " ;" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -1265,32 +1265,32 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -1301,13 +1301,13 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) @@ -1320,12 +1320,12 @@ class TDTestCase: sql += "from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(sql) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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']) \ @@ -1335,13 +1335,13 @@ class TDTestCase: sql += "%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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) @@ -1355,7 +1355,7 @@ class TDTestCase: sql += " from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(sql) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) @@ -1366,12 +1366,12 @@ class TDTestCase: 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 asct22, " % random.choice(self.q_select) + 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 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) @@ -1379,27 +1379,27 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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.t_u_where) sql += "and %s " % random.choice(self.t_u_or_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - + self.restartDnodes() tdSql.query("select 1-10 as math_nest from stable_1 limit 1;") for i in range(self.fornum): @@ -1424,8 +1424,8 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -1442,12 +1442,12 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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): @@ -1471,10 +1471,10 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) + self.cur1.execute(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']) : @@ -1489,8 +1489,8 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -1500,78 +1500,78 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 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 asct13, " % random.choice(self.q_select) sql += "%s as asct14, " % math_fun_2 - sql += "%s as asct15 " % random.choice(self.t_select) + sql += "%s as asct15 " % 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) - self.cur1.execute(sql) + self.cur1.execute(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 += "%s " % random.choice(self.t_select) sql += " from ( select * from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 asct1, " % math_fun_1 sql += "%s as asct2" % math_fun_2 sql += " from stable_1 where " sql += "%s " % random.choice(self.q_where) @@ -1579,67 +1579,67 @@ class TDTestCase: sql += "%s " % random.choice(self.order_desc_where) sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) sql += " ) ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 + 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 += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(sql) self.explain_sql(sql) - + #taos -f sql # startTime_taosf = time.time() print("taos -f %s sql start!" %mathlist) @@ -1648,274 +1648,274 @@ class TDTestCase: _ = subprocess.check_output(taos_cmd1, shell=True) print("taos -f %s sql over!" %mathlist) # endTime_taosf = time.time() - # print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) - - print("=========%s====over=============" %mathlist) + # print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) + + print("=========%s====over=============" %mathlist) def str_nest(self,strlist): - - print("==========%s===start=============" %strlist) - os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) - + + 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)'] + 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)'] + '(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_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)'] + '(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) + 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)',] + '(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)'] + '(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)',] + '(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)'] + '(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) + 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("'","") + '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("'","") + '(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("'","") + + 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("'","") + '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("'","") + + 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("'","") + + 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("'","") + + 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) + 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'] - + '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("'","") + 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("'","") + '(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("'","") + + 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("'","") + '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("'","") + + 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("'","") + + 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("'","") + + 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 = "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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) - self.cur1.execute(sql) + self.cur1.execute(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 = "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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 as asct1, " % str_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%s " % random.choice(self.unionall_or_union) sql += "select ts , asct2 from ( select " - sql += "%s as asct2, " % str_fun_2 + sql += "%s as asct2, " % str_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.q_where) #sql += "%s " % random.choice(having_support) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) - self.explain_sql(sql) - elif (strlist == ['LENGTH','CHAR_LENGTH']): + 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 as asct1, " % str_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%s " % random.choice(self.unionall_or_union) sql += "select sum(asct2), min(asct2) from ( select " - sql += "%s as asct2, " % str_fun_2 + sql += "%s as asct2, " % str_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.q_where) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) - + self.cur1.execute(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']): @@ -1923,20 +1923,20 @@ class TDTestCase: 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 += "%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 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #tdSql.query(sql) #'unexpected end of data' # self.cur1.execute(sql) # self.explain_sql(sql) @@ -1945,92 +1945,92 @@ class TDTestCase: 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 += "%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 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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, " % str_fun_1 sql += "%s as asct21, " % random.choice(self.q_select) - sql += "%s as asct22, " % 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) self.explain_sql(sql) elif (strlist == ['LENGTH','CHAR_LENGTH']): sql = "select ts ," - sql += "%s, " % str_fun_1 + 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 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) @@ -2040,35 +2040,35 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -2078,13 +2078,13 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) @@ -2094,18 +2094,18 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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']): @@ -2114,13 +2114,13 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) @@ -2132,13 +2132,13 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) @@ -2148,12 +2148,12 @@ class TDTestCase: 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 += "%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) @@ -2161,32 +2161,32 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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) + tdLog.info(len(sql)) + tdSql.query(sql) + self.cur1.execute(sql) + self.explain_sql(sql) + self.restartDnodes() tdSql.query("select 1-10 as str_nest from stable_1 limit 1;") for i in range(self.fornum): @@ -2210,11 +2210,11 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) - self.explain_sql(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 @@ -2235,12 +2235,12 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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): @@ -2263,11 +2263,11 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) - self.explain_sql(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 @@ -2287,8 +2287,8 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -2297,85 +2297,85 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 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 asct12, " % random.choice(self.q_select) sql += "%s as asct13, " % str_fun_2 - sql += "%s as asct14 " % random.choice(self.t_select) + 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) - tdLog.info(len(sql)) - tdSql.query(sql) - tdSql.checkRows(300) - self.cur1.execute(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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(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) + tdLog.info(len(sql)) + tdSql.query(sql) + tdSql.checkRows(300) + self.cur1.execute(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 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) @@ -2383,14 +2383,14 @@ class TDTestCase: sql += "%s " % random.choice(self.order_desc_where) sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) sql += " ) ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 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) @@ -2398,56 +2398,56 @@ class TDTestCase: sql += "%s " % random.choice(self.order_desc_where) sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) sql += " ) ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 += "%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 += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(sql) self.explain_sql(sql) - + #taos -f sql startTime_taos_f = time.time() print("taos -f %s sql start!" %strlist) @@ -2456,215 +2456,215 @@ class TDTestCase: _ = 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) - + 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)) - + + 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 = ['()'] + 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_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)) + 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))] + '%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))] + + 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))] + '(%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))] + + 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() + 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] - + '(%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] - + '(%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)'] - + 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_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() + 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("'","") - + 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) + '%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_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) + '%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)] + + 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() + 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) + '%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_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) + '%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)] + + 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("'","") - + 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_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 + str_functions = timelist #下面的4个是全的,这个只是1个 i = random.randint(1,4) if i ==1: @@ -2672,33 +2672,33 @@ class TDTestCase: 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("'","") + + 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("'","") + + 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("'","") + '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("'","") + + 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("'","") - + 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("'","") @@ -2706,285 +2706,285 @@ class TDTestCase: 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("'","") + '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("'","") + + 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("'","") - + 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("'","") + 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("'","") - + 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("'","") + '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("'","") + + 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("'","") - + 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("'","") - + 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("'","") + 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("'","") + + 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("'","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + elif (timelist == ['CAST_1']) : - str_functions = timelist - + 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("'","") + + 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("'","") + 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","") - + 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("'","") + '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("'","") + 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","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_1","") + elif (timelist == ['CAST_2']) : - str_functions = timelist + 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","") + 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","") - + 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("'","") + '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("'","") + 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","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_2","") + elif (timelist == ['CAST_3']) : - str_functions = timelist + 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","") + 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","") - + 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("'","") + '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("'","") + 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","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_3","") + elif (timelist == ['CAST_4']) : - str_functions = timelist + 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","") - + 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("'","") + 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("'","") + 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","") - + 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 = "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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(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 = "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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 as asct1, " % time_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%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 as asct2, " % time_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.q_where) #sql += "%s " % random.choice(having_support) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.cur1.execute(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 asct1, " % time_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%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 as asct2, " % time_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.q_where) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) - elif (timelist == ['ELAPSED']) : + self.cur1.execute(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 += "%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 += "%s " % random.choice(self.unionall_or_union) sql += "select avg(asct2),now(),today(),timezone() from ( select " - sql += "%s as asct2 " % time_fun_2 + 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.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) - + self.cur1.execute(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'])\ @@ -2993,20 +2993,20 @@ class TDTestCase: 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 += "%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 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -3015,176 +3015,176 @@ class TDTestCase: 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 += "%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 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - elif (timelist == ['ELAPSED']) : + 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 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 += " order by asct1 asc " sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) self.explain_sql(sql) - elif (timelist == ['ELAPSED']) : + 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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']) : + if (timelist == ['ELAPSED']) : sql = "select now(),today(),timezone(), " - sql += "%s, " % time_fun_1 + 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) else: sql = "select ts ,now(),today(),timezone(), " - sql += "%s as asct11, " % time_fun_1 + 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 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 1-6 as time_nest from stable_1 limit 1;") - for i in range(self.fornum): + 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -3195,15 +3195,15 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) + tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(sql) self.explain_sql(sql) @@ -3211,15 +3211,15 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) + tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(sql) self.explain_sql(sql) @@ -3230,12 +3230,12 @@ class TDTestCase: sql += "from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(sql) + tdLog.info(sql) tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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'])\ @@ -3245,15 +3245,15 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) + tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(sql) self.explain_sql(sql) @@ -3263,18 +3263,18 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) + tdSql.query(sql) tdSql.checkRows(300) - self.cur1.execute(sql) - self.explain_sql(sql) + self.cur1.execute(sql) + self.explain_sql(sql) elif (timelist == ['ELAPSED']) : sql = "select floor(abs(asct1)),now(),today(),timezone() " sql += "from ( select " @@ -3283,10 +3283,10 @@ class TDTestCase: sql += "from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(sql) + tdLog.info(sql) tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) + tdSql.query(sql) + self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 1-9 as time_nest from stable_1 limit 1;") @@ -3294,12 +3294,12 @@ class TDTestCase: 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 += "%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) @@ -3307,19 +3307,19 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) @@ -3327,27 +3327,27 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) - + self.cur1.execute(sql) + self.explain_sql(sql) + self.restartDnodes() tdSql.query("select 1-10 as time_nest from stable_1 limit 1;") for i in range(self.fornum): @@ -3372,8 +3372,8 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -3397,11 +3397,11 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + self.cur1.execute(sql) + self.explain_sql(sql) elif (timelist == ['ELAPSED']) : sql = "select abs(asct1),now(),today(),timezone() from ( select " sql += "%s as asct1 ," % time_fun_1 @@ -3416,12 +3416,12 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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): @@ -3445,8 +3445,8 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -3469,8 +3469,8 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -3486,11 +3486,11 @@ class TDTestCase: sql += "%s as asct2 " % time_fun_2 sql += " from stable_2 where " sql += "%s " % random.choice(self.q_where) - sql += "order by asct1 " + sql += "order by asct1 " sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -3500,114 +3500,114 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 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 asct12, " % random.choice(self.q_select) sql += "%s as asct13, " % time_fun_2 - sql += "%s as asct122 " % random.choice(self.t_select) + 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) - self.cur1.execute(sql) + self.cur1.execute(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 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 asct12, " % random.choice(self.q_select) sql += "%s as asct13, " % time_fun_2 - sql += "%s as asct122 " % random.choice(self.t_select) + 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) - self.cur1.execute(sql) + self.cur1.execute(sql) self.explain_sql(sql) elif (timelist == ['ELAPSED']) : sql = "select now(),today(),timezone(), " - sql += "%s as asct1, " % time_fun_1 + 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 asct1, " % time_fun_1 sql += "%s as asct2" % time_fun_2 sql += " from stable_1 where " sql += "%s " % random.choice(self.q_where) @@ -3615,14 +3615,14 @@ class TDTestCase: sql += "%s " % random.choice(self.order_desc_where) sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) sql += " ) ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 asct1, " % time_fun_1 sql += "%s as asct2" % time_fun_2 sql += " from stable_1 where " sql += "%s " % random.choice(self.q_where) @@ -3630,88 +3630,88 @@ class TDTestCase: sql += "%s " % random.choice(self.order_desc_where) sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) sql += " ) ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(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 += "%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 += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) + self.cur1.execute(sql) self.explain_sql(sql) - + #taos -f sql startTime_taos_f = time.time() print("taos -f %s sql start!" %timelist) @@ -3720,149 +3720,149 @@ class TDTestCase: _ = 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) + print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) + + print("=========%s====over=============" %timelist) def base_nest(self,baselist): - - print("==========%s===start=============" %baselist) - os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) - + + print("==========%s===start=============" %baselist) + os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) + self.dropandcreateDB_random("%s" %self.db_nest, 1) - + if (baselist == ['A']) or (baselist == ['S']) or (baselist == ['F']) \ or (baselist == ['C']): - base_functions = baselist - 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)'] + base_functions = baselist + 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(base_functions,1)+random.sample(fun_fix_column,1) base_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","") fun_column_2 = random.sample(base_functions,1)+random.sample(fun_fix_column,1) base_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)'] + '(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(base_functions,1)+random.sample(fun_fix_column_j,1) base_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","") fun_column_join_2 = random.sample(base_functions,1)+random.sample(fun_fix_column_j,1) base_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","") elif (baselist == ['P']) or (baselist == ['M']) or (baselist == ['S'])or (baselist == ['T']): - base_functions = baselist - num = random.randint(0, 1000) + base_functions = baselist + 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)'] + '(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(base_functions,1)+random.sample(fun_fix_column,1) base_fun_1 = str(fun_column_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(num)) fun_column_2 = random.sample(base_functions,1)+random.sample(fun_fix_column,1) base_fun_2 = str(fun_column_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(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)'] + '(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(base_functions,1)+random.sample(fun_fix_column_j,1) base_fun_join_1 = str(fun_column_join_1).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(num)) fun_column_join_2 = random.sample(base_functions,1)+random.sample(fun_fix_column_j,1) base_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace(", ","").replace("num",base(num)) - + tdSql.query("select 1-1 as base_nest from stable_1 limit 1;") for i in range(self.fornum): - sql = "select ts , floor(asct1) from ( select " - sql += "%s as asct1, " % base_fun_1 - sql += "%s as asct2, " % base_fun_2 + sql = "select ts , floor(asct1) from ( select " + sql += "%s as asct1, " % base_fun_1 + sql += "%s as asct2, " % base_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) - + tdSql.query("select 1-2 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts , abs(asct1) from ( select " - sql += "%s as asct1, " % base_fun_1 + sql += "%s as asct1, " % base_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%s " % random.choice(self.unionall_or_union) sql += "select ts , asct2 from ( select " - sql += "%s as asct2, " % base_fun_2 + sql += "%s as asct2, " % base_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.q_where) #sql += "%s " % random.choice(having_support) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #tdSql.query(sql) - #self.cur1.execute(sql) - + #self.cur1.execute(sql) + tdSql.query("select 1-3 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts , min(asct1) from ( select " sql += "%s as asct1, ts ," % base_fun_1 sql += "%s as asct2, " % base_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 select " % random.choice(self.unionall_or_union) sql += "%s as asct2, ts ," % base_fun_2 sql += "%s as asct1, " % base_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #tdSql.query(sql) #self.cur1.execute(sql) - + tdSql.query("select 1-4 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts1,ts2 ,timediff(ts1,ts2), asct1 from ( select t1.ts as ts1," - sql += "%s, " % base_fun_join_1 - sql += "%s as asct1, " % base_fun_join_2 - sql += "%s, " % base_fun_join_1 - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) + sql += "%s, " % base_fun_join_1 + sql += "%s as asct1, " % base_fun_join_2 + sql += "%s, " % base_fun_join_1 + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % random.choice(self.q_select) 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_u_where) sql += ");" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) - + tdSql.query("select 1-5 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts ," - sql += "%s, " % base_fun_1 + sql += "%s, " % base_fun_1 + sql += "%s, " % random.choice(self.q_select) sql += "%s, " % random.choice(self.q_select) - sql += "%s, " % random.choice(self.q_select) sql += "%s " % base_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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) @@ -3870,19 +3870,19 @@ class TDTestCase: tdSql.query("select 1-6 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts , max(asct1) from ( select t1.ts as ts1," - sql += "%s, " % base_fun_join_1 - sql += "%s as asct1, " % base_fun_join_2 - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) - sql += "%s, " % base_fun_join_1 + sql += "%s, " % base_fun_join_1 + sql += "%s as asct1, " % base_fun_join_2 + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % random.choice(self.q_select) + sql += "%s, " % base_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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) tdSql.query("select 1-7 as base_nest from stable_1 limit 1;") @@ -3890,18 +3890,18 @@ class TDTestCase: sql = "select ts , abs(asct1) from ( select " sql += "%s as asct1, ts ," % base_fun_1 sql += "%s as asct2, " % base_fun_2 - sql += "%s, " % random.choice(self.q_select) - sql += "%s, " % random.choice(self.t_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(sql) tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(sql) - + tdSql.query("select 1-8 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts,floor(asct1) " @@ -3909,13 +3909,13 @@ class TDTestCase: sql += "%s, " % random.choice(self.s_s_select) sql += "%s as asct1, ts ," % base_fun_1 sql += "%s as asct2, " % base_fun_2 - sql += "%s, " % random.choice(self.q_select) - sql += "%s, " % random.choice(self.t_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(sql) tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) @@ -3924,12 +3924,12 @@ class TDTestCase: tdSql.query("select 1-9 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts , max(asct1) from ( select t1.ts as ts1," - sql += "%s, " % base_fun_join_1 - sql += "%s as asct1, " % base_fun_join_2 - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) + sql += "%s, " % base_fun_join_1 + sql += "%s as asct1, " % base_fun_join_2 + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % 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.t_u_where) @@ -3937,11 +3937,11 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) - + self.restartDnodes() tdSql.query("select 1-10 as base_nest from stable_1 limit 1;") for i in range(self.fornum): @@ -3964,11 +3964,11 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #tdSql.query(sql) #self.cur1.execute(sql) - + #3 inter union not support tdSql.query("select 1-11 as base_nest from stable_1 limit 1;") for i in range(self.fornum): @@ -3992,53 +3992,53 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #TD-15837 tdSql.query(sql) # self.cur1.execute(sql) tdSql.query("select 1-12 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts , max(asct1) from ( select t1.ts as ts1," - sql += "%s, " % base_fun_join_1 - sql += "%s as asct1, " % base_fun_join_2 - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) + sql += "%s, " % base_fun_join_1 + sql += "%s as asct1, " % base_fun_join_2 + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % 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_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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) - + tdSql.query("select 1-13 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts ," - sql += "%s, " % base_fun_1 + sql += "%s, " % base_fun_1 + sql += "%s, " % random.choice(self.q_select) sql += "%s, " % random.choice(self.q_select) - sql += "%s, " % random.choice(self.q_select) sql += "%s " % base_fun_2 - sql += "%s " % random.choice(self.t_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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(sql) - + tdSql.query("select 1-14 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select avg(asct1),count(asct2) from ( select " - sql += "%s as asct1, " % base_fun_1 + sql += "%s as asct1, " % base_fun_1 sql += "%s as asct2" % base_fun_2 sql += " from stable_1 where " sql += "%s " % random.choice(self.q_where) @@ -4046,33 +4046,33 @@ class TDTestCase: sql += "%s " % random.choice(self.order_desc_where) sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) sql += " ) ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - + self.cur1.execute(sql) + tdSql.query("select 1-15 as base_nest from stable_1 limit 1;") for i in range(self.fornum): sql = "select ts , max(asct1) from ( select t1.ts as ts1," - sql += "%s, " % base_fun_join_1 - sql += "%s as asct1, " % base_fun_join_2 - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) - sql += "t2.%s " % random.choice(self.q_select) + sql += "%s, " % base_fun_join_1 + sql += "%s as asct1, " % base_fun_join_2 + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % random.choice(self.q_select) + sql += "t2.%s " % 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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - self.cur1.execute(sql) - + self.cur1.execute(sql) + #taos -f sql startTime_taos_f = time.time() print("taos -f %s sql start!" %baselist) @@ -4080,35 +4080,35 @@ class TDTestCase: _ = subprocess.check_output(taos_cmd1, shell=True).decode("utf-8") print("taos -f %s sql over!" %baselist) endTime_taos_f = time.time() - print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) - - print("=========%s====over=============" %baselist) - + print("taos_f total time %ds" % (endTime_taos_f - startTime_taos_f)) + + print("=========%s====over=============" %baselist) + def function_before_26(self): - + print('=====================2.6 old function start ===========') - os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) - + 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 += "%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) - tdLog.info(len(sql)) + sql += ");" + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql,queryTimes=1) tdSql.checkRows(100) self.cur1.execute(sql) self.explain_sql(sql) - - #1 outer union not support + + #1 outer union not support #self.dropandcreateDB_random("%s" %db, 1) tdSql.query("select 1-2 from stable_1;") for i in range(self.fornum): @@ -4127,13 +4127,13 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(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): @@ -4151,13 +4151,13 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(200) self.cur1.execute(sql) self.explain_sql(sql) - + #1 inter union not support tdSql.query("select 1-3 from stable_1;") for i in range(self.fornum): @@ -4167,7 +4167,7 @@ class TDTestCase: sql += "%s, " % random.choice(self.q_select) sql += "ts from regular_table_1 where " sql += "%s " % random.choice(self.q_where) - sql += "" + sql += "" sql += " union all select " sql += "%s, " % random.choice(self.s_r_select) sql += "%s, " % random.choice(self.q_select) @@ -4175,13 +4175,13 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(sql) self.explain_sql(sql) - + tdSql.query("select 1-3 from stable_1;") for i in range(self.fornum): sql = "select ts from ( select " @@ -4196,48 +4196,48 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(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) + + #join:select * from (select column form regular_table1,regular_table2 where t1.ts=t2.ts and <\>\in\and\or order by) #self.dropandcreateDB_random("%s" %db, 1) 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 += "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 += "and %s " % random.choice(self.q_u_or_where) sql += "%s " % random.choice(self.order_u_where) sql += ");" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) self.explain_sql(sql) - #2 select column from (select * form regular_table ) where <\>\in\and\or order by + #2 select column from (select * form regular_table ) where <\>\in\and\or order by #self.dropandcreateDB_random("%s" %db, 1) 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(100) self.cur1.execute(sql) @@ -4248,31 +4248,31 @@ class TDTestCase: tdSql.query("select 2-2 from stable_1;") for i in range(self.fornum): sql = "select ts , * from ( select t1.ts ," - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t1.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) - sql += "t2.%s, " % random.choice(self.q_select) + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t1.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % random.choice(self.q_select) + sql += "t2.%s, " % random.choice(self.q_select) 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 += "%s " % random.choice(self.order_u_where) #sql += ");" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.error(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.error(sql) - #3 select * from (select column\tag form stable where <\>\in\and\or order by ) + #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 += "%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(sql) tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) @@ -4284,39 +4284,39 @@ class TDTestCase: 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 += "%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(sql) tdLog.info(len(sql)) - tdSql.query(sql) + tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(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 ) + # 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 += "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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - + #3 outer union not support self.restartDnodes() tdSql.query("select 3-3 from stable_1;") @@ -4336,10 +4336,10 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - tdSql.checkRows(300) + tdSql.checkRows(500) self.cur1.execute(sql) self.explain_sql(sql) for i in range(self.fornum): @@ -4357,13 +4357,13 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(600) self.cur1.execute(sql) self.explain_sql(sql) - + #3 inter union not support tdSql.query("select 3-4 from stable_1;") for i in range(self.fornum): @@ -4380,9 +4380,9 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4390,53 +4390,53 @@ class TDTestCase: 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 += "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - tdSql.checkRows(300) + tdSql.checkRows(100) self.cur1.execute(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 += "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) - tdSql.checkRows(300) + tdSql.checkRows(100) self.cur1.execute(sql) self.explain_sql(sql) - #4 select column from (select * form stable where <\>\in\and\or order by ) + #4 select column from (select * form stable where <\>\in\and\or order by ) #self.dropandcreateDB_random("%s" %db, 1) 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(300) self.cur1.execute(sql) @@ -4451,8 +4451,8 @@ class TDTestCase: sql += "%s " % random.choice(self.qt_where) sql += "%s " % random.choice(self.order_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4462,12 +4462,12 @@ class TDTestCase: for i in range(self.fornum): sql = "select distinct c5_1 " sql += " from ( select " - sql += "%s " % random.choice(self.calc_select_in_ts) + 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4481,8 +4481,8 @@ class TDTestCase: sql += "%s " % random.choice(self.qt_where) sql += "%s " % random.choice(self.order_desc_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.error(sql) tdSql.query("select 6-1 from stable_1;") for i in range(self.fornum): @@ -4490,8 +4490,8 @@ class TDTestCase: sql += "%s " % random.choice(self.dt_select) sql += " from stable_1 where " sql += "%s ) ;" % random.choice(self.qt_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4506,9 +4506,9 @@ class TDTestCase: sql += "%s " % random.choice(self.order_desc_where) sql += "%s " % random.choice([self.limit_where[0] , self.limit_where[1]] ) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.error(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.error(sql) tdSql.query("select 7-1 from stable_1;") for i in range(self.fornum): sql = "select * from ( select " @@ -4517,8 +4517,8 @@ class TDTestCase: sql += "%s " % random.choice(self.qt_where) sql += "%s " % random.choice([self.limit_where[0] , self.limit_where[1]] ) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) tdSql.checkRows(1) self.cur1.execute(sql) @@ -4526,45 +4526,45 @@ class TDTestCase: #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 ) - + # dcDB = self.dropandcreateDB_random("%s" %db, 1) 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4572,130 +4572,130 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) - self.explain_sql(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) + self.cur1.execute(sql) + self.explain_sql(sql) - #9 select * from (select ts,calc form stable where <\>\in\and\or order by ) + #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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - - #10 select calc from (select * form regualr_table where <\>\in\and\or order by ) + + #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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - + #10-1 select calc from (select * form regualr_table where <\>\in\and\or order by ) - # rsDn = self.restartDnodes() + # rsDn = self.restartDnodes() # self.dropandcreateDB_random("%s" %db, 1) # rsDn = self.restartDnodes() 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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - #10-2 select calc from (select * form regualr_tables where <\>\in\and\or order by ) + #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 = "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) @@ -4703,16 +4703,16 @@ class TDTestCase: sql += "%s " % random.choice(self.limit_u_where) sql += ") " sql += "%s ;" % random.choice(self.limit1_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 10-4 from stable_1;") for i in range(self.fornum): - sql = "select " - sql += "%s as calc10_4 " % random.choice(self.calc_select_all) + sql = "select " + sql += "%s as calc10_4 " % random.choice(self.calc_select_all) sql += " from ( select * 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 += " and %s " % random.choice(self.q_u_or_where) @@ -4720,84 +4720,84 @@ class TDTestCase: sql += "%s " % random.choice(self.limit_u_where) sql += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.error(sql) - #11 select calc from (select * form stable where <\>\in\and\or order by limit ) + #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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - #11-1 select calc from (select * form stable where <\>\in\and\or order by limit ) + #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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - + #11-2 select calc from (select * form stables where <\>\in\and\or order by limit ) tdSql.query("select 11-3 from stable_1;") for i in range(self.fornum): sql = "select " - sql += "%s " % random.choice(self.calc_select_all) + sql += "%s " % random.choice(self.calc_select_all) sql += "as calc11_1 from ( select * 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 += "%s " % random.choice(self.limit_u_where) sql += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.error(sql) tdSql.query("select 11-4 from stable_1;") for i in range(self.fornum): sql = "select " - sql += "%s " % random.choice(self.calc_select_all) + sql += "%s " % random.choice(self.calc_select_all) sql += "as calc11_1 from ( select * 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.order_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.error(sql) - #12 select calc-diff from (select * form regualr_table where <\>\in\and\or order by limit ) + #12 select calc-diff from (select * form regualr_table where <\>\in\and\or order by limit ) ##self.dropandcreateDB_random("%s" %db, 1) 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4805,27 +4805,27 @@ class TDTestCase: tdSql.query("select 12-2 from stable_1;") for i in range(self.fornum): sql = "select " - sql += "%s " % random.choice(self.calc_calculate_regular) + sql += "%s " % random.choice(self.calc_calculate_regular) sql += " from ( select * 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.limit_where[2] , self.limit_where[3]] ) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.error(sql) tdSql.query("select 12-2.2 from stable_1;") for i in range(self.fornum): sql = "select " - sql += "%s " % random.choice(self.calc_calculate_regular) + sql += "%s " % random.choice(self.calc_calculate_regular) sql += " from ( select * 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.order_u_where) sql += "%s " % random.choice([self.limit_where[2] , self.limit_where[3]] ) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.error(sql) #12-1 select calc-diff from (select * form stable where <\>\in\and\or order by limit ) @@ -4833,15 +4833,15 @@ class TDTestCase: self.restartDnodes() for i in range(self.fornum): sql = "select * from ( select " - sql += "%s " % random.choice(self.calc_calculate_regular) + 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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4850,15 +4850,15 @@ class TDTestCase: #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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4867,31 +4867,31 @@ class TDTestCase: #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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4900,15 +4900,15 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4917,16 +4917,16 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4935,17 +4935,17 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4953,17 +4953,17 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -4972,48 +4972,48 @@ class TDTestCase: 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 += "%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 += "%s " % random.choice(self.group_where_regular) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) - self.data_check(sql,mark='15-1') - + tdLog.info(sql) + tdLog.info(len(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 += "%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.group_where_regular_j) sql += "%s " % random.choice(self.limit_u_where) sql += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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.group_where_regular_j) sql += "%s " % random.choice(self.limit_u_where) sql += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5021,226 +5021,226 @@ class TDTestCase: 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 += "%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 += "order by calc15_1 " sql += "%s " % random.choice(self.limit_where) - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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 += "order by calc15_1 " sql += "%s " % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 15-4.2 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 += "%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.qt_u_or_where) sql += "%s " % random.choice(self.group_where_j) sql += ") " - sql += "order by calc15_1 " + sql += "order by calc15_1 " sql += "%s " % random.choice(self.limit_u_where) - tdLog.info(sql) - tdLog.info(len(sql)) - self.data_check(sql,mark='15-4.2') + tdLog.info(sql) + tdLog.info(len(sql)) + self.data_check(sql,mark='15-4.2') 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 += "%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 += "order by calc15_1 " sql += "%s " % random.choice(self.limit_where) - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 ) + #16 select * from (select calc_aggregate_regulars as agg from regular_table where <\>\in\and\or order by limit offset ) #self.dropandcreateDB_random("%s" %db, 1) tdSql.query("select 16-1 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + 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 += "%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 += "order by calc16_0 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 16-2 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + 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 += ", %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 += "order by calc16_0 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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 += ", %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 += "order by calc16_0 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - + tdSql.query("select 16-5 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + 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 += "%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 += "order by calc16_1 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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 = "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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5249,56 +5249,56 @@ class TDTestCase: #self.dropandcreateDB_random("%s" %db, 1) tdSql.query("select 17-1 from stable_1;") for i in range(self.fornum): - #this is having_support , but tag-select cannot mix with last_row,other select can + #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) - sql += "%s as cal17_1 ," % random.choice(self.calc_aggregate_all) - sql += "%s as cal17_2 " % random.choice(self.calc_aggregate_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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 + #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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 17-2.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 + #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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5307,17 +5307,17 @@ class TDTestCase: for i in range(self.fornum): #this is having_tagnot_support , because tag-select cannot mix with last_row... 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5325,16 +5325,16 @@ class TDTestCase: for i in range(self.fornum): #this is having_tagnot_support , because tag-select cannot mix with last_row... 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5342,82 +5342,82 @@ class TDTestCase: for i in range(self.fornum): #this is having_tagnot_support , because tag-select cannot mix with last_row... 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 += "%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) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 17-5 from stable_1;") for i in range(self.fornum): - #having_not_support + #having_not_support 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5425,48 +5425,48 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5474,48 +5474,48 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) @@ -5523,258 +5523,258 @@ class TDTestCase: 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 + #19 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or session order by limit )interval_sliding #self.dropandcreateDB_random("%s" %db, 1) 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 += "%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.q_where) sql += "%s " % random.choice(self.state_window) sql += "%s " % random.choice(self.limit1_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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.q_u_where) sql += "%s " % random.choice(self.state_u_window) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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.q_u_or_where) sql += "%s " % random.choice(self.state_u_window) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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.q_where) sql += "%s " % random.choice(self.state_window) sql += "%s " % random.choice(self.limit1_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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.q_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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.q_u_or_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) tdSql.query("select 19-5 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 += "%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 where " - sql += "%s " % random.choice(self.q_where) + sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.state_window) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ") " sql += "%s " % random.choice(self.interval_sliding) - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.error(sql) - + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.error(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 += "%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.q_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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.qt_u_or_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.query(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - #20 select * from (select calc_select_fills form regualr_table or stable where <\>\in\and\or fill_where group by order by limit offset ) + #20 select * from (select calc_select_fills form regualr_table or stable where <\>\in\and\or fill_where group by order by limit offset ) #self.dropandcreateDB_random("%s" %db, 1) tdSql.query("select 20-1 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill) - sql += "%s ," % random.choice(self.calc_select_fill) - sql += "%s " % random.choice(self.calc_select_fill) + sql += "%s ," % random.choice(self.calc_select_fill) + sql += "%s " % random.choice(self.calc_select_fill) sql += " from stable_1 where " - sql += "%s " % random.choice(self.interp_where) + sql += "%s " % random.choice(self.interp_where) sql += "%s " % random.choice(self.fill_where) sql += "%s " % random.choice(self.group_where) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #interp不支持 tdSql.query(sql) #self.cur1.execute(sql) #self.explain_sql(sql) @@ -5782,303 +5782,303 @@ class TDTestCase: rsDn = self.restartDnodes() tdSql.query("select 20-2 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill_j) - sql += "%s ," % random.choice(self.calc_select_fill_j) - sql += "%s " % random.choice(self.calc_select_fill_j) + sql += "%s ," % random.choice(self.calc_select_fill_j) + sql += "%s " % random.choice(self.calc_select_fill_j) sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " sql += "%s and " % random.choice(self.t_join_where) - sql += "%s " % random.choice(self.interp_where_j) + sql += "%s " % random.choice(self.interp_where_j) sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #interp不支持 tdSql.query(sql) #self.cur1.execute(sql) #self.explain_sql(sql) tdSql.query("select 20-2.2 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill_j) - sql += "%s ," % random.choice(self.calc_select_fill_j) - sql += "%s " % random.choice(self.calc_select_fill_j) + sql += "%s ," % random.choice(self.calc_select_fill_j) + sql += "%s " % random.choice(self.calc_select_fill_j) sql += " from stable_1 t1 , stable_2 t2 where t1.ts = t2.ts and " sql += "%s and " % random.choice(self.qt_u_or_where) - sql += "%s " % random.choice(self.interp_where_j) + sql += "%s " % random.choice(self.interp_where_j) sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #interp不支持 tdSql.query(sql) #self.cur1.execute(sql) #self.explain_sql(sql) tdSql.query("select 20-3 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill) - sql += "%s ," % random.choice(self.calc_select_fill) - sql += "%s " % random.choice(self.calc_select_fill) + sql += "%s ," % random.choice(self.calc_select_fill) + sql += "%s " % random.choice(self.calc_select_fill) sql += " from stable_1 where " - sql += "%s " % self.interp_where[2] + sql += "%s " % self.interp_where[2] sql += "%s " % random.choice(self.fill_where) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #interp不支持 tdSql.query(sql) #self.cur1.execute(sql) #self.explain_sql(sql) - + tdSql.query("select 20-4 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill_j) - sql += "%s ," % random.choice(self.calc_select_fill_j) - sql += "%s " % random.choice(self.calc_select_fill_j) - sql += " from stable_1 t1, table_1 t2 where t1.ts = t2.ts and " + sql += "%s ," % random.choice(self.calc_select_fill_j) + sql += "%s " % random.choice(self.calc_select_fill_j) + sql += " from stable_1 t1, table_1 t2 where t1.ts = t2.ts and " #sql += "%s and " % random.choice(self.t_join_where) sql += "%s " % self.interp_where_j[random.randint(0,5)] sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) #interp不支持 tdSql.query(sql) #self.cur1.execute(sql) #self.explain_sql(sql) tdSql.query("select 20-4.2 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill_j) - sql += "%s ," % random.choice(self.calc_select_fill_j) - sql += "%s " % random.choice(self.calc_select_fill_j) - sql += " from stable_1 t1, stable_1_1 t2 where t1.ts = t2.ts and " + sql += "%s ," % random.choice(self.calc_select_fill_j) + sql += "%s " % random.choice(self.calc_select_fill_j) + sql += " from stable_1 t1, stable_1_1 t2 where t1.ts = t2.ts and " sql += "%s and " % random.choice(self.qt_u_or_where) sql += "%s " % self.interp_where_j[random.randint(0,5)] sql += "%s " % random.choice(self.fill_where) sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) ##interp不支持 tdSql.error(sql) #self.cur1.execute(sql) #self.explain_sql(sql) - + tdSql.query("select 20-5 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill) - sql += "%s ," % random.choice(self.calc_select_fill) - sql += "%s " % random.choice(self.calc_select_fill) + sql += "%s ," % random.choice(self.calc_select_fill) + sql += "%s " % random.choice(self.calc_select_fill) sql += " from regular_table_1 where " - sql += "%s " % self.interp_where[1] + sql += "%s " % self.interp_where[1] sql += "%s " % random.choice(self.fill_where) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) ##interp不支持 tdSql.query(sql) #self.cur1.execute(sql) #self.explain_sql(sql) tdSql.query("select 20-6 from stable_1;") for i in range(self.fornum): - sql = "select * from ( select " + sql = "select * from ( select " sql += "%s , " % random.choice(self.calc_select_fill_j) - sql += "%s ," % random.choice(self.calc_select_fill_j) - sql += "%s " % random.choice(self.calc_select_fill_j) + sql += "%s ," % random.choice(self.calc_select_fill_j) + sql += "%s " % random.choice(self.calc_select_fill_j) sql += " from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and " - #sql += "%s " % random.choice(self.interp_where_j) - sql += "%s " % self.interp_where_j[random.randint(0,5)] + #sql += "%s " % random.choice(self.interp_where_j) + sql += "%s " % self.interp_where_j[random.randint(0,5)] sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) ##interp不支持 tdSql.query(sql) #self.cur1.execute(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 i in range(self.fornum): # sql_start = "select * from ( " # sql_end = ")" for_num = random.randint(1, 15); - sql = "select * from (" * for_num + 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + sql += ")" * for_num + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql2)) - tdSql.query(sql2) + sql2 += ")) " + tdLog.info(sql2) + tdLog.info(len(sql2)) + tdSql.query(sql2) self.cur1.execute(sql2) self.explain_sql(sql2) - + self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1) self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql ,1,10,3,3) self.data_matrix_equal('%s' %sql ,1,10,3,3,'%s' %sql2 ,1,10,3,3) - - tdLog.info("=====1-1==over=========") - + + 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 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + sql += ")" * for_num + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql2)) + sql2 += ")) " + tdLog.info(sql2) + tdLog.info(len(sql2)) tdSql.query(sql2) self.cur1.execute(sql2) - self.explain_sql(sql2) - + self.explain_sql(sql2) + self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1) - tdLog.info("=====1-2==over=========") - + 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 (" * for_num sql += "select * from ( select * from ( select " - sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.qt_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) - tdLog.info(len(sql)) - tdSql.query(sql) + sql += ")" * for_num + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql2)) - tdSql.query(sql2) + sql2 += ")) " + tdLog.info(sql2) + tdLog.info(len(sql2)) + tdSql.query(sql2) self.cur1.execute(sql2) self.explain_sql(sql2) - + self.data_matrix_equal('%s' %sql ,1,10,3,3,'%s' %sql2 ,1,10,3,3) - - tdLog.info("=====2-1==over=========") - + + 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 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) + sql += ")" * for_num + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) self.cur1.execute(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 += "%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) - tdLog.info(len(sql2)) - tdSql.query(sql2) + sql2 += ")) " + tdLog.info(sql2) + tdLog.info(len(sql2)) + tdSql.query(sql2) self.cur1.execute(sql2) self.explain_sql(sql2) - + self.data_matrix_equal('%s' %sql ,1,10,1,1,'%s' %sql2 ,1,10,1,1) - tdLog.info("=====2-2==over=========") - - #3 select ts ,calc from (select * form stable where <\>\in\and\or order by limit ) + tdLog.info("=====2-2==over=========") + + #3 select ts ,calc from (select * form stable where <\>\in\and\or order by limit ) #self.dropandcreateDB_random("%s" %db, 1) 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 += "%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) - tdLog.info(len(sql)) - tdSql.query(sql) - self.cur1.execute(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.query(sql) + self.cur1.execute(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 += "%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.order_desc_where) sql += "%s " % random.choice(self.limit_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) + tdLog.info(sql) + tdLog.info(len(sql)) tdSql.query(sql) self.cur1.execute(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.calc_calculate_regular) sql += "%s ," % random.choice(self.dqt_select) sql += "%s " % random.choice(self.qt_select) sql += " from ( select * from stable_1 where " @@ -6086,9 +6086,9 @@ class TDTestCase: sql += "%s " % random.choice(self.orders_desc_where) sql += "%s " % random.choice(self.limit_where) sql += ") ;" - tdLog.info(sql) - tdLog.info(len(sql)) - tdSql.error(sql) + tdLog.info(sql) + tdLog.info(len(sql)) + tdSql.error(sql) #special sql tdSql.query("select 6-1 from stable_1;") @@ -6098,41 +6098,41 @@ class TDTestCase: sql = "select _block_dist() from (select * from stable_1);" tdSql.error(sql) sql = "select * from (select database());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) sql = "select * from (select client_version());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) sql = "select * from (select client_version() as version);" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) sql = "select * from (select server_version());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) sql = "select * from (select server_version() as version);" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) sql = "select * from (select server_status());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) sql = "select * from (select server_status() as status);" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.cur1.execute(sql) self.explain_sql(sql) - + #taos -f sql startTime_taos_f = time.time() print("taos -f sql start!") @@ -6145,57 +6145,57 @@ class TDTestCase: print('=====================2.6 old function end ===========') - - + + def run(self): tdSql.prepare() - - startTime = time.time() - self.function_before_26() - + startTime = time.time() + + self.function_before_26() + self.math_nest(['UNIQUE']) - self.math_nest(['MODE']) + 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(['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.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']) #放到time里起来弄 # 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(['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): diff --git a/tests/system-test/2-query/stablity.py b/tests/system-test/2-query/stablity.py index 569bee62ec..ff026bf120 100755 --- a/tests/system-test/2-query/stablity.py +++ b/tests/system-test/2-query/stablity.py @@ -24,10 +24,10 @@ from util.dnodes import tdDnodes from util.dnodes import * class TDTestCase: - updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 , + 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, replicaVar=1): self.replicaVar = int(replicaVar) tdLog.debug("start to execute %s" % __file__) @@ -36,13 +36,13 @@ class TDTestCase: 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 = "stab" 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 '] @@ -53,11 +53,11 @@ class TDTestCase: 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' , + 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' , + 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 @@ -68,13 +68,13 @@ class TDTestCase: self.s_s_select= ['tbname' , '_rowts' , '_c0', '_C0' ] self.unionall_or_union= [ ' union ' , ' union all ' ] - # regular column where + # 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_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_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\' ', @@ -88,38 +88,38 @@ class TDTestCase: '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_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_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_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)' , + 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_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_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_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\' ) ', @@ -132,38 +132,38 @@ class TDTestCase: '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_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_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.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_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)' , + 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_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.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_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 + # 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 @@ -176,87 +176,87 @@ class TDTestCase: 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 + # 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', + + 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 , 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', + 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.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.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.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', + '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', + 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.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', + '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', + 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.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', + '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 ' , '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', + 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_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_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_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 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', + 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_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 '] - + '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', @@ -282,15 +282,15 @@ class TDTestCase: 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 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 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'] + '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', @@ -303,7 +303,7 @@ class TDTestCase: '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' ] @@ -312,7 +312,7 @@ class TDTestCase: # 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)' , @@ -320,7 +320,7 @@ class TDTestCase: '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_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)' , @@ -328,8 +328,8 @@ class TDTestCase: '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)', + '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)' , @@ -344,25 +344,25 @@ class TDTestCase: 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_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_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_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_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)'] - + '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)' , @@ -371,11 +371,11 @@ class TDTestCase: '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\''] @@ -410,21 +410,21 @@ class TDTestCase: '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)' , + '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_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_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_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_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)' , @@ -433,20 +433,20 @@ class TDTestCase: '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_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_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_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)'] + '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)' , @@ -454,7 +454,7 @@ class TDTestCase: '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\'' , @@ -486,7 +486,7 @@ class TDTestCase: 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)'] + '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)' , @@ -534,11 +534,11 @@ class TDTestCase: '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)' , + '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_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)' , @@ -549,7 +549,7 @@ class TDTestCase: '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)' , @@ -585,11 +585,11 @@ class TDTestCase: '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 = 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 @@ -609,7 +609,7 @@ class TDTestCase: 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) ,\ @@ -621,28 +621,28 @@ class TDTestCase: 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_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_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_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))) + 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 \ @@ -668,105 +668,105 @@ class TDTestCase: 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): + for i in range(1, num_random*n + 1): 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() , + '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() , + '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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*2, 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() , + '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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*2 +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() , + '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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*4, 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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*4 +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() , + 'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;''' + % (ts + i*1000*60*60*4 +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) + + 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: @@ -774,60 +774,60 @@ class TDTestCase: 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)) - + + 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)'] + 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)'] + '(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 + 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)'] + '(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)'] + '(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) + 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)'] + '(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)', @@ -835,207 +835,207 @@ class TDTestCase: '(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)'] + '(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(1, 1000) + math_functions = mathlist + num = random.randint(1, 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)'] + '(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)'] + '(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("'","") - + 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)'] - + '(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("'","") + 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) + + 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)) - + 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)'] - + '(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("'","") + 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("'","") + 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'] - + 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) - + + normalized = random.randint(0, 1) + i = random.randint(1,3) if i == 1: - bin_type = 'user_input' + 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_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_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("}\"","}'") - + 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("}\"","}'") - + 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("}\"","}'") - + 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("}\"","}'") - + 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 = "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 += "%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) + 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 = "select %s as asct1 " % math_fun_1 sql += " from regular_table_1 where " sql += "%s " % random.choice(self.q_where) - tdLog.info(sql) + 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 = "(select %s as asct1, " % math_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.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 += "%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.q_where) sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) - self.explain_sql(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 + 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 += "%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.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdSql.query(sql) - self.explain_sql(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']) \ @@ -1043,19 +1043,19 @@ class TDTestCase: 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 += "%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 (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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) elif (mathlist == ['MODE']) : @@ -1063,13 +1063,13 @@ class TDTestCase: 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 (select " % random.choice(self.unionall_or_union) sql += "%s as asct2 ," % math_fun_2 - sql += "%s as asct1 " % math_fun_1 + sql += "%s as asct1 " % math_fun_1 sql += " from regular_table_2 where " sql += "%s " % random.choice(self.q_where) sql += ")" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) elif (mathlist == ['MAVG']) or (mathlist == ['statecount','stateduration']) or (mathlist == ['CSUM']) or (mathlist == ['HISTOGRAM']) \ @@ -1077,66 +1077,66 @@ class TDTestCase: 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 (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 += " order by asct1 asc " sql += ")" - tdLog.info(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 += "%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) + 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 += "%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) + 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, " % math_fun_1 sql += "%s as asct1, " % random.choice(self.q_select) - sql += "%s as asct2, " % 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) + 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) + 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;") @@ -1144,29 +1144,29 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + tdLog.info(sql) + tdSql.query(sql) self.explain_sql(sql) tdSql.query("select 1-7 as math_nest from stable_1 limit 1;") @@ -1176,13 +1176,13 @@ class TDTestCase: 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 += "%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) + 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']) \ @@ -1192,10 +1192,10 @@ class TDTestCase: sql += "from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(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']) \ @@ -1203,12 +1203,12 @@ class TDTestCase: 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 += "%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) + 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']) \ @@ -1216,7 +1216,7 @@ class TDTestCase: sql = "select %s as asct1 " % math_fun_1 sql += " from stable_1 where " sql += "%s " % random.choice(self.qt_where) - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -1224,33 +1224,33 @@ class TDTestCase: 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 = "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) + 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 = "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) + 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']) \ @@ -1273,7 +1273,7 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(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']) \ @@ -1288,10 +1288,10 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdSql.query(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): @@ -1314,8 +1314,8 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdSql.query(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']) : @@ -1328,7 +1328,7 @@ class TDTestCase: sql += " from stable_2 where " sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -1337,65 +1337,65 @@ class TDTestCase: 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 += "%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) + 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 = "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) + 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 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 asct13, " % random.choice(self.q_select) sql += "%s as asct14, " % math_fun_2 - sql += "%s as asct15 " % random.choice(self.t_select) + sql += "%s as asct15 " % random.choice(self.t_select) sql += " from stable_1 " - tdLog.info(sql) - tdSql.query(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 " sql += "%s " % math_fun_2 - sql += "%s " % random.choice(self.t_select) + 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) + 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 asct1, " % math_fun_1 sql += "%s as asct2" % math_fun_2 sql += " from stable_1 where " sql += "%s " % random.choice(self.q_where) @@ -1403,322 +1403,322 @@ class TDTestCase: 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) + 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 += "%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) + 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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(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 + 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 += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(sql) + 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) + 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)) - + + 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)'] + 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)'] + '(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_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)'] + '(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) + 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)',] + '(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)'] + '(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)',] + '(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)'] + '(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) + 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("'","") + '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("'","") + '(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("'","") + + 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("'","") + '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("'","") + + 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("'","") + + 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("'","") + + 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) + 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'] - + '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("'","") + 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("'","") + '(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("'","") + + 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("'","") + '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("'","") + + 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("'","") + + 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("'","") + + 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 = "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 += "%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) + 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 = "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 += "%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) + 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 as asct1, " % str_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%s " % random.choice(self.unionall_or_union) sql += "select ts , asct2 from ( select " - sql += "%s as asct2, " % str_fun_2 + sql += "%s as asct2, " % str_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.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']): + 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 as asct1, " % str_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%s " % random.choice(self.unionall_or_union) sql += "select sum(asct2), min(asct2) from ( select " - sql += "%s as asct2, " % str_fun_2 + sql += "%s as asct2, " % str_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.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) - + 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']): @@ -1726,100 +1726,100 @@ class TDTestCase: 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 += "%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 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 += "%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) + 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 += "%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 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 += "%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) + 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 += "%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) + 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 += "%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) + 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, " % str_fun_1 sql += "%s as asct21, " % random.choice(self.q_select) - sql += "%s as asct22, " % 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) + 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, " % str_fun_1 sql += "%s as asct22, " % random.choice(self.q_select) - sql += "%s as asct21, " % 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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -1827,32 +1827,32 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + tdLog.info(sql) + tdSql.query(sql) self.explain_sql(sql) tdSql.query("select 1-7 as str_nest from stable_1 limit 1;") @@ -1861,29 +1861,29 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + 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']): @@ -1892,13 +1892,13 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) elif (strlist == ['LENGTH','CHAR_LENGTH']): @@ -1907,13 +1907,13 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -1921,12 +1921,12 @@ class TDTestCase: 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 += "%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) @@ -1934,17 +1934,17 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(sql) - tdSql.query(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 += "%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) @@ -1952,11 +1952,11 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(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']): @@ -1979,9 +1979,9 @@ class TDTestCase: 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) + 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 @@ -2002,10 +2002,10 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(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): @@ -2028,9 +2028,9 @@ class TDTestCase: 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) + 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 @@ -2050,7 +2050,7 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -2058,75 +2058,75 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + 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 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 asct12, " % random.choice(self.q_select) sql += "%s as asct13, " % str_fun_2 - sql += "%s as asct14 " % random.choice(self.t_select) + 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) + 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 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 asct12, " % random.choice(self.q_select) sql += "%s as asct13, " % str_fun_2 - sql += "%s as asct14 " % random.choice(self.t_select) + 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) + 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 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) @@ -2134,12 +2134,12 @@ class TDTestCase: 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) + 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 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) @@ -2147,50 +2147,50 @@ class TDTestCase: 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) + 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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(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 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 += "%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 += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(sql) + 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) @@ -2198,215 +2198,215 @@ class TDTestCase: # _ = 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) - + 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)) - + + 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 = ['()'] + 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_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)) + 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))] + '%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))] + + 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))] + '(%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))] + + 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() + 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] - + '(%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] - + '(%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)'] - + 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_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() + 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("'","") - + 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) + '%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_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) + '%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)] + + 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() + 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) + '%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_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) + '%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)] + + 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("'","") - + 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_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 + str_functions = timelist #下面的4个是全的,这个只是1个 i = random.randint(1,4) if i ==1: @@ -2414,33 +2414,33 @@ class TDTestCase: 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("'","") + + 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("'","") + + 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("'","") + '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("'","") + + 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("'","") - + 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("'","") @@ -2448,270 +2448,270 @@ class TDTestCase: 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("'","") + '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("'","") + + 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("'","") - + 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("'","") + 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("'","") - + 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("'","") + '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("'","") + + 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("'","") - + 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("'","") - + 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("'","") + 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("'","") + + 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("'","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","") + elif (timelist == ['CAST_1']) : - str_functions = timelist - + 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("'","") + + 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("'","") + 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","") - + 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("'","") + '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("'","") + 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","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_1","") + elif (timelist == ['CAST_2']) : - str_functions = timelist + 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","") + 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","") - + 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("'","") + '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("'","") + 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","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_2","") + elif (timelist == ['CAST_3']) : - str_functions = timelist + 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","") + 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","") - + 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("'","") + '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("'","") + 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","") - + time_fun_join_2 = str(fun_column_join_2).replace("[","").replace("]","").replace("'","").replace("_3","") + elif (timelist == ['CAST_4']) : - str_functions = timelist + 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","") - + 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("'","") + 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("'","") + 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","") - + 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 = "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 += "%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) + 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 = "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 += "%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) + 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 = "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) + 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 as asct1, " % time_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%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 as asct2, " % time_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.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) + 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 asct1, " % time_fun_1 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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 += "%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 as asct2, " % time_fun_2 sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.q_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.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']) : + 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 += "%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 += "%s " % random.choice(self.unionall_or_union) sql += "select avg(asct2),now(),today(),timezone() from ( select " - sql += "%s as asct2 " % time_fun_2 + 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.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdSql.query(sql) - self.explain_sql(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'])\ @@ -2720,19 +2720,19 @@ class TDTestCase: 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 += "%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 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 += "%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) + 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']): @@ -2740,154 +2740,154 @@ class TDTestCase: 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 += "%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 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - elif (timelist == ['ELAPSED']) : + 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 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 += " order by asct1 asc " sql += ")" - tdLog.info(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 += "%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) + 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - elif (timelist == ['ELAPSED']) : + 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 += "%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) + 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']) : + if (timelist == ['ELAPSED']) : sql = "select now(),today(),timezone(), " - sql += "%s, " % time_fun_1 + 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) + 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 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 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) + 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): + 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 += "%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) + 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 += "%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) + 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 += "%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) + tdLog.info(sql) + tdSql.query(sql) self.explain_sql(sql) tdSql.query("select 1-7 as time_nest from stable_1 limit 1;") @@ -2897,27 +2897,27 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + tdLog.info(sql) + tdSql.query(sql) self.explain_sql(sql) elif (timelist == ['ELAPSED']) : sql = "select (asct1)/asct2 ,now(),today(),timezone() from ( select " @@ -2926,10 +2926,10 @@ class TDTestCase: sql += "from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(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'])\ @@ -2939,14 +2939,14 @@ class TDTestCase: 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 += "%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) + 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() " @@ -2954,15 +2954,15 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) elif (timelist == ['ELAPSED']) : sql = "select floor(abs(asct1)),now(),today(),timezone() " sql += "from ( select " @@ -2971,8 +2971,8 @@ class TDTestCase: sql += "from stable_1 where " sql += "%s " % random.choice(self.qt_where) sql += ") ;" - tdLog.info(sql) - tdSql.query(sql) + tdLog.info(sql) + tdSql.query(sql) self.explain_sql(sql) tdSql.query("select 1-9 as time_nest from stable_1 limit 1;") @@ -2980,12 +2980,12 @@ class TDTestCase: 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 += "%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) @@ -2993,17 +2993,17 @@ class TDTestCase: sql += "%s " % random.choice(self.order_u_where) sql += "%s " % random.choice(self.limit1_where) sql += ") ;" - tdLog.info(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 += "%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) @@ -3011,24 +3011,24 @@ class TDTestCase: 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) + 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 += "%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) - - + 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'])\ @@ -3052,7 +3052,7 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(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']): @@ -3075,9 +3075,9 @@ class TDTestCase: 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) + 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 @@ -3092,10 +3092,10 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) - tdSql.query(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): @@ -3119,7 +3119,7 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(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']): @@ -3141,7 +3141,7 @@ class TDTestCase: sql += "%s " % random.choice(self.order_where) sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) elif (timelist == ['ELAPSED']) : @@ -3156,10 +3156,10 @@ class TDTestCase: sql += "%s as asct2 " % time_fun_2 sql += " from stable_2 where " sql += "%s " % random.choice(self.q_where) - sql += "order by asct1 " + sql += "order by asct1 " sql += "%s " % random.choice(self.limit1_where) sql += ")" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3168,100 +3168,100 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 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 asct12, " % random.choice(self.q_select) sql += "%s as asct13, " % time_fun_2 - sql += "%s as asct122 " % random.choice(self.t_select) + 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) + 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 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 asct12, " % random.choice(self.q_select) sql += "%s as asct13, " % time_fun_2 - sql += "%s as asct122 " % random.choice(self.t_select) + 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) + 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 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) + 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 asct1, " % time_fun_1 sql += "%s as asct2" % time_fun_2 sql += " from stable_1 where " sql += "%s " % random.choice(self.q_where) @@ -3269,12 +3269,12 @@ class TDTestCase: 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) + 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 asct1, " % time_fun_1 sql += "%s as asct2" % time_fun_2 sql += " from stable_1 where " sql += "%s " % random.choice(self.q_where) @@ -3282,78 +3282,78 @@ class TDTestCase: 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) + 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 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) + 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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(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,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 += "%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 += ") " sql += "%s " % random.choice(self.order_desc_where) sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(sql) + 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 += "%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 += ") " sql += "%s ;" % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(sql) + 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) @@ -3361,32 +3361,32 @@ class TDTestCase: # _ = 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) - + 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)) - + 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 += "%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) + sql += ");" + tdLog.info(sql) tdSql.query(sql,queryTimes=1) self.explain_sql(sql) - - #1 outer union not support + + #1 outer union not support tdSql.query("select 1-2 from stable_1;") for i in range(self.fornum): sql = "select t1s from ( select " @@ -3403,10 +3403,10 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(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): @@ -3424,10 +3424,10 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(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): @@ -3437,7 +3437,7 @@ class TDTestCase: sql += "%s, " % random.choice(self.q_select) sql += "ts from regular_table_1 where " sql += "%s " % random.choice(self.q_where) - sql += "" + sql += "" sql += " union all select " sql += "%s, " % random.choice(self.s_r_select) sql += "%s, " % random.choice(self.q_select) @@ -3445,10 +3445,10 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(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 " @@ -3463,54 +3463,54 @@ class TDTestCase: 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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - #2 select column from (select * form regular_table ) where <\>\in\and\or order by + #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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - #3 select * from (select column\tag form stable where <\>\in\and\or order by ) + #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 += "%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(sql) tdLog.info(len(sql)) tdSql.query(sql) self.explain_sql(sql) @@ -3520,37 +3520,37 @@ class TDTestCase: 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 += "%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(sql) tdLog.info(len(sql)) - tdSql.query(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 ) + # 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 += "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) + 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 " @@ -3568,7 +3568,7 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) for i in range(self.fornum): @@ -3586,10 +3586,10 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(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): @@ -3606,53 +3606,53 @@ class TDTestCase: sql += "%s " % random.choice(self.q_where) sql += "%s " % random.choice(self.order_where) sql += ")" - tdLog.info(sql) - tdSql.query(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 += "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) + 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 += "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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - #4 select column from (select * form stable where <\>\in\and\or order by ) + #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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3665,7 +3665,7 @@ class TDTestCase: sql += "%s " % random.choice(self.qt_where) sql += "%s " % random.choice(self.order_where) sql += ") ;" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3674,11 +3674,11 @@ class TDTestCase: for i in range(self.fornum): sql = "select distinct c5_1 " sql += " from ( select " - sql += "%s " % random.choice(self.calc_select_in_ts) + 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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3689,11 +3689,11 @@ class TDTestCase: sql += "%s " % random.choice(self.dt_select) sql += " from stable_1 where " sql += "%s ) ;" % random.choice(self.qt_where) - tdLog.info(sql) + 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 ) + #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 " @@ -3702,7 +3702,7 @@ class TDTestCase: sql += "%s " % random.choice(self.qt_where) sql += "%s " % random.choice([self.limit_where[0] , self.limit_where[1]] ) sql += ") ;" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3711,146 +3711,146 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + tdLog.info(sql) + tdSql.query(sql) + self.explain_sql(sql) - #9 select * from (select ts,calc form stable where <\>\in\and\or order by ) + #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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - - #10 select calc from (select * form regualr_table where <\>\in\and\or order by ) + + #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 = "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) + 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 = "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) + 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 ) + #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 = "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) @@ -3858,64 +3858,64 @@ class TDTestCase: sql += "%s " % random.choice(self.limit_u_where) sql += ") " sql += "%s ;" % random.choice(self.limit1_where) - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - #11 select calc from (select * form stable where <\>\in\and\or order by limit ) + #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 += "%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) + 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 ) + #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 += "%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) + 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 ) + #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 += "%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) + 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;") + 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3923,14 +3923,14 @@ class TDTestCase: #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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3938,27 +3938,27 @@ class TDTestCase: #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 += "%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) + tdLog.info(sql) tdSql.query(sql) - self.explain_sql(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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3966,14 +3966,14 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3981,15 +3981,15 @@ class TDTestCase: 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -3997,32 +3997,32 @@ class TDTestCase: 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 += "%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) + 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 += "%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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -4030,227 +4030,227 @@ class TDTestCase: 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 += "%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 += "%s " % random.choice(self.group_where_regular) sql += ") ;" - tdLog.info(sql) - self.data_check(sql,mark='15-1') - + 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 += "%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.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) + 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 += "%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.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) + 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 += "%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 += "order by calc15_1 " sql += "%s " % random.choice(self.limit_where) - tdLog.info(sql) - tdSql.query(sql) + 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 += "%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 += "order by calc15_1 " sql += "%s " % random.choice(self.limit_u_where) - tdLog.info(sql) - tdSql.query(sql) + 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 += "%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 += "order by calc15_1 " sql += "%s " % random.choice(self.limit_where) - tdLog.info(sql) - tdSql.query(sql) + 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 ) + #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 = "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 += "%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 += "order by calc16_0 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) + 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 = "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 += ", %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 += "order by calc16_0 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) + 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 = "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 += ", %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 += "order by calc16_0 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) + 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 = "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) + 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 = "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) + 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 = "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) + 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 = "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 += "%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 += "order by calc16_1 " sql += "%s " % random.choice(self.limit1_where) - tdLog.info(sql) + 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 = "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) + 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 = "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) + 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 = "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) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) @@ -4259,566 +4259,566 @@ class TDTestCase: 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 += "%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) + 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 + #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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 += "%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) + 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 + #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 += "%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.q_where) sql += "%s " % random.choice(self.state_window) sql += "%s " % random.choice(self.limit1_where) sql += ") " - tdLog.info(sql) - tdSql.query(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 += "%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.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) + 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 += "%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.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) + 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 += "%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.q_where) sql += "%s " % random.choice(self.state_window) sql += "%s " % random.choice(self.limit1_where) sql += ") " - tdLog.info(sql) - tdSql.query(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 += "%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.q_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdSql.query(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 += "%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.q_u_or_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdSql.query(sql) - self.explain_sql(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 += "%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.q_u_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdSql.query(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 += "%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.qt_u_or_where) sql += "%s " % random.choice(self.limit_u_where) sql += ") " - tdLog.info(sql) - tdSql.query(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 i in range(self.fornum): for_num = random.randint(1, 15); - sql = "select * from (" * for_num + 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 += "%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) + 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 += "%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) + sql2 += ")) " + tdLog.info(sql2) + tdSql.query(sql2) self.cur1.execute(sql2) - self.explain_sql(sql2) - - tdLog.info("=====1-1==over=========") - + 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 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 += "%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) + 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 += "%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) + sql2 += ")) " + tdLog.info(sql2) tdSql.query(sql2) - self.explain_sql(sql2) - tdLog.info("=====1-2==over=========") - + 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 (" * for_num sql += "select * from ( select * from ( select " - sql += "%s, " % random.choice(self.s_s_select) - sql += "%s, " % random.choice(self.qt_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) + 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 += "%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) + sql2 += ")) " + tdLog.info(sql2) + tdSql.query(sql2) self.explain_sql(sql2) - - tdLog.info("=====2-1==over=========") - + + 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 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 += "%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) + 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 += "%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) + 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 ) + 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 += "%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) + 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 += "%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) + 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.calc_calculate_regular) sql += "%s ," % random.choice(self.dqt_select) sql += "%s " % random.choice(self.qt_select) sql += " from ( select * from stable_1 where " @@ -4826,8 +4826,8 @@ class TDTestCase: sql += "%s " % random.choice(self.orders_desc_where) sql += "%s " % random.choice(self.limit_where) sql += ") ;" - tdLog.info(sql) - tdSql.error(sql) + tdLog.info(sql) + tdSql.error(sql) #special sql tdSql.query("select 6-1 from stable_1;") @@ -4837,34 +4837,34 @@ class TDTestCase: sql = "select _block_dist() from (select * from stable_1);" tdSql.error(sql) sql = "select * from (select database());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) sql = "select * from (select client_version());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) sql = "select * from (select client_version() as version);" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) sql = "select * from (select server_version());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) sql = "select * from (select server_version() as version);" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) sql = "select * from (select server_status());" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) sql = "select * from (select server_status() as status);" - tdLog.info(sql) + tdLog.info(sql) tdSql.query(sql) self.explain_sql(sql) - + #taos -f sql startTime_taos_f = time.time() print("taos -f sql start!") @@ -4875,56 +4875,56 @@ class TDTestCase: 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.dropandcreateDB_random("%s" %self.db_nest, 1) - + startTime = time.time() + + #self.function_before_26() + + self.dropandcreateDB_random("%s" %self.db_nest, 1) + self.math_nest(['UNIQUE']) - self.math_nest(['MODE']) + 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(['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.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(['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']) + self.time_nest(['TIMEDIFF_2']) endTime = time.time() print("total time %ds" % (endTime - startTime)) - + def stop(self): diff --git a/tests/system-test/2-query/stablity_1.py b/tests/system-test/2-query/stablity_1.py index c1a5eea350..bde92fc9bd 100755 --- a/tests/system-test/2-query/stablity_1.py +++ b/tests/system-test/2-query/stablity_1.py @@ -17,52 +17,52 @@ class TDTestCase(TDTestCase): def run(self): tdSql.prepare() - - startTime = time.time() - self.function_before_26() - - self.dropandcreateDB_random("%s" %self.db_nest, 1) - + startTime = time.time() + + self.function_before_26() + + self.dropandcreateDB_random("%s" %self.db_nest, 1) + # self.math_nest(['UNIQUE']) - # self.math_nest(['MODE']) + # 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(['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.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(['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']) + self.time_nest(['TIMEDIFF_2']) endTime = time.time() print("total time %ds" % (endTime - startTime)) - + def stop(self): tdSql.close() From a90ce0008c35e22e52e2d94e2c01c5355ea935c6 Mon Sep 17 00:00:00 2001 From: "wenzhouwww@live.cn" Date: Tue, 15 Nov 2022 14:55:37 +0800 Subject: [PATCH 36/49] fix/release of CentOS about rpm packing can find python3 --- packaging/rpm/tdengine.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/rpm/tdengine.spec b/packaging/rpm/tdengine.spec index 637d2d425a..e9d86219cb 100644 --- a/packaging/rpm/tdengine.spec +++ b/packaging/rpm/tdengine.spec @@ -2,6 +2,7 @@ %define userlocalpath /usr/local %define cfg_install_dir /etc/taos %define __strip /bin/true +%global __python /usr/bin/python3 Name: tdengine Version: %{_version} From 9d1cdb0b055e0ec3ee6c257719e158e58673c8e1 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 15:13:59 +0800 Subject: [PATCH 37/49] test: add asan case --- tests/parallel_test/cases.task | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 2369b238ea..cf2e95e590 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -10,9 +10,9 @@ ,,y,script,./test.sh -f tsim/user/password.sim ,,y,script,./test.sh -f tsim/user/privilege_db.sim ,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim -,,,script,./test.sh -f tsim/db/alter_option.sim -,,,script,./test.sh -f tsim/db/alter_replica_13.sim -,,,script,./test.sh -f tsim/db/alter_replica_31.sim +,,y,script,./test.sh -f tsim/db/alter_option.sim +,,y,script,./test.sh -f tsim/db/alter_replica_13.sim +,,y,script,./test.sh -f tsim/db/alter_replica_31.sim ,,y,script,./test.sh -f tsim/db/basic1.sim ,,y,script,./test.sh -f tsim/db/basic2.sim ,,y,script,./test.sh -f tsim/db/basic3.sim @@ -20,7 +20,7 @@ ,,y,script,./test.sh -f tsim/db/basic5.sim ,,y,script,./test.sh -f tsim/db/basic6.sim ,,y,script,./test.sh -f tsim/db/commit.sim -,,,script,./test.sh -f tsim/db/create_all_options.sim +,,y,script,./test.sh -f tsim/db/create_all_options.sim ,,y,script,./test.sh -f tsim/db/delete_reuse1.sim ,,y,script,./test.sh -f tsim/db/delete_reuse2.sim ,,y,script,./test.sh -f tsim/db/delete_reusevnode.sim @@ -90,7 +90,7 @@ ,,y,script,./test.sh -f tsim/parser/auto_create_tb.sim ,,y,script,./test.sh -f tsim/parser/between_and.sim ,,y,script,./test.sh -f tsim/parser/binary_escapeCharacter.sim -,,,script,./test.sh -f tsim/parser/col_arithmetic_operation.sim +,,y,script,./test.sh -f tsim/parser/col_arithmetic_operation.sim ,,y,script,./test.sh -f tsim/parser/columnValue_bigint.sim ,,y,script,./test.sh -f tsim/parser/columnValue_bool.sim ,,y,script,./test.sh -f tsim/parser/columnValue_double.sim @@ -124,7 +124,7 @@ ,,y,script,./test.sh -f tsim/parser/import.sim ,,y,script,./test.sh -f tsim/parser/insert_multiTbl.sim ,,y,script,./test.sh -f tsim/parser/insert_tb.sim -,,,script,./test.sh -f tsim/parser/join_manyblocks.sim +,,y,script,./test.sh -f tsim/parser/join_manyblocks.sim ,,y,script,./test.sh -f tsim/parser/join_multitables.sim ,,y,script,./test.sh -f tsim/parser/join_multivnode.sim ,,y,script,./test.sh -f tsim/parser/join.sim @@ -173,9 +173,9 @@ ,,,script,./test.sh -f tsim/query/udf.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim ,,y,script,./test.sh -f tsim/snode/basic1.sim -,,,script,./test.sh -f tsim/mnode/basic1.sim -,,,script,./test.sh -f tsim/mnode/basic2.sim -,,,script,./test.sh -f tsim/mnode/basic3.sim +,,y,script,./test.sh -f tsim/mnode/basic1.sim +,,y,script,./test.sh -f tsim/mnode/basic2.sim +,,y,script,./test.sh -f tsim/mnode/basic3.sim ,,,script,./test.sh -f tsim/mnode/basic4.sim ,,,script,./test.sh -f tsim/mnode/basic5.sim ,,y,script,./test.sh -f tsim/show/basic.sim @@ -219,8 +219,8 @@ ,,,script,./test.sh -f tsim/stream/distributeSession0.sim ,,,script,./test.sh -f tsim/stream/session0.sim ,,,script,./test.sh -f tsim/stream/session1.sim -,,,script,./test.sh -f tsim/stream/state0.sim -,,,script,./test.sh -f tsim/stream/triggerInterval0.sim +,,y,script,./test.sh -f tsim/stream/state0.sim +,,y,script,./test.sh -f tsim/stream/triggerInterval0.sim ,,,script,./test.sh -f tsim/stream/triggerSession0.sim ,,y,script,./test.sh -f tsim/stream/partitionby.sim ,,y,script,./test.sh -f tsim/stream/partitionby1.sim @@ -288,11 +288,11 @@ ,,,script,./test.sh -f tsim/valgrind/checkError7.sim ,,,script,./test.sh -f tsim/valgrind/checkError8.sim ,,,script,./test.sh -f tsim/valgrind/checkUdf.sim -,,,script,./test.sh -f tsim/vnode/replica3_basic.sim -,,,script,./test.sh -f tsim/vnode/replica3_repeat.sim -,,,script,./test.sh -f tsim/vnode/replica3_vgroup.sim -,,,script,./test.sh -f tsim/vnode/replica3_many.sim -,,,script,./test.sh -f tsim/vnode/replica3_import.sim +,,y,script,./test.sh -f tsim/vnode/replica3_basic.sim +,,y,script,./test.sh -f tsim/vnode/replica3_repeat.sim +,,y,script,./test.sh -f tsim/vnode/replica3_vgroup.sim +,,y,script,./test.sh -f tsim/vnode/replica3_many.sim +,,y,script,./test.sh -f tsim/vnode/replica3_import.sim ,,,script,./test.sh -f tsim/vnode/stable_balance_replica1.sim ,,y,script,./test.sh -f tsim/vnode/stable_dnode2_stop.sim ,,y,script,./test.sh -f tsim/vnode/stable_dnode2.sim @@ -307,7 +307,7 @@ ,,y,script,./test.sh -f tsim/scalar/in.sim ,,y,script,./test.sh -f tsim/scalar/scalar.sim ,,y,script,./test.sh -f tsim/scalar/filter.sim -,,,script,./test.sh -f tsim/scalar/caseWhen.sim +,,y,script,./test.sh -f tsim/scalar/caseWhen.sim ,,y,script,./test.sh -f tsim/alter/cached_schema_after_alter.sim ,,y,script,./test.sh -f tsim/alter/dnode.sim ,,y,script,./test.sh -f tsim/alter/table.sim From 5f824801d1c3aa67a5b930214c7f5793c49f3cae Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 15:28:08 +0800 Subject: [PATCH 38/49] test: add asan case --- tests/parallel_test/cases.task | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index cf2e95e590..e15260a284 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -42,8 +42,8 @@ ,,,script,./test.sh -f tsim/dnode/balance3.sim ,,,script,./test.sh -f tsim/dnode/balancex.sim ,,y,script,./test.sh -f tsim/dnode/create_dnode.sim -,,,script,./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim -,,,script,./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim +,,y,script,./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim +,,y,script,./test.sh -f tsim/dnode/drop_dnode_has_qnode_snode.sim ,,,script,./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica1.sim ,,,script,./test.sh -f tsim/dnode/drop_dnode_has_vnode_replica3.sim ,,,script,./test.sh -f tsim/dnode/drop_dnode_has_multi_vnode_replica1.sim From 276fc51969dd57752a684832c50615d163ae3471 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 15 Nov 2022 15:28:51 +0800 Subject: [PATCH 39/49] fix: clear meta reader's decoder to free leaked memory --- source/dnode/vnode/src/vnd/vnodeSvr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 6883354547..5c8c166833 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -1189,6 +1189,8 @@ static int32_t vnodeProcessBatchDeleteReq(SVnode *pVnode, int64_t version, void vError("vgId:%d, delete error since %s, suid:%" PRId64 ", uid:%" PRId64 ", start ts:%" PRId64 ", end ts:%" PRId64, TD_VID(pVnode), terrstr(), deleteReq.suid, uid, pOneReq->ts, pOneReq->ts); } + + tDecoderClear(&mr.coder); } metaReaderClear(&mr); taosArrayDestroy(deleteReq.deleteReqs); From 5ad1bca624057d439bd97f9fec5e96f02cbe8dd5 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 15 Nov 2022 15:57:50 +0800 Subject: [PATCH 40/49] fix: free value return by tdb --- source/dnode/vnode/src/tq/tqMeta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/dnode/vnode/src/tq/tqMeta.c b/source/dnode/vnode/src/tq/tqMeta.c index b021c5ee7f..a15d19fbe1 100644 --- a/source/dnode/vnode/src/tq/tqMeta.c +++ b/source/dnode/vnode/src/tq/tqMeta.c @@ -179,6 +179,7 @@ int32_t tqMetaRestoreCheckInfo(STQ* pTq) { if (tDecodeSTqCheckInfo(&decoder, &info) < 0) { terrno = TSDB_CODE_OUT_OF_MEMORY; tdbFree(pKey); + tdbFree(pVal); tdbTbcClose(pCur); return -1; } @@ -186,11 +187,13 @@ int32_t tqMetaRestoreCheckInfo(STQ* pTq) { if (taosHashPut(pTq->pCheckInfo, info.topic, strlen(info.topic), &info, sizeof(STqCheckInfo)) < 0) { terrno = TSDB_CODE_OUT_OF_MEMORY; tdbFree(pKey); + tdbFree(pVal); tdbTbcClose(pCur); return -1; } } tdbFree(pKey); + tdbFree(pVal); tdbTbcClose(pCur); return 0; } From cfc00310809f3e40884df8eb98f2c001f3604fb6 Mon Sep 17 00:00:00 2001 From: Huo Linhe Date: Tue, 15 Nov 2022 15:58:47 +0800 Subject: [PATCH 41/49] chore: update taosws to fix some unhandled error --- 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 33ca6c659c..5c448e2c1d 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 38c4599 + GIT_TAG 7664c41 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From 094ada1566b0f5d800a1da194c8c11b72769999a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 16:13:22 +0800 Subject: [PATCH 42/49] test: add tsan case --- tests/parallel_test/cases.task | 58 +++++++++++++++++----------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index e15260a284..2e964c3f42 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -12,7 +12,7 @@ ,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim ,,y,script,./test.sh -f tsim/db/alter_option.sim ,,y,script,./test.sh -f tsim/db/alter_replica_13.sim -,,y,script,./test.sh -f tsim/db/alter_replica_31.sim +,,,script,./test.sh -f tsim/db/alter_replica_31.sim ,,y,script,./test.sh -f tsim/db/basic1.sim ,,y,script,./test.sh -f tsim/db/basic2.sim ,,y,script,./test.sh -f tsim/db/basic3.sim @@ -207,7 +207,7 @@ ,,y,script,./test.sh -f tsim/table/table.sim ,,y,script,./test.sh -f tsim/table/tinyint.sim ,,y,script,./test.sh -f tsim/table/vgroup.sim -,,,script,./test.sh -f tsim/stream/basic0.sim -g +,,n,script,./test.sh -f tsim/stream/basic0.sim -g ,,y,script,./test.sh -f tsim/stream/basic1.sim ,,y,script,./test.sh -f tsim/stream/basic2.sim ,,,script,./test.sh -f tsim/stream/drop_stream.sim @@ -228,14 +228,14 @@ ,,,script,./test.sh -f tsim/stream/windowClose.sim ,,y,script,./test.sh -f tsim/stream/ignoreExpiredData.sim ,,y,script,./test.sh -f tsim/stream/sliding.sim -,,,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim +,,y,script,./test.sh -f tsim/stream/partitionbyColumnInterval.sim ,,,script,./test.sh -f tsim/stream/partitionbyColumnSession.sim -,,,script,./test.sh -f tsim/stream/partitionbyColumnState.sim -,,,script,./test.sh -f tsim/stream/deleteInterval.sim +,,y,script,./test.sh -f tsim/stream/partitionbyColumnState.sim +,,y,script,./test.sh -f tsim/stream/deleteInterval.sim ,,,script,./test.sh -f tsim/stream/deleteSession.sim -,,,script,./test.sh -f tsim/stream/deleteState.sim +,,y,script,./test.sh -f tsim/stream/deleteState.sim ,,y,script,./test.sh -f tsim/stream/fillIntervalDelete0.sim -,,,script,./test.sh -f tsim/stream/fillIntervalDelete1.sim +,,y,script,./test.sh -f tsim/stream/fillIntervalDelete1.sim ,,y,script,./test.sh -f tsim/stream/fillIntervalLinear.sim ,,y,script,./test.sh -f tsim/stream/fillIntervalPartitionBy.sim ,,y,script,./test.sh -f tsim/stream/fillIntervalPrevNext.sim @@ -244,16 +244,16 @@ ,,y,script,./test.sh -f tsim/trans/create_db.sim ,,y,script,./test.sh -f tsim/tmq/basic1.sim ,,y,script,./test.sh -f tsim/tmq/basic2.sim -,,,script,./test.sh -f tsim/tmq/basic3.sim -,,,script,./test.sh -f tsim/tmq/basic4.sim -,,,script,./test.sh -f tsim/tmq/basic1Of2Cons.sim -,,,script,./test.sh -f tsim/tmq/basic2Of2Cons.sim -,,,script,./test.sh -f tsim/tmq/basic3Of2Cons.sim -,,,script,./test.sh -f tsim/tmq/basic4Of2Cons.sim -,,,script,./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim +,,y,script,./test.sh -f tsim/tmq/basic3.sim +,,y,script,./test.sh -f tsim/tmq/basic4.sim +,,y,script,./test.sh -f tsim/tmq/basic1Of2Cons.sim +,,y,script,./test.sh -f tsim/tmq/basic2Of2Cons.sim +,,y,script,./test.sh -f tsim/tmq/basic3Of2Cons.sim +,,y,script,./test.sh -f tsim/tmq/basic4Of2Cons.sim +,,y,script,./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim ,,,script,./test.sh -f tsim/tmq/topic.sim -,,,script,./test.sh -f tsim/tmq/snapshot.sim -,,,script,./test.sh -f tsim/tmq/snapshot1.sim +,,y,script,./test.sh -f tsim/tmq/snapshot.sim +,,y,script,./test.sh -f tsim/tmq/snapshot1.sim ,,y,script,./test.sh -f tsim/stable/alter_comment.sim ,,y,script,./test.sh -f tsim/stable/alter_count.sim ,,y,script,./test.sh -f tsim/stable/alter_import.sim @@ -279,15 +279,15 @@ ,,,script,./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim ,,y,script,./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim ,,,script,./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim -,,,script,./test.sh -f tsim/valgrind/checkError1.sim -,,,script,./test.sh -f tsim/valgrind/checkError2.sim -,,,script,./test.sh -f tsim/valgrind/checkError3.sim -,,,script,./test.sh -f tsim/valgrind/checkError4.sim -,,,script,./test.sh -f tsim/valgrind/checkError5.sim -,,,script,./test.sh -f tsim/valgrind/checkError6.sim -,,,script,./test.sh -f tsim/valgrind/checkError7.sim -,,,script,./test.sh -f tsim/valgrind/checkError8.sim -,,,script,./test.sh -f tsim/valgrind/checkUdf.sim +,,n,script,./test.sh -f tsim/valgrind/checkError1.sim +,,n,script,./test.sh -f tsim/valgrind/checkError2.sim +,,n,script,./test.sh -f tsim/valgrind/checkError3.sim +,,n,script,./test.sh -f tsim/valgrind/checkError4.sim +,,n,script,./test.sh -f tsim/valgrind/checkError5.sim +,,n,script,./test.sh -f tsim/valgrind/checkError6.sim +,,n,script,./test.sh -f tsim/valgrind/checkError7.sim +,,n,script,./test.sh -f tsim/valgrind/checkError8.sim +,,n,script,./test.sh -f tsim/valgrind/checkUdf.sim ,,y,script,./test.sh -f tsim/vnode/replica3_basic.sim ,,y,script,./test.sh -f tsim/vnode/replica3_repeat.sim ,,y,script,./test.sh -f tsim/vnode/replica3_vgroup.sim @@ -299,10 +299,10 @@ ,,y,script,./test.sh -f tsim/vnode/stable_dnode3.sim ,,,script,./test.sh -f tsim/vnode/stable_replica3_dnode6.sim ,,,script,./test.sh -f tsim/vnode/stable_replica3_vnode3.sim -,,,script,./test.sh -f tsim/sync/3Replica1VgElect.sim -,,,script,./test.sh -f tsim/sync/3Replica5VgElect.sim -,,,script,./test.sh -f tsim/sync/oneReplica1VgElect.sim -,,,script,./test.sh -f tsim/sync/oneReplica5VgElect.sim +,,y,script,./test.sh -f tsim/sync/3Replica1VgElect.sim +,,y,script,./test.sh -f tsim/sync/3Replica5VgElect.sim +,,y,script,./test.sh -f tsim/sync/oneReplica1VgElect.sim +,,y,script,./test.sh -f tsim/sync/oneReplica5VgElect.sim ,,y,script,./test.sh -f tsim/catalog/alterInCurrent.sim ,,y,script,./test.sh -f tsim/scalar/in.sim ,,y,script,./test.sh -f tsim/scalar/scalar.sim From 91b098735cbea200df978a8bc9133fb8bc7c62fe Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 16:16:43 +0800 Subject: [PATCH 43/49] test: remove asan case --- tests/parallel_test/cases.task | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 2e964c3f42..67753d7f46 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -173,9 +173,9 @@ ,,,script,./test.sh -f tsim/query/udf.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim ,,y,script,./test.sh -f tsim/snode/basic1.sim -,,y,script,./test.sh -f tsim/mnode/basic1.sim -,,y,script,./test.sh -f tsim/mnode/basic2.sim -,,y,script,./test.sh -f tsim/mnode/basic3.sim +,,,script,./test.sh -f tsim/mnode/basic1.sim +,,,script,./test.sh -f tsim/mnode/basic2.sim +,,,script,./test.sh -f tsim/mnode/basic3.sim ,,,script,./test.sh -f tsim/mnode/basic4.sim ,,,script,./test.sh -f tsim/mnode/basic5.sim ,,y,script,./test.sh -f tsim/show/basic.sim @@ -288,7 +288,7 @@ ,,n,script,./test.sh -f tsim/valgrind/checkError7.sim ,,n,script,./test.sh -f tsim/valgrind/checkError8.sim ,,n,script,./test.sh -f tsim/valgrind/checkUdf.sim -,,y,script,./test.sh -f tsim/vnode/replica3_basic.sim +,,,script,./test.sh -f tsim/vnode/replica3_basic.sim ,,y,script,./test.sh -f tsim/vnode/replica3_repeat.sim ,,y,script,./test.sh -f tsim/vnode/replica3_vgroup.sim ,,y,script,./test.sh -f tsim/vnode/replica3_many.sim From 9687d352e5981ffe68979382c84ce6ae79993c5e Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Nov 2022 16:23:54 +0800 Subject: [PATCH 44/49] test: remove asan case --- tests/parallel_test/cases.task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 67753d7f46..9b1d829c9a 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -11,7 +11,7 @@ ,,y,script,./test.sh -f tsim/user/privilege_db.sim ,,y,script,./test.sh -f tsim/user/privilege_sysinfo.sim ,,y,script,./test.sh -f tsim/db/alter_option.sim -,,y,script,./test.sh -f tsim/db/alter_replica_13.sim +,,,script,./test.sh -f tsim/db/alter_replica_13.sim ,,,script,./test.sh -f tsim/db/alter_replica_31.sim ,,y,script,./test.sh -f tsim/db/basic1.sim ,,y,script,./test.sh -f tsim/db/basic2.sim From 885c49b2ebedcb7fd0e1b4325300881f28aabc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Tue, 15 Nov 2022 16:54:55 +0800 Subject: [PATCH 45/49] test: refine query cases --- tests/parallel_test/cases.task | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 9b1d829c9a..e58ad6b892 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -111,6 +111,9 @@ ,,y,script,./test.sh -f tsim/parser/fill_us.sim ,,y,script,./test.sh -f tsim/parser/fill.sim ,,y,script,./test.sh -f tsim/parser/first_last.sim +,,y,script,./test.sh -f tsim/parser/fill_stb.sim +,,y,script,./test.sh -f tsim/parser/interp.sim +#,,y,script,./test.sh -f tsim/parser/limit2.sim ,,y,script,./test.sh -f tsim/parser/fourArithmetic-basic.sim ,,,script,./test.sh -f tsim/parser/function.sim ,,y,script,./test.sh -f tsim/parser/groupby-basic.sim From 92e4ad1bdd2c04fc401ad3c6e4709e97a7696c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Tue, 15 Nov 2022 16:55:12 +0800 Subject: [PATCH 46/49] test: refine query cases --- tests/script/tsim/parser/interp.sim | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/script/tsim/parser/interp.sim b/tests/script/tsim/parser/interp.sim index f6cfc86098..1b7878178c 100644 --- a/tests/script/tsim/parser/interp.sim +++ b/tests/script/tsim/parser/interp.sim @@ -68,12 +68,8 @@ print ================= TD-5931 sql create stable st5931(ts timestamp, f int) tags(t int) sql create table ct5931 using st5931 tags(1) sql create table nt5931(ts timestamp, f int) -sql select interp(*) from nt5931 where ts=now -sql select interp(*) from st5931 where ts=now -sql select interp(*) from ct5931 where ts=now - -if $rows != 0 then - return -1 -endi +sql_error select interp(*) from nt5931 where ts=now +sql_error select interp(*) from st5931 where ts=now +sql_error select interp(*) from ct5931 where ts=now system sh/exec.sh -n dnode1 -s stop -x SIGINT From b64de325708f6c3641bb984e72d05c3089816741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Tue, 15 Nov 2022 16:55:34 +0800 Subject: [PATCH 47/49] test: refine query cases --- tests/script/tsim/parser/interp_test.sim | 2421 +--------------------- 1 file changed, 75 insertions(+), 2346 deletions(-) diff --git a/tests/script/tsim/parser/interp_test.sim b/tests/script/tsim/parser/interp_test.sim index 5c94b72b43..ae80cb09fd 100644 --- a/tests/script/tsim/parser/interp_test.sim +++ b/tests/script/tsim/parser/interp_test.sim @@ -23,60 +23,12 @@ sql use $db print ====== select interp from table $tb = $tbPrefix . 0 ## interp(*) from tb -sql select interp(*) from $tb where ts = $ts0 -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi +sql_error select interp(*) from $tb where ts = $ts0 ## interp + limit offset -sql select interp(*) from $tb where ts = $ts0 limit 5 offset 1 -if $rows != 0 then - return -1 -endi +sql_error select interp(*) from $tb where ts = $ts0 limit 5 offset 1 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0.00000 then - return -1 -endi -if $data04 != 0.000000000 then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != binary0 then - return -1 -endi -if $data09 != nchar0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 ## intp + aggregation functions $t = $ts0 + $delta @@ -91,2405 +43,182 @@ sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5) ### interp from tb + fill $t = $ts0 + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t ## fill(none) -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) -if $rows != 0 then - return -1 -endi -$t = $tsu + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) + +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) ## fill(NULL) $t = $tsu - 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, NULL) order by ts asc -if $rows != 1 then - return -1 -endi -if $data00 != @18-11-25 19:29:59.000@ then - return -1 -endi -if $data01 != NULL then - print expect NULL, actual $data01 - return -1 -endi -if $data02 != NULL then - return -1 -endi -if $data03 != NULL then - return -1 -endi -if $data04 != NULL then - return -1 -endi -if $data05 != NULL then - return -1 -endi -if $data06 != NULL then - return -1 -endi -if $data07 != NULL then - return -1 -endi -if $data08 != NULL then - return -1 -endi -if $data09 != NULL then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, NULL) order by ts asc $t = $tsu + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) ## fill(prev) $t = $ts0 + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) -if $rows != 1 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(prev) -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0.00000 then - return -1 -endi -if $data04 != 0.000000000 then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != binary0 then - return -1 -endi -if $data09 != nchar0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(prev) $t = $ts0 - 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) $t = $ts0 + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(prev) -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != NULL then - return -1 -endi -if $data03 != 0.00000 then - print expect 0.00000, actual:$data03 - return -1 -endi -# if $data04 != NULL then -# return -1 -# endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(prev) $t = $tsu + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) ## fill(linear) $t = $ts0 + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) -print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -print $data03 -if $data03 != 0.00167 then - return -1 -endi -if $data04 != 0.001666667 then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != NULL then - return -1 -endi -if $data08 != NULL then - return -1 -endi -if $data09 != NULL then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) + # columns contain NULL values $t = $ts0 + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(linear) -print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != NULL then - return -1 -endi -if $data03 != 0.00167 then - return -1 -endi -if $data04 != NULL then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != NULL then - return -1 -endi -if $data08 != NULL then - return -1 -endi -if $data09 != NULL then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(linear) print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear) -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear) -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0.00000 then - return -1 -endi -if $data04 != 0.000000000 then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != binary0 then - return -1 -endi -if $data09 != nchar0 then - return -1 -endi -# columns contain NULL values +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear) print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear) -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear) -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != NULL then - return -1 -endi -if $data03 != 0.00000 then - return -1 -endi -if $data04 != NULL then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != binary0 then - return -1 -endi -if $data09 != nchar0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear) $t = $ts0 - 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) $t = $tsu + 1000 print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) ## fill(value) $t = $ts0 + 1000 print 91 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != -2 then - return -1 -endi -if $data02 != -2 then - return -1 -endi -if $data03 != -2.00000 then - return -1 -endi -if $data04 != -2.000000000 then - return -1 -endi -if $data05 != -2 then - return -1 -endi -if $data06 != -2 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != NULL then - return -1 -endi -if $data09 != NULL then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(value, -1, -2, -3) -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0.00000 then - return -1 -endi -if $data04 != 0.000000000 then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != binary0 then - return -1 -endi -if $data09 != nchar0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(value, -1, -2, -3) # table has NULL columns -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(value, -1, -2, -3) -if $rows != 1 then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != NULL then - return -1 -endi -if $data03 != 0.00000 then - return -1 -endi -if $data04 != NULL then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(value, -1, -2, -3) $t = $ts0 - 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) $t = $tsu + 1000 -sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) -if $rows != 0 then - return -1 -endi +sql_error select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) ### select interp from stable ## interp(*) from stb print select interp(*) from $stb where ts = $ts0 -sql select interp(*) from $stb where ts = $ts0 -if $rows != 1 then - return -1 -endi -$t = $ts0 + 1000 -print 92 +sql_error select interp(*) from $stb where ts = $ts0 + +sql_error select interp(*) from $stb where ts = $t -sql select interp(*) from $stb where ts = $t -if $rows != 0 then - return -1 -endi ## interp(*) from stb + group by -sql select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc +sql_error select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc print ====== select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc -print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 -print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29 -if $rows != $tbNum then - return -1 -endi -if $data00 != @18-09-17 09:00:00.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data04 != 0.000000000 then - return -1 -endi -if $data08 != intp_tb0 then - return -1 -endi -if $data22 != NULL then - return -1 -endi -if $data24 != NULL then - return -1 -endi -if $data28 != intp_tb2 then - return -1 -endi ## interp(*) from stb + group by + limit offset -sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0 -if $rows != 0 then - return -1 -endi -sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0 offset 1 +sql_error select interp(*) from $stb where ts = $ts0 group by tbname limit 0 + +sql_error select interp(*) from $stb where ts = $ts0 group by tbname limit 0 offset 1 ## interp(*) from stb + group by + fill(none) $t = $ts0 + 1000 -sql select interp(*) from $stb where ts = $t fill(none) group by tbname -if $rows != 0 then - return -1 -endi +sql_error select interp(*) from $stb where ts = $t fill(none) group by tbname -sql select interp(*) from $stb where ts = $ts0 fill(none) group by tbname -if $rows != 4 then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data21 != 0 then - return -1 -endi -if $data22 != NULL then - return -1 -endi -if $data24 != NULL then - return -1 -endi +sql_error select interp(*) from $stb where ts = $ts0 fill(none) group by tbname ## interp(*) from stb + group by + fill(none) $t = $ts0 + 1000 -sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname -if $rows != $tbNum then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data12 != NULL then - return -1 -endi -if $data23 != NULL then - return -1 -endi -if $data34 != NULL then - return -1 -endi -if $data05 != NULL then - return -1 -endi -if $data16 != NULL then - return -1 -endi -if $data27 != NULL then - return -1 -endi -if $data38 != NULL then - return -1 -endi -if $data09 != NULL then - return -1 -endi +sql_error select interp(*) from $stb where ts = $t fill(NULL) group by tbname -sql select interp(*) from $stb where ts = $ts0 fill(NULL) group by tbname +sql_error select interp(*) from $stb where ts = $ts0 fill(NULL) group by tbname print $rows -if $rows != 4 then - return -1 -endi - -if $data01 != 0 then - return -1 -endi - -if $data02 != 0 then - return -1 -endi -if $data21 != 0 then - return -1 -endi -if $data22 != NULL then - return -1 -endi -if $data24 != NULL then - return -1 -endi - ## interp(*) from stb + group by + fill(prev) $t = $ts0 + 1000 -sql select interp(*) from $stb where ts = $t fill(prev) group by tbname -print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 -print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29 -if $rows != $tbNum then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0.00000 then - return -1 -endi -if $data04 != 0.000000000 then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != binary0 then - return -1 -endi -if $data09 != nchar0 then - return -1 -endi -if $data20 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data21 != 0 then - return -1 -endi -if $data22 != NULL then - return -1 -endi -if $data23 != 0.00000 then - return -1 -endi -if $data24 != NULL then - return -1 -endi -if $data25 != 0 then - return -1 -endi -if $data26 != 0 then - return -1 -endi -if $data27 != 1 then - return -1 -endi -if $data28 != binary0 then - return -1 -endi -if $data29 != nchar0 then - return -1 -endi +sql_error select interp(*) from $stb where ts = $t fill(prev) group by tbname ## interp(*) from stb + group by + fill(linear) $t = $ts0 + 1000 -sql select interp(*) from $stb where ts = $t fill(linear) group by tbname -print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 -print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29 -if $rows != $tbNum then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != 0 then - return -1 -endi -if $data02 != 0 then - return -1 -endi -if $data03 != 0.00167 then - return -1 -endi -if $data04 != 0.001666667 then - return -1 -endi -if $data05 != 0 then - return -1 -endi -if $data06 != 0 then - return -1 -endi -if $data07 != NULL then - return -1 -endi -if $data08 != NULL then - return -1 -endi -if $data09 != NULL then - return -1 -endi -if $data20 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data21 != 0 then - return -1 -endi -if $data22 != NULL then - return -1 -endi -if $data23 != 0.00167 then - return -1 -endi -if $data24 != NULL then - return -1 -endi -if $data25 != 0 then - return -1 -endi -if $data26 != 0 then - return -1 -endi -if $data27 != NULL then - return -1 -endi -if $data28 != NULL then - return -1 -endi -if $data29 != NULL then - return -1 -endi +sql_error select interp(*) from $stb where ts = $t fill(linear) group by tbname ## interp(*) from stb + group by + fill(value) $t = $ts0 + 1000 -sql select interp(*) from $stb where ts = $t fill(value, -1, -2) group by tbname -print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 -print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29 -if $rows != $tbNum then - return -1 -endi -if $data00 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data01 != -2 then - return -1 -endi -if $data02 != -2 then - return -1 -endi -if $data03 != -2.00000 then - return -1 -endi -if $data04 != -2.000000000 then - return -1 -endi -if $data05 != -2 then - return -1 -endi -if $data06 != -2 then - return -1 -endi -if $data07 != 1 then - return -1 -endi -if $data08 != NULL then - return -1 -endi -if $data09 != NULL then - return -1 -endi -if $data20 != @18-09-17 09:00:01.000@ then - return -1 -endi -if $data21 != -2 then - return -1 -endi -if $data22 != -2 then - return -1 -endi -if $data23 != -2.00000 then - return -1 -endi -if $data24 != -2.000000000 then - return -1 -endi -if $data25 != -2 then - return -1 -endi -if $data26 != -2 then - return -1 -endi -if $data27 != 1 then - return -1 -endi -if $data28 != NULL then - return -1 -endi -if $data29 != NULL then - return -1 -endi +sql_error select interp(*) from $stb where ts = $t fill(value, -1, -2) group by tbname sql_error select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12'; -sql select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12' every(1s) fill(linear); -if $rows != 0 then - return -1 -endi +sql_error select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12' every(1s) fill(linear); -sql select interp(c1) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m); -if $rows != 1 then - return -1 -endi +sql_error select interp(c1) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m); -if $data00 != @18-11-25 18:30:00.000@ then - return -1 -endi +sql_error select interp(c1,c3,c4,ts) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m) fill(linear) -if $data01 != 3 then - return -1 -endi +sql_error select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear); -sql select interp(c1,c3,c4,ts) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m) fill(linear) -if $rows != 5 then - return -1 -endi +sql_error select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear) order by ts desc; -if $data00 != @18-11-25 17:54:00.000@ then - return -1 -endi +sql_error select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(2m) fill(linear) order by ts; -if $data01 != 0 then - return -1 -endi +sql_error select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts; -if $data02 != 0.00000 then - return -1 -endi +sql_error select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts desc; -if $data03 != 0.000000000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(linear); -if $data04 != @18-11-25 17:54:00.000@ then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(value, 1); -if $data10 != @18-11-25 18:12:00.000@ then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(NULL); -if $data11 != 1 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(prev); -if $data12 != 1.20000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(next); -if $data13 != 1.200000000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(linear); -if $data14 != @18-11-25 18:12:00.000@ then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(next); -if $data40 != @18-11-25 19:06:00.000@ then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(linear); -if $data41 != 6 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(prev); -if $data42 != 6.60000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(next); -if $data43 != 6.600000000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(linear); -if $data44 != @18-11-25 19:06:00.000@ then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(prev); +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(next); -sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear); -if $rows != 8 then - return -1 -endi -if $data00 != @18-09-17 20:35:00.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @18-09-17 20:36:00.000@ then - return -1 -endi -if $data11 != NULL then - return -1 -endi -if $data20 != @18-09-17 20:37:00.000@ then - return -1 -endi -if $data21 != NULL then - return -1 -endi -if $data30 != @18-09-17 20:38:00.000@ then - return -1 -endi -if $data31 != NULL then - return -1 -endi -if $data40 != @18-09-17 20:39:00.000@ then - return -1 -endi -if $data41 != NULL then - return -1 -endi -if $data50 != @18-09-17 20:40:00.000@ then - return -1 -endi -if $data51 != 0 then - return -1 -endi -if $data60 != @18-09-17 20:41:00.000@ then - return -1 -endi -if $data61 != NULL then - return -1 -endi -if $data70 != @18-09-17 20:42:00.000@ then - return -1 -endi -if $data71 != NULL then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(linear); +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(prev); -sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear) order by ts desc; -if $rows != 8 then - return -1 -endi -if $data00 != @18-09-17 20:42:00.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @18-09-17 20:41:00.000@ then - return -1 -endi -if $data11 != NULL then - return -1 -endi -if $data20 != @18-09-17 20:40:00.000@ then - return -1 -endi -if $data21 != 0 then - return -1 -endi -if $data30 != @18-09-17 20:39:00.000@ then - return -1 -endi -if $data31 != NULL then - return -1 -endi -if $data40 != @18-09-17 20:38:00.000@ then - return -1 -endi -if $data41 != NULL then - return -1 -endi -if $data50 != @18-09-17 20:37:00.000@ then - return -1 -endi -if $data51 != NULL then - return -1 -endi -if $data60 != @18-09-17 20:36:00.000@ then - return -1 -endi -if $data61 != NULL then - return -1 -endi -if $data70 != @18-09-17 20:35:00.000@ then - return -1 -endi -if $data71 != NULL then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(next); -sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(2m) fill(linear) order by ts; -if $rows != 9 then - return -1 -endi -if $data00 != @18-09-17 20:34:00.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @18-09-17 20:36:00.000@ then - return -1 -endi -if $data11 != NULL then - return -1 -endi -if $data20 != @18-09-17 20:38:00.000@ then - return -1 -endi -if $data21 != NULL then - return -1 -endi -if $data30 != @18-09-17 20:40:00.000@ then - return -1 -endi -if $data31 != 0.00000 then - return -1 -endi -if $data40 != @18-09-17 20:42:00.000@ then - return -1 -endi -if $data41 != 0.20000 then - return -1 -endi -if $data50 != @18-09-17 20:44:00.000@ then - return -1 -endi -if $data51 != 0.40000 then - return -1 -endi -if $data60 != @18-09-17 20:46:00.000@ then - return -1 -endi -if $data61 != 0.60000 then - return -1 -endi -if $data70 != @18-09-17 20:48:00.000@ then - return -1 -endi -if $data71 != 0.80000 then - return -1 -endi -if $data80 != @18-09-17 20:50:00.000@ then - return -1 -endi -if $data81 != 1.00000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(value, 1); +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(null); -sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts; -if $rows != 6 then - return -1 -endi -if $data00 != @18-09-17 20:33:00.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @18-09-17 20:36:00.000@ then - return -1 -endi -if $data11 != NULL then - return -1 -endi -if $data20 != @18-09-17 20:39:00.000@ then - return -1 -endi -if $data21 != NULL then - return -1 -endi -if $data30 != @18-09-17 20:42:00.000@ then - return -1 -endi -if $data31 != 0.20000 then - return -1 -endi -if $data40 != @18-09-17 20:45:00.000@ then - return -1 -endi -if $data41 != 0.50000 then - return -1 -endi -if $data50 != @18-09-17 20:48:00.000@ then - return -1 -endi -if $data51 != 0.80000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(linear); -sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts desc; -if $rows != 6 then - return -1 -endi -if $data00 != @18-09-17 20:48:00.000@ then - return -1 -endi -if $data01 != 0.80000 then - return -1 -endi -if $data10 != @18-09-17 20:45:00.000@ then - return -1 -endi -if $data11 != 0.50000 then - return -1 -endi -if $data20 != @18-09-17 20:42:00.000@ then - return -1 -endi -if $data21 != 0.20000 then - return -1 -endi -if $data30 != @18-09-17 20:39:00.000@ then - return -1 -endi -if $data31 != NULL then - return -1 -endi -if $data40 != @18-09-17 20:36:00.000@ then - return -1 -endi -if $data41 != NULL then - return -1 -endi -if $data50 != @18-09-17 20:33:00.000@ then - return -1 -endi -if $data51 != NULL then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(prev); +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(next); +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(linear); -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(linear); -if $rows != 6 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.31818 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.77273 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.50000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.50000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.87500 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(prev); -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(value, 1); -if $rows != 6 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 1.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 1.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 1.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 1.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 1.00000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(next); -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(NULL); -if $rows != 6 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != NULL then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != NULL then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != NULL then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != NULL then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != NULL then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(prev); -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(prev); -if $rows != 6 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.00000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(next); -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(next); -if $rows != 6 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 4.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 4.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 5.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 8.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 10.00000 then - return -1 -endi - - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(linear); -if $rows != 0 then - return -1 -endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(prev); -if $rows != 2 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(next); -if $rows != 2 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != NULL then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(linear); -if $rows != 3 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.31818 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.77273 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(prev); -if $rows != 3 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(next); -if $rows != 3 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 4.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 4.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(linear); -if $rows != 10 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.31818 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.77273 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.50000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.50000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.87500 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != NULL then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != NULL then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != NULL then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != NULL then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(prev); -if $rows != 10 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 14.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 14.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 14.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(next); -if $rows != 10 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 4.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 4.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 5.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 8.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 10.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != NULL then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != NULL then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != NULL then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != NULL then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(linear); -if $rows != 12 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.31818 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.77273 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.50000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.50000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.87500 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.11765 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 15.29412 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(prev); -if $rows != 12 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 14.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 14.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 14.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(next); -if $rows != 12 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 4.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 4.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 5.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 8.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 10.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 20.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 20.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 20.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 20.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(value, 1); -if $rows != 4 then - return -1 -endi -if $data00 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data11 != 1.00000 then - return -1 -endi -if $data20 != @21-07-25 02:20:04.000@ then - return -1 -endi -if $data21 != 1.00000 then - return -1 -endi -if $data30 != @21-07-25 02:20:05.000@ then - return -1 -endi -if $data31 != 20.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(null); -if $rows != 4 then - return -1 -endi -if $data00 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data11 != NULL then - return -1 -endi -if $data20 != @21-07-25 02:20:04.000@ then - return -1 -endi -if $data21 != NULL then - return -1 -endi -if $data30 != @21-07-25 02:20:05.000@ then - return -1 -endi -if $data31 != 20.00000 then - return -1 -endi - - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(linear); -if $rows != 32 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.31818 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.77273 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.50000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.50000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.87500 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.11765 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 15.29412 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(prev); -if $rows != 32 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 14.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 14.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 14.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(next); -if $rows != 32 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 4.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 4.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 5.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 8.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 10.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 20.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 20.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 20.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 20.00000 then - return -1 -endi - - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(linear); -if $rows != 307 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.31818 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.77273 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.50000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.50000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.87500 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.11765 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 15.29412 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(prev); -if $rows != 307 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 14.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 14.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 14.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(next); -if $rows != 307 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 4.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 4.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 5.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 8.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 10.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 20.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 20.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 20.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 20.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(linear); -if $rows != 3907 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.31818 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.77273 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.50000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.50000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.87500 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.11765 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 15.29412 then - return -1 -endi - - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(prev); -if $rows != 3907 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != NULL then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 3.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 3.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 4.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 7.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 9.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 14.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 14.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 14.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 14.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(next); -if $rows != 3907 then - return -1 -endi -if $data00 != @21-07-25 02:19:54.000@ then - return -1 -endi -if $data01 != 1.00000 then - return -1 -endi -if $data10 != @21-07-25 02:19:55.000@ then - return -1 -endi -if $data11 != 4.00000 then - return -1 -endi -if $data20 != @21-07-25 02:19:56.000@ then - return -1 -endi -if $data21 != 4.00000 then - return -1 -endi -if $data30 != @21-07-25 02:19:57.000@ then - return -1 -endi -if $data31 != 5.00000 then - return -1 -endi -if $data40 != @21-07-25 02:19:58.000@ then - return -1 -endi -if $data41 != 8.00000 then - return -1 -endi -if $data50 != @21-07-25 02:19:59.000@ then - return -1 -endi -if $data51 != 10.00000 then - return -1 -endi -if $data60 != @21-07-25 02:20:00.000@ then - return -1 -endi -if $data61 != 20.00000 then - return -1 -endi -if $data70 != @21-07-25 02:20:01.000@ then - return -1 -endi -if $data71 != 20.00000 then - return -1 -endi -if $data80 != @21-07-25 02:20:02.000@ then - return -1 -endi -if $data81 != 20.00000 then - return -1 -endi -if $data90 != @21-07-25 02:20:03.000@ then - return -1 -endi -if $data91 != 20.00000 then - return -1 -endi - -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:07' every(1s); -if $rows != 1 then - return -1 -endi -if $data00 != @21-07-25 02:20:05.000@ then - return -1 -endi -if $data01 != 20.00000 then - return -1 -endi +sql_error select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:07' every(1s); From bd9f5338db1fb4abc64d09c489ed149e713adedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Tue, 15 Nov 2022 16:55:54 +0800 Subject: [PATCH 48/49] test: refine query cases --- tests/script/tsim/parser/limit2_query.sim | 118 ++++++---------------- 1 file changed, 31 insertions(+), 87 deletions(-) diff --git a/tests/script/tsim/parser/limit2_query.sim b/tests/script/tsim/parser/limit2_query.sim index fc69035935..3c5002d591 100644 --- a/tests/script/tsim/parser/limit2_query.sim +++ b/tests/script/tsim/parser/limit2_query.sim @@ -80,7 +80,7 @@ endi sql_error select count(*) from $stb where t1 like 1 ##### aggregation on tb + where + fill + limit offset -sql select _wstart, max(c1) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) limit 10 offset 1 +sql select _wstart, max(c1) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1) limit 10 offset 1 if $rows != 10 then return -1 endi @@ -101,32 +101,26 @@ if $data91 != 5 then endi $tb5 = $tbPrefix . 5 -sql select max(c1), min(c2) from $tb5 where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4) limit 10 offset 1 +sql select max(c1), min(c2) from $tb5 where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) limit 10 offset 1 if $rows != 10 then return -1 endi -if $data00 != @18-09-17 09:05:00.000@ then +if $data00 != -1 then return -1 endi -if $data01 != -1 then +if $data01 != -2 then return -1 endi -if $data02 != -2 then +if $data10 != 1 then return -1 endi -if $data11 != 1 then +if $data11 != -2 then return -1 endi -if $data12 != -2 then +if $data90 != 5 then return -1 endi -if $data90 != @18-09-17 09:50:00.000@ then - return -1 -endi -if $data91 != 5 then - return -1 -endi -if $data92 != -2 then +if $data91 != -2 then return -1 endi @@ -135,7 +129,7 @@ endi $tb = $tbPrefix . 0 $limit = $rowNum $offset = $limit / 2 -sql select max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) limit $limit offset $offset +sql select max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2 ,-3, -4 , -5, -6 ,-7 ,'-8', '-9') limit $limit offset $offset if $rows != $limit then print expect $limit, actual $rows return -1 @@ -143,11 +137,8 @@ endi if $data01 != 0 then return -1 endi -if $data11 != -1 then - return -1 -endi -sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000, -2) limit 8200 +sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000) limit 8200 if $rows != 8200 then return -1 endi @@ -155,88 +146,56 @@ endi sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000) limit 100000; -sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000, -2) limit 10 offset 8190; +sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000) limit 10 offset 8190; if $rows != 10 then return -1 endi -if $data00 != @18-10-15 19:30:00.000@ then +if $data00 != 5 then return -1 endi -if $data01 != 5 then +if $data10 != -1000 then return -1 endi -if $data10 != @18-10-15 19:35:00.000@ then +if $data20 != 6 then return -1 endi -if $data11 != -1000 then +if $data30 != -1000 then return -1 endi -if $data20 != @18-10-15 19:40:00.000@ then - return -1 -endi - -if $data21 != 6 then - return -1 -endi - -if $data30 != @18-10-15 19:45:00.000@ then - return -1 -endi - -if $data31 != -1000 then - return -1 -endi - -sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000, -2) limit 10 offset 10001; +sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000) limit 10 offset 10001; if $rows != 10 then return -1 endi -if $data00 != @18-10-22 02:25:00.000@ then +if $data00 != -1000 then return -1 endi -if $data01 != -1000 then +if $data10 != 1 then return -1 endi -if $data10 != @18-10-22 02:30:00.000@ then +if $data20 != -1000 then return -1 endi -if $data11 != 1 then +if $data30 != 2 then return -1 endi -if $data20 != @18-10-22 02:35:00.000@ then - return -1 -endi - -if $data21 != -1000 then - return -1 -endi - -if $data30 != @18-10-22 02:40:00.000@ then - return -1 -endi - -if $data31 != 2 then - return -1 -endi - -sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000, -2) limit 10000 offset 10001; +sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000) limit 10000 offset 10001; print ====> needs to validate the last row result if $rows != 9998 then return -1 endi -sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000, -2) limit 100 offset 20001; +sql select max(c1) from lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1000) limit 100 offset 20001; if $rows != 0 then return -1 endi @@ -244,7 +203,7 @@ endi # tb + interval + fill(linear) + limit offset $limit = $rowNum $offset = $limit / 2 -sql select max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(linear) limit $limit offset $offset +sql select _wstart,max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(linear) limit $limit offset $offset if $rows != $limit then print expect $limit, actual $rows return -1 @@ -290,7 +249,7 @@ endi $limit = $rowNum $offset = $limit / 2 $offset = $offset + 10 -sql select max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu and c1 = 5 interval(5m) fill(value, -1, -2) limit $limit offset $offset +sql select _wstart,max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu and c1 = 5 interval(5m) fill(value, -1, -2 ,-3, -4 , -5, -6 ,-7 ,'-8', '-9') limit $limit offset $offset if $rows != $limit then return -1 endi @@ -324,20 +283,11 @@ endi if $data19 != NULL then return -1 endi -if $data16 != -2.000000000 then - return -1 -endi -if $data17 != 1 then - return -1 -endi -if $data11 != -1 then - return -1 -endi $limit = $rowNum $offset = $limit * 2 $offset = $offset - 11 -sql select max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu and c1 = 5 interval(5m) fill(value, -1, -2) limit $limit offset $offset +sql select _wstart,max(c1), min(c2), sum(c3), avg(c4), stddev(c5), spread(c6), first(c7), last(c8), first(c9) from $tb where ts >= $ts0 and ts <= $tsu and c1 = 5 interval(5m) fill(value, -1, -2 ,-3, -4 , -5, -6 ,-7 ,'-8', '-9') limit $limit offset $offset if $rows != 10 then return -1 endi @@ -368,27 +318,21 @@ endi if $data19 != nchar5 then return -1 endi -if $data27 != 1 then - return -1 -endi -if $data38 != NULL then - return -1 -endi -if $data49 != NULL then - return -1 -endi ### [TBASE-350] ## stb + interval + fill + group by + limit offset -sql select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) group by t1 limit 2 offset 10 -if $rows != 20 then +sql select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4 ,-7 ,'-8', '-9') limit 2 offset 10 +if $rows != 2 then return -1 endi +#add one more test case +sql select max(c1), last(c8) from lm2_db0.lm2_tb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(linear) limit 10 offset 4089;" + $limit = 5 $offset = $rowNum * 2 $offset = $offset - 2 -sql select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) group by t1 order by t1 limit $limit offset $offset +sql select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4 ,-7 ,'-8', '-9') order by t1 limit $limit offset $offset if $rows != $tbNum then return -1 endi From 5434f996e80ad369508482a50408e2e87a97fce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chappyguoxy=E2=80=9D?= <“happy_guoxy@163.com”> Date: Tue, 15 Nov 2022 16:56:15 +0800 Subject: [PATCH 49/49] test: refine query cases --- tests/script/tsim/parser/fill_stb.sim | 66 +++++++++------------------ 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/tests/script/tsim/parser/fill_stb.sim b/tests/script/tsim/parser/fill_stb.sim index 6c61631aa8..66787b3606 100644 --- a/tests/script/tsim/parser/fill_stb.sim +++ b/tests/script/tsim/parser/fill_stb.sim @@ -97,8 +97,8 @@ $tsu = $tsu + $ts0 #endi # number of fill values exceeds number of selected columns -print select _wstart, count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8) -sql select _wstart, count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8) +print select _wstart, count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6) +sql select _wstart, count(ts), max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2, -3, -4, -5, -6) $val = $rowNum * 2 $val = $val - 1 print $rows $val @@ -136,8 +136,8 @@ if $data74 != -4.00000 then endi ## fill(value) + group by -print select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8) -sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4, -5, -6, -7, -8) +print select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4, -5) +sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu partition by t1 interval(5m) fill(value, -1, -2, -3, -4, -5) $val = $rowNum * 2 print $rowNum, $val @@ -154,8 +154,8 @@ if $data11 != -1 then endi # number of fill values is smaller than number of selected columns -print select _wstart, max(c1), max(c2), max(c3) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6) -sql select _wstart, max(c1), max(c2), max(c3) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6) +print select _wstart, max(c1), max(c2), max(c3) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6) +sql select _wstart, max(c1), max(c2), max(c3) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6) if $data11 != 6 then return -1 endi @@ -170,7 +170,7 @@ endi sql_error select max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6) # fill_char_values_to_arithmetic_fields -sql select sum(c1), avg(c2), max(c3), min(c4), avg(c4), count(c6), last(c7), last(c8) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'c', 'c', 'c', 'c', 'c', 'c', 'c', 'c') +sql_error select sum(c1), avg(c2), max(c3), min(c4), avg(c4), count(c6), last(c7), last(c8) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'c', 'c', 'c', 'c', 'c', 'c', 'c', 'c') # fill_multiple_columns sql_error select sum(c1), avg(c2), min(c3), max(c4), count(c6), first(c7), last(c8) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 99, 99, 99, 99, 99, abc, abc) @@ -199,7 +199,7 @@ sql select max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu partitio # return -1 #endi -sql select _wstart, min(c1), max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1) +sql select _wstart, min(c1), max(c4) from $stb where t1 > 4 and ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -1) $val = $rowNum * 2 $val = $val - 1 if $rows != $val then @@ -222,52 +222,30 @@ if $data12 != -1.000000000 then endi # fill_into_nonarithmetic_fieds -print select _wstart, first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 20000000, 20000000, 20000000) -sql select _wstart, first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 20000000, 20000000, 20000000) +print select _wstart, first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '20000000', '20000000', '20000000') +sql select _wstart, first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '20000000', '20000000', '20000000') #if $data11 != 20000000 then #if $data11 != 1 then # return -1 #endi -sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1, 1, 1) -sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1.1, 1.1, 1.1) -sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1, 1e1, 1e1) +sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1', '1', '1') +sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1.1', '1.1', '1.1') +sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e1', '1e1', '1e1') sql select first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1') # fill quoted values into bool column will throw error unless the value is 'true' or 'false' Note:2018-10-24 # fill values into binary or nchar columns will be set to NULL automatically Note:2018-10-24 sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1','1e1') -sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, true, true, true) +sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true', 'true') sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true','true') # fill nonarithmetic values into arithmetic fields -sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, abc); -sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true'); +sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'abc'); +sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true'); -sql select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '2e1'); -$val = $rowNum * 2 -$val = $val - 1 -if $rows != $val then - return -1 -endi -if $data01 != $rowNum then - return -1 -endi -#if $data11 != 20 then -# return -1 -#endi +sql_error select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '2e1'); -sql select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 2e1); -if $rows != $val then - return -1 -endi -if $data01 != $rowNum then - return -1 -endi -if $data11 != 20 then - return -1 -endi - -sql select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '20'); +sql select _wstart, count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 20); if $rows != $val then return -1 endi @@ -377,23 +355,23 @@ endi ## NULL fill print fill(NULL) print select _wstart, max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(value, NULL) limit 5 -sql select _wstart, max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(value, NULL) limit 5 +sql select _wstart, max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 partition by t1 interval(5m) fill(NULL) limit 5 if $rows != 25 then return -1 endi if $data01 != 0 then return -1 endi -if $data02 != 0 then +if $data02 != NULL then return -1 endi if $data06 != 1 then return -1 endi -if $data11 != 0 then +if $data11 != NULL then return -1 endi -if $data12 != 0 then +if $data12 != NULL then return -1 endi if $data18 != NULL then