diff --git a/.travis.yml b/.travis.yml index f9a27fdabde10c96821d307a75d52502cea656ee..17ede412d2702198dab2191d596299da8b18ba0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,8 +72,8 @@ matrix: fi done - grep 'definitely lost' mem-error-out.txt | uniq | tee uniq-definitely-lost-out.txt - for defiMemError in `cat uniq-definitely-lost-out.txt | awk '{print $7}'` + grep 'definitely lost:' mem-error-out.txt | uniq | tee uniq-definitely-lost-out.txt + for defiMemError in `cat uniq-definitely-lost-out.txt | awk '{print $4}'` do if [ -n "$defiMemError" ]; then if [ "$defiMemError" -gt 16 ]; then diff --git a/src/client/src/tscLocal.c b/src/client/src/tscLocal.c index 600ef8834407360a814767a0633720327fcd697c..5ae226a577a9af982c7c0d926eb432d5e7e73ac4 100644 --- a/src/client/src/tscLocal.c +++ b/src/client/src/tscLocal.c @@ -156,7 +156,8 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) { pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, 3); if (i >= tscGetNumOfColumns(pMeta) && tscGetNumOfTags(pMeta) != 0) { char* output = pRes->data + tscFieldInfoGetOffset(pQueryInfo, 3) * totalNumOfRows + pField->bytes * i; - STR_WITH_SIZE_TO_VARSTR(output, "TAG", 3); + const char *src = "TAG"; + STR_WITH_SIZE_TO_VARSTR(output, src, strlen(src)); } } @@ -191,7 +192,8 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) { // tag value pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, 3); char *target = pRes->data + tscFieldInfoGetOffset(pQueryInfo, 3) * totalNumOfRows + pField->bytes * i; - STR_WITH_SIZE_TO_VARSTR(target, "TAG", 3); + const char *src = "TAG"; + STR_WITH_SIZE_TO_VARSTR(target, src, strlen(src)); pTagValue += pSchema[i].bytes; } diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index cd5dd6355acabbd760d131a9cfd6ad87b8627a7f..4cc03f7ad9d04c4bd48c44d2f0563edecdc394cf 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -370,10 +370,11 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } - char* pMsg = pCmd->payload + tsRpcHeadSize; - pMsg += sizeof(SMgmtHead); + char* pMsg = pCmd->payload; SCMCfgDnodeMsg* pCfg = (SCMCfgDnodeMsg*)pMsg; + pDCL->a[0].n = strdequote(pDCL->a[0].z); + strncpy(pCfg->ep, pDCL->a[0].z, pDCL->a[0].n); strncpy(pCfg->config, pDCL->a[1].z, pDCL->a[1].n); @@ -2254,14 +2255,14 @@ int32_t setKillInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { char* portStr = strtok(NULL, &delim); if (!validateIpAddress(ipStr, strlen(ipStr))) { - memset(pCmd->payload, 0, tListLen(pCmd->payload)); + memset(pCmd->payload, 0, strlen(pCmd->payload)); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1); } uint16_t port = (uint16_t)strtol(portStr, NULL, 10); if (port <= 0 || port > 65535) { - memset(pCmd->payload, 0, tListLen(pCmd->payload)); + memset(pCmd->payload, 0, strlen(pCmd->payload)); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 35e2250dd8674090c2c68ed8d68bd7e7946a2bb8..119a84e964f70bfa061d1b245e483eaf2210dd25 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -1005,13 +1005,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int32_t tscBuildCfgDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SSqlCmd *pCmd = &pSql->cmd; pCmd->payloadLen = sizeof(SCMCfgDnodeMsg); - - if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) { - tscError("%p failed to malloc for query msg", pSql); - return TSDB_CODE_CLI_OUT_OF_MEMORY; - } - - pCmd->msgType = TSDB_MSG_TYPE_MD_CONFIG_DNODE; + pCmd->msgType = TSDB_MSG_TYPE_CM_CONFIG_DNODE; return TSDB_CODE_SUCCESS; } @@ -1189,7 +1183,7 @@ int32_t tscBuildKillMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscEstimateCreateTableMsgLength(SSqlObj *pSql, SSqlInfo *pInfo) { SSqlCmd *pCmd = &(pSql->cmd); - int32_t size = minMsgSize() + sizeof(SMgmtHead) + sizeof(SCMCreateTableMsg); + int32_t size = minMsgSize() + sizeof(SCMCreateTableMsg); SCreateTableSQL *pCreateTableInfo = pInfo->pCreateTableInfo; if (pCreateTableInfo->type == TSQL_CREATE_TABLE_FROM_STABLE) { @@ -1277,7 +1271,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscEstimateAlterTableMsgLength(SSqlCmd *pCmd) { SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); - return minMsgSize() + sizeof(SMgmtHead) + sizeof(SCMAlterTableMsg) + sizeof(SSchema) * tscNumOfFields(pQueryInfo) + + return minMsgSize() + sizeof(SCMAlterTableMsg) + sizeof(SSchema) * tscNumOfFields(pQueryInfo) + TSDB_EXTRA_PAYLOAD_SIZE; } @@ -1534,6 +1528,7 @@ int tscBuildTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) { * no used 4B **/ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) { +#if 0 SSqlCmd *pCmd = &pSql->cmd; // copy payload content to temp buff @@ -1566,6 +1561,8 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pCmd->payloadLen); return pCmd->payloadLen; +#endif + return 0; } //static UNUSED_FUNC int32_t tscEstimateMetricMetaMsgSize(SSqlCmd *pCmd) { @@ -1765,7 +1762,7 @@ int tscEstimateHeartBeatMsgLength(SSqlObj *pSql) { int size = 0; STscObj *pObj = pSql->pTscObj; - size += tsRpcHeadSize + sizeof(SMgmtHead); + size += tsRpcHeadSize; size += sizeof(SQqueryList); SSqlObj *tpSql = pObj->sqlList; @@ -1801,13 +1798,9 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) { return -1; } - pMsg = pCmd->payload + tsRpcHeadSize; + pMsg = pCmd->payload; pStart = pMsg; - SMgmtHead *pMgmt = (SMgmtHead *)pMsg; - strcpy(pMgmt->db, pObj->db); - pMsg += sizeof(SMgmtHead); - pMsg = tscBuildQueryStreamDesc(pMsg, pObj); pthread_mutex_unlock(&pObj->mutex); diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 9828906532e9bb1d0109a75d6fa9a07af7af2ee9..991c1b403bffa059ed70803caae40d83750040e0 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -204,10 +204,19 @@ static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT; void taosSetAllDebugFlag() { for (int32_t i = 0; i < tsGlobalConfigNum; ++i) { - SGlobalCfg *cfg = &tsGlobalConfig[i]; - if ((cfg->cfgType & TSDB_CFG_CTYPE_B_LOG) && cfg->cfgType == TAOS_CFG_VTYPE_INT32) { - *((int32_t*)cfg->ptr) = debugFlag; - } + mdebugFlag = debugFlag; + sdbDebugFlag = debugFlag; + dDebugFlag = debugFlag; + vDebugFlag = debugFlag; + cdebugFlag = debugFlag; + jnidebugFlag = debugFlag; + odbcdebugFlag = debugFlag; + httpDebugFlag = debugFlag; + monitorDebugFlag = debugFlag; + rpcDebugFlag = debugFlag; + uDebugFlag = debugFlag; + sDebugFlag = debugFlag; + //qdebugFlag = debugFlag; } uPrint("all debug flag are set to %d", debugFlag); } @@ -1189,6 +1198,10 @@ void taosInitGlobalCfg() { } bool taosCheckGlobalCfg() { + if (debugFlag == 135 || debugFlag == 199) { + taosSetAllDebugFlag(); + } + taosGetFqdn(tsLocalEp); sprintf(tsLocalEp + strlen(tsLocalEp), ":%d", tsServerPort); uPrint("localEp is %s", tsLocalEp); diff --git a/src/dnode/src/dnodeShell.c b/src/dnode/src/dnodeShell.c index 8ca3aa12e17a16c7e75e6510f52a8bd79528107e..cf6b5e38abda31202ad73d3f635b743d3ba33eec 100644 --- a/src/dnode/src/dnodeShell.c +++ b/src/dnode/src/dnodeShell.c @@ -137,7 +137,6 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) { } } - static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) { return TSDB_CODE_SUCCESS; } diff --git a/src/dnode/src/dnodeVWrite.c b/src/dnode/src/dnodeVWrite.c index 147d2bdfbbc9afb5507327e305a8409c22ba848d..5de4c16c500258fe5f3d5d7588bc8782530d8791 100644 --- a/src/dnode/src/dnodeVWrite.c +++ b/src/dnode/src/dnodeVWrite.c @@ -85,7 +85,7 @@ void dnodeCleanupWrite() { void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) { char *pCont = (char *)pMsg->pCont; - if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT || pMsg->msgType == TSDB_MSG_TYPE_MD_DROP_STABLE) { + if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT) { SMsgDesc *pDesc = (SMsgDesc *)pCont; pDesc->numOfVnodes = htonl(pDesc->numOfVnodes); pCont += sizeof(SMsgDesc); diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index fec14bd938687373bca8e0e5f5bf26358fbecb0c..8dac73606d336ca376c0b5f70521285fb7d78344 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -317,10 +317,6 @@ typedef struct { int8_t flag; } SCMCreateUserMsg, SCMAlterUserMsg; -typedef struct { - char db[TSDB_TABLE_ID_LEN + 1]; -} SMgmtHead; - typedef struct { int32_t contLen; int32_t vgId; @@ -330,6 +326,7 @@ typedef struct { } SMDDropTableMsg; typedef struct { + int32_t contLen; int32_t vgId; int64_t uid; char tableId[TSDB_TABLE_ID_LEN + 1]; diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 937c8d177dc73138e626f83b18657cbb8eb485a2..33b76cea2deaa8b54d844b0002fbf648d1822599 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -634,7 +634,7 @@ void *readMetric(void *sarg) { fprintf(fp, "Querying On %d records:\n", totalData); for (int j = 0; j < n; j++) { - char condition[BUFFER_SIZE] = "\0"; + char condition[BUFFER_SIZE - 30] = "\0"; char tempS[BUFFER_SIZE] = "\0"; int m = 10 < num_of_tables ? 10 : num_of_tables; diff --git a/src/mnode/src/mgmtDb.c b/src/mnode/src/mgmtDb.c index 8c6a80eb615e6ee9f4ea96c71474dec5437fbb13..4f54a85baa79fa7b386b63b4484e3f821dabe6a0 100644 --- a/src/mnode/src/mgmtDb.c +++ b/src/mnode/src/mgmtDb.c @@ -677,9 +677,11 @@ static int32_t mgmtRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void * pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; if (pDb->status == TSDB_DB_STATUS_READY) { - STR_WITH_SIZE_TO_VARSTR(pWrite, "ready", 5); + const char *src = "ready"; + STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src)); } else { - STR_WITH_SIZE_TO_VARSTR(pWrite, "dropping", 8); + const char *src = "dropping"; + STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src)); } cols++; diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index a170aa2d02d1d12107c212930c0797e80c2aaa6e..d60dae32aef9a9762378121d99ec36cf11aa6bf5 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -223,7 +223,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) { if (pCmCfgDnode->ep[0] == 0) { strcpy(pCmCfgDnode->ep, tsLocalEp); } else { - strcpy(pCmCfgDnode->ep, pCmCfgDnode->ep); + // TODO temporary disabled for compiling: strcpy(pCmCfgDnode->ep, pCmCfgDnode->ep); } if (strcmp(pMsg->pUser->user, "root") != 0) { @@ -252,7 +252,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) { } static void mgmtProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) { - mPrint("cfg vnode rsp is received, result:%s", tstrerror(rpcMsg->code)); + mPrint("cfg dnode rsp is received"); } void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) { diff --git a/src/mnode/src/mgmtMain.c b/src/mnode/src/mgmtMain.c index 434552980fb22657cffcb79080b85473d6e5e574..2a8e139eecc47934df09ca49e5ccab64dcf66985 100644 --- a/src/mnode/src/mgmtMain.c +++ b/src/mnode/src/mgmtMain.c @@ -132,6 +132,7 @@ int32_t mgmtInitSystem() { void mgmtCleanUpSystem() { mPrint("starting to clean up mgmt"); + tsMgmtIsRunning = false; mgmtCleanUpShell(); mgmtCleanupServer(); grantCleanUp(); @@ -144,7 +145,6 @@ void mgmtCleanUpSystem() { mgmtCleanupDnodes(); mgmtCleanUpUsers(); mgmtCleanUpAccts(); - tsMgmtIsRunning = false; mPrint("mgmt is cleaned up"); } diff --git a/src/mnode/src/mgmtSdb.c b/src/mnode/src/mgmtSdb.c index d2a5287f138a112c8aac2bd1fae1b9b8c8a6a6d6..4a18c5e285567ec1455abfecceeee305e8d9ac51 100644 --- a/src/mnode/src/mgmtSdb.c +++ b/src/mnode/src/mgmtSdb.c @@ -323,11 +323,19 @@ void sdbCleanUp() { if (tsSdbObj.status != SDB_STATUS_SERVING) return; tsSdbObj.status = SDB_STATUS_CLOSING; - syncStop(tsSdbObj.sync); - walClose(tsSdbObj.wal); + + if (tsSdbObj.sync) { + syncStop(tsSdbObj.sync); + tsSdbObj.sync = NULL; + } + + if (tsSdbObj.wal) { + walClose(tsSdbObj.wal); + tsSdbObj.wal = NULL; + } + sem_destroy(&tsSdbObj.sem); pthread_mutex_destroy(&tsSdbObj.mutex); - memset(&tsSdbObj, 0, sizeof(tsSdbObj)); } void sdbIncRef(void *handle, void *pRow) { diff --git a/src/mnode/src/mgmtTable.c b/src/mnode/src/mgmtTable.c index 2225e08f58c4d94c75027280c545d99792870594..bfe357cf7c74069e5cb41f569f9129d3d26c1376 100644 --- a/src/mnode/src/mgmtTable.c +++ b/src/mnode/src/mgmtTable.c @@ -701,10 +701,10 @@ static void mgmtProcessDropTableMsg(SQueuedMsg *pMsg) { } if (pMsg->pTable->type == TSDB_SUPER_TABLE) { - mTrace("table:%s, start to drop stable", pDrop->tableId); + mPrint("table:%s, start to drop stable", pDrop->tableId); mgmtProcessDropSuperTableMsg(pMsg); } else { - mTrace("table:%s, start to drop ctable", pDrop->tableId); + mPrint("table:%s, start to drop ctable", pDrop->tableId); mgmtProcessDropChildTableMsg(pMsg); } } @@ -802,29 +802,32 @@ static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) { int32_t vgId = pStable->vgList[vg]; if (vgId == 0) break; + SVgObj *pVgroup = mgmtGetVgroup(vgId); + if (pVgroup == NULL) break; + SMDDropSTableMsg *pDrop = rpcMallocCont(sizeof(SMDDropSTableMsg)); + pDrop->contLen = htonl(sizeof(SMDDropSTableMsg)); pDrop->vgId = htonl(vgId); pDrop->uid = htobe64(pStable->uid); mgmtExtractTableName(pStable->info.tableId, pDrop->tableId); - - SVgObj *pVgroup = mgmtGetVgroup(vgId); - if (pVgroup != NULL) { - SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup); - SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE}; - dnodeSendMsgToDnode(&ipSet, &rpcMsg); - mgmtDecVgroupRef(pVgroup); - } + + mPrint("stable:%s, send drop stable msg to vgId:%d", pStable->info.tableId, vgId); + SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup); + SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE}; + dnodeSendMsgToDnode(&ipSet, &rpcMsg); + mgmtDecVgroupRef(pVgroup); } - } else { - SSdbOper oper = { - .type = SDB_OPER_GLOBAL, - .table = tsSuperTableSdb, - .pObj = pStable - }; - int32_t code = sdbDeleteRow(&oper); - mLPrint("stable:%s, is dropped from sdb, result:%s", pStable->info.tableId, tstrerror(code)); - mgmtSendSimpleResp(pMsg->thandle, code); - } + } + + SSdbOper oper = { + .type = SDB_OPER_GLOBAL, + .table = tsSuperTableSdb, + .pObj = pStable + }; + + int32_t code = sdbDeleteRow(&oper); + mLPrint("stable:%s, is dropped from sdb, result:%s", pStable->info.tableId, tstrerror(code)); + mgmtSendSimpleResp(pMsg->thandle, code); } static int32_t mgmtFindSuperTableTagIndex(SSuperTableObj *pStable, const char *tagName) { @@ -1303,7 +1306,7 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) { } static void mgmtProcessDropSuperTableRsp(SRpcMsg *rpcMsg) { - mTrace("drop stable rsp received, handle:%p code:%s", rpcMsg->handle, tstrerror(rpcMsg->code)); + mPrint("drop stable rsp received, result:%s", tstrerror(rpcMsg->code)); } static void *mgmtBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableObj *pTable) { @@ -1540,7 +1543,7 @@ static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) { SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pMsg->pVgroup); - mTrace("table:%s, send drop ctable msg", pDrop->tableId); + mPrint("table:%s, send drop ctable msg", pDrop->tableId); SQueuedMsg *newMsg = mgmtCloneQueuedMsg(pMsg); newMsg->ahandle = pMsg->pTable; SRpcMsg rpcMsg = { @@ -1867,7 +1870,7 @@ static void mgmtProcessDropChildTableRsp(SRpcMsg *rpcMsg) { queueMsg->received++; SChildTableObj *pTable = queueMsg->ahandle; - mTrace("table:%s, drop table rsp received, thandle:%p result:%s", pTable->info.tableId, queueMsg->thandle, tstrerror(rpcMsg->code)); + mPrint("table:%s, drop table rsp received, thandle:%p result:%s", pTable->info.tableId, queueMsg->thandle, tstrerror(rpcMsg->code)); if (rpcMsg->code != TSDB_CODE_SUCCESS) { mError("table:%s, failed to drop in dnode, reason:%s", pTable->info.tableId, tstrerror(rpcMsg->code)); diff --git a/src/mnode/src/mgmtUser.c b/src/mnode/src/mgmtUser.c index b0e58a50525733f1659d581c727e58dc0aa793b2..9630ab3d587842b408d5f12ba1e4ae71ececd1e6 100644 --- a/src/mnode/src/mgmtUser.c +++ b/src/mnode/src/mgmtUser.c @@ -309,11 +309,14 @@ static int32_t mgmtRetrieveUsers(SShowObj *pShow, char *data, int32_t rows, void pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; if (pUser->superAuth) { - STR_WITH_SIZE_TO_VARSTR(pWrite, "super", 5); + const char *src = "super"; + STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src)); } else if (pUser->writeAuth) { - STR_WITH_SIZE_TO_VARSTR(pWrite, "writable", 8); + const char *src = "writable"; + STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src)); } else { - STR_WITH_SIZE_TO_VARSTR(pWrite, "readable", 8); + const char *src = "readable"; + STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src)); } cols++; @@ -525,4 +528,4 @@ void mgmtDropAllUsers(SAcctObj *pAcct) { } mTrace("acct:%s, all users:%d is dropped from sdb", pAcct->user, numOfUsers); -} \ No newline at end of file +} diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index cbe235a26a75f463e9af14b487f4adb0bb5c87b4..b87c6ad7274dceb0463827f731b6f4c912d9613d 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -494,11 +494,12 @@ int32_t mgmtRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pCo cols++; } else { pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; - STR_WITH_SIZE_TO_VARSTR(pWrite, "NULL", 4); + const char *src = "NULL"; + STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src)); cols++; pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; - STR_WITH_SIZE_TO_VARSTR(pWrite, "NULL", 4); + STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src)); cols++; } } diff --git a/src/os/linux/CMakeLists.txt b/src/os/linux/CMakeLists.txt index 83d717f905fb4cfa40ba357c46c6740ba1f3f636..7be4a13f255d0e72b3ad7462edb5424cdf3762ec 100644 --- a/src/os/linux/CMakeLists.txt +++ b/src/os/linux/CMakeLists.txt @@ -12,3 +12,5 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) ADD_LIBRARY(os ${SRC}) TARGET_LINK_LIBRARIES(os m rt) ENDIF () + +SET_SOURCE_FILES_PROPERTIES(src/linuxSysPara.c PROPERTIES COMPILE_FLAGS -w) diff --git a/src/os/linux/inc/os.h b/src/os/linux/inc/os.h index 27a8363050a2519248ce515e94185c4a623c0d55..cab899753d654912bc10817d4114bcc931760ddd 100644 --- a/src/os/linux/inc/os.h +++ b/src/os/linux/inc/os.h @@ -23,13 +23,6 @@ extern "C" { #include #include -#ifndef _ALPINE - #include - #include -#else - #include -#endif - #include #include #include @@ -82,6 +75,7 @@ extern "C" { #include #include #include +#include #define taosCloseSocket(x) \ { \ diff --git a/src/os/linux/inc/tsysctl.h b/src/os/linux/inc/tsysctl.h new file mode 100644 index 0000000000000000000000000000000000000000..559d5653ee5f1083595d299c7dc61a99a0a35b46 --- /dev/null +++ b/src/os/linux/inc/tsysctl.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef TDENGINE_TSYSCTL_H +#define TDENGINE_TSYSCTL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ALPINE + #include + #include +#else + #include +#endif + +#endif diff --git a/src/os/linux/src/linuxSysPara.c b/src/os/linux/src/linuxSysPara.c index 6bab418385655f4869223033ae993ee4953cfb51..8b8607a58d779e645efc53b057c84d2496f79726 100644 --- a/src/os/linux/src/linuxSysPara.c +++ b/src/os/linux/src/linuxSysPara.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "os.h" +#include "tsysctl.h" #include "tconfig.h" #include "tglobal.h" #include "tulog.h" diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index 6ffac08b4e5bd7c2bb3f4ce25292cc87276b1553..16845812bf520336a5ba3a9bb1764d1d8cc30226 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -301,7 +301,7 @@ void *vnodeGetVnode(int32_t vgId) { SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId); if (ppVnode == NULL || *ppVnode == NULL) { terrno = TSDB_CODE_INVALID_VGROUP_ID; - vPrint("vgId:%d not exist", vgId); + vPrint("vgId:%d, not exist", vgId); return NULL; } diff --git a/src/vnode/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c index 6f0bc5fcced18af3a666a9ab93c1177374b6f9a5..f560c648e10a28978308e54911f25aef4cb9cce0 100644 --- a/src/vnode/src/vnodeWrite.c +++ b/src/vnode/src/vnodeWrite.c @@ -184,7 +184,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet int16_t numOfColumns = htons(pTable->numOfColumns); int16_t numOfTags = htons(pTable->numOfTags); int32_t sid = htonl(pTable->sid); - uint64_t uid = htobe64(pTable->uid); + uint64_t uid = htobe64(pTable->uid); SSchema *pSchema = (SSchema *) pTable->data; int32_t totalCols = numOfColumns + numOfTags; @@ -231,13 +231,15 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet int32_t code = 0; vTrace("vgId:%d, stable:%s, start to drop", pVnode->vgId, pTable->tableId); - // TODO: drop stable in vvnode - //int64_t uid = htobe64(pTable->uid); - //void *pTsdb = dnodeGetVnodeTsdb(pMsg->pVnode); - //rpcRsp.code = tsdbDropTable(pTsdb, pTable->uid); + + STableId stableId = { + .uid = htobe64(pTable->uid), + .tid = -1 + }; - code = TSDB_CODE_SUCCESS; - vTrace("vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code); + code = tsdbDropTable(pVnode->tsdb, stableId); + + vTrace("vgId:%d, stable:%s, drop stable result:%s", pVnode, pTable->tableId, tstrerror(code)); return code; } diff --git a/tests/pytest/insert/binary.py b/tests/pytest/insert/binary.py index e254fb1438b7d7363dd2edb695087c95c2b10a91..677ae4bf298cd22cefce8f18ee255ea2c982e155 100644 --- a/tests/pytest/insert/binary.py +++ b/tests/pytest/insert/binary.py @@ -14,7 +14,6 @@ class TDTestCase: def run(self): tdSql.prepare() - tdLog.info('=============== step1') tdLog.info('create table tb (ts timestamp, speed binary(5))') tdSql.execute('create table tb (ts timestamp, speed binary(5))') diff --git a/tests/pytest/smoketest.sh b/tests/pytest/smoketest.sh index 37af5f3f42a26cd6322571c399e5573c205f2540..e51e8792ec55f31bd006701cb84b71fc822547e5 100755 --- a/tests/pytest/smoketest.sh +++ b/tests/pytest/smoketest.sh @@ -1,172 +1,116 @@ #!/bin/bash python3 ./test.py $1 -f insert/basic.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/int.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/float.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/bigint.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/bool.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/double.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/smallint.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/tinyint.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/binary.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/date.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f insert/nchar.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f table/column_name.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f table/column_num.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f table/db_table.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importDataLastTO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importDataLastT.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importDataTO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importDataT.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importHeadOverlap.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importHeadPartOverlap.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importHORestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importHPORestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importHRestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importLastSub.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1HO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1HPO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1H.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1S.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1Sub.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1TO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1TPO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock1T.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2HO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2HPO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2H.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2S.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2Sub.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2TO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2TPO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlock2T.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importBlockbetween.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importCacheFileSub.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importCacheFileTO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importCacheFileT.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importDataLastSub.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importHead.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importLastTO.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importLastT.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importSpan.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importSRestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importSubRestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importTailOverlap.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importTail.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importTORestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importTPORestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 python3 ./test.py $1 -f import_merge/importTRestart.py -python3 ./test.py -s $1 -sleep 1 +python3 ./test.py $1 -s && sleep 1 diff --git a/tests/pytest/test.py b/tests/pytest/test.py index 9bf16606340bf117f48dafcef9ba4e98ece9af76..a4129be34cdcadf5836359d5100cd0c0603b0c41 100644 --- a/tests/pytest/test.py +++ b/tests/pytest/test.py @@ -92,23 +92,23 @@ if __name__ == "__main__": tdDnodes.start(1) if masterIp == "": - host='127.0.0.1' + host = '127.0.0.1' else: - host=masterIp + host = masterIp - tdLog.notice("Procedures for tdengine deployed in %s" % (host)) + tdLog.info("Procedures for tdengine deployed in %s" % (host)) if testCluster: - tdLog.notice("Procedures for testing cluster") + tdLog.info("Procedures for testing cluster") if fileName == "all": tdCases.runAllCluster() else: tdCases.runOneCluster(fileName) else: - tdLog.notice("Procedures for testing self-deployment") + tdLog.info("Procedures for testing self-deployment") conn = taos.connect( - host, - config=tdDnodes.getSimCfgPath()) + host, + config=tdDnodes.getSimCfgPath()) if fileName == "all": tdCases.runAllLinux(conn) else: diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index 2532cec702df3dd8771721ac58dc750b202a8a36..e492a35c2061f4638ffdee83aea925de135e84de 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -205,24 +205,47 @@ class TDDnode: time.sleep(2) def stop(self): + if self.valgrind == 0: + toBeKilled = "taosd" + else: + toBeKilled = "valgrind.bin" + if self.running != 0: - cmd = "ps -ef|grep -w taosd | grep '%s' | grep -v grep | awk '{print $2}' && pkill -sigint taosd" % ( - self.cfgDir) - if os.system(cmd) != 0: - tdLog.exit(cmd) - tdLog.debug("dnode:%d is stopped by kill -SIGINT" % (self.index)) + killCmd = "ps -ef|grep -w %s| grep '%s' | grep -v grep | awk '{print $2}' | xargs kill -INT" % ( + toBeKilled, self.cfgDir) + + psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled + processID = subprocess.check_output(psCmd, shell=True) + + while(processID): + os.system(killCmd) + time.sleep(1) + processID = subprocess.check_output(psCmd, shell=True) + + tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index)) tdLog.debug( "wait 2 seconds for the dnode:%d to stop." % (self.index)) time.sleep(2) def forcestop(self): + if self.valgrind == 0: + toBeKilled = "taosd" + else: + toBeKilled = "valgrind.bin" + if self.running != 0: - cmd = "ps -ef|grep -w taosd | grep '%s' | grep -v grep | awk '{print $2}' && pkill -sigkill taosd" % ( - self.cfgDir) - if os.system(cmd) != 0: - tdLog.exit(cmd) - tdLog.debug("dnode:%d is stopped by kill -9" % (self.index)) + killCmd = "ps -ef|grep -w %s| grep '%s' | grep -v grep | awk '{print $2}' | xargs kill -KILL" % ( + toBeKilled, self.cfgDir) + psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled + processID = subprocess.check_output(psCmd, shell=True) + + while(processID): + os.system(killCmd) + time.sleep(1) + processID = subprocess.check_output(psCmd, shell=True) + + tdLog.debug("dnode:%d is stopped by kill -KILL" % (self.index)) tdLog.debug( "wait 2 seconds for the dnode:%d to stop." % (self.index)) @@ -268,8 +291,21 @@ class TDDnodes: self.dnodes.append(TDDnode(10)) def init(self, path): - cmd = "ps -ef|grep -w taosd | grep 'taosd' | grep -v grep | awk '{print $2}' && pkill -sigkill taosd" - os.system(cmd) + killCmd = "ps -ef|grep -w taosd | grep -v grep | awk '{print $2}' | xargs kill -KILL" + psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'" + processID = subprocess.check_output(psCmd, shell=True) + while(processID): + os.system(killCmd) + time.sleep(1) + processID = subprocess.check_output(psCmd, shell=True) + + killCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}' | xargs kill -KILL" + psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'" + processID = subprocess.check_output(psCmd, shell=True) + while(processID): + os.system(killCmd) + time.sleep(1) + processID = subprocess.check_output(psCmd, shell=True) binPath = os.path.dirname(os.path.realpath(__file__)) binPath = binPath + "/../../../debug/" @@ -361,8 +397,22 @@ class TDDnodes: os.system(cmd) # if os.system(cmd) != 0 : # tdLog.exit(cmd) - cmd = "ps -ef | grep -w taosd | grep 'dnode' | grep -v grep | awk '{print $2}' && pkill -sigkill taosd" - os.system(cmd) + killCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}' | xargs kill -KILL" + psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'" + processID = subprocess.check_output(psCmd, shell=True) + while(processID): + os.system(killCmd) + time.sleep(1) + processID = subprocess.check_output(psCmd, shell=True) + + killCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}' | xargs kill -KILL" + psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'" + processID = subprocess.check_output(psCmd, shell=True) + while(processID): + os.system(killCmd) + time.sleep(1) + processID = subprocess.check_output(psCmd, shell=True) + # if os.system(cmd) != 0 : # tdLog.exit(cmd) diff --git a/tests/script/basicSuite.sim b/tests/script/basicSuite.sim index 93cd0de4d2b25ecdd1513c61b50aeb491d43b4c1..676ac93bf2b293ed820f122a20993d8e638e05fd 100644 --- a/tests/script/basicSuite.sim +++ b/tests/script/basicSuite.sim @@ -1,49 +1,25 @@ ################################# -run general/db/basic1.sim -run general/db/basic2.sim -run general/db/basic3.sim +run general/cache/new_metrics.sim +run general/compress/compress.sim +run general/compute/avg.sim +run general/compute/bottom.sim +run general/compute/count.sim +run general/db/len.sim run general/db/basic4.sim -run general/db/basic5.sim - -run general/table/basic1.sim -run general/table/basic2.sim +run general/http/restful_insert.sim +run general/import/basic.sim +run general/import/commit.sim +run general/insert/basic.sim +run general/insert/query_file_memory.sim +run general/parser/binary_escapeCharacter.sim +run general/parser/columnValue_bigint.sim +run general/parser/select_from_cache_disk.sim +run general/table/autocreate.sim run general/table/basic3.sim -run general/table/column_num.sim run general/table/column_name.sim -run general/table/bigint.sim -run general/table/bool.sim -run general/table/double.sim -run general/table/float.sim run general/table/int.sim -run general/table/smallint.sim -run general/table/tinyint.sim -run general/table/db.table.sim - +run general/table/vgroup.sim run general/user/basic1.sim -run general/user/pass_alter.sim -run general/user/pass_len.sim -run general/user/user_create.sim run general/user/user_len.sim - -# run general/compute/count.sim -# run general/compute/avg.sim -# run general/compute/sum.sim -# run general/compute/min.sim -# run general/compute/max.sim -# run general/compute/first.sim -# run general/compute/last.sim -run general/compute/stddev.sim -# run general/compute/leastsquare.sim -run general/compute/top.sim -run general/compute/bottom.sim -run general/compute/percentile.sim -run general/compute/diff.sim -# run general/compute/interval.sim -run general/compute/null.sim -# run general/compute/diff2.sim - -run general/parse/testSuite.sim -run general/field/testSuite.sim - - +run general/vector/single.sim ################################## diff --git a/tests/script/general/http/grafana_bug.sim b/tests/script/general/http/grafana_bug.sim index 6f12849b2b718f671f083a8c3de49aeb0ef37052..708af23cfc8376e51b42c782e5a5106cadd1ac28 100644 --- a/tests/script/general/http/grafana_bug.sim +++ b/tests/script/general/http/grafana_bug.sim @@ -35,7 +35,7 @@ print =============== step1 - one query, 1 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"A","target":"A","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then +if $system_content != @[{"refId":"A","target":"A","datapoints":[[null,1577980800000],[null,1578067200000]]}]@ then return -1 endi @@ -51,32 +51,32 @@ print =============== step3 - one query, 3 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step3.1-> $system_content -if $system_content != @[{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then +if $system_content != @[{"refId":"A","target":"{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,}","datapoints":[[2,1578067200000]]}]@ then return -1 endi system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb "} ]' 127.0.0.1:6020/grafana/query print step3.2-> $system_content -if $system_content != @[{"refId":"A","target":"11","datapoints":[[1,1577808000000]]},{"refId":"A","target":"12","datapoints":[[1,1577894400000]]},{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then +if $system_content != @[{"refId":"A","target":"{val1:11,}","datapoints":[[1,1577808000000]]},{"refId":"A","target":"{val1:12,}","datapoints":[[1,1577894400000]]},{"refId":"A","target":"{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,}","datapoints":[[2,1578067200000]]}]@ then return -1 endi system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query print step3.3-> $system_content -if $system_content != @[{"refId":"A","target":"1","datapoints":[[11,1577808000000],[12,1577894400000]]},{"refId":"A","target":"2","datapoints":[[13,1577980800000],[14,1578067200000]]}]@ then +if $system_content != @[{"refId":"A","target":"{val:1,}","datapoints":[[11,1577808000000],[12,1577894400000]]},{"refId":"A","target":"{val:2,}","datapoints":[[13,1577980800000],[14,1578067200000]]}]@ then return -1 endi print =============== step4 - one query, 4 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val2,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query print step4.1-> $system_content -if $system_content != @[{"refId":"A","target":"1","datapoints":[[21,1577808000000],[22,1577894400000]]},{"refId":"A","target":"2","datapoints":[[23,1577980800000],[24,1578067200000]]}]@ then +if $system_content != @[{"refId":"A","target":"{val1:11,, val:1,}","datapoints":[[21,1577808000000]]},{"refId":"A","target":"{val1:12,, val:1,}","datapoints":[[22,1577894400000]]},{"refId":"A","target":"{val1:13,, val:2,}","datapoints":[[23,1577980800000]]},{"refId":"A","target":"{val1:14,, val:2,}","datapoints":[[24,1578067200000]]}]@ then return -1 endi system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1,val2 from db.tb "} ]' 127.0.0.1:6020/grafana/query print step4.2-> $system_content -if $system_content != @[{"refId":"A","target":"21","datapoints":[[1,1577808000000]]},{"refId":"A","target":"22","datapoints":[[1,1577894400000]]},{"refId":"A","target":"23","datapoints":[[2,1577980800000]]},{"refId":"A","target":"24","datapoints":[[2,1578067200000]]}]@ then +if $system_content != @[{"refId":"A","target":"{val1:11,, val2:21,}","datapoints":[[1,1577808000000]]},{"refId":"A","target":"{val1:12,, val2:22,}","datapoints":[[1,1577894400000]]},{"refId":"A","target":"{val1:13,, val2:23,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,, val2:24,}","datapoints":[[2,1578067200000]]}]@ then return -1 endi @@ -90,20 +90,20 @@ endi print =============== step6 - one query, 2 column, no timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"A","target":"23","datapoints":[[13,"-"]]},{"refId":"A","target":"24","datapoints":[[14,"-"]]}]@ then +if $system_content != @[{"refId":"A","target":"{val2:23,}","datapoints":[[13,"-"]]},{"refId":"A","target":"{val2:24,}","datapoints":[[14,"-"]]}]@ then return -1 endi print =============== step7 - one query, 3 column, no timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"A","target":"2","datapoints":[[13,"-"],[14,"-"]]}]@ then +if $system_content != @[{"refId":"A","target":"{val2:23,, val:2,}","datapoints":[[13,"-"]]},{"refId":"A","target":"{val2:24,, val:2,}","datapoints":[[14,"-"]]}]@ then return -1 endi system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb"} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"A","target":"1","datapoints":[[11,"-"],[12,"-"]]},{"refId":"A","target":"2","datapoints":[[13,"-"],[14,"-"]]}]@ then +if $system_content != @[{"refId":"A","target":"{val2:21,, val:1,}","datapoints":[[11,"-"]]},{"refId":"A","target":"{val2:22,, val:1,}","datapoints":[[12,"-"]]},{"refId":"A","target":"{val2:23,, val:2,}","datapoints":[[13,"-"]]},{"refId":"A","target":"{val2:24,, val:2,}","datapoints":[[14,"-"]]}]@ then return -1 endi @@ -132,7 +132,7 @@ print =============== step11 - two query, 1 column, with timestamp, 1 column, w system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"A","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then +if $system_content != @[{"refId":"B","target":"BB","datapoints":[[null,1577980800000],[null,1578067200000]]},{"refId":"A","target":"A","datapoints":[[null,1577980800000],[null,1578067200000]]}]@ then return -1 endi @@ -140,14 +140,14 @@ print =============== step12 - two query, 1 column, with timestamp, 2 column, w system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"A","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then +if $system_content != @[{"refId":"B","target":"BB","datapoints":[[null,1577980800000],[null,1578067200000]]},{"refId":"A","target":"A","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then return -1 endi print =============== step13 - two query, 1 column, with timestamp, 3 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then +if $system_content != @[{"refId":"B","target":"BB","datapoints":[[null,1577980800000],[null,1578067200000]]},{"refId":"A","target":"{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,}","datapoints":[[2,1578067200000]]}]@ then return -1 endi @@ -161,14 +161,14 @@ endi print =============== step15 - two query, 2 column, with timestamp, 3 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB213","datapoints":[[223,1577980800000]]},{"refId":"B","target":"BB214","datapoints":[[224,1578067200000]]},{"refId":"A","target":"AA","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then +if $system_content != @[{"refId":"B","target":"BB{val1:213,}","datapoints":[[223,1577980800000]]},{"refId":"B","target":"BB{val1:214,}","datapoints":[[224,1578067200000]]},{"refId":"A","target":"AA","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then return -1 endi print =============== step16 - two query, 3 column, with timestamp, 4 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val, val1, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB213","datapoints":[[22,1577980800000]]},{"refId":"B","target":"BB214","datapoints":[[22,1578067200000]]},{"refId":"A","target":"AA13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"AA14","datapoints":[[2,1578067200000]]}]@ then +if $system_content != @[{"refId":"B","target":"BB{val1:213,, val2:223,, val1:213,}","datapoints":[[22,1577980800000]]},{"refId":"B","target":"BB{val1:214,, val2:224,, val1:214,}","datapoints":[[22,1578067200000]]},{"refId":"A","target":"AA{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"AA{val1:14,}","datapoints":[[2,1578067200000]]}]@ then return -1 endi @@ -196,7 +196,7 @@ endi print =============== step20 - two query, 1 column, no timestamp, 1 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then +if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA","datapoints":[[null,1577980800000],[null,1578067200000]]}]@ then return -1 endi @@ -210,28 +210,28 @@ endi print =============== step22 - two query, 1 column, no timestamp, 3 column, with timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val1, val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA223","datapoints":[[213,1577980800000]]},{"refId":"A","target":"AA224","datapoints":[[214,1578067200000]]}]@ then +if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA{val2:223,}","datapoints":[[213,1577980800000]]},{"refId":"A","target":"AA{val2:224,}","datapoints":[[214,1578067200000]]}]@ then return -1 endi print =============== step23 - two query, 2 column, no timestamp, 1 column, no timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA","datapoints":[[213,"-"],[214,"-"]]}]@ then +if $system_content != @[{"refId":"B","target":"BB{val2:223,}","datapoints":[[213,"-"]]},{"refId":"B","target":"BB{val2:224,}","datapoints":[[214,"-"]]},{"refId":"A","target":"AA","datapoints":[[213,"-"],[214,"-"]]}]@ then return -1 endi print =============== step24 - two query, 2 column, no timestamp, 2 column, no timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA213","datapoints":[[22,"-"]]},{"refId":"A","target":"AA214","datapoints":[[22,"-"]]}]@ then +if $system_content != @[{"refId":"B","target":"BB{val2:223,}","datapoints":[[213,"-"]]},{"refId":"B","target":"BB{val2:224,}","datapoints":[[214,"-"]]},{"refId":"A","target":"AA{val1:213,}","datapoints":[[22,"-"]]},{"refId":"A","target":"AA{val1:214,}","datapoints":[[22,"-"]]}]@ then return -1 endi print =============== step25 - two query, 2 column, no timestamp, 3 column, no timestamp system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1,val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query print step1-> $system_content -if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA223","datapoints":[[22,"-"]]},{"refId":"A","target":"AA224","datapoints":[[22,"-"]]}]@ then +if $system_content != @[{"refId":"B","target":"BB{val2:223,}","datapoints":[[213,"-"]]},{"refId":"B","target":"BB{val2:224,}","datapoints":[[214,"-"]]},{"refId":"A","target":"AA{val1:213,, val2:223,}","datapoints":[[22,"-"]]},{"refId":"A","target":"AA{val1:214,, val2:224,}","datapoints":[[22,"-"]]}]@ then return -1 endi diff --git a/tests/script/general/http/telegraf.sim b/tests/script/general/http/telegraf.sim index 60eeec652e8b5fa7be5488a4a85b8b258cf4495c..d9f3340f06fa80dad2291ceca6d17af07a4be923 100644 --- a/tests/script/general/http/telegraf.sim +++ b/tests/script/general/http/telegraf.sim @@ -16,14 +16,14 @@ print =============== step1 - parse system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/ print $system_content -if $system_content != @{"status":"error","code":1022,"desc":"database name can not be NULL"}@ then +if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then return -1 endi system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/ print $system_content -if $system_content != @{"status":"error","code":1022,"desc":"database name can not be NULL"}@ then +if $system_content != @{"status":"error","code":1022,"desc":"database name can not be null"}@ then return -1 endi @@ -170,7 +170,7 @@ endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1038,"desc":"tag name is NULL"}@ then +if $system_content != @{"status":"error","code":1038,"desc":"tag name is null"}@ then return -1 endi @@ -191,14 +191,14 @@ endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1041,"desc":"tag value is NULL"}@ then +if $system_content != @{"status":"error","code":1041,"desc":"tag value is null"}@ then return -1 endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"1022":"111"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1042,"desc":"table is NULL"}@ then +if $system_content != @{"status":"error","code":1042,"desc":"table is null"}@ then return -1 endi @@ -219,14 +219,14 @@ endi system_content curl -u root:taosdata -d '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1048,"desc":"field name is NULL"}@ then +if $system_content != @{"status":"error","code":1048,"desc":"field name is null"}@ then return -1 endi system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":"","Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1 print $system_content -if $system_content != @{"status":"error","code":1051,"desc":"field value is NULL"}@ then +if $system_content != @{"status":"error","code":1051,"desc":"field value is null"}@ then return -1 endi diff --git a/tests/script/general/insert/insert_drop.sim b/tests/script/general/insert/insert_drop.sim index 087b9f6aa9231cea43740b151f127124bbc48cee..5655576e200edb61c8cdbb075cd5c3dc709c0317 100644 --- a/tests/script/general/insert/insert_drop.sim +++ b/tests/script/general/insert/insert_drop.sim @@ -46,8 +46,9 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT sleep 2000 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql connect -sleep 3000 + +sql reset query cache +sleep 1000 sql use $db sql drop table tb5 @@ -71,13 +72,15 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT sleep 2000 system sh/exec.sh -n dnode1 -s start print ================== server restart completed -sql connect -sleep 3000 + +sql reset query cache +sleep 1000 sql use $db sql create table tb5 using $stb tags(5) sql select * from tb5 +print $rows should be 0 if $rows != 0 then return -1 endi diff --git a/tests/script/general/metrics/testSuite.sim b/tests/script/general/metrics/testSuite.sim deleted file mode 100644 index 55300034b65f2d7c94cd1b76d384b9d8db0a263c..0000000000000000000000000000000000000000 --- a/tests/script/general/metrics/testSuite.sim +++ /dev/null @@ -1,4 +0,0 @@ -run general/metrics/disk.sim -run general/metrics/metrics.sim -run general/metrics/values.sim -run general/metrics/vnode3.sim diff --git a/tests/script/general/metrics/disk.sim b/tests/script/general/stable/disk.sim similarity index 100% rename from tests/script/general/metrics/disk.sim rename to tests/script/general/stable/disk.sim diff --git a/tests/script/general/metrics/metrics.sim b/tests/script/general/stable/metrics.sim similarity index 100% rename from tests/script/general/metrics/metrics.sim rename to tests/script/general/stable/metrics.sim diff --git a/tests/script/general/stable/testSuite.sim b/tests/script/general/stable/testSuite.sim new file mode 100644 index 0000000000000000000000000000000000000000..a3696c8706e6c1913d06df31866f9ea0a37620b0 --- /dev/null +++ b/tests/script/general/stable/testSuite.sim @@ -0,0 +1,4 @@ +run general/stable/disk.sim +run general/stable/metrics.sim +run general/stable/values.sim +run general/stable/vnode3.sim diff --git a/tests/script/general/metrics/values.sim b/tests/script/general/stable/values.sim similarity index 100% rename from tests/script/general/metrics/values.sim rename to tests/script/general/stable/values.sim diff --git a/tests/script/general/metrics/vnode3.sim b/tests/script/general/stable/vnode3.sim similarity index 100% rename from tests/script/general/metrics/vnode3.sim rename to tests/script/general/stable/vnode3.sim diff --git a/tests/script/general/table/basic3.sim b/tests/script/general/table/basic3.sim index 7f90dc0c52f5ed5439e82f86c3318282d3dc39d7..ded00e153a2be88ed8c9193d4c9051dacde1fc31 100644 --- a/tests/script/general/table/basic3.sim +++ b/tests/script/general/table/basic3.sim @@ -70,4 +70,11 @@ if $data21 != 3 then return -1 endi +print =============== drop stable +sql drop table db.st +sql show db.stables +if $rows != 0 then + return -1 +endi + system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 44fc24e107cd1bea0f1bc8f6ebffdcd6b8d99eb2..48617c149a12ef29c7b51733059c0f7607eb522f 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -27,21 +27,21 @@ cd ../../../debug; make ./test.sh -f general/compress/compress2.sim ./test.sh -f general/compress/uncompress.sim -#./test.sh -f general/compute/avg.sim +./test.sh -f general/compute/avg.sim ./test.sh -f general/compute/bottom.sim -#./test.sh -f general/compute/count.sim +./test.sh -f general/compute/count.sim ./test.sh -f general/compute/diff.sim #./test.sh -f general/compute/diff2.sim -#./test.sh -f general/compute/first.sim +./test.sh -f general/compute/first.sim #./test.sh -f general/compute/interval.sim #./test.sh -f general/compute/last.sim #./test.sh -f general/compute/leastsquare.sim -#./test.sh -f general/compute/max.sim -#./test.sh -f general/compute/min.sim +./test.sh -f general/compute/max.sim +./test.sh -f general/compute/min.sim ./test.sh -f general/compute/null.sim ./test.sh -f general/compute/percentile.sim ./test.sh -f general/compute/stddev.sim -#./test.sh -f general/compute/sum.sim +./test.sh -f general/compute/sum.sim ./test.sh -f general/compute/top.sim ./test.sh -f general/db/basic.sim @@ -65,20 +65,20 @@ cd ../../../debug; make #./test.sh -f general/field/4.sim #./test.sh -f general/field/5.sim #./test.sh -f general/field/6.sim -./test.sh -f general/field/bigint.sim +##./test.sh -f general/field/bigint.sim #./test.sh -f general/field/binary.sim -./test.sh -f general/field/bool.sim +##./test.sh -f general/field/bool.sim #./test.sh -f general/field/single.sim -./test.sh -f general/field/smallint.sim -./test.sh -f general/field/tinyint.sim +##./test.sh -f general/field/smallint.sim +##./test.sh -f general/field/tinyint.sim -./test.sh -f general/http/restful.sim +##./test.sh -f general/http/restful.sim ./test.sh -f general/http/restful_insert.sim ./test.sh -f general/http/restful_limit.sim -./test.sh -f general/http/restful_full.sim +##./test.sh -f general/http/restful_full.sim ./test.sh -f general/http/prepare.sim ./test.sh -f general/http/telegraf.sim -#./test.sh -f general/http/grafana_bug.sim +./test.sh -f general/http/grafana_bug.sim #./test.sh -f general/http/grafana.sim ./test.sh -f general/import/basic.sim @@ -96,11 +96,6 @@ cd ../../../debug; make ./test.sh -f general/insert/query_multi_file.sim ./test.sh -f general/insert/tcp.sim -#./test.sh -f general/metrics/disk.sim -#./test.sh -f general/metrics/metrics.sim -#./test.sh -f general/metrics/values.sim -#./test.sh -f general/metrics/vnode3.sim - #parser # ./test.sh -f general/parser/alter.sim @@ -109,7 +104,7 @@ cd ../../../debug; make # ./test.sh -f general/parser/auto_create_tb.sim # ./test.sh -f general/parser/auto_create_tb_drop_tb.sim ./test.sh -f general/parser/binary_escapeCharacter.sim -./test.sh -f general/parser/bug.sim +#./test.sh -f general/parser/bug.sim ./test.sh -f general/parser/col_arithmetic_operation.sim ./test.sh -f general/parser/columnValue_bigint.sim ./test.sh -f general/parser/columnValue_bool.sim @@ -162,6 +157,11 @@ cd ../../../debug; make # ./test.sh -f general/parser/select_with_tags.sim # ./test.sh -f general/parser/groupby.sim +#./test.sh -f general/stable/disk.sim +#./test.sh -f general/stable/metrics.sim +#./test.sh -f general/stable/values.sim +#./test.sh -f general/stable/vnode3.sim + #stream ./test.sh -f general/table/autocreate.sim @@ -220,9 +220,9 @@ cd ../../../debug; make ./test.sh -f general/user/basic1.sim #./test.sh -f general/user/monitor.sim -./test.sh -f general/user/pass_alter.sim +##./test.sh -f general/user/pass_alter.sim ./test.sh -f general/user/pass_len.sim -./test.sh -f general/user/user_create.sim +##./test.sh -f general/user/user_create.sim ./test.sh -f general/user/user_len.sim #./test.sh -f general/vector/metrics_field.sim @@ -240,24 +240,24 @@ cd ../../../debug; make ################################# ./test.sh -u -f unique/account/account_create.sim -./test.sh -u -f unique/account/account_delete.sim +##./test.sh -u -f unique/account/account_delete.sim ./test.sh -u -f unique/account/account_len.sim -./test.sh -u -f unique/account/authority.sim +##./test.sh -u -f unique/account/authority.sim ./test.sh -u -f unique/account/basic.sim ./test.sh -u -f unique/account/paras.sim -./test.sh -u -f unique/account/pass_alter.sim +##./test.sh -u -f unique/account/pass_alter.sim ./test.sh -u -f unique/account/pass_len.sim ./test.sh -u -f unique/account/usage.sim -./test.sh -u -f unique/account/user_create.sim +##./test.sh -u -f unique/account/user_create.sim ./test.sh -u -f unique/account/user_len.sim #./test.sh -u -f unique/big/balance.sim #./test.sh -u -f unique/big/maxvnodes.sim #./test.sh -u -f unique/big/tcp.sim -./test.sh -u -f unique/cluster/balance1.sim -./test.sh -u -f unique/cluster/balance2.sim -./test.sh -u -f unique/cluster/balance3.sim +##./test.sh -u -f unique/cluster/balance1.sim +##./test.sh -u -f unique/cluster/balance2.sim +##./test.sh -u -f unique/cluster/balance3.sim #./test.sh -u -f unique/cluster/cache.sim ./test.sh -u -f unique/column/replica3.sim @@ -265,26 +265,26 @@ cd ../../../debug; make #./test.sh -u -f unique/db/commit.sim #./test.sh -u -f unique/db/delete.sim #./test.sh -u -f unique/db/delete_part.sim -./test.sh -u -f unique/db/replica_add12.sim -./test.sh -u -f unique/db/replica_add13.sim -./test.sh -u -f unique/db/replica_add23.sim -./test.sh -u -f unique/db/replica_reduce21.sim -./test.sh -u -f unique/db/replica_reduce32.sim -./test.sh -u -f unique/db/replica_reduce31.sim -./test.sh -u -f unique/db/replica_part.sim - -./test.sh -u -f unique/dnode/balance1.sim -./test.sh -u -f unique/dnode/balance2.sim -./test.sh -u -f unique/dnode/balance3.sim -./test.sh -u -f unique/dnode/balancex.sim -./test.sh -u -f unique/dnode/offline1.sim -./test.sh -u -f unique/dnode/offline2.sim +##./test.sh -u -f unique/db/replica_add12.sim +##./test.sh -u -f unique/db/replica_add13.sim +##./test.sh -u -f unique/db/replica_add23.sim +##./test.sh -u -f unique/db/replica_reduce21.sim +##./test.sh -u -f unique/db/replica_reduce32.sim +##./test.sh -u -f unique/db/replica_reduce31.sim +##./test.sh -u -f unique/db/replica_part.sim + +##./test.sh -u -f unique/dnode/balance1.sim +##./test.sh -u -f unique/dnode/balance2.sim +##./test.sh -u -f unique/dnode/balance3.sim +##./test.sh -u -f unique/dnode/balancex.sim +##./test.sh -u -f unique/dnode/offline1.sim +##./test.sh -u -f unique/dnode/offline2.sim #./test.sh -u -f unique/dnode/remove1.sim #./test.sh -u -f unique/dnode/remove2.sim #./test.sh -u -f unique/dnode/vnode_clean.sim -./test.sh -u -f unique/http/admin.sim -./test.sh -u -f unique/http/opentsdb.sim +##./test.sh -u -f unique/http/admin.sim +##./test.sh -u -f unique/http/opentsdb.sim #./test.sh -u -f unique/import/replica2.sim #./test.sh -u -f unique/import/replica3.sim @@ -298,28 +298,28 @@ cd ../../../debug; make #./test.sh -u -f unique/metrics/replica3_dnode6.sim #./test.sh -u -f unique/metrics/replica3_vnode3.sim -./test.sh -u -f unique/mnode/mgmt22.sim -./test.sh -u -f unique/mnode/mgmt23.sim -./test.sh -u -f unique/mnode/mgmt24.sim -./test.sh -u -f unique/mnode/mgmt25.sim -./test.sh -u -f unique/mnode/mgmt26.sim -./test.sh -u -f unique/mnode/mgmt33.sim -./test.sh -u -f unique/mnode/mgmt34.sim +##./test.sh -u -f unique/mnode/mgmt22.sim +##./test.sh -u -f unique/mnode/mgmt23.sim +##./test.sh -u -f unique/mnode/mgmt24.sim +##./test.sh -u -f unique/mnode/mgmt25.sim +##./test.sh -u -f unique/mnode/mgmt26.sim +##./test.sh -u -f unique/mnode/mgmt33.sim +##./test.sh -u -f unique/mnode/mgmt34.sim #./test.sh -u -f unique/mnode/mgmtr2.sim #./test.sh -u -f unique/mnode/secondIp.sim #stream -./test.sh -u -f unique/table/delete_part.sim +##./test.sh -u -f unique/table/delete_part.sim -./test.sh -u -f unique/vnode/replica2_basic2.sim -./test.sh -u -f unique/vnode/replica3_basic.sim +##./test.sh -u -f unique/vnode/replica2_basic2.sim +##./test.sh -u -f unique/vnode/replica3_basic.sim #./test.sh -u -f unique/vnode/commit.sim #./test.sh -u -f unique/vnode/many.sim #./test.sh -u -f unique/vnode/replica2_basic.sim -./test.sh -u -f unique/vnode/replica2_basic2.sim +##./test.sh -u -f unique/vnode/replica2_basic2.sim #./test.sh -u -f unique/vnode/replica2_repeat.sim -./test.sh -u -f unique/vnode/replica3_basic.sim +##./test.sh -u -f unique/vnode/replica3_basic.sim #./test.sh -u -f unique/vnode/replica3_repeat.sim #./test.sh -u -f unique/vnode/replica3_vgroup.sim diff --git a/tests/script/sh/deploy.sh b/tests/script/sh/deploy.sh index bfbba3a01281d70501fb0a28c7713a23f0a32e94..5587e3bb8c16d38e952630c894d99996e20cefaa 100755 --- a/tests/script/sh/deploy.sh +++ b/tests/script/sh/deploy.sh @@ -108,6 +108,7 @@ echo "udebugFlag 131" >> $TAOS_CFG echo "jnidebugFlag 131" >> $TAOS_CFG echo "sdebugFlag 135" >> $TAOS_CFG echo "monitor 0" >> $TAOS_CFG +echo "monitorInterval 1" >> $TAOS_CFG echo "http 0" >> $TAOS_CFG echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG echo "defaultPass taosdata" >> $TAOS_CFG diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index bd07918ddc85c019c7be891a68dea3a5afa92ace..d6ab2d5b92e311c0dfdabeb5680e77651870f41d 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -119,7 +119,7 @@ char *simGetVariable(SScript *script, char *varName, int varLen) { int simExecuteExpression(SScript *script, char *exp) { char *op1, *op2, *var1, *var2, *var3, *rest; int op1Len, op2Len, var1Len, var2Len, var3Len, val0, val1; - char t0[512], t1[512], t2[512], t3[512]; + char t0[512], t1[512], t2[512], t3[1024]; int result; rest = paGetToken(exp, &var1, &var1Len); @@ -310,14 +310,15 @@ void simStoreSystemContentResult(SScript *script, char *filename) { bool simExecuteSystemContentCmd(SScript *script, char *option) { char buf[4096] = {0}; + char buf1[4096 + 512] = {0}; char filename[400] = {0}; sprintf(filename, "%s/%s.tmp", tsScriptDir, script->fileName); sprintf(buf, "cd %s; ", tsScriptDir); simVisuallizeOption(script, option, buf + strlen(buf)); - sprintf(buf, "%s > %s 2>/dev/null", buf, filename); + sprintf(buf1, "%s > %s 2>/dev/null", buf, filename); - sprintf(script->system_exit_code, "%d", system(buf)); + sprintf(script->system_exit_code, "%d", system(buf1)); simStoreSystemContentResult(script, filename); script->linePos++;