Merge branch '3.0' of https://github.com/taosdata/TDengine into fix/ly_res
This commit is contained in:
commit
a9fe796484
|
@ -100,6 +100,9 @@ tests/examples/JDBC/JDBCDemo/.project
|
|||
tests/examples/JDBC/JDBCDemo/.settings/
|
||||
source/libs/parser/inc/sql.*
|
||||
tests/script/tmqResult.txt
|
||||
tests/system-test/case_to_run.txt
|
||||
tests/develop-test/case_to_run.txt
|
||||
tests/scripts/case_to_run.txt
|
||||
tests/tmqResult.txt
|
||||
tests/script/jenkins/basic.txt
|
||||
|
||||
|
|
|
@ -20,8 +20,7 @@ table_options:
|
|||
|
||||
table_option: {
|
||||
COMMENT 'string_value'
|
||||
| SMA(col_name [, col_name] ...)
|
||||
| TTL value
|
||||
| SMA(col_name [, col_name] ...)
|
||||
}
|
||||
|
||||
```
|
||||
|
|
|
@ -20,8 +20,7 @@ table_options:
|
|||
|
||||
table_option: {
|
||||
COMMENT 'string_value'
|
||||
| SMA(col_name [, col_name] ...)
|
||||
| TTL value
|
||||
| SMA(col_name [, col_name] ...)
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ typedef struct SFuncExecEnv {
|
|||
} SFuncExecEnv;
|
||||
|
||||
typedef bool (*FExecGetEnv)(struct SFunctionNode *pFunc, SFuncExecEnv *pEnv);
|
||||
typedef void (*FExecCleanUp)(struct SqlFunctionCtx* pCtx);
|
||||
typedef int32_t (*FExecInit)(struct SqlFunctionCtx *pCtx, struct SResultRowEntryInfo *pResultCellInfo);
|
||||
typedef int32_t (*FExecProcess)(struct SqlFunctionCtx *pCtx);
|
||||
typedef int32_t (*FExecFinalize)(struct SqlFunctionCtx *pCtx, SSDataBlock *pBlock);
|
||||
|
@ -54,6 +55,7 @@ typedef struct SFuncExecFuncs {
|
|||
FExecProcess process;
|
||||
FExecFinalize finalize;
|
||||
FExecCombine combine;
|
||||
FExecCleanUp cleanup;
|
||||
processFuncByRow processFuncByRow;
|
||||
} SFuncExecFuncs;
|
||||
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
#include "catalog.h"
|
||||
#include "clientInt.h"
|
||||
#include "clientLog.h"
|
||||
#include "scheduler.h"
|
||||
#include "trpc.h"
|
||||
#include "tglobal.h"
|
||||
#include "clientMonitor.h"
|
||||
#include "scheduler.h"
|
||||
#include "tglobal.h"
|
||||
#include "trpc.h"
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
|
@ -244,11 +244,9 @@ static int32_t hbProcessDBInfoRsp(void *value, int32_t valueLen, struct SCatalog
|
|||
goto _return;
|
||||
}
|
||||
|
||||
TSC_ERR_JRET(catalogUpdateDBVgInfo(pCatalog,
|
||||
(rsp->useDbRsp->db[0] == 'i') ?
|
||||
TSDB_PERFORMANCE_SCHEMA_DB :
|
||||
TSDB_INFORMATION_SCHEMA_DB,
|
||||
rsp->useDbRsp->uid, vgInfo));
|
||||
TSC_ERR_JRET(catalogUpdateDBVgInfo(
|
||||
pCatalog, (rsp->useDbRsp->db[0] == 'i') ? TSDB_PERFORMANCE_SCHEMA_DB : TSDB_INFORMATION_SCHEMA_DB,
|
||||
rsp->useDbRsp->uid, vgInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -556,7 +554,6 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
taosHashRelease(pAppHbMgr->activeInfo, pReq);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
|
@ -609,8 +606,8 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
|
|||
}
|
||||
|
||||
pInst->monitorParas = pRsp.monitorParas;
|
||||
tscDebug("[monitor] paras from hb, clusterId:%" PRIx64 " monitorParas threshold:%d scope:%d",
|
||||
pInst->clusterId, pRsp.monitorParas.tsSlowLogThreshold, pRsp.monitorParas.tsSlowLogScope);
|
||||
tscDebug("[monitor] paras from hb, clusterId:%" PRIx64 " monitorParas threshold:%d scope:%d", pInst->clusterId,
|
||||
pRsp.monitorParas.tsSlowLogThreshold, pRsp.monitorParas.tsSlowLogScope);
|
||||
|
||||
if (rspNum) {
|
||||
tscDebug("hb got %d rsp, %d empty rsp received before", rspNum,
|
||||
|
@ -1108,7 +1105,8 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
|
|||
if (clientHbMgr.appHbHash) {
|
||||
code = taosHashPut(clientHbMgr.appHbHash, &hbParam->clusterId, sizeof(uint64_t), NULL, 0);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbQueryHbReqHandle put clusterId failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbQueryHbReqHandle put clusterId failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId,
|
||||
tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
@ -1261,7 +1259,7 @@ int32_t hbGatherAppInfo(void) {
|
|||
SAppHbMgr *pAppHbMgr = taosArrayGetP(clientHbMgr.appHbMgrs, i);
|
||||
if (pAppHbMgr == NULL) continue;
|
||||
|
||||
int64_t clusterId = pAppHbMgr->pAppInstInfo->clusterId;
|
||||
int64_t clusterId = pAppHbMgr->pAppInstInfo->clusterId;
|
||||
SAppHbReq *pApp = taosHashGet(clientHbMgr.appSummary, &clusterId, sizeof(clusterId));
|
||||
if (NULL == pApp) {
|
||||
(void)memcpy(&req.summary, &pAppHbMgr->pAppInstInfo->summary, sizeof(req.summary));
|
||||
|
@ -1303,8 +1301,7 @@ static void *hbThreadFunc(void *param) {
|
|||
return NULL;
|
||||
}
|
||||
if (sz > 1 && !clientHbMgr.appHbHash) {
|
||||
clientHbMgr.appHbHash =
|
||||
taosHashInit(0, taosGetDefaultHashFunction(TSDB_DATA_TYPE_UBIGINT), true, HASH_NO_LOCK);
|
||||
clientHbMgr.appHbHash = taosHashInit(0, taosGetDefaultHashFunction(TSDB_DATA_TYPE_UBIGINT), true, HASH_NO_LOCK);
|
||||
if (NULL == clientHbMgr.appHbHash) {
|
||||
tscError("taosHashInit failed");
|
||||
return NULL;
|
||||
|
@ -1324,13 +1321,13 @@ static void *hbThreadFunc(void *param) {
|
|||
continue;
|
||||
}
|
||||
SClientHbBatchReq *pReq = NULL;
|
||||
int32_t code = hbGatherAllInfo(pAppHbMgr, &pReq);
|
||||
int32_t code = hbGatherAllInfo(pAppHbMgr, &pReq);
|
||||
if (TSDB_CODE_SUCCESS != code || taosArrayGetP(clientHbMgr.appHbMgrs, i) == NULL) {
|
||||
terrno = code ? code : TSDB_CODE_OUT_OF_RANGE;
|
||||
tFreeClientHbBatchReq(pReq);
|
||||
continue;
|
||||
}
|
||||
int tlen = tSerializeSClientHbBatchReq(NULL, 0, pReq);
|
||||
int tlen = tSerializeSClientHbBatchReq(NULL, 0, pReq);
|
||||
if (tlen == -1) {
|
||||
tFreeClientHbBatchReq(pReq);
|
||||
break;
|
||||
|
@ -1368,9 +1365,8 @@ static void *hbThreadFunc(void *param) {
|
|||
pInfo->requestObjRefId = 0;
|
||||
|
||||
SAppInstInfo *pAppInstInfo = pAppHbMgr->pAppInstInfo;
|
||||
int64_t transporterId = 0;
|
||||
SEpSet epSet = getEpSet_s(&pAppInstInfo->mgmtEp);
|
||||
if (TSDB_CODE_SUCCESS != asyncSendMsgToServer(pAppInstInfo->pTransporter, &epSet, &transporterId, pInfo)) {
|
||||
if (TSDB_CODE_SUCCESS != asyncSendMsgToServer(pAppInstInfo->pTransporter, &epSet, NULL, pInfo)) {
|
||||
tscWarn("failed to async send msg to server");
|
||||
}
|
||||
tFreeClientHbBatchReq(pReq);
|
||||
|
@ -1389,7 +1385,7 @@ static void *hbThreadFunc(void *param) {
|
|||
}
|
||||
|
||||
static int32_t hbCreateThread() {
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
TdThreadAttr thAttr;
|
||||
TSC_ERR_JRET(taosThreadAttrInit(&thAttr));
|
||||
TSC_ERR_JRET(taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE));
|
||||
|
@ -1467,9 +1463,9 @@ int32_t appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key, SAppHbMgr **pAppHbMg
|
|||
|
||||
TSC_ERR_JRET(taosThreadMutexLock(&clientHbMgr.lock));
|
||||
if (taosArrayPush(clientHbMgr.appHbMgrs, &(*pAppHbMgr)) == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
(void)taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||
goto _return;
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
(void)taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||
goto _return;
|
||||
}
|
||||
(*pAppHbMgr)->idx = taosArrayGetSize(clientHbMgr.appHbMgrs) - 1;
|
||||
TSC_ERR_JRET(taosThreadMutexUnlock(&clientHbMgr.lock));
|
||||
|
|
|
@ -1567,9 +1567,8 @@ int32_t taosConnectImpl(const char* user, const char* auth, const char* db, __ta
|
|||
return code;
|
||||
}
|
||||
|
||||
int64_t transporterId = 0;
|
||||
code = asyncSendMsgToServer((*pTscObj)->pAppInfo->pTransporter, &(*pTscObj)->pAppInfo->mgmtEp.epSet, &transporterId,
|
||||
body);
|
||||
// int64_t transporterId = 0;
|
||||
code = asyncSendMsgToServer((*pTscObj)->pAppInfo->pTransporter, &(*pTscObj)->pAppInfo->mgmtEp.epSet, NULL, body);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
destroyTscObj(*pTscObj);
|
||||
tscError("failed to send connect msg to server, code:%s", tstrerror(code));
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -530,8 +530,7 @@ int32_t ctgAsyncSendMsg(SCatalog* pCtg, SRequestConnInfo* pConn, SCtgJob* pJob,
|
|||
pMsgSendInfo->msgInfo.handle = NULL;
|
||||
pMsgSendInfo->msgType = msgType;
|
||||
|
||||
int64_t transporterId = 0;
|
||||
code = asyncSendMsgToServer(pConn->pTrans, &pConn->mgmtEps, &transporterId, pMsgSendInfo);
|
||||
code = asyncSendMsgToServer(pConn->pTrans, &pConn->mgmtEps, NULL, pMsgSendInfo);
|
||||
pMsgSendInfo = NULL;
|
||||
if (code) {
|
||||
ctgError("asyncSendMsgToSever failed, error: %s", tstrerror(code));
|
||||
|
|
|
@ -326,6 +326,9 @@ int32_t doAggregateImpl(SOperatorInfo* pOperator, SqlFunctionCtx* pCtx) {
|
|||
}
|
||||
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
if (pCtx[k].fpSet.cleanup != NULL) {
|
||||
pCtx[k].fpSet.cleanup(&pCtx[k]);
|
||||
}
|
||||
qError("%s aggregate function error happens, code: %s", GET_TASKID(pOperator->pTaskInfo), tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
@ -640,6 +643,9 @@ void applyAggFunctionOnPartialTuples(SExecTaskInfo* taskInfo, SqlFunctionCtx* pC
|
|||
}
|
||||
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
if (pCtx[k].fpSet.cleanup != NULL) {
|
||||
pCtx[k].fpSet.cleanup(&pCtx[k]);
|
||||
}
|
||||
qError("%s apply functions error, code: %s", GET_TASKID(taskInfo), tstrerror(code));
|
||||
taskInfo->code = code;
|
||||
T_LONG_JMP(taskInfo->env, code);
|
||||
|
|
|
@ -1919,10 +1919,10 @@ _return:
|
|||
if (pInfo != NULL) {
|
||||
destroyMergeJoinOperator(pInfo);
|
||||
}
|
||||
destroyOperatorAndDownstreams(pOperator, pDownstream, oldNum);
|
||||
if (newDownstreams) {
|
||||
taosMemoryFree(pDownstream);
|
||||
}
|
||||
destroyOperatorAndDownstreams(pOperator, pDownstream, oldNum);
|
||||
pTaskInfo->code = code;
|
||||
|
||||
return code;
|
||||
|
|
|
@ -1057,6 +1057,9 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc
|
|||
|
||||
code = pfCtx->fpSet.process(pfCtx);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
if (pCtx[k].fpSet.cleanup != NULL) {
|
||||
pCtx[k].fpSet.cleanup(&pCtx[k]);
|
||||
}
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ typedef struct SBuiltinFuncDefinition {
|
|||
FExecProcess processFunc;
|
||||
FScalarExecProcess sprocessFunc;
|
||||
FExecFinalize finalizeFunc;
|
||||
FExecCleanUp cleanupFunc;
|
||||
#ifdef BUILD_NO_CALL
|
||||
FExecProcess invertFunc;
|
||||
#endif
|
||||
|
|
|
@ -239,6 +239,7 @@ bool getModeFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv);
|
|||
int32_t modeFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo);
|
||||
int32_t modeFunction(SqlFunctionCtx* pCtx);
|
||||
int32_t modeFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock);
|
||||
void modeFunctionCleanupExt(SqlFunctionCtx* pCtx);
|
||||
|
||||
bool getTwaFuncEnv(struct SFunctionNode* pFunc, SFuncExecEnv* pEnv);
|
||||
int32_t twaFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo);
|
||||
|
|
|
@ -3658,6 +3658,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
|||
.processFunc = modeFunction,
|
||||
.sprocessFunc = modeScalarFunction,
|
||||
.finalizeFunc = modeFinalize,
|
||||
.cleanupFunc = modeFunctionCleanupExt
|
||||
},
|
||||
{
|
||||
.name = "abs",
|
||||
|
|
|
@ -6019,6 +6019,12 @@ static void modeFunctionCleanup(SModeInfo * pInfo) {
|
|||
taosMemoryFreeClear(pInfo->buf);
|
||||
}
|
||||
|
||||
void modeFunctionCleanupExt(SqlFunctionCtx* pCtx) {
|
||||
SResultRowEntryInfo* pResInfo = GET_RES_INFO(pCtx);
|
||||
SModeInfo* pInfo = GET_ROWCELL_INTERBUF(pResInfo);
|
||||
modeFunctionCleanup(pInfo);
|
||||
}
|
||||
|
||||
static int32_t saveModeTupleData(SqlFunctionCtx* pCtx, char* data, SModeInfo *pInfo, STuplePos* pPos) {
|
||||
if (IS_VAR_DATA_TYPE(pInfo->colType)) {
|
||||
(void)memcpy(pInfo->buf, data, varDataTLen(data));
|
||||
|
|
|
@ -142,6 +142,7 @@ int32_t fmGetFuncExecFuncs(int32_t funcId, SFuncExecFuncs* pFpSet) {
|
|||
pFpSet->finalize = funcMgtBuiltins[funcId].finalizeFunc;
|
||||
pFpSet->combine = funcMgtBuiltins[funcId].combineFunc;
|
||||
pFpSet->processFuncByRow = funcMgtBuiltins[funcId].processFuncByRow;
|
||||
pFpSet->cleanup = funcMgtBuiltins[funcId].cleanupFunc;
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -586,7 +586,7 @@ int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst) {
|
|||
}
|
||||
memcpy(*pDst, pSrc, sizeof(*pSrc));
|
||||
(*pDst)->vgArray = NULL;
|
||||
|
||||
|
||||
if (pSrc->vgHash) {
|
||||
(*pDst)->vgHash = taosHashInit(taosHashGetSize(pSrc->vgHash), taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true,
|
||||
HASH_ENTRY_LOCK);
|
||||
|
|
|
@ -982,6 +982,7 @@ int32_t schAsyncSendMsg(SSchJob *pJob, SSchTask *pTask, SSchTrans *trans, SQuery
|
|||
SCH_ERR_JRET(code);
|
||||
}
|
||||
trans->pHandle = (void *)refId;
|
||||
pMsgSendInfo->msgInfo.handle =trans->pHandle;
|
||||
}
|
||||
|
||||
if (pJob && pTask) {
|
||||
|
@ -996,8 +997,7 @@ int32_t schAsyncSendMsg(SSchJob *pJob, SSchTask *pTask, SSchTrans *trans, SQuery
|
|||
pTask->lastMsgType = msgType;
|
||||
}
|
||||
|
||||
int64_t transporterId = 0;
|
||||
code = asyncSendMsgToServerExt(trans->pTrans, epSet, &transporterId, pMsgSendInfo, persistHandle, ctx);
|
||||
code = asyncSendMsgToServerExt(trans->pTrans, epSet, NULL, pMsgSendInfo, persistHandle, ctx);
|
||||
pMsgSendInfo = NULL;
|
||||
if (code) {
|
||||
SCH_ERR_JRET(code);
|
||||
|
|
|
@ -1496,9 +1496,10 @@ static void cliHandleFastFail(SCliConn* pConn, int status) {
|
|||
}
|
||||
} else {
|
||||
SFailFastItem item = {.count = 1, .timestamp = cTimestamp};
|
||||
int32_t code = taosHashPut(pThrd->failFastCache, pConn->dstAddr, strlen(pConn->dstAddr), &item, sizeof(SFailFastItem));
|
||||
int32_t code =
|
||||
taosHashPut(pThrd->failFastCache, pConn->dstAddr, strlen(pConn->dstAddr), &item, sizeof(SFailFastItem));
|
||||
if (code != 0) {
|
||||
tError("failed to put fail-fast item to cache, reason:%s", tstrerror(code));
|
||||
tError("failed to put fail-fast item to cache, reason:%s", tstrerror(code));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2980,7 +2981,9 @@ int32_t transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, S
|
|||
|
||||
QUEUE_PUSH(&exh->q, &pCliMsg->seqq);
|
||||
taosWUnLockLatch(&exh->latch);
|
||||
|
||||
tDebug("msg refId: %" PRId64 "", handle);
|
||||
(void)transReleaseExHandle(transGetRefMgt(), handle);
|
||||
(void)transReleaseExHandle(transGetInstMgt(), (int64_t)shandle);
|
||||
return 0;
|
||||
} else {
|
||||
|
|
|
@ -64,7 +64,7 @@ class TAdapter:
|
|||
"enable" : True
|
||||
},
|
||||
"node_exporter" : {
|
||||
"enable" : True
|
||||
"enable" : False
|
||||
},
|
||||
"prometheus" : {
|
||||
"enable" : True
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
python3 ./test.py -f multi-level/mlevel_basic.py -N 3 -L 3 -D 2
|
||||
python3 ./test.py -f db-encrypt/basic.py
|
||||
python3 ./test.py -f s3/s3Basic.py -N 3
|
||||
python3 ./test.py -f cluster/snapshot.py -N 3 -L 3 -D 2
|
||||
python3 ./test.py -f query/function/test_func_elapsed.py
|
||||
python3 ./test.py -f query/function/concat.py
|
||||
python3 ./test.py -f query/function/cast.py
|
||||
python3 ./test.py -f query/test_join.py
|
||||
python3 ./test.py -f query/test_compare.py
|
||||
python3 ./test.py -f insert/test_column_tag_boundary.py
|
||||
python3 ./test.py -f query/fill/fill_desc.py -N 3 -L 3 -D 2
|
||||
python3 ./test.py -f query/fill/fill_null.py
|
||||
python3 ./test.py -f cluster/incSnapshot.py -N 3
|
||||
python3 ./test.py -f query/query_basic.py -N 3
|
||||
python3 ./test.py -f query/accuracy/test_query_accuracy.py
|
||||
python3 ./test.py -f insert/insert_basic.py -N 3
|
||||
python3 ./test.py -f cluster/splitVgroupByLearner.py -N 3
|
||||
python3 ./test.py -f authorith/authBasic.py -N 3
|
||||
python3 ./test.py -f cmdline/fullopt.py
|
||||
python3 ./test.py -f query/show.py -N 3
|
||||
python3 ./test.py -f alter/alterConfig.py -N 3
|
||||
python3 ./test.py -f query/subquery/subqueryBugs.py -N 3
|
||||
python3 ./test.py -f storage/oneStageComp.py -N 3 -L 3 -D 1
|
||||
python3 ./test.py -f storage/compressBasic.py -N 3
|
||||
python3 ./test.py -f grant/grantBugs.py -N 3
|
||||
python3 ./test.py -f query/queryBugs.py -N 3
|
||||
python3 ./test.py -f tmq/tmqBugs.py -N 3
|
||||
python3 ./test.py -f query/fill/fill_compare_asc_desc.py
|
||||
python3 ./test.py -f query/last/test_last.py
|
|
@ -5,20 +5,35 @@ parm_path=$(pwd ${parm_path})
|
|||
echo "execute path:${parm_path}"
|
||||
cd ${parm_path}
|
||||
cp cases.task ${case_file}
|
||||
# comment udf and stream case in windows
|
||||
# comment udf and stream and sma case in windows
|
||||
sed -i '/udf/d' ${case_file}
|
||||
sed -i '/Udf/d' ${case_file}
|
||||
sed -i '/stream/d' ${case_file}
|
||||
sed -i '/^$/d' ${case_file}
|
||||
sed -i '$a\%%FINISHED%%' ${case_file}
|
||||
#unsupported case:sma
|
||||
sed -i '/tsim\/sync\/vnodesnapshot-rsma-test.sim/d' ${case_file}
|
||||
sed -i '/tsim\/sma/d' ${case_file}
|
||||
sed -i '/tsim\/tagindex\/sma_and_tag_index.sim/d' ${case_file}
|
||||
#unsupported case:to_char
|
||||
sed -i '/tsim\/query\/sort-pre-cols.sim/d' ${case_file}
|
||||
sed -i '/2-query\/nestedQueryInterval.py/d' ${case_file}
|
||||
#unsupported case:stream
|
||||
sed -i '/database_pre_suf/d' ${case_file}
|
||||
sed -i '/tsma/d' ${case_file}
|
||||
|
||||
|
||||
utest="unit-test"
|
||||
tsimtest="script"
|
||||
systest="system-test"
|
||||
devtest="develop-test"
|
||||
doctest="docs-examples-test"
|
||||
rm -rf win-${utest}.log win-${tsimtest}.log win-${systest}.log win-${devtest}.log win-${doctest}.log
|
||||
rm -rf ${parm_path}/../${utest}/win-test-file ${parm_path}/../${tsimtest}/win-test-file ${parm_path}/../${systest}/win-test-file ${parm_path}/../${devtest}/win-test-file
|
||||
armytest="army"
|
||||
|
||||
rm -rf win-${utest}.log win-${tsimtest}.log win-${systest}.log win-${devtest}.log win-${doctest}.log win-${armytest}.log
|
||||
|
||||
rm -rf ${parm_path}/../${utest}/win-test-file ${parm_path}/../${tsimtest}/win-test-file ${parm_path}/../${systest}/win-test-file ${parm_path}/../${devtest}/win-test-file ${parm_path}/../${doctest}/win-test-file ${parm_path}/../${armytest}/win-test-file
|
||||
|
||||
while read -r line
|
||||
do
|
||||
echo "$line"|grep -q "^#"
|
||||
|
@ -44,6 +59,15 @@ do
|
|||
fi
|
||||
continue
|
||||
fi
|
||||
if [[ "${exec_dir}" == "${armytest}" ]]; then
|
||||
if [[ "${case_cmd}" =~ "pytest.sh" ]]; then
|
||||
case_cmd=$(echo "$case_cmd"|cut -d ' ' -f 2-)
|
||||
echo "${case_cmd}" >> win-${armytest}.log
|
||||
else
|
||||
echo "${case_cmd}" >> win-${armytest}.log
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
if [[ "${exec_dir}" == "${devtest}" ]]; then
|
||||
echo ${case_cmd} >> win-${devtest}.log
|
||||
continue
|
||||
|
@ -57,6 +81,7 @@ mv win-${utest}.log ${parm_path}/../${utest}/win-test-file
|
|||
mv win-${tsimtest}.log ${parm_path}/../${tsimtest}/win-test-file
|
||||
mv win-${systest}.log ${parm_path}/../${systest}/win-test-file
|
||||
mv win-${devtest}.log ${parm_path}/../${devtest}/win-test-file
|
||||
|
||||
mv win-${armytest}.log ${parm_path}/../${armytest}/win-test-file
|
||||
mv win-${doctest}.log ${parm_path}/../${armytest}/win-test-file
|
||||
|
||||
rm -rf ${case_file}
|
||||
|
|
|
@ -979,6 +979,155 @@ class TDCom:
|
|||
for stream_name in stream_name_list:
|
||||
tdSql.execute(f'drop stream if exists {stream_name};')
|
||||
|
||||
|
||||
def check_stream_wal_info(self, wal_info):
|
||||
# This method is defined for the 'info' column of the 'information_schema.ins_stream_tasks'.
|
||||
# Define the regular expression pattern to match the required format
|
||||
# This pattern looks for a number followed by an optional space and then a pair of square brackets
|
||||
# containing two numbers separated by a comma.
|
||||
pattern = r'(\d+)\s*\[(\d+),\s*(\d+)\]'
|
||||
|
||||
# Use the search function from the re module to find a match in the string
|
||||
match = re.search(pattern, wal_info)
|
||||
|
||||
# Check if a match was found
|
||||
if match:
|
||||
# Extract the numbers from the matching groups
|
||||
first_number = int(match.group(1)) # The number before the brackets
|
||||
second_number = int(match.group(3)) # The second number inside the brackets
|
||||
|
||||
# Compare the extracted numbers and return the result
|
||||
if second_number >=5 :
|
||||
if first_number >= second_number-5 and first_number <= second_number:
|
||||
return True
|
||||
elif second_number < 5:
|
||||
if first_number >= second_number-1 and first_number <= second_number:
|
||||
return True
|
||||
|
||||
# If no match was found, or the pattern does not match the expected format, return False
|
||||
return False
|
||||
|
||||
def check_stream_task_status(self, stream_name, vgroups, stream_timeout=None):
|
||||
"""check stream status
|
||||
|
||||
Args:
|
||||
stream_name (str): stream_name
|
||||
vgroups (int): vgroups
|
||||
Returns:
|
||||
str: status
|
||||
"""
|
||||
timeout = self.stream_timeout if stream_timeout is None else stream_timeout
|
||||
|
||||
#check stream task rows
|
||||
sql_task_all = f"select `task_id`,node_id,stream_name,status,info,history_task_id from information_schema.ins_stream_tasks where stream_name='{stream_name}' and `level`='source';"
|
||||
sql_task_status = f"select distinct(status) from information_schema.ins_stream_tasks where stream_name='{stream_name}' and `level`='source';"
|
||||
sql_task_history = f"select distinct(history_task_id) from information_schema.ins_stream_tasks where stream_name='{stream_name}' and `level`='source';"
|
||||
tdSql.query(sql_task_all)
|
||||
tdSql.checkRows(vgroups)
|
||||
|
||||
#check stream task status
|
||||
checktimes = 1
|
||||
check_stream_success = 0
|
||||
vgroup_num = 0
|
||||
while checktimes <= timeout:
|
||||
tdLog.notice(f"checktimes:{checktimes}")
|
||||
try:
|
||||
result_task_alll = tdSql.query(sql_task_all,row_tag=True)
|
||||
result_task_alll_rows = tdSql.query(sql_task_all)
|
||||
result_task_status = tdSql.query(sql_task_status,row_tag=True)
|
||||
result_task_status_rows = tdSql.query(sql_task_status)
|
||||
result_task_history = tdSql.query(sql_task_history,row_tag=True)
|
||||
result_task_history_rows = tdSql.query(sql_task_history)
|
||||
|
||||
tdLog.notice(f"Try to check stream status, check times: {checktimes} and stream task list[{check_stream_success}]")
|
||||
print(f"result_task_status:{result_task_status},result_task_history:{result_task_history},result_task_alll:{result_task_alll}")
|
||||
if result_task_status_rows == 1 and result_task_status ==[('ready',)] :
|
||||
if result_task_history_rows == 1 and result_task_history == [(None,)] :
|
||||
for vgroup_num in range(vgroups):
|
||||
if self.check_stream_wal_info(result_task_alll[vgroup_num][4]) :
|
||||
check_stream_success += 1
|
||||
tdLog.info(f"check stream task list[{check_stream_success}] sucessfully :")
|
||||
else:
|
||||
check_stream_success = 0
|
||||
break
|
||||
|
||||
if check_stream_success == vgroups:
|
||||
break
|
||||
time.sleep(1)
|
||||
checktimes += 1
|
||||
vgroup_num = vgroup_num
|
||||
except Exception as e:
|
||||
tdLog.notice(f"Try to check stream status again, check times: {checktimes}")
|
||||
checktimes += 1
|
||||
tdSql.print_error_frame_info(result_task_alll[vgroup_num],"status is ready,info is finished and history_task_id is NULL",sql_task_all)
|
||||
else:
|
||||
checktimes_end = checktimes - 1
|
||||
tdLog.notice(f"it has spend {checktimes_end} for checking stream task status but it failed")
|
||||
if checktimes_end == timeout:
|
||||
tdSql.print_error_frame_info(result_task_alll[vgroup_num],"status is ready,info is finished and history_task_id is NULL",sql_task_all)
|
||||
|
||||
# def check_stream_task_status(self, stream_name, vgroups, stream_timeout=None):
|
||||
# """check stream status
|
||||
|
||||
# Args:
|
||||
# stream_name (str): stream_name
|
||||
# vgroups (int): vgroups
|
||||
# Returns:
|
||||
# str: status
|
||||
# """
|
||||
# timeout = self.stream_timeout if stream_timeout is None else stream_timeout
|
||||
|
||||
# #check stream task rows
|
||||
# sql_task_all = f"select `task_id`,node_id,stream_name,status,info,history_task_id from information_schema.ins_stream_tasks where stream_name='{stream_name}' and `level`='source';"
|
||||
# sql_task_status = f"select distinct(status) from information_schema.ins_stream_tasks where stream_name='{stream_name}' and `level`='source';"
|
||||
# sql_task_history = f"select distinct(history_task_id) from information_schema.ins_stream_tasks where stream_name='{stream_name}' and `level`='source';"
|
||||
# tdSql.query(sql_task_all)
|
||||
# tdSql.checkRows(vgroups)
|
||||
|
||||
# #check stream task status
|
||||
# checktimes = 1
|
||||
# check_stream_success = 0
|
||||
# vgroup_num = 0
|
||||
# while checktimes <= timeout:
|
||||
# print(f"checktimes:{checktimes}")
|
||||
# try:
|
||||
# result_task_alll = tdSql.query(sql_task_all,row_tag=True)
|
||||
# result_task_alll_rows = tdSql.query(sql_task_all)
|
||||
# result_task_status = tdSql.query(sql_task_status,row_tag=True)
|
||||
# result_task_status_rows = tdSql.query(sql_task_status)
|
||||
# result_task_history = tdSql.query(sql_task_history,row_tag=True)
|
||||
# result_task_history_rows = tdSql.query(sql_task_history)
|
||||
|
||||
# tdLog.notice(f"Try to check stream status, check times: {checktimes} and stream task list[{check_stream_success}]")
|
||||
# print(f"result_task_status:{result_task_status},result_task_history:{result_task_history},result_task_alll:{result_task_alll}")
|
||||
# for vgroup_num in range(vgroups):
|
||||
# if result_task_alll[vgroup_num][3] == "ready" and self.check_stream_wal_info(result_task_alll[vgroup_num][4]) and result_task_alll[vgroup_num][5] == None:
|
||||
# check_stream_success += 1
|
||||
# tdLog.info(f"check stream task list[{check_stream_success}] sucessfully :")
|
||||
# else:
|
||||
# check_stream_success = 0
|
||||
# break
|
||||
|
||||
# if check_stream_success == vgroups:
|
||||
# break
|
||||
# time.sleep(1)
|
||||
# checktimes += 1
|
||||
# vgroup_num = vgroup_num
|
||||
# except Exception as e:
|
||||
# tdLog.notice(f"Try to check stream status again, check times: {checktimes}")
|
||||
# checktimes += 1
|
||||
# tdSql.print_error_frame_info(result_task_alll[vgroup_num],"status is ready,info is finished and history_task_id is NULL",sql_task_all)
|
||||
|
||||
# else:
|
||||
# checktimes_end = checktimes - 1
|
||||
# tdLog.notice(f"it has spend {checktimes_end} for checking stream task status but it failed")
|
||||
# if checktimes_end == timeout:
|
||||
# tdSql.print_error_frame_info(result_task_alll[vgroup_num],"status is ready,info is finished and history_task_id is NULL",sql_task_all)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def drop_db(self, dbname="test"):
|
||||
"""drop a db
|
||||
|
||||
|
|
|
@ -61,6 +61,13 @@ class TDSql:
|
|||
def close(self):
|
||||
self.cursor.close()
|
||||
|
||||
def print_error_frame_info(self, elm, expect_elm, sql=None):
|
||||
caller = inspect.getframeinfo(inspect.stack()[1][0])
|
||||
print_sql = self.sql if sql is None else sql
|
||||
args = (caller.filename, caller.lineno, print_sql, elm, expect_elm)
|
||||
# tdLog.info("%s(%d) failed: sql:%s, elm:%s != expect_elm:%s" % args)
|
||||
raise Exception("%s(%d) failed: sql:%s, elm:%s != expect_elm:%s" % args)
|
||||
|
||||
def prepare(self, dbname="db", drop=True, **kwargs):
|
||||
tdLog.info(f"prepare database:{dbname}")
|
||||
s = 'reset query cache'
|
||||
|
@ -331,13 +338,14 @@ class TDSql:
|
|||
return self.queryRows
|
||||
|
||||
def checkRows(self, expectedRows):
|
||||
if self.queryRows == expectedRows:
|
||||
tdLog.info("sql:%s, queryRows:%d == expect:%d" % (self.sql, self.queryRows, expectedRows))
|
||||
return True
|
||||
else:
|
||||
caller = inspect.getframeinfo(inspect.stack()[1][0])
|
||||
args = (caller.filename, caller.lineno, self.sql, self.queryRows, expectedRows)
|
||||
tdLog.exit("%s(%d) failed: sql:%s, queryRows:%d != expect:%d" % args)
|
||||
return self.checkEqual(self.queryRows, expectedRows)
|
||||
# if self.queryRows == expectedRows:
|
||||
# tdLog.info("sql:%s, queryRows:%d == expect:%d" % (self.sql, self.queryRows, expectedRows))
|
||||
# return True
|
||||
# else:
|
||||
# caller = inspect.getframeinfo(inspect.stack()[1][0])
|
||||
# args = (caller.filename, caller.lineno, self.sql, self.queryRows, expectedRows)
|
||||
# tdLog.exit("%s(%d) failed: sql:%s, queryRows:%d != expect:%d" % args)
|
||||
|
||||
def checkRows_not_exited(self, expectedRows):
|
||||
"""
|
||||
|
@ -636,16 +644,12 @@ class TDSql:
|
|||
def checkEqual(self, elm, expect_elm):
|
||||
if elm == expect_elm:
|
||||
tdLog.info("sql:%s, elm:%s == expect_elm:%s" % (self.sql, elm, expect_elm))
|
||||
return
|
||||
return True
|
||||
if self.__check_equal(elm, expect_elm):
|
||||
tdLog.info("sql:%s, elm:%s == expect_elm:%s" % (self.sql, elm, expect_elm))
|
||||
return
|
||||
|
||||
caller = inspect.getframeinfo(inspect.stack()[1][0])
|
||||
args = (caller.filename, caller.lineno, self.sql, elm, expect_elm)
|
||||
# tdLog.info("%s(%d) failed: sql:%s, elm:%s != expect_elm:%s" % args)
|
||||
raise Exception("%s(%d) failed: sql:%s, elm:%s != expect_elm:%s" % args)
|
||||
|
||||
return True
|
||||
self.print_error_frame_info(elm, expect_elm)
|
||||
|
||||
def checkNotEqual(self, elm, expect_elm):
|
||||
if elm != expect_elm:
|
||||
tdLog.info("sql:%s, elm:%s != expect_elm:%s" % (self.sql, elm, expect_elm))
|
||||
|
|
|
@ -97,6 +97,6 @@ else
|
|||
if [ $python_error -ne 0 ] || [ $python_taos_error -ne 0 ] ; then
|
||||
cat ${LOG_DIR}/*.info |grep "#" | grep -w "TDinternal"
|
||||
fi
|
||||
cat ${LOG_DIR}/*.asan
|
||||
cat ${LOG_DIR}/*.asan |grep "#" | grep -w "TDinternal"
|
||||
exit 1
|
||||
fi
|
|
@ -4,5 +4,5 @@ rem echo taskkill /F /IM taosd.exe
|
|||
|
||||
wmic process where "name='taosd.exe'" call terminate > NUL 2>&1
|
||||
taskkill /F /IM taosd.exe > NUL 2>&1
|
||||
|
||||
sleep 2
|
||||
rem echo taskkill /F /IM taosd.exe finished
|
|
@ -15,42 +15,42 @@ fi
|
|||
|
||||
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
||||
while [ -n "$PID" ]; do
|
||||
echo kill -15 $PID
|
||||
#pkill -15 taosd
|
||||
kill -15 $PID
|
||||
echo kill -9 $PID
|
||||
#pkill -9 taosd
|
||||
kill -9 $PID
|
||||
echo "Killing taosd processes"
|
||||
if [ "$OS_TYPE" != "Darwin" ]; then
|
||||
fuser -k -n tcp 6030
|
||||
else
|
||||
lsof -nti:6030 | xargs kill -15
|
||||
lsof -nti:6030 | xargs kill -9
|
||||
fi
|
||||
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
||||
done
|
||||
|
||||
PID=`ps -ef|grep -w taos | grep -v grep | awk '{print $2}'`
|
||||
while [ -n "$PID" ]; do
|
||||
echo kill -15 $PID
|
||||
echo kill -9 $PID
|
||||
#pkill -9 taos
|
||||
kill -15 $PID
|
||||
kill -9 $PID
|
||||
echo "Killing taos processes"
|
||||
if [ "$OS_TYPE" != "Darwin" ]; then
|
||||
fuser -k -n tcp 6030
|
||||
else
|
||||
lsof -nti:6030 | xargs kill -15
|
||||
lsof -nti:6030 | xargs kill -9
|
||||
fi
|
||||
PID=`ps -ef|grep -w taos | grep -v grep | awk '{print $2}'`
|
||||
done
|
||||
|
||||
PID=`ps -ef|grep -w tmq_sim | grep -v grep | awk '{print $2}'`
|
||||
while [ -n "$PID" ]; do
|
||||
echo kill -15 $PID
|
||||
#pkill -15 tmq_sim
|
||||
kill -15 $PID
|
||||
echo kill -9 $PID
|
||||
#pkill -9 tmq_sim
|
||||
kill -9 $PID
|
||||
echo "Killing tmq_sim processes"
|
||||
if [ "$OS_TYPE" != "Darwin" ]; then
|
||||
fuser -k -n tcp 6030
|
||||
else
|
||||
lsof -nti:6030 | xargs kill -15
|
||||
lsof -nti:6030 | xargs kill -9
|
||||
fi
|
||||
PID=`ps -ef|grep -w tmq_sim | grep -v grep | awk '{print $2}'`
|
||||
done
|
|
@ -308,4 +308,4 @@ if $rows != 2 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -200,7 +200,6 @@
|
|||
./test.sh -f tsim/query/unionall_as_table.sim
|
||||
./test.sh -f tsim/query/multi_order_by.sim
|
||||
./test.sh -f tsim/query/sys_tbname.sim
|
||||
./test.sh -f tsim/query/sort-pre-cols.sim
|
||||
./test.sh -f tsim/query/groupby.sim
|
||||
./test.sh -f tsim/query/groupby_distinct.sim
|
||||
./test.sh -f tsim/query/event.sim
|
||||
|
@ -289,12 +288,6 @@
|
|||
./test.sh -f tsim/stable/tag_rename.sim
|
||||
./test.sh -f tsim/stable/values.sim
|
||||
./test.sh -f tsim/stable/vnode3.sim
|
||||
./test.sh -f tsim/sma/drop_sma.sim
|
||||
./test.sh -f tsim/sma/sma_leak.sim
|
||||
./test.sh -f tsim/sma/tsmaCreateInsertQuery.sim
|
||||
./test.sh -f tsim/sma/rsmaCreateInsertQuery.sim
|
||||
./test.sh -f tsim/sma/rsmaCreateInsertQueryDelete.sim
|
||||
./test.sh -f tsim/sync/vnodesnapshot-rsma-test.sim
|
||||
./test.sh -f tsim/valgrind/checkError1.sim
|
||||
./test.sh -f tsim/valgrind/checkError2.sim
|
||||
./test.sh -f tsim/valgrind/checkError3.sim
|
||||
|
@ -406,7 +399,6 @@
|
|||
./test.sh -f tsim/tag/tbNameIn.sim
|
||||
./test.sh -f tmp/monitor.sim
|
||||
./test.sh -f tsim/tagindex/add_index.sim
|
||||
./test.sh -f tsim/tagindex/sma_and_tag_index.sim
|
||||
./test.sh -f tsim/tagindex/indexOverflow.sim
|
||||
./test.sh -f tsim/view/view.sim
|
||||
./test.sh -f tsim/query/cache_last.sim
|
||||
|
|
|
@ -42,19 +42,19 @@ class TDTestCase:
|
|||
type = 'stable'
|
||||
tdSql.execute(f'create topic if not exists {name} as {type} {name}')
|
||||
tdSql.query('show topics')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0],name)
|
||||
tdSql.checkData(0, 0, name)
|
||||
tdSql.execute(f'drop topic {name}')
|
||||
tdSql.execute(f'create topic if not exists `{name}` as {type} {name}')
|
||||
tdSql.query('show topics')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0],name)
|
||||
tdSql.checkData(0, 0, name)
|
||||
tdSql.execute(f'drop topic {name}')
|
||||
tdSql.execute(f'create topic if not exists `{name}` as {type} `{name}`')
|
||||
tdSql.query('show topics')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0],name)
|
||||
tdSql.checkData(0, 0, name)
|
||||
tdSql.execute(f'drop topic {name}')
|
||||
tdSql.execute(f'create topic if not exists `{name}` as {type} `{name}`')
|
||||
tdSql.query('show topics')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0],name)
|
||||
tdSql.checkData(0, 0, name)
|
||||
tdSql.execute(f'drop topic `{name}`')
|
||||
|
||||
def db_name_check(self):
|
||||
|
@ -70,14 +70,14 @@ class TDTestCase:
|
|||
|
||||
time.sleep(15)
|
||||
tdSql.query('show streams')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0],self.streamname)
|
||||
tdSql.checkData(0, 0, self.streamname)
|
||||
tdSql.execute(f'drop stream {self.streamname}')
|
||||
tdSql.execute(f'drop stable {self.streamtb}')
|
||||
tdSql.execute(f'create stream {self.streamname} into `{self.streamtb}` as select count(*) from {self.stbname} interval(10s);')
|
||||
|
||||
time.sleep(10)
|
||||
tdSql.query('show streams')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0],self.streamname)
|
||||
tdSql.checkData(0, 0, self.streamname)
|
||||
tdSql.execute(f'drop stream `{self.streamname}`')
|
||||
tdSql.execute(f'drop database {self.dbname}')
|
||||
|
||||
|
@ -89,17 +89,17 @@ class TDTestCase:
|
|||
tdSql.execute(f'insert into {self.ntbname1} values(now(),1,1)')
|
||||
tdSql.execute(f'insert into {self.ntbname2} values(now(),2,2)')
|
||||
tdSql.query(f'select `{self.ntbname1}`.`c0`, `{self.ntbname1}`.`c1` from `{self.ntbname1}`')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0], 1)
|
||||
tdSql.checkData(0, 0, 1)
|
||||
tdSql.query(f'select `{self.ntbname1}`.`c0`, `{self.ntbname1}`.`c1` from `{self.dbname}`.`{self.ntbname1}`')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0], 1)
|
||||
tdSql.checkData(0, 0, 1)
|
||||
tdSql.query(f'select `{self.ntbname1}`.`c0` from `{self.ntbname2}` `{self.ntbname1}`')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0], 2)
|
||||
tdSql.checkData(0, 0, 2)
|
||||
tdSql.query(f'select `{self.ntbname1}`.`c0` from (select * from `{self.ntbname2}`) `{self.ntbname1}`')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][0], 2)
|
||||
tdSql.checkData(0, 0, 2)
|
||||
# select `t1`.`col1`, `col2`, `col3` from (select ts `col1`, 123 `col2`, c0 + c1 as `col3` from t2) `t1`;
|
||||
tdSql.query(f'select `{self.ntbname1}`.`col1`, `col2`, `col3` from (select ts `col1`, 123 `col2`, c0 + c1 as `col3` from {self.ntbname2}) `{self.ntbname1}`')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][1], 123)
|
||||
tdSql.checkEqual(tdSql.queryResult[0][2], 4)
|
||||
tdSql.checkData(0, 1, 123)
|
||||
tdSql.checkData(0, 2, 4)
|
||||
|
||||
# tdSql.execute(f'drop database {self.dbname}')
|
||||
|
||||
|
@ -117,15 +117,15 @@ class TDTestCase:
|
|||
|
||||
tdSql.query(f'select `t1`.`ts`, `t1`.`c0` + `t2`.`c0` as `c0`, `t1`.`c1` * `t2`.`c1` as `c1` from `{self.ntbname1}` `t1` join `{self.ntbname2}` `t2` on timetruncate(`t1`.`ts`, 1s) = timetruncate(`t2`.`ts`, 1s);')
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkEqual(tdSql.queryResult[0][1], 3)
|
||||
tdSql.checkData(0, 1, 3)
|
||||
|
||||
tdSql.query(f'select `t1`.`ts`, `t1`.`c1`, `t1`.`c2` from (select `ts`, `c0` + 1 as `c1`, `c1` + 2 as `c2` from `{self.ntbname1}`) `t1`;')
|
||||
tdSql.checkEqual(tdSql.queryResult[0][1], 2)
|
||||
tdSql.checkEqual(tdSql.queryResult[0][2], 3)
|
||||
tdSql.checkData(0, 1, 2)
|
||||
tdSql.checkData(0, 2, 3)
|
||||
|
||||
tdSql.query(f'select `t`.`ts`, cast(`t`.`v1` as int) + `t`.`c0` as `v` from (select `ts`, "12" as `v1`, `c0`, `c1` from `ntb1`) `t`;')
|
||||
tdSql.checkRows(1)
|
||||
tdSql.checkEqual(tdSql.queryResult[0][1], 13)
|
||||
tdSql.checkData(0, 1, 13)
|
||||
|
||||
tdSql.query(f'select count(`t1`.`ts`) from (select `t`.`ts` from `{self.ntbname1}` `t`) `t1`;')
|
||||
tdSql.checkRows(1)
|
||||
|
@ -133,7 +133,8 @@ class TDTestCase:
|
|||
def run(self):
|
||||
self.topic_name_check()
|
||||
self.db_name_check()
|
||||
self.stream_name_check()
|
||||
if platform.system().lower() == 'windows':
|
||||
self.stream_name_check()
|
||||
self.table_name_check()
|
||||
self.view_name_check()
|
||||
self.query_check()
|
||||
|
|
|
@ -16,7 +16,7 @@ import random
|
|||
import time
|
||||
import copy
|
||||
import string
|
||||
|
||||
import platform
|
||||
import taos
|
||||
from util.log import *
|
||||
from util.cases import *
|
||||
|
@ -380,14 +380,15 @@ class TDTestCase:
|
|||
# forbid
|
||||
def checkForbid(self):
|
||||
# stream
|
||||
tdLog.info("check forbid split having stream...")
|
||||
tdSql.execute("create database streamdb;")
|
||||
tdSql.execute("use streamdb;")
|
||||
tdSql.execute("create table ta(ts timestamp, age int);")
|
||||
tdSql.execute("create stream ma into sta as select count(*) from ta interval(1s);")
|
||||
self.expectSplitError("streamdb")
|
||||
tdSql.execute("drop stream ma;")
|
||||
self.expectSplitOk("streamdb")
|
||||
if platform.system().lower() != 'windows':
|
||||
tdLog.info("check forbid split having stream...")
|
||||
tdSql.execute("create database streamdb;")
|
||||
tdSql.execute("use streamdb;")
|
||||
tdSql.execute("create table ta(ts timestamp, age int);")
|
||||
tdSql.execute("create stream ma into sta as select count(*) from ta interval(1s);")
|
||||
self.expectSplitError("streamdb")
|
||||
tdSql.execute("drop stream ma;")
|
||||
self.expectSplitOk("streamdb")
|
||||
|
||||
# topic
|
||||
tdLog.info("check forbid split having topic...")
|
||||
|
|
|
@ -16,7 +16,7 @@ import random
|
|||
import time
|
||||
import copy
|
||||
import string
|
||||
|
||||
import platform
|
||||
import taos
|
||||
from util.log import *
|
||||
from util.cases import *
|
||||
|
@ -380,14 +380,15 @@ class TDTestCase:
|
|||
# forbid
|
||||
def checkForbid(self):
|
||||
# stream
|
||||
tdLog.info("check forbid split having stream...")
|
||||
tdSql.execute("create database streamdb;")
|
||||
tdSql.execute("use streamdb;")
|
||||
tdSql.execute("create table ta(ts timestamp, age int);")
|
||||
tdSql.execute("create stream ma into sta as select count(*) from ta interval(1s);")
|
||||
self.expectSplitError("streamdb")
|
||||
tdSql.execute("drop stream ma;")
|
||||
self.expectSplitOk("streamdb")
|
||||
if platform.system().lower() != 'windows':
|
||||
tdLog.info("check forbid split having stream...")
|
||||
tdSql.execute("create database streamdb;")
|
||||
tdSql.execute("use streamdb;")
|
||||
tdSql.execute("create table ta(ts timestamp, age int);")
|
||||
tdSql.execute("create stream ma into sta as select count(*) from ta interval(1s);")
|
||||
self.expectSplitError("streamdb")
|
||||
tdSql.execute("drop stream ma;")
|
||||
self.expectSplitOk("streamdb")
|
||||
|
||||
# topic
|
||||
tdLog.info("check forbid split having topic...")
|
||||
|
|
|
@ -154,7 +154,10 @@ class TDTestCase:
|
|||
tdSql.query("use source_db")
|
||||
tdSql.query("create table if not exists source_db.stb (ts timestamp, k int) tags (a int);")
|
||||
tdSql.query("create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);")
|
||||
tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS startts, min(k), max(k), sum(k) from source_db.stb interval(10m);")
|
||||
if platform.system().lower() == 'windows':
|
||||
pass
|
||||
else:
|
||||
tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS startts, min(k), max(k), sum(k) from source_db.stb interval(10m);")
|
||||
|
||||
|
||||
#TD-19944 -Q=3
|
||||
|
|
|
@ -17,7 +17,10 @@ class TDTestCase:
|
|||
self.replicaVar = int(replicaVar)
|
||||
tdLog.debug("start to execute %s" % __file__)
|
||||
tdSql.init(conn.cursor(), logSql)
|
||||
self.buffer_boundary = [3, 4097, 8193, 12289, 16384]
|
||||
if platform.system().lower() == 'windows':
|
||||
self.buffer_boundary = [3, 4097]
|
||||
else:
|
||||
self.buffer_boundary = [3, 4097, 8193, 12289, 16384]
|
||||
# remove the value > free_memory, 70% is the weight to calculate the max value
|
||||
# if platform.system() == "Linux" and platform.machine() == "aarch64":
|
||||
# mem = psutil.virtual_memory()
|
||||
|
|
|
@ -22,6 +22,7 @@ from util.cases import tdCases
|
|||
from util.sql import tdSql
|
||||
from util.dnodes import tdDnodes
|
||||
from util.dnodes import *
|
||||
from util.common import *
|
||||
|
||||
class TDTestCase:
|
||||
updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 135}
|
||||
|
@ -158,7 +159,8 @@ class TDTestCase:
|
|||
fake.pystr() ,fake.pystr() ,fake.pyfloat(),fake.pyfloat(),fake.random_int(min=-2147483647, max=2147483647, step=1)))
|
||||
|
||||
# create stream
|
||||
tdSql.execute('''create stream current_stream trigger at_once IGNORE EXPIRED 0 into stream_max_stable_1 as select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''')
|
||||
stream_name="current_stream"
|
||||
tdSql.execute(f'''create stream {stream_name} trigger at_once IGNORE EXPIRED 0 into stream_max_stable_1 as select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''')
|
||||
|
||||
# insert data positive
|
||||
for i in range(num_random*n):
|
||||
|
@ -287,8 +289,8 @@ class TDTestCase:
|
|||
tdSql.query("select count(*) from hn_table_1_r;")
|
||||
tdSql.checkData(0,0,num_random*n)
|
||||
|
||||
sleep(5)
|
||||
# stream data check
|
||||
tdCom.check_stream_task_status(stream_name,vgroups,90)
|
||||
tdSql.query("select startts,wend,max_int from stream_max_stable_1 ;")
|
||||
tdSql.checkRows(20)
|
||||
tdSql.query("select sum(max_int) from stream_max_stable_1 ;")
|
||||
|
|
|
@ -162,7 +162,8 @@ class TDTestCase:
|
|||
self.drop_ntb_check()
|
||||
self.drop_stb_ctb_check()
|
||||
self.drop_topic_check()
|
||||
self.drop_stream_check()
|
||||
if platform.system().lower() == 'windows':
|
||||
self.drop_stream_check()
|
||||
pass
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
import sys
|
||||
import random
|
||||
import time
|
||||
|
||||
import platform
|
||||
import taos
|
||||
from util.log import *
|
||||
from util.cases import *
|
||||
|
@ -149,9 +149,10 @@ class TDTestCase:
|
|||
tdSql.execute(sql)
|
||||
|
||||
# create stream
|
||||
sql = "create stream ma into sta as select count(ts) from st interval(100b)"
|
||||
tdLog.info(sql)
|
||||
tdSql.execute(sql)
|
||||
if platform.system().lower() != 'windows':
|
||||
sql = "create stream ma into sta as select count(ts) from st interval(100b)"
|
||||
tdLog.info(sql)
|
||||
tdSql.execute(sql)
|
||||
|
||||
# insert data
|
||||
self.insertData()
|
||||
|
@ -315,7 +316,8 @@ class TDTestCase:
|
|||
self.checkWhere()
|
||||
|
||||
# check stream
|
||||
self.checkStream()
|
||||
if platform.system().lower() != 'windows':
|
||||
self.checkStream()
|
||||
|
||||
# stop
|
||||
def stop(self):
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
import sys
|
||||
import random
|
||||
import time
|
||||
|
||||
import platform
|
||||
import taos
|
||||
from util.log import *
|
||||
from util.cases import *
|
||||
|
@ -149,9 +149,10 @@ class TDTestCase:
|
|||
tdSql.execute(sql)
|
||||
|
||||
# create stream
|
||||
sql = "create stream ma into sta as select count(ts) from st interval(100u)"
|
||||
tdLog.info(sql)
|
||||
tdSql.execute(sql)
|
||||
if platform.system().lower() != 'windows':
|
||||
sql = "create stream ma into sta as select count(ts) from st interval(100u)"
|
||||
tdLog.info(sql)
|
||||
tdSql.execute(sql)
|
||||
|
||||
# insert data
|
||||
self.insertData()
|
||||
|
@ -289,7 +290,8 @@ class TDTestCase:
|
|||
self.checkWhere()
|
||||
|
||||
# check stream
|
||||
self.checkStream()
|
||||
if platform.system().lower() != 'windows':
|
||||
self.checkStream()
|
||||
|
||||
# stop
|
||||
def stop(self):
|
||||
|
|
|
@ -25,7 +25,9 @@ class TDTestCase:
|
|||
self.tag2 = f'using {self.stable0}(groupId) tags(2)'
|
||||
self.file1 = f"{self.testcasePath}/b.csv"
|
||||
self.file2 = f"{self.testcasePath}/c.csv"
|
||||
|
||||
if platform.system().lower() == 'windows':
|
||||
self.file1 = self.file1.replace("\\","\\\\")
|
||||
self.file2 = self.file2.replace("\\","\\\\")
|
||||
tdLog.debug(f"start to excute {__file__}")
|
||||
tdSql.init(conn.cursor(), logSql)
|
||||
|
||||
|
|
|
@ -56,26 +56,33 @@ class TDTestCase(TDTestCase):
|
|||
|
||||
|
||||
def check_sql_result_include(self, sql,include_result):
|
||||
result = os.popen("taos -s 'reset query cache; %s'" %sql)
|
||||
result = os.popen(f"taos -s \"reset query cache; {sql}\"" )
|
||||
res = result.read()
|
||||
#tdLog.info(res)
|
||||
if (include_result in res):
|
||||
tdLog.info(f"check_sql_result_include : checkEqual success")
|
||||
else :
|
||||
tdLog.info(res)
|
||||
if res is None or res == '':
|
||||
tdLog.info(sql)
|
||||
tdLog.exit(f"check_sql_result_include : checkEqual error")
|
||||
tdLog.exit(f"check_sql_result_include : taos -s return null")
|
||||
else:
|
||||
if (include_result in res):
|
||||
tdLog.info(f"check_sql_result_include : checkEqual success")
|
||||
else :
|
||||
tdLog.info(res)
|
||||
tdLog.info(sql)
|
||||
tdLog.exit(f"check_sql_result_include : checkEqual error")
|
||||
|
||||
def check_sql_result_not_include(self, sql,not_include_result):
|
||||
result = os.popen("taos -s 'reset query cache; %s'" %sql)
|
||||
result = os.popen(f"taos -s \"reset query cache; {sql}\"" )
|
||||
res = result.read()
|
||||
#tdLog.info(res)
|
||||
if (not_include_result in res):
|
||||
tdLog.info(res)
|
||||
if res is None or res == '':
|
||||
tdLog.info(sql)
|
||||
tdLog.exit(f"check_sql_result_not_include : checkEqual error")
|
||||
else :
|
||||
tdLog.info(f"check_sql_result_not_include : checkEqual success")
|
||||
tdLog.exit(f"check_sql_result_not_include : taos -s return null")
|
||||
else:
|
||||
if (not_include_result in res):
|
||||
tdLog.info(res)
|
||||
tdLog.info(sql)
|
||||
tdLog.exit(f"check_sql_result_not_include : checkEqual error")
|
||||
else :
|
||||
tdLog.info(f"check_sql_result_not_include : checkEqual success")
|
||||
|
||||
def cachemodel_none(self, dbname="nested"):
|
||||
|
||||
|
@ -325,6 +332,7 @@ class TDTestCase(TDTestCase):
|
|||
|
||||
for i in range(2):
|
||||
self.cachemodel_none()
|
||||
tdLog.info("last_row")
|
||||
tdSql.query("alter database nested cachemodel 'last_row' ")
|
||||
tdSql.query("reset query cache;")
|
||||
self.cachemodel_last_row()
|
||||
|
|
|
@ -65,9 +65,12 @@ class TDTestCase:
|
|||
while count < self.mnodeCheckCnt:
|
||||
time.sleep(1)
|
||||
tdSql.query("select * from information_schema.ins_mnodes;")
|
||||
rst = tdSql.checkRows(self.mnodes)
|
||||
print(f"rst: {rst}")
|
||||
if tdSql.checkRows(self.mnodes) :
|
||||
tdLog.debug("mnode is three nodes")
|
||||
else:
|
||||
tdSql.print_error_frame_info(tdSql.queryRows,3)
|
||||
tdLog.exit("mnode number is correct")
|
||||
|
||||
roleOfMnode0 = tdSql.queryResult[0][self.roleIndex]
|
||||
|
|
|
@ -1,2 +1,19 @@
|
|||
#python3 ./test.py -f 2-query/last.py -Q 3
|
||||
#./test.sh -f tsim/mnode/basic4.sim
|
||||
python3 ./test.py -f 2-query/match.py
|
||||
python3 ./test.py -f 0-others/splitVGroup.py -N 3 -n 1
|
||||
python3 ./test.py -f 2-query/tsma.py
|
||||
python3 ./test.py -f 2-query/tsma2.py
|
||||
python3 ./test.py -f 1-insert/database_pre_suf.py
|
||||
python3 ./test.py -f 0-others/splitVGroup.py -N 3 -n 1
|
||||
python3 ./test.py -f 0-others/splitVGroupWal.py -N 3 -n 1
|
||||
python3 ./test.py -f 0-others/delete_check.py
|
||||
python3 ./test.py -f 1-insert/alter_database.py
|
||||
python3 ./test.py -f 1-insert/db_tb_name_check.py
|
||||
python3 ./test.py -f 1-insert/precisionUS.py
|
||||
python3 ./test.py -f 1-insert/precisionNS.py
|
||||
python3 ./test.py -f 1-insert/ts-4272.py
|
||||
python3 ./test.py -f 2-query/last+last_row.py
|
||||
python3 ./test.py -f 2-query/normal.py
|
||||
python3 ./test.py -f 2-query/To_iso8601.py
|
||||
python3 ./test.py -f 2-query/normal.py
|
||||
python3 ./test.py -f 5-taos-tools/taosbenchmark/insertMix.py -N 3
|
||||
python3 ./test.py -f 7-tmq/tmq_taosx.py
|
|
@ -44,7 +44,7 @@ def checkRunTimeError():
|
|||
time.sleep(1)
|
||||
timeCount = timeCount + 1
|
||||
print("checkRunTimeError",timeCount)
|
||||
if (timeCount>600):
|
||||
if (timeCount>1200):
|
||||
print("stop the test.")
|
||||
os.system("TASKKILL /F /IM taosd.exe")
|
||||
os.system("TASKKILL /F /IM taos.exe")
|
||||
|
|
|
@ -104,7 +104,6 @@ python3 ./test.py -f 2-query/insert_null_none.py -R
|
|||
python3 ./test.py -f 2-query/insert_null_none.py -Q 2
|
||||
python3 ./test.py -f 2-query/insert_null_none.py -Q 3
|
||||
python3 ./test.py -f 2-query/insert_null_none.py -Q 4
|
||||
python3 ./test.py -f 1-insert/database_pre_suf.py
|
||||
python3 ./test.py -f 2-query/concat.py -Q 3
|
||||
python3 ./test.py -f 2-query/out_of_order.py -Q 2
|
||||
python3 ./test.py -f 2-query/out_of_order.py -Q 4
|
||||
|
@ -572,7 +571,6 @@ python3 ./test.py -f 2-query/join2.py
|
|||
python3 ./test.py -f 2-query/union1.py
|
||||
python3 ./test.py -f 2-query/concat2.py
|
||||
python3 ./test.py -f 2-query/json_tag.py
|
||||
python3 ./test.py -f 2-query/nestedQueryInterval.py
|
||||
python3 ./test.py -f 2-query/systable_func.py
|
||||
python3 ./test.py -f 2-query/test_ts4382.py
|
||||
python3 ./test.py -f 2-query/test_ts4403.py
|
||||
|
@ -687,7 +685,6 @@ python3 ./test.py -f 2-query/arctan.py -Q 2
|
|||
python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 2
|
||||
python3 ./test.py -f 2-query/interp.py -Q 2
|
||||
python3 ./test.py -f 2-query/fill.py -Q 2
|
||||
python3 ./test.py -f 2-query/nestedQueryInterval.py -Q 2
|
||||
python3 ./test.py -f 2-query/stablity.py -Q 2
|
||||
python3 ./test.py -f 2-query/stablity_1.py -Q 2
|
||||
python3 ./test.py -f 2-query/avg.py -Q 2
|
||||
|
@ -783,7 +780,6 @@ python3 ./test.py -f 2-query/arcsin.py -Q 3
|
|||
python3 ./test.py -f 2-query/arccos.py -Q 3
|
||||
python3 ./test.py -f 2-query/arctan.py -Q 3
|
||||
python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 3
|
||||
python3 ./test.py -f 2-query/nestedQueryInterval.py -Q 3
|
||||
python3 ./test.py -f 2-query/stablity.py -Q 3
|
||||
python3 ./test.py -f 2-query/stablity_1.py -Q 3
|
||||
python3 ./test.py -f 2-query/avg.py -Q 3
|
||||
|
@ -881,7 +877,6 @@ python3 ./test.py -f 2-query/arcsin.py -Q 4
|
|||
python3 ./test.py -f 2-query/arccos.py -Q 4
|
||||
python3 ./test.py -f 2-query/arctan.py -Q 4
|
||||
python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4
|
||||
python3 ./test.py -f 2-query/nestedQueryInterval.py -Q 4
|
||||
python3 ./test.py -f 2-query/stablity.py -Q 4
|
||||
python3 ./test.py -f 2-query/stablity_1.py -Q 4
|
||||
python3 ./test.py -f 2-query/avg.py -Q 4
|
||||
|
@ -914,7 +909,6 @@ python3 ./test.py -f 2-query/last_row.py -Q 4
|
|||
python3 ./test.py -f 2-query/tsbsQuery.py -Q 4
|
||||
python3 ./test.py -f 2-query/sml.py -Q 4
|
||||
python3 ./test.py -f 2-query/interp.py -Q 4
|
||||
python3 ./test.py -f 2-query/fill.py -Q 4
|
||||
python3 ./test.py -f 2-query/case_when.py -Q 4
|
||||
python3 ./test.py -f 2-query/insert_select.py
|
||||
python3 ./test.py -f 2-query/insert_select.py -R
|
||||
|
|
Loading…
Reference in New Issue