diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 3a26d294a40d3c9cd89c7a7ab639aaa889151e53..cafb0b8fb1d96a1ed5d8e6222c550c9887fd2678 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -300,7 +300,6 @@ typedef struct STscObj { char sversion[TSDB_VERSION_LEN]; char writeAuth : 1; char superAuth : 1; - void* pMgmtConn; struct SSqlObj * pSql; struct SSqlObj * pHb; struct SSqlObj * sqlList; @@ -360,7 +359,7 @@ typedef struct SSqlStream { struct SSqlStream *prev, *next; } SSqlStream; -int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn); +int32_t tscInitRpc(const char *user, const char *secret); void tscInitMsgsFp(); int tsParseSql(SSqlObj *pSql, bool multiVnodeInsertion); @@ -426,7 +425,7 @@ void tscQueueAsyncFreeResult(SSqlObj *pSql); int32_t tscToSQLCmd(SSqlObj *pSql, struct SSqlInfo *pInfo); void tscGetResultColumnChr(SSqlRes *pRes, SFieldInfo* pFieldInfo, int32_t column); -extern void * pVnodeConn; +extern void * pDnodeConn; extern void * tscCacheHandle; extern void * tscTmr; extern void * tscQhandle; diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 79916c499141e7a775739e983d3ad7f8ef40eebc..6c23b079d19ff90395cc0796e23453464b58602c 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -191,7 +191,6 @@ void tscProcessActivityTimer(void *handle, void *tmrId) { } int tscSendMsgToServer(SSqlObj *pSql) { - STscObj* pObj = pSql->pTscObj; SSqlCmd* pCmd = &pSql->cmd; char *pMsg = rpcMallocCont(pCmd->payloadLen); @@ -201,30 +200,22 @@ int tscSendMsgToServer(SSqlObj *pSql) { } if (pSql->cmd.command < TSDB_SQL_MGMT) { - tscTrace("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList.port[0]); memcpy(pMsg, pSql->cmd.payload + tsRpcHeadSize, pSql->cmd.payloadLen); + } else { + pSql->ipList = tscMgmtIpSet; + memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen); + } + + tscTrace("%p msg:%s is sent to server", pSql, taosMsg[pSql->cmd.msgType]); - SRpcMsg rpcMsg = { + SRpcMsg rpcMsg = { .msgType = pSql->cmd.msgType, .pCont = pMsg, .contLen = pSql->cmd.payloadLen, .handle = pSql, .code = 0 - }; - rpcSendRequest(pVnodeConn, &pSql->ipList, &rpcMsg); - } else { - pSql->ipList = tscMgmtIpSet; - memcpy(pMsg, pSql->cmd.payload, pSql->cmd.payloadLen); - SRpcMsg rpcMsg = { - .msgType = pSql->cmd.msgType, - .pCont = pMsg, - .contLen = pSql->cmd.payloadLen, - .handle = pSql, - .code = 0 - }; - tscTrace("%p msg:%s is sent to server", pSql, taosMsg[pSql->cmd.msgType]); - rpcSendRequest(pObj->pMgmtConn, &pSql->ipList, &rpcMsg); - } + }; + rpcSendRequest(pDnodeConn, &pSql->ipList, &rpcMsg); return TSDB_CODE_SUCCESS; } @@ -485,7 +476,7 @@ void tscKillSTableQuery(SSqlObj *pSql) { tscTrace("%p super table query cancelled", pSql); } -int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { +int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) { char *pMsg, *pStart; pStart = pSql->cmd.payload + tsRpcHeadSize; @@ -514,7 +505,7 @@ int tscBuildRetrieveMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pRetrieveMsg->header.contLen = htonl(pSql->cmd.payloadLen); - pSql->cmd.msgType = TSDB_MSG_TYPE_RETRIEVE; + pSql->cmd.msgType = TSDB_MSG_TYPE_FETCH; return TSDB_CODE_SUCCESS; } @@ -1353,7 +1344,7 @@ int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) { int tscBuildRetrieveFromMgmtMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SSqlCmd *pCmd = &pSql->cmd; - pCmd->msgType = TSDB_MSG_TYPE_RETRIEVE; + pCmd->msgType = TSDB_MSG_TYPE_CM_RETRIEVE; pCmd->payloadLen = sizeof(SRetrieveTableMsg); if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) { @@ -2569,7 +2560,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) { void tscInitMsgsFp() { tscBuildMsg[TSDB_SQL_SELECT] = tscBuildQueryMsg; tscBuildMsg[TSDB_SQL_INSERT] = tscBuildSubmitMsg; - tscBuildMsg[TSDB_SQL_FETCH] = tscBuildRetrieveMsg; + tscBuildMsg[TSDB_SQL_FETCH] = tscBuildFetchMsg; tscBuildMsg[TSDB_SQL_CREATE_DB] = tscBuildCreateDbMsg; tscBuildMsg[TSDB_SQL_CREATE_USER] = tscBuildUserMsg; diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index a39b1a86bd09c015841fdb8782a16d256988dfc0..15d7e76b9a05a73e405668798e1e8a7cd4f88899 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -66,8 +66,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con return NULL; } - void* pMgmtConn = NULL; - if (tscInitRpc(user, pass, &pMgmtConn) != 0) { + if (tscInitRpc(user, pass) != 0) { terrno = TSDB_CODE_NETWORK_UNAVAIL; return NULL; } @@ -78,7 +77,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con tscMgmtIpSet.inUse = 0; tscMgmtIpSet.numOfIps = 1; strcpy(tscMgmtIpSet.fqdn[0], ip); - tscMgmtIpSet.port[0] = port? port: tsMnodeShellPort; + tscMgmtIpSet.port[0] = port? port: tsDnodeShellPort; } else { if (tsFirst[0] != 0) { taosGetFqdnPortFromEp(tsFirst, tscMgmtIpSet.fqdn[tscMgmtIpSet.numOfIps], &tscMgmtIpSet.port[tscMgmtIpSet.numOfIps]); @@ -101,7 +100,7 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con strncpy(pObj->user, user, TSDB_USER_LEN); taosEncryptPass((uint8_t *)pass, strlen(pass), pObj->pass); - pObj->mgmtPort = port ? port : tsMnodeShellPort; + pObj->mgmtPort = port ? port : tsDnodeShellPort; if (db) { int32_t len = strlen(db); @@ -119,7 +118,6 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con strtolower(pObj->db, tmp); } - pObj->pMgmtConn = pMgmtConn; pthread_mutex_init(&pObj->mutex, NULL); SSqlObj *pSql = (SSqlObj *)calloc(1, sizeof(SSqlObj)); @@ -168,13 +166,6 @@ static void syncConnCallback(void *param, TAOS_RES *tres, int code) { TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) { tscTrace("try to create a connection to %s", ip); - if (port != 0) { - tsServerPort = port; - tsMnodeShellPort = tsServerPort + TSDB_PORT_MNODESHELL; - tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; - tsMnodeDnodePort = tsServerPort + TSDB_PORT_MNODEDNODE; - tsDnodeMnodePort = tsServerPort + TSDB_PORT_DNODEMNODE; - } STscObj *pObj = taosConnectImpl(ip, user, pass, db, port, NULL, NULL, NULL); if (pObj != NULL) { diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 89c185f199e17faec2b71072d5832919ad37b212..f7254468b6088c59c9e777466d05cc93c3797799 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -30,7 +30,7 @@ #include "tlocale.h" // global, not configurable -void * pVnodeConn; +void * pDnodeConn; void * tscCacheHandle; void * tscTmr; void * tscQhandle; @@ -48,15 +48,15 @@ void tscCheckDiskUsage(void *UNUSED_PARAM(para), void* UNUSED_PARAM(param)) { taosTmrReset(tscCheckDiskUsage, 1000, NULL, tscTmr, &tscCheckDiskUsageTmr); } -int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn) { +int32_t tscInitRpc(const char *user, const char *secret) { SRpcInit rpcInit; char secretEncrypt[32] = {0}; taosEncryptPass((uint8_t *)secret, strlen(secret), secretEncrypt); - if (pVnodeConn == NULL) { + if (pDnodeConn == NULL) { memset(&rpcInit, 0, sizeof(rpcInit)); rpcInit.localPort = 0; - rpcInit.label = "TSC-vnode"; + rpcInit.label = "TSC"; rpcInit.numOfThreads = tscNumOfThreads; rpcInit.cfp = tscProcessMsgFromServer; rpcInit.sessions = tsMaxVnodeConnections; @@ -66,35 +66,13 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pMgmtConn) { rpcInit.ckey = "key"; rpcInit.secret = secretEncrypt; - pVnodeConn = rpcOpen(&rpcInit); - if (pVnodeConn == NULL) { + pDnodeConn = rpcOpen(&rpcInit); + if (pDnodeConn == NULL) { tscError("failed to init connection to vnode"); return -1; } } - if (*pMgmtConn == NULL) { - memset(&rpcInit, 0, sizeof(rpcInit)); - rpcInit.localPort = 0; - rpcInit.label = "TSC-mgmt"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = tscProcessMsgFromServer; - rpcInit.ufp = tscUpdateIpSet; - rpcInit.sessions = tsMaxMgmtConnections; - rpcInit.connType = TAOS_CONN_CLIENT; - rpcInit.idleTime = 2000; - rpcInit.user = (char*)user; - rpcInit.ckey = "key"; - rpcInit.spi = 1; - rpcInit.secret = secretEncrypt; - - *pMgmtConn = rpcOpen(&rpcInit); - if (*pMgmtConn == NULL) { - tscError("failed to init connection to mgmt"); - return -1; - } - } - return 0; } @@ -190,9 +168,9 @@ void taos_cleanup() { taosCloseLog(); - if (pVnodeConn != NULL) { - rpcClose(pVnodeConn); - pVnodeConn = NULL; + if (pDnodeConn != NULL) { + rpcClose(pDnodeConn); + pDnodeConn = NULL; } taosTmrCleanUp(tscTmr); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 0b1130508245354523835acece4d77b9ea1f4243..47d4de9f21bf7dd1586372fe381ed262eeac0d0a 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -756,7 +756,10 @@ void tscCloseTscObj(STscObj* pObj) { taosTmrStopA(&(pObj->pTimer)); tscFreeSqlObj(pSql); - rpcClose(pObj->pMgmtConn); + if (pSql) { + sem_destroy(&pSql->rspSem); + } + pthread_mutex_destroy(&pObj->mutex); tscTrace("%p DB connection is closed", pObj); diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index 40c4e049d2a1143530525b018d3f2ec7e2ee12b2..05afbab642c6288ad00456949685fea64e7e6297 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -55,10 +55,8 @@ extern char tsFirst[]; extern char tsSecond[]; extern char tsLocalEp[]; extern uint16_t tsServerPort; -extern uint16_t tsMnodeDnodePort; -extern uint16_t tsMnodeShellPort; extern uint16_t tsDnodeShellPort; -extern uint16_t tsDnodeMnodePort; +extern uint16_t tsDnodeDnodePort; extern uint16_t tsSyncPort; extern int32_t tsStatusInterval; @@ -141,7 +139,8 @@ extern int32_t tsMonitorInterval; extern int32_t tsAsyncLog; extern int32_t tsNumOfLogLines; -extern int32_t ddebugFlag; +extern int32_t dDebugFlag; +extern int32_t vDebugFlag; extern int32_t mdebugFlag; extern int32_t cdebugFlag; extern int32_t jnidebugFlag; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index b50e7b97f1bc06ece6b91e7cc5af92aba72a307a..9828906532e9bb1d0109a75d6fa9a07af7af2ee9 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -66,11 +66,9 @@ char tsSecond[TSDB_FQDN_LEN] = {0}; char tsArbitrator[TSDB_FQDN_LEN] = {0}; char tsLocalEp[TSDB_FQDN_LEN] = {0}; // Local End Point, hostname:port uint16_t tsServerPort = 6030; -uint16_t tsMnodeShellPort = 6030; // udp[6030-6034] tcp[6030] -uint16_t tsDnodeShellPort = 6035; // udp[6035-6039] tcp[6035] -uint16_t tsMnodeDnodePort = 6040; // udp/tcp -uint16_t tsDnodeMnodePort = 6045; // udp/tcp -uint16_t tsSyncPort = 6050; +uint16_t tsDnodeShellPort = 6030; // udp[6035-6039] tcp[6035] +uint16_t tsDnodeDnodePort = 6035; // udp/tcp +uint16_t tsSyncPort = 6040; int32_t tsStatusInterval = 1; // second int32_t tsShellActivityTimer = 3; // second @@ -131,17 +129,18 @@ int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN; int32_t tsNumOfLogLines = 10000000; int32_t mdebugFlag = 135; int32_t sdbDebugFlag = 135; -int32_t ddebugFlag = 131; -int32_t cdebugFlag = 131; +int32_t dDebugFlag = 135; +int32_t vDebugFlag = 135; +int32_t cdebugFlag = 135; int32_t jnidebugFlag = 131; int32_t odbcdebugFlag = 131; int32_t httpDebugFlag = 131; int32_t monitorDebugFlag = 131; int32_t qdebugFlag = 131; -int32_t rpcDebugFlag = 131; +int32_t rpcDebugFlag = 135; int32_t uDebugFlag = 131; int32_t debugFlag = 131; -int32_t sDebugFlag = 131; +int32_t sDebugFlag = 135; // the maximum number of results for projection query on super table that are returned from // one virtual node, to order according to timestamp @@ -1004,7 +1003,7 @@ static void doInitGlobalConfig() { taosInitConfigOption(cfg); cfg.option = "dDebugFlag"; - cfg.ptr = &ddebugFlag; + cfg.ptr = &dDebugFlag; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG; cfg.minValue = 0; @@ -1233,10 +1232,8 @@ bool taosCheckGlobalCfg() { tsVersion = 10 * tsVersion; - tsMnodeShellPort = tsServerPort + TSDB_PORT_MNODESHELL; // udp[6030-6034] tcp[6030] tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035] - tsMnodeDnodePort = tsServerPort + TSDB_PORT_MNODEDNODE; // udp/tcp - tsDnodeMnodePort = tsServerPort + TSDB_PORT_DNODEMNODE; // udp/tcp + tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp tsSyncPort = tsServerPort + TSDB_PORT_SYNC; return true; diff --git a/src/cq/src/cqMain.c b/src/cq/src/cqMain.c index 62b9a414944f9e365e066dd93c9578914f897164..e4f3142b8962ea41f7661968827fa18073860d14 100644 --- a/src/cq/src/cqMain.c +++ b/src/cq/src/cqMain.c @@ -26,10 +26,10 @@ #include "tcq.h" #include "taos.h" -#define cError(...) if (cqDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR CQ ", cqDebugFlag, __VA_ARGS__);} -#define cWarn(...) if (cqDebugFlag & DEBUG_WARN) {taosPrintLog("WARN CQ ", cqDebugFlag, __VA_ARGS__);} -#define cTrace(...) if (cqDebugFlag & DEBUG_TRACE) {taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__);} -#define cPrint(...) {taosPrintLog("WAL ", 255, __VA_ARGS__);} +#define cError(...) if (cqDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR CQ ", cqDebugFlag, __VA_ARGS__);} +#define cWarn(...) if (cqDebugFlag & DEBUG_WARN) {taosPrintLog("WARN CQ ", cqDebugFlag, __VA_ARGS__);} +#define cTrace(...) if (cqDebugFlag & DEBUG_TRACE) {taosPrintLog("CQ ", cqDebugFlag, __VA_ARGS__);} +#define cPrint(...) {taosPrintLog("CQ ", 255, __VA_ARGS__);} typedef struct { int vgId; diff --git a/src/cq/test/cqtest.c b/src/cq/test/cqtest.c index f620f443823fbc0d18560774604d785272c83409..7977bd85bc18fcf659fa3608b4ccf99923529d92 100644 --- a/src/cq/test/cqtest.c +++ b/src/cq/test/cqtest.c @@ -33,13 +33,13 @@ int main(int argc, char *argv[]) { for (int i=1; i + * + * 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_DNODE_LOG_H +#define TDENGINE_DNODE_LOG_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "tlog.h" + +extern int32_t dDebugFlag; + +#define dError(...) if (dDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR DND ", 255, __VA_ARGS__); } +#define dWarn(...) if (dDebugFlag & DEBUG_WARN) {taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); } +#define dTrace(...) if (dDebugFlag & DEBUG_TRACE) {taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); } +#define dPrint(...) {taosPrintLog("DND ", 255, __VA_ARGS__); } + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/dnode/inc/dnodeLog.h b/src/dnode/inc/dnodeLog.h deleted file mode 100644 index 18a5874e444ebd7be9dc998ab428100beeef8cef..0000000000000000000000000000000000000000 --- a/src/dnode/inc/dnodeLog.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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_DNODE_LOG_H -#define TDENGINE_DNODE_LOG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "tlog.h" - -extern int32_t ddebugFlag; - -#define dError(...) \ - if (ddebugFlag & DEBUG_ERROR) { \ - taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \ - } -#define dWarn(...) \ - if (ddebugFlag & DEBUG_WARN) { \ - taosPrintLog("WARN DND ", ddebugFlag, __VA_ARGS__); \ - } -#define dTrace(...) \ - if (ddebugFlag & DEBUG_TRACE) { \ - taosPrintLog("DND ", ddebugFlag, __VA_ARGS__); \ - } -#define dPrint(...) \ - { taosPrintLog("DND ", 255, __VA_ARGS__); } - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/dnode/inc/dnodeMgmt.h b/src/dnode/inc/dnodeMgmt.h index b8d01916fe0938676a09656813a91765e4b9507d..6f2af423bc2d92e3d323a7a1dff9fcabe1f2dd2c 100644 --- a/src/dnode/inc/dnodeMgmt.h +++ b/src/dnode/inc/dnodeMgmt.h @@ -22,7 +22,7 @@ extern "C" { int32_t dnodeInitMgmt(); void dnodeCleanupMgmt(); -void dnodeMgmt(SRpcMsg *rpcMsg); +void dnodeDispatchToDnodeMgmt(SRpcMsg *rpcMsg); void* dnodeGetVnode(int32_t vgId); int32_t dnodeGetVnodeStatus(void *pVnode); diff --git a/src/dnode/inc/dnodeMClient.h b/src/dnode/inc/dnodePeer.h similarity index 80% rename from src/dnode/inc/dnodeMClient.h rename to src/dnode/inc/dnodePeer.h index 6d413ada884cc874a8277888995b96fa3e70aa48..2ce8d80c0f7e2924d93f326418ec3819696a806a 100644 --- a/src/dnode/inc/dnodeMClient.h +++ b/src/dnode/inc/dnodePeer.h @@ -13,16 +13,17 @@ * along with this program. If not, see . */ -#ifndef TDENGINE_DNODE_MCLIENT_H -#define TDENGINE_DNODE_MCLIENT_H +#ifndef TDENGINE_DNODE_DNODE_H +#define TDENGINE_DNODE_DNODE_H #ifdef __cplusplus extern "C" { #endif -int32_t dnodeInitMClient(); -void dnodeCleanupMClient(); -void dnodeSendMsgToMnode(SRpcMsg *rpcMsg); +int32_t dnodeInitServer(); +void dnodeCleanupServer(); +int32_t dnodeInitClient(); +void dnodeCleanupClient(); #ifdef __cplusplus } diff --git a/src/dnode/inc/dnodeRead.h b/src/dnode/inc/dnodeVRead.h similarity index 93% rename from src/dnode/inc/dnodeRead.h rename to src/dnode/inc/dnodeVRead.h index 0d521b6bb5202711274dd6ebab40f734c40b5120..9e0c7b312000b9af2b84cb2a0c493b7501873090 100644 --- a/src/dnode/inc/dnodeRead.h +++ b/src/dnode/inc/dnodeVRead.h @@ -22,7 +22,7 @@ extern "C" { int32_t dnodeInitRead(); void dnodeCleanupRead(); -void dnodeRead(SRpcMsg *pMsg); +void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg); #ifdef __cplusplus } diff --git a/src/dnode/inc/dnodeWrite.h b/src/dnode/inc/dnodeVWrite.h similarity index 94% rename from src/dnode/inc/dnodeWrite.h rename to src/dnode/inc/dnodeVWrite.h index 028eaa95c2905016e7e444e2508af141b7dfeee5..461e51983fb6e8fa84a6a3da83a8d72f5d7a930c 100644 --- a/src/dnode/inc/dnodeWrite.h +++ b/src/dnode/inc/dnodeVWrite.h @@ -22,7 +22,7 @@ extern "C" { int32_t dnodeInitWrite(); void dnodeCleanupWrite(); -void dnodeWrite(SRpcMsg *pMsg); +void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg); void dnodeSendWriteResponse(void *pVnode, void *param, int32_t code); #ifdef __cplusplus diff --git a/src/dnode/src/dnodeMClient.c b/src/dnode/src/dnodeMClient.c deleted file mode 100644 index 3aa863799b612b0817c9e9951b484566ff263b2d..0000000000000000000000000000000000000000 --- a/src/dnode/src/dnodeMClient.c +++ /dev/null @@ -1,468 +0,0 @@ -/* - * 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 . - */ - -#define _DEFAULT_SOURCE -#include "os.h" -#include "cJSON.h" -#include "taosmsg.h" -#include "trpc.h" -#include "tutil.h" -#include "tsync.h" -#include "ttime.h" -#include "ttimer.h" -#include "tbalance.h" -#include "tglobal.h" -#include "vnode.h" -#include "mnode.h" -#include "dnode.h" -#include "dnodeLog.h" -#include "dnodeMClient.h" -#include "dnodeModule.h" -#include "dnodeMgmt.h" - -#define MPEER_CONTENT_LEN 2000 - -static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes); -static bool dnodeReadMnodeInfos(); -static void dnodeSaveMnodeInfos(); -static void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg); -static bool dnodeReadDnodeCfg(); -static void dnodeSaveDnodeCfg(); -static void dnodeProcessRspFromMnode(SRpcMsg *pMsg); -static void dnodeProcessStatusRsp(SRpcMsg *pMsg); -static void dnodeSendStatusMsg(void *handle, void *tmrId); -static void (*tsDnodeProcessMgmtRspFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); - -static void *tsDnodeMClientRpc = NULL; -static void *tsDnodeTmr = NULL; -static void *tsStatusTimer = NULL; -static uint32_t tsRebootTime; - -static SRpcIpSet tsMnodeIpSet = {0}; -static SDMMnodeInfos tsMnodeInfos = {0}; -static SDMDnodeCfg tsDnodeCfg = {0}; - -void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) { - dTrace("mgmt IP list is changed for ufp is called"); - tsMnodeIpSet = *pIpSet; -} - -void dnodeGetMnodeDnodeIpSet(void *ipSetRaw) { - SRpcIpSet *ipSet = ipSetRaw; - ipSet->numOfIps = tsMnodeInfos.nodeNum; - ipSet->inUse = tsMnodeInfos.inUse; - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; ++i) { - taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, ipSet->fqdn[i], &ipSet->port[i]); - ipSet->port[i] += TSDB_PORT_MNODEDNODE; - } -} - -int32_t dnodeInitMClient() { - dnodeReadDnodeCfg(); - tsRebootTime = taosGetTimestampSec(); - - tsDnodeTmr = taosTmrInit(100, 200, 60000, "DND-DM"); - if (tsDnodeTmr == NULL) { - dError("failed to init dnode timer"); - return -1; - } - - if (!dnodeReadMnodeInfos()) { - memset(&tsMnodeIpSet, 0, sizeof(SRpcIpSet)); - memset(&tsMnodeInfos, 0, sizeof(SDMMnodeInfos)); - tsMnodeIpSet.numOfIps = 1; - taosGetFqdnPortFromEp(tsFirst, tsMnodeIpSet.fqdn[0], &tsMnodeIpSet.port[0]); - tsMnodeIpSet.port[0] += TSDB_PORT_MNODEDNODE; - if (strcmp(tsSecond, tsFirst) != 0) { - tsMnodeIpSet.numOfIps = 2; - taosGetFqdnPortFromEp(tsSecond, tsMnodeIpSet.fqdn[1], &tsMnodeIpSet.port[1]); - tsMnodeIpSet.port[1] += TSDB_PORT_MNODEDNODE; - } - } else { - tsMnodeIpSet.inUse = tsMnodeInfos.inUse; - tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); - tsMnodeIpSet.port[i] += TSDB_PORT_MNODEDNODE; - } - } - - SRpcInit rpcInit; - memset(&rpcInit, 0, sizeof(rpcInit)); - rpcInit.label = "DND-MC"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = dnodeProcessRspFromMnode; - rpcInit.ufp = dnodeUpdateIpSet; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_CLIENT; - rpcInit.idleTime = tsShellActivityTimer * 2000; - rpcInit.user = "t"; - rpcInit.ckey = "key"; - rpcInit.secret = "secret"; - - tsDnodeMClientRpc = rpcOpen(&rpcInit); - if (tsDnodeMClientRpc == NULL) { - dError("failed to init mnode rpc client"); - return -1; - } - - tsDnodeProcessMgmtRspFp[TSDB_MSG_TYPE_DM_STATUS_RSP] = dnodeProcessStatusRsp; - taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer); - - dPrint("mnode rpc client is opened"); - return 0; -} - -void dnodeCleanupMClient() { - if (tsStatusTimer != NULL) { - taosTmrStopA(&tsStatusTimer); - tsStatusTimer = NULL; - } - - if (tsDnodeTmr != NULL) { - taosTmrCleanUp(tsDnodeTmr); - tsDnodeTmr = NULL; - } - - if (tsDnodeMClientRpc) { - rpcClose(tsDnodeMClientRpc); - tsDnodeMClientRpc = NULL; - dPrint("mnode rpc client is closed"); - } -} - -static void dnodeProcessRspFromMnode(SRpcMsg *pMsg) { - if (tsDnodeProcessMgmtRspFp[pMsg->msgType]) { - (*tsDnodeProcessMgmtRspFp[pMsg->msgType])(pMsg); - } else { - dError("%s is not processed in dnode mclient", taosMsg[pMsg->msgType]); - SRpcMsg rpcRsp = {.pCont = 0, .contLen = 0, .code = TSDB_CODE_OPS_NOT_SUPPORT, .handle = pMsg->handle}; - rpcSendResponse(&rpcRsp); - } - - rpcFreeCont(pMsg->pCont); -} - -static void dnodeProcessStatusRsp(SRpcMsg *pMsg) { - if (pMsg->code != TSDB_CODE_SUCCESS) { - dError("status rsp is received, error:%s", tstrerror(pMsg->code)); - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - return; - } - - SDMStatusRsp *pStatusRsp = pMsg->pCont; - SDMMnodeInfos *pMnodes = &pStatusRsp->mnodes; - if (pMnodes->nodeNum <= 0) { - dError("status msg is invalid, num of ips is %d", pMnodes->nodeNum); - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - return; - } - - SDMDnodeCfg *pCfg = &pStatusRsp->dnodeCfg; - pCfg->numOfVnodes = htonl(pCfg->numOfVnodes); - pCfg->moduleStatus = htonl(pCfg->moduleStatus); - pCfg->dnodeId = htonl(pCfg->dnodeId); - - for (int32_t i = 0; i < pMnodes->nodeNum; ++i) { - SDMMnodeInfo *pMnodeInfo = &pMnodes->nodeInfos[i]; - pMnodeInfo->nodeId = htonl(pMnodeInfo->nodeId); - } - - SDMVgroupAccess *pVgAcccess = pStatusRsp->vgAccess; - for (int32_t i = 0; i < pCfg->numOfVnodes; ++i) { - pVgAcccess[i].vgId = htonl(pVgAcccess[i].vgId); - } - - dnodeProcessModuleStatus(pCfg->moduleStatus); - dnodeUpdateDnodeCfg(pCfg); - dnodeUpdateMnodeInfos(pMnodes); - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); -} - -static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) { - bool mnodesChanged = (memcmp(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)) != 0); - bool mnodesNotInit = (tsMnodeInfos.nodeNum == 0); - if (!(mnodesChanged || mnodesNotInit)) return; - - memcpy(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)); - - tsMnodeIpSet.inUse = tsMnodeInfos.inUse; - tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); - tsMnodeIpSet.port[i] += TSDB_PORT_MNODEDNODE; - } - - dPrint("mnodes is changed, nodeNum:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); - } - - dnodeSaveMnodeInfos(); - sdbUpdateSync(); -} - -void dnodeSendMsgToMnode(SRpcMsg *rpcMsg) { - if (tsDnodeMClientRpc) { - rpcSendRequest(tsDnodeMClientRpc, &tsMnodeIpSet, rpcMsg); - } -} - -static bool dnodeReadMnodeInfos() { - char ipFile[TSDB_FILENAME_LEN] = {0}; - sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); - FILE *fp = fopen(ipFile, "r"); - if (!fp) { - dTrace("failed to read mnode mgmtIpList.json, file not exist"); - return false; - } - - bool ret = false; - int maxLen = 2000; - char *content = calloc(1, maxLen + 1); - int len = fread(content, 1, maxLen, fp); - if (len <= 0) { - free(content); - fclose(fp); - dError("failed to read mnode mgmtIpList.json, content is null"); - return false; - } - - cJSON* root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read mnode mgmtIpList.json, invalid json format"); - goto PARSE_OVER; - } - - cJSON* inUse = cJSON_GetObjectItem(root, "inUse"); - if (!inUse || inUse->type != cJSON_Number) { - dError("failed to read mnode mgmtIpList.json, inUse not found"); - goto PARSE_OVER; - } - tsMnodeInfos.inUse = inUse->valueint; - - cJSON* nodeNum = cJSON_GetObjectItem(root, "nodeNum"); - if (!nodeNum || nodeNum->type != cJSON_Number) { - dError("failed to read mnode mgmtIpList.json, nodeNum not found"); - goto PARSE_OVER; - } - tsMnodeInfos.nodeNum = nodeNum->valueint; - - cJSON* nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); - if (!nodeInfos || nodeInfos->type != cJSON_Array) { - dError("failed to read mnode mgmtIpList.json, nodeInfos not found"); - goto PARSE_OVER; - } - - int size = cJSON_GetArraySize(nodeInfos); - if (size != tsMnodeInfos.nodeNum) { - dError("failed to read mnode mgmtIpList.json, nodeInfos size not matched"); - goto PARSE_OVER; - } - - for (int i = 0; i < size; ++i) { - cJSON* nodeInfo = cJSON_GetArrayItem(nodeInfos, i); - if (nodeInfo == NULL) continue; - - cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId"); - if (!nodeId || nodeId->type != cJSON_Number) { - dError("failed to read mnode mgmtIpList.json, nodeId not found"); - goto PARSE_OVER; - } - tsMnodeInfos.nodeInfos[i].nodeId = nodeId->valueint; - - cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp"); - if (!nodeEp || nodeEp->type != cJSON_String || nodeEp->valuestring == NULL) { - dError("failed to read mnode mgmtIpList.json, nodeName not found"); - goto PARSE_OVER; - } - strncpy(tsMnodeInfos.nodeInfos[i].nodeEp, nodeEp->valuestring, TSDB_FQDN_LEN); - } - - ret = true; - - dPrint("read mnode iplist successed, numOfIps:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); - } - -PARSE_OVER: - free(content); - cJSON_Delete(root); - fclose(fp); - return ret; -} - -static void dnodeSaveMnodeInfos() { - char ipFile[TSDB_FILENAME_LEN] = {0}; - sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); - FILE *fp = fopen(ipFile, "w"); - if (!fp) return; - - int32_t len = 0; - int32_t maxLen = 2000; - char * content = calloc(1, maxLen + 1); - - len += snprintf(content + len, maxLen - len, "{\n"); - len += snprintf(content + len, maxLen - len, " \"inUse\": %d,\n", tsMnodeInfos.inUse); - len += snprintf(content + len, maxLen - len, " \"nodeNum\": %d,\n", tsMnodeInfos.nodeNum); - len += snprintf(content + len, maxLen - len, " \"nodeInfos\": [{\n"); - for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { - len += snprintf(content + len, maxLen - len, " \"nodeId\": %d,\n", tsMnodeInfos.nodeInfos[i].nodeId); - len += snprintf(content + len, maxLen - len, " \"nodeEp\": \"%s\"\n", tsMnodeInfos.nodeInfos[i].nodeEp); - if (i < tsMnodeInfos.nodeNum -1) { - len += snprintf(content + len, maxLen - len, " },{\n"); - } else { - len += snprintf(content + len, maxLen - len, " }]\n"); - } - } - len += snprintf(content + len, maxLen - len, "}\n"); - - fwrite(content, 1, len, fp); - fclose(fp); - free(content); - - dPrint("save mnode iplist successed"); -} - -char *dnodeGetMnodeMasterEp() { - return tsMnodeInfos.nodeInfos[tsMnodeIpSet.inUse].nodeEp; -} - -void* dnodeGetMnodeInfos() { - return &tsMnodeInfos; -} - -static void dnodeSendStatusMsg(void *handle, void *tmrId) { - if (tsDnodeTmr == NULL) { - dError("dnode timer is already released"); - return; - } - - if (tsStatusTimer == NULL) { - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - dError("failed to start status timer"); - return; - } - - int32_t contLen = sizeof(SDMStatusMsg) + TSDB_MAX_VNODES * sizeof(SVnodeLoad); - SDMStatusMsg *pStatus = rpcMallocCont(contLen); - if (pStatus == NULL) { - taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); - dError("failed to malloc status message"); - return; - } - - //strcpy(pStatus->dnodeName, tsDnodeName); - pStatus->version = htonl(tsVersion); - pStatus->dnodeId = htonl(tsDnodeCfg.dnodeId); - strcpy(pStatus->dnodeEp, tsLocalEp); - pStatus->lastReboot = htonl(tsRebootTime); - pStatus->numOfTotalVnodes = htons((uint16_t) tsNumOfTotalVnodes); - pStatus->numOfCores = htons((uint16_t) tsNumOfCores); - pStatus->diskAvailable = tsAvailDataDirGB; - pStatus->alternativeRole = (uint8_t) tsAlternativeRole; - - vnodeBuildStatusMsg(pStatus); - contLen = sizeof(SDMStatusMsg) + pStatus->openVnodes * sizeof(SVnodeLoad); - pStatus->openVnodes = htons(pStatus->openVnodes); - - SRpcMsg rpcMsg = { - .pCont = pStatus, - .contLen = contLen, - .msgType = TSDB_MSG_TYPE_DM_STATUS - }; - - dnodeSendMsgToMnode(&rpcMsg); -} - -static bool dnodeReadDnodeCfg() { - char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; - sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); - - FILE *fp = fopen(dnodeCfgFile, "r"); - if (!fp) { - dTrace("failed to read dnodeCfg.json, file not exist"); - return false; - } - - bool ret = false; - int maxLen = 100; - char *content = calloc(1, maxLen + 1); - int len = fread(content, 1, maxLen, fp); - if (len <= 0) { - free(content); - fclose(fp); - dError("failed to read dnodeCfg.json, content is null"); - return false; - } - - cJSON* root = cJSON_Parse(content); - if (root == NULL) { - dError("failed to read dnodeCfg.json, invalid json format"); - goto PARSE_CFG_OVER; - } - - cJSON* dnodeId = cJSON_GetObjectItem(root, "dnodeId"); - if (!dnodeId || dnodeId->type != cJSON_Number) { - dError("failed to read dnodeCfg.json, dnodeId not found"); - goto PARSE_CFG_OVER; - } - tsDnodeCfg.dnodeId = dnodeId->valueint; - - ret = true; - - dPrint("read numOfVnodes successed, dnodeId:%d", tsDnodeCfg.dnodeId); - -PARSE_CFG_OVER: - free(content); - cJSON_Delete(root); - fclose(fp); - return ret; -} - -static void dnodeSaveDnodeCfg() { - char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; - sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); - - FILE *fp = fopen(dnodeCfgFile, "w"); - if (!fp) return; - - int32_t len = 0; - int32_t maxLen = 100; - char * content = calloc(1, maxLen + 1); - - len += snprintf(content + len, maxLen - len, "{\n"); - len += snprintf(content + len, maxLen - len, " \"dnodeId\": %d\n", tsDnodeCfg.dnodeId); - len += snprintf(content + len, maxLen - len, "}\n"); - - fwrite(content, 1, len, fp); - fclose(fp); - free(content); - - dPrint("save dnodeId successed"); -} - -void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg) { - if (tsDnodeCfg.dnodeId == 0) { - dPrint("dnodeId is set to %d", pCfg->dnodeId); - tsDnodeCfg.dnodeId = pCfg->dnodeId; - dnodeSaveDnodeCfg(); - } -} - -int32_t dnodeGetDnodeId() { - return tsDnodeCfg.dnodeId; -} diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c index 940b884927719986009d6934802e2972cab49399..5b62192fa8c65ca4a58a520e8390899986d00787 100644 --- a/src/dnode/src/dnodeMain.c +++ b/src/dnode/src/dnodeMain.c @@ -22,14 +22,13 @@ #include "tconfig.h" #include "tglobal.h" #include "dnode.h" -#include "dnodeLog.h" -#include "dnodeMClient.h" +#include "dnodeInt.h" #include "dnodeMgmt.h" -#include "dnodeMnode.h" +#include "dnodePeer.h" #include "dnodeModule.h" -#include "dnodeRead.h" +#include "dnodeVRead.h" #include "dnodeShell.h" -#include "dnodeWrite.h" +#include "dnodeVWrite.h" #include "tgrant.h" static int32_t dnodeInitSystem(); @@ -167,9 +166,9 @@ static int32_t dnodeInitSystem() { if (dnodeInitStorage() != 0) return -1; if (dnodeInitRead() != 0) return -1; if (dnodeInitWrite() != 0) return -1; - if (dnodeInitMClient() != 0) return -1; + if (dnodeInitClient() != 0) return -1; if (dnodeInitModules() != 0) return -1; - if (dnodeInitMnode() != 0) return -1; + if (dnodeInitServer() != 0) return -1; if (dnodeInitMgmt() != 0) return -1; if (dnodeInitShell() != 0) return -1; @@ -185,9 +184,9 @@ static void dnodeCleanUpSystem() { if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_STOPPED) { dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_STOPPED); dnodeCleanupShell(); - dnodeCleanupMnode(); + dnodeCleanupServer(); dnodeCleanupMgmt(); - dnodeCleanupMClient(); + dnodeCleanupClient(); dnodeCleanupWrite(); dnodeCleanupRead(); dnodeCleanUpModules(); diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index fbf1ceea71bb55733ddeffc5329d0dfc8cbb93d8..62d22573ff1981a1b12dc9a4aaaee92f2c3c1a5f 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -15,19 +15,47 @@ #define _DEFAULT_SOURCE #include "os.h" +#include "cJSON.h" #include "ihash.h" #include "taoserror.h" #include "taosmsg.h" +#include "ttime.h" +#include "ttimer.h" #include "trpc.h" #include "tsdb.h" #include "twal.h" -#include "vnode.h" +#include "tsync.h" +#include "ttime.h" +#include "ttimer.h" +#include "tbalance.h" #include "tglobal.h" -#include "dnodeLog.h" -#include "dnodeMClient.h" +#include "dnode.h" +#include "vnode.h" +#include "mnode.h" +#include "dnodeInt.h" #include "dnodeMgmt.h" -#include "dnodeRead.h" -#include "dnodeWrite.h" +#include "dnodeVRead.h" +#include "dnodeVWrite.h" +#include "dnodeModule.h" + +#define MPEER_CONTENT_LEN 2000 + +static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes); +static bool dnodeReadMnodeInfos(); +static void dnodeSaveMnodeInfos(); +static void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg); +static bool dnodeReadDnodeCfg(); +static void dnodeSaveDnodeCfg(); +static void dnodeProcessStatusRsp(SRpcMsg *pMsg); +static void dnodeSendStatusMsg(void *handle, void *tmrId); + +static void *tsDnodeTmr = NULL; +static void *tsStatusTimer = NULL; +static uint32_t tsRebootTime; + +static SRpcIpSet tsMnodeIpSet = {0}; +static SDMMnodeInfos tsMnodeInfos = {0}; +static SDMDnodeCfg tsDnodeCfg = {0}; static int32_t dnodeOpenVnodes(); static void dnodeCloseVnodes(); @@ -43,19 +71,63 @@ int32_t dnodeInitMgmt() { dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeProcessAlterStreamMsg; dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeProcessConfigDnodeMsg; + dnodeAddClientRspHandle(TSDB_MSG_TYPE_DM_STATUS_RSP, dnodeProcessStatusRsp); + dnodeReadDnodeCfg(); + tsRebootTime = taosGetTimestampSec(); + + tsDnodeTmr = taosTmrInit(100, 200, 60000, "DND-DM"); + if (tsDnodeTmr == NULL) { + dError("failed to init dnode timer"); + return -1; + } + + if (!dnodeReadMnodeInfos()) { + memset(&tsMnodeIpSet, 0, sizeof(SRpcIpSet)); + memset(&tsMnodeInfos, 0, sizeof(SDMMnodeInfos)); + tsMnodeIpSet.numOfIps = 1; + taosGetFqdnPortFromEp(tsFirst, tsMnodeIpSet.fqdn[0], &tsMnodeIpSet.port[0]); + tsMnodeIpSet.port[0] += TSDB_PORT_DNODEDNODE; + if (strcmp(tsSecond, tsFirst) != 0) { + tsMnodeIpSet.numOfIps = 2; + taosGetFqdnPortFromEp(tsSecond, tsMnodeIpSet.fqdn[1], &tsMnodeIpSet.port[1]); + tsMnodeIpSet.port[1] += TSDB_PORT_DNODEDNODE; + } + } else { + tsMnodeIpSet.inUse = tsMnodeInfos.inUse; + tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); + tsMnodeIpSet.port[i] += TSDB_PORT_DNODEDNODE; + } + } + int32_t code = dnodeOpenVnodes(); if (code != TSDB_CODE_SUCCESS) { return -1; } + taosTmrReset(dnodeSendStatusMsg, 500, NULL, tsDnodeTmr, &tsStatusTimer); + + dPrint("dnode mgmt is initialized"); + return TSDB_CODE_SUCCESS; } void dnodeCleanupMgmt() { + if (tsStatusTimer != NULL) { + taosTmrStopA(&tsStatusTimer); + tsStatusTimer = NULL; + } + + if (tsDnodeTmr != NULL) { + taosTmrCleanUp(tsDnodeTmr); + tsDnodeTmr = NULL; + } + dnodeCloseVnodes(); } -void dnodeMgmt(SRpcMsg *pMsg) { +void dnodeDispatchToDnodeMgmt(SRpcMsg *pMsg) { SRpcMsg rsp; if (dnodeProcessMgmtMsgFp[pMsg->msgType]) { @@ -116,7 +188,7 @@ static int32_t dnodeOpenVnodes() { free(vnodeList); - dPrint("there are total vnodes:%d, failed to open:%d", numOfVnodes, failed); + dPrint("there are total vnodes:%d, openned:%d failed:%d", numOfVnodes, numOfVnodes-failed, failed); return TSDB_CODE_SUCCESS; } @@ -193,3 +265,326 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) { SMDCfgDnodeMsg *pCfg = (SMDCfgDnodeMsg *)pMsg->pCont; return taosCfgDynamicOptions(pCfg->config); } + + +void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) { + dTrace("mgmt IP list is changed for ufp is called"); + tsMnodeIpSet = *pIpSet; +} + +void dnodeGetMnodeDnodeIpSet(void *ipSetRaw) { + SRpcIpSet *ipSet = ipSetRaw; + ipSet->numOfIps = tsMnodeInfos.nodeNum; + ipSet->inUse = tsMnodeInfos.inUse; + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; ++i) { + taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, ipSet->fqdn[i], &ipSet->port[i]); + ipSet->port[i] += TSDB_PORT_DNODEDNODE; + } +} + +static void dnodeProcessStatusRsp(SRpcMsg *pMsg) { + if (pMsg->code != TSDB_CODE_SUCCESS) { + dError("status rsp is received, error:%s", tstrerror(pMsg->code)); + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + return; + } + + SDMStatusRsp *pStatusRsp = pMsg->pCont; + SDMMnodeInfos *pMnodes = &pStatusRsp->mnodes; + if (pMnodes->nodeNum <= 0) { + dError("status msg is invalid, num of ips is %d", pMnodes->nodeNum); + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + return; + } + + SDMDnodeCfg *pCfg = &pStatusRsp->dnodeCfg; + pCfg->numOfVnodes = htonl(pCfg->numOfVnodes); + pCfg->moduleStatus = htonl(pCfg->moduleStatus); + pCfg->dnodeId = htonl(pCfg->dnodeId); + + for (int32_t i = 0; i < pMnodes->nodeNum; ++i) { + SDMMnodeInfo *pMnodeInfo = &pMnodes->nodeInfos[i]; + pMnodeInfo->nodeId = htonl(pMnodeInfo->nodeId); + } + + SDMVgroupAccess *pVgAcccess = pStatusRsp->vgAccess; + for (int32_t i = 0; i < pCfg->numOfVnodes; ++i) { + pVgAcccess[i].vgId = htonl(pVgAcccess[i].vgId); + } + + dnodeProcessModuleStatus(pCfg->moduleStatus); + dnodeUpdateDnodeCfg(pCfg); + dnodeUpdateMnodeInfos(pMnodes); + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); +} + +static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) { + bool mnodesChanged = (memcmp(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)) != 0); + bool mnodesNotInit = (tsMnodeInfos.nodeNum == 0); + if (!(mnodesChanged || mnodesNotInit)) return; + + memcpy(&tsMnodeInfos, pMnodes, sizeof(SDMMnodeInfos)); + + tsMnodeIpSet.inUse = tsMnodeInfos.inUse; + tsMnodeIpSet.numOfIps = tsMnodeInfos.nodeNum; + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + taosGetFqdnPortFromEp(tsMnodeInfos.nodeInfos[i].nodeEp, tsMnodeIpSet.fqdn[i], &tsMnodeIpSet.port[i]); + tsMnodeIpSet.port[i] += TSDB_PORT_DNODEDNODE; + } + + dPrint("mnodes is changed, nodeNum:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); + } + + dnodeSaveMnodeInfos(); + sdbUpdateSync(); +} + +static bool dnodeReadMnodeInfos() { + char ipFile[TSDB_FILENAME_LEN] = {0}; + sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); + FILE *fp = fopen(ipFile, "r"); + if (!fp) { + dTrace("failed to read mnode mgmtIpList.json, file not exist"); + return false; + } + + bool ret = false; + int maxLen = 2000; + char *content = calloc(1, maxLen + 1); + int len = fread(content, 1, maxLen, fp); + if (len <= 0) { + free(content); + fclose(fp); + dError("failed to read mnode mgmtIpList.json, content is null"); + return false; + } + + cJSON* root = cJSON_Parse(content); + if (root == NULL) { + dError("failed to read mnode mgmtIpList.json, invalid json format"); + goto PARSE_OVER; + } + + cJSON* inUse = cJSON_GetObjectItem(root, "inUse"); + if (!inUse || inUse->type != cJSON_Number) { + dError("failed to read mnode mgmtIpList.json, inUse not found"); + goto PARSE_OVER; + } + tsMnodeInfos.inUse = inUse->valueint; + + cJSON* nodeNum = cJSON_GetObjectItem(root, "nodeNum"); + if (!nodeNum || nodeNum->type != cJSON_Number) { + dError("failed to read mnode mgmtIpList.json, nodeNum not found"); + goto PARSE_OVER; + } + tsMnodeInfos.nodeNum = nodeNum->valueint; + + cJSON* nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); + if (!nodeInfos || nodeInfos->type != cJSON_Array) { + dError("failed to read mnode mgmtIpList.json, nodeInfos not found"); + goto PARSE_OVER; + } + + int size = cJSON_GetArraySize(nodeInfos); + if (size != tsMnodeInfos.nodeNum) { + dError("failed to read mnode mgmtIpList.json, nodeInfos size not matched"); + goto PARSE_OVER; + } + + for (int i = 0; i < size; ++i) { + cJSON* nodeInfo = cJSON_GetArrayItem(nodeInfos, i); + if (nodeInfo == NULL) continue; + + cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId"); + if (!nodeId || nodeId->type != cJSON_Number) { + dError("failed to read mnode mgmtIpList.json, nodeId not found"); + goto PARSE_OVER; + } + tsMnodeInfos.nodeInfos[i].nodeId = nodeId->valueint; + + cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp"); + if (!nodeEp || nodeEp->type != cJSON_String || nodeEp->valuestring == NULL) { + dError("failed to read mnode mgmtIpList.json, nodeName not found"); + goto PARSE_OVER; + } + strncpy(tsMnodeInfos.nodeInfos[i].nodeEp, nodeEp->valuestring, TSDB_FQDN_LEN); + } + + ret = true; + + dPrint("read mnode iplist successed, numOfIps:%d inUse:%d", tsMnodeInfos.nodeNum, tsMnodeInfos.inUse); + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + dPrint("mnode:%d, %s", tsMnodeInfos.nodeInfos[i].nodeId, tsMnodeInfos.nodeInfos[i].nodeEp); + } + +PARSE_OVER: + free(content); + cJSON_Delete(root); + fclose(fp); + return ret; +} + +static void dnodeSaveMnodeInfos() { + char ipFile[TSDB_FILENAME_LEN] = {0}; + sprintf(ipFile, "%s/mgmtIpList.json", tsDnodeDir); + FILE *fp = fopen(ipFile, "w"); + if (!fp) return; + + int32_t len = 0; + int32_t maxLen = 2000; + char * content = calloc(1, maxLen + 1); + + len += snprintf(content + len, maxLen - len, "{\n"); + len += snprintf(content + len, maxLen - len, " \"inUse\": %d,\n", tsMnodeInfos.inUse); + len += snprintf(content + len, maxLen - len, " \"nodeNum\": %d,\n", tsMnodeInfos.nodeNum); + len += snprintf(content + len, maxLen - len, " \"nodeInfos\": [{\n"); + for (int32_t i = 0; i < tsMnodeInfos.nodeNum; i++) { + len += snprintf(content + len, maxLen - len, " \"nodeId\": %d,\n", tsMnodeInfos.nodeInfos[i].nodeId); + len += snprintf(content + len, maxLen - len, " \"nodeEp\": \"%s\"\n", tsMnodeInfos.nodeInfos[i].nodeEp); + if (i < tsMnodeInfos.nodeNum -1) { + len += snprintf(content + len, maxLen - len, " },{\n"); + } else { + len += snprintf(content + len, maxLen - len, " }]\n"); + } + } + len += snprintf(content + len, maxLen - len, "}\n"); + + fwrite(content, 1, len, fp); + fclose(fp); + free(content); + + dPrint("save mnode iplist successed"); +} + +char *dnodeGetMnodeMasterEp() { + return tsMnodeInfos.nodeInfos[tsMnodeIpSet.inUse].nodeEp; +} + +void* dnodeGetMnodeInfos() { + return &tsMnodeInfos; +} + +static void dnodeSendStatusMsg(void *handle, void *tmrId) { + if (tsDnodeTmr == NULL) { + dError("dnode timer is already released"); + return; + } + + if (tsStatusTimer == NULL) { + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + dError("failed to start status timer"); + return; + } + + int32_t contLen = sizeof(SDMStatusMsg) + TSDB_MAX_VNODES * sizeof(SVnodeLoad); + SDMStatusMsg *pStatus = rpcMallocCont(contLen); + if (pStatus == NULL) { + taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsDnodeTmr, &tsStatusTimer); + dError("failed to malloc status message"); + return; + } + + //strcpy(pStatus->dnodeName, tsDnodeName); + pStatus->version = htonl(tsVersion); + pStatus->dnodeId = htonl(tsDnodeCfg.dnodeId); + strcpy(pStatus->dnodeEp, tsLocalEp); + pStatus->lastReboot = htonl(tsRebootTime); + pStatus->numOfTotalVnodes = htons((uint16_t) tsNumOfTotalVnodes); + pStatus->numOfCores = htons((uint16_t) tsNumOfCores); + pStatus->diskAvailable = tsAvailDataDirGB; + pStatus->alternativeRole = (uint8_t) tsAlternativeRole; + + vnodeBuildStatusMsg(pStatus); + contLen = sizeof(SDMStatusMsg) + pStatus->openVnodes * sizeof(SVnodeLoad); + pStatus->openVnodes = htons(pStatus->openVnodes); + + SRpcMsg rpcMsg = { + .pCont = pStatus, + .contLen = contLen, + .msgType = TSDB_MSG_TYPE_DM_STATUS + }; + + dnodeSendMsgToDnode(&tsMnodeIpSet, &rpcMsg); +} + +static bool dnodeReadDnodeCfg() { + char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; + sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); + + FILE *fp = fopen(dnodeCfgFile, "r"); + if (!fp) { + dTrace("failed to read dnodeCfg.json, file not exist"); + return false; + } + + bool ret = false; + int maxLen = 100; + char *content = calloc(1, maxLen + 1); + int len = fread(content, 1, maxLen, fp); + if (len <= 0) { + free(content); + fclose(fp); + dError("failed to read dnodeCfg.json, content is null"); + return false; + } + + cJSON* root = cJSON_Parse(content); + if (root == NULL) { + dError("failed to read dnodeCfg.json, invalid json format"); + goto PARSE_CFG_OVER; + } + + cJSON* dnodeId = cJSON_GetObjectItem(root, "dnodeId"); + if (!dnodeId || dnodeId->type != cJSON_Number) { + dError("failed to read dnodeCfg.json, dnodeId not found"); + goto PARSE_CFG_OVER; + } + tsDnodeCfg.dnodeId = dnodeId->valueint; + + ret = true; + + dPrint("read numOfVnodes successed, dnodeId:%d", tsDnodeCfg.dnodeId); + +PARSE_CFG_OVER: + free(content); + cJSON_Delete(root); + fclose(fp); + return ret; +} + +static void dnodeSaveDnodeCfg() { + char dnodeCfgFile[TSDB_FILENAME_LEN] = {0}; + sprintf(dnodeCfgFile, "%s/dnodeCfg.json", tsDnodeDir); + + FILE *fp = fopen(dnodeCfgFile, "w"); + if (!fp) return; + + int32_t len = 0; + int32_t maxLen = 100; + char * content = calloc(1, maxLen + 1); + + len += snprintf(content + len, maxLen - len, "{\n"); + len += snprintf(content + len, maxLen - len, " \"dnodeId\": %d\n", tsDnodeCfg.dnodeId); + len += snprintf(content + len, maxLen - len, "}\n"); + + fwrite(content, 1, len, fp); + fclose(fp); + free(content); + + dPrint("save dnodeId successed"); +} + +void dnodeUpdateDnodeCfg(SDMDnodeCfg *pCfg) { + if (tsDnodeCfg.dnodeId == 0) { + dPrint("dnodeId is set to %d", pCfg->dnodeId); + tsDnodeCfg.dnodeId = pCfg->dnodeId; + dnodeSaveDnodeCfg(); + } +} + +int32_t dnodeGetDnodeId() { + return tsDnodeCfg.dnodeId; +} + diff --git a/src/dnode/src/dnodeMnode.c b/src/dnode/src/dnodeMnode.c deleted file mode 100644 index 75c09d43ba3a553300b8b764cb511e797bd91b9c..0000000000000000000000000000000000000000 --- a/src/dnode/src/dnodeMnode.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 . - */ - -#include "os.h" -#include "taosmsg.h" -#include "tglobal.h" -#include "trpc.h" -#include "dnode.h" -#include "dnodeLog.h" -#include "dnodeMgmt.h" -#include "dnodeWrite.h" - -static void (*dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); -static void dnodeProcessMsgFromMnode(SRpcMsg *pMsg); -static void *tsDnodeMnodeRpc = NULL; - -int32_t dnodeInitMnode() { - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CREATE_TABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_TABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_TABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_STABLE] = dnodeWrite; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CREATE_VNODE] = dnodeMgmt; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_VNODE] = dnodeMgmt; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeMgmt; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeMgmt; - - SRpcInit rpcInit; - memset(&rpcInit, 0, sizeof(rpcInit)); - rpcInit.localPort = tsDnodeMnodePort; - rpcInit.label = "DND-MS"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = dnodeProcessMsgFromMnode; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 2000; - - tsDnodeMnodeRpc = rpcOpen(&rpcInit); - if (tsDnodeMnodeRpc == NULL) { - dError("failed to init mnode rpc server"); - return -1; - } - - dPrint("mnode rpc server is opened"); - return 0; -} - -void dnodeCleanupMnode() { - if (tsDnodeMnodeRpc) { - rpcClose(tsDnodeMnodeRpc); - tsDnodeMnodeRpc = NULL; - dPrint("mnode rpc server is closed"); - } -} - -static void dnodeProcessMsgFromMnode(SRpcMsg *pMsg) { - SRpcMsg rspMsg; - rspMsg.handle = pMsg->handle; - rspMsg.pCont = NULL; - rspMsg.contLen = 0; - - if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) { - rspMsg.code = TSDB_CODE_NOT_READY; - rpcSendResponse(&rspMsg); - rpcFreeCont(pMsg->pCont); - dTrace("thandle:%p, query msg is ignored since dnode not running", pMsg->handle); - return; - } - - if (pMsg->pCont == NULL) { - rspMsg.code = TSDB_CODE_INVALID_MSG_LEN; - rpcSendResponse(&rspMsg); - return; - } - - if (dnodeProcessMgmtMsgFp[pMsg->msgType]) { - (*dnodeProcessMgmtMsgFp[pMsg->msgType])(pMsg); - } else { - dError("%s is not processed in dnode mserver", taosMsg[pMsg->msgType]); - rspMsg.code = TSDB_CODE_MSG_NOT_PROCESSED; - rpcSendResponse(&rspMsg); - rpcFreeCont(pMsg->pCont); - } -} - - diff --git a/src/dnode/src/dnodeModule.c b/src/dnode/src/dnodeModule.c index e1aa48d47786898cb511b55a7913e8ee48d9158c..2e081de2a8f6cdd999edd57287e09a0bb5a3e2ea 100644 --- a/src/dnode/src/dnodeModule.c +++ b/src/dnode/src/dnodeModule.c @@ -17,10 +17,11 @@ #include "os.h" #include "taosdef.h" #include "tglobal.h" +#include "trpc.h" #include "mnode.h" #include "http.h" #include "monitor.h" -#include "dnodeLog.h" +#include "dnodeInt.h" #include "dnodeModule.h" typedef struct { diff --git a/src/dnode/src/dnodePeer.c b/src/dnode/src/dnodePeer.c new file mode 100644 index 0000000000000000000000000000000000000000..b1e5d9fd38d3a2f6d0ab2f369c57e5218d0d36c4 --- /dev/null +++ b/src/dnode/src/dnodePeer.c @@ -0,0 +1,165 @@ +/* + * 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 . + */ + +/* this file is mainly responsible for the communication between DNODEs. Each + * dnode works as both server and client. Dnode may send status, grant, config + * messages to mnode, mnode may send create/alter/drop table/vnode messages + * to dnode. All theses messages are handled from here + */ + +#include "os.h" +#include "taosmsg.h" +#include "tglobal.h" +#include "trpc.h" +#include "dnode.h" +#include "dnodeInt.h" +#include "dnodeMgmt.h" +#include "dnodeVWrite.h" +#include "mnode.h" + +extern void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet); +static void (*dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); +static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg); +static void (*dnodeProcessRspMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *rpcMsg); +static void dnodeProcessRspFromDnode(SRpcMsg *pMsg); +static void *tsDnodeServerRpc = NULL; +static void *tsDnodeClientRpc = NULL; + +int32_t dnodeInitServer() { + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CREATE_TABLE] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_DROP_TABLE] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_ALTER_TABLE] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_DROP_STABLE] = dnodeDispatchToVnodeWriteQueue; + + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CREATE_VNODE] = dnodeDispatchToDnodeMgmt; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_DROP_VNODE] = dnodeDispatchToDnodeMgmt; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeDispatchToDnodeMgmt; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeDispatchToDnodeMgmt; + + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_CONFIG_TABLE] = mgmtProcessReqMsgFromDnode; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_CONFIG_VNODE] = mgmtProcessReqMsgFromDnode; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_GRANT] = mgmtProcessReqMsgFromDnode; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_STATUS] = mgmtProcessReqMsgFromDnode; + + SRpcInit rpcInit; + memset(&rpcInit, 0, sizeof(rpcInit)); + rpcInit.localPort = tsDnodeDnodePort; + rpcInit.label = "DND-S"; + rpcInit.numOfThreads = 1; + rpcInit.cfp = dnodeProcessReqMsgFromDnode; + rpcInit.sessions = 100; + rpcInit.connType = TAOS_CONN_SERVER; + rpcInit.idleTime = tsShellActivityTimer * 2000; + + tsDnodeServerRpc = rpcOpen(&rpcInit); + if (tsDnodeServerRpc == NULL) { + dError("failed to init inter-dnodes RPC server"); + return -1; + } + + dPrint("inter-dnodes RPC server is opened"); + return 0; +} + +void dnodeCleanupServer() { + if (tsDnodeServerRpc) { + rpcClose(tsDnodeServerRpc); + tsDnodeServerRpc = NULL; + dPrint("inter-dnodes RPC server is closed"); + } +} + +static void dnodeProcessReqMsgFromDnode(SRpcMsg *pMsg) { + SRpcMsg rspMsg; + rspMsg.handle = pMsg->handle; + rspMsg.pCont = NULL; + rspMsg.contLen = 0; + + if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) { + rspMsg.code = TSDB_CODE_NOT_READY; + rpcSendResponse(&rspMsg); + rpcFreeCont(pMsg->pCont); + dTrace("RPC %p, msg:%s is ignored since dnode not running", pMsg->handle, taosMsg[pMsg->msgType]); + return; + } + + if (pMsg->pCont == NULL) { + rspMsg.code = TSDB_CODE_INVALID_MSG_LEN; + rpcSendResponse(&rspMsg); + return; + } + + if (dnodeProcessReqMsgFp[pMsg->msgType]) { + (*dnodeProcessReqMsgFp[pMsg->msgType])(pMsg); + } else { + rspMsg.code = TSDB_CODE_MSG_NOT_PROCESSED; + rpcSendResponse(&rspMsg); + rpcFreeCont(pMsg->pCont); + dTrace("RPC %p, message:%s not processed", pMsg->handle, taosMsg[pMsg->msgType]); + return; + + } +} + +int32_t dnodeInitClient() { + SRpcInit rpcInit; + memset(&rpcInit, 0, sizeof(rpcInit)); + rpcInit.label = "DND-C"; + rpcInit.numOfThreads = 1; + rpcInit.cfp = dnodeProcessRspFromDnode; + rpcInit.ufp = dnodeUpdateIpSet; + rpcInit.sessions = 100; + rpcInit.connType = TAOS_CONN_CLIENT; + rpcInit.idleTime = tsShellActivityTimer * 2000; + rpcInit.user = "t"; + rpcInit.ckey = "key"; + rpcInit.secret = "secret"; + + tsDnodeClientRpc = rpcOpen(&rpcInit); + if (tsDnodeClientRpc == NULL) { + dError("failed to init mnode rpc client"); + return -1; + } + + dPrint("inter-dnodes rpc client is opened"); + return 0; +} + +void dnodeCleanupClient() { + if (tsDnodeClientRpc) { + rpcClose(tsDnodeClientRpc); + tsDnodeClientRpc = NULL; + dPrint("inter-dnodes rpc client is closed"); + } +} + +static void dnodeProcessRspFromDnode(SRpcMsg *pMsg) { + + if (dnodeProcessRspMsgFp[pMsg->msgType]) { + (*dnodeProcessRspMsgFp[pMsg->msgType])(pMsg); + } else { + dError("RPC %p, msg:%s is not processed", pMsg->handle, taosMsg[pMsg->msgType]); + } + + rpcFreeCont(pMsg->pCont); +} + +void dnodeAddClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { + dnodeProcessRspMsgFp[msgType] = fp; +} + +void dnodeSendMsgToDnode(SRpcIpSet *ipSet, SRpcMsg *rpcMsg) { + rpcSendRequest(tsDnodeClientRpc, ipSet, rpcMsg); +} diff --git a/src/dnode/src/dnodeShell.c b/src/dnode/src/dnodeShell.c index 544d443bc0417c110f8c89b81c787119a6138206..8ca3aa12e17a16c7e75e6510f52a8bd79528107e 100644 --- a/src/dnode/src/dnodeShell.c +++ b/src/dnode/src/dnodeShell.c @@ -22,9 +22,9 @@ #include "tglobal.h" #include "http.h" #include "dnode.h" -#include "dnodeLog.h" -#include "dnodeRead.h" -#include "dnodeWrite.h" +#include "dnodeInt.h" +#include "dnodeVRead.h" +#include "dnodeVWrite.h" #include "dnodeShell.h" static void (*dnodeProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *); @@ -34,10 +34,43 @@ static void * tsDnodeShellRpc = NULL; static int32_t tsDnodeQueryReqNum = 0; static int32_t tsDnodeSubmitReqNum = 0; +void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg); + int32_t dnodeInitShell() { - dnodeProcessShellMsgFp[TSDB_MSG_TYPE_SUBMIT] = dnodeWrite; - dnodeProcessShellMsgFp[TSDB_MSG_TYPE_QUERY] = dnodeRead; - dnodeProcessShellMsgFp[TSDB_MSG_TYPE_RETRIEVE] = dnodeRead; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_SUBMIT] = dnodeDispatchToVnodeWriteQueue; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_QUERY] = dnodeDispatchToVnodeReadQueue; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_FETCH] = dnodeDispatchToVnodeReadQueue; + + // the following message shall be treated as mnode write + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CONNECT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_ACCT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_ACCT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_ACCT] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_USER] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_USER] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_USER] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DNODE]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DNODE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CREATE_TABLE]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_DROP_TABLE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_TABLE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_ALTER_STREAM]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_QUERY] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_STREAM] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_CONN] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_HEARTBEAT] = mgmtProcessMsgFromShell; + + // the following message shall be treated as mnode query + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_USE_DB] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_TABLE_META] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_STABLE_VGROUP]= mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_TABLES_META] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_SHOW] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_RETRIEVE] = mgmtProcessMsgFromShell; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CONFIG_DNODE]= mgmtProcessMsgFromShell; int32_t numOfThreads = tsNumOfCores * tsNumOfThreadsPerCore; numOfThreads = (int32_t) ((1.0 - tsRatioOfQueryThreads) * numOfThreads / 2.0); @@ -48,7 +81,7 @@ int32_t dnodeInitShell() { SRpcInit rpcInit; memset(&rpcInit, 0, sizeof(rpcInit)); rpcInit.localPort = tsDnodeShellPort; - rpcInit.label = "DND-shell"; + rpcInit.label = "SHELL"; rpcInit.numOfThreads = numOfThreads; rpcInit.cfp = dnodeProcessMsgFromShell; rpcInit.sessions = TSDB_SESSIONS_PER_DNODE; @@ -80,7 +113,7 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) { rpcMsg.contLen = 0; if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_RUNING) { - dError("RPC %p, shell msg is ignored since dnode not running", pMsg->handle); + dError("RPC %p, shell msg:%s is ignored since dnode not running", pMsg->handle, taosMsg[pMsg->msgType]); rpcMsg.code = TSDB_CODE_NOT_READY; rpcSendResponse(&rpcMsg); rpcFreeCont(pMsg->pCont); @@ -96,13 +129,15 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) { if ( dnodeProcessShellMsgFp[pMsg->msgType] ) { (*dnodeProcessShellMsgFp[pMsg->msgType])(pMsg); } else { - dError("RPC %p, msg:%s from shell is not handled", pMsg->handle, taosMsg[pMsg->msgType]); + dError("RPC %p, shell msg:%s is not processed", pMsg->handle, taosMsg[pMsg->msgType]); rpcMsg.code = TSDB_CODE_MSG_NOT_PROCESSED; rpcSendResponse(&rpcMsg); rpcFreeCont(pMsg->pCont); + return; } } + static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) { return TSDB_CODE_SUCCESS; } diff --git a/src/dnode/src/dnodeRead.c b/src/dnode/src/dnodeVRead.c similarity index 97% rename from src/dnode/src/dnodeRead.c rename to src/dnode/src/dnodeVRead.c index efa5dc76951258dba76d5a8ff3d8370728858f41..ff211bf1b289344396193d6692ce494b9360ff17 100644 --- a/src/dnode/src/dnodeRead.c +++ b/src/dnode/src/dnodeVRead.c @@ -21,9 +21,9 @@ #include "trpc.h" #include "twal.h" #include "tglobal.h" -#include "dnodeLog.h" +#include "dnodeInt.h" #include "dnodeMgmt.h" -#include "dnodeRead.h" +#include "dnodeVRead.h" #include "vnode.h" typedef struct { @@ -84,7 +84,7 @@ void dnodeCleanupRead() { dPrint("dnode read is closed"); } -void dnodeRead(SRpcMsg *pMsg) { +void dnodeDispatchToVnodeReadQueue(SRpcMsg *pMsg) { int32_t queuedMsgNum = 0; int32_t leftLen = pMsg->contLen; char *pCont = (char *) pMsg->pCont; @@ -97,7 +97,7 @@ void dnodeRead(SRpcMsg *pMsg) { pHead->vgId = htonl(pHead->vgId); pHead->contLen = htonl(pHead->contLen); - if (pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE) { + if (pMsg->msgType == TSDB_MSG_TYPE_FETCH) { pVnode = vnodeGetVnode(pHead->vgId); } else { pVnode = vnodeAccquireVnode(pHead->vgId); diff --git a/src/dnode/src/dnodeWrite.c b/src/dnode/src/dnodeVWrite.c similarity index 98% rename from src/dnode/src/dnodeWrite.c rename to src/dnode/src/dnodeVWrite.c index 4ca9b1935df4584a9a5e7fe5a35eb27911c66bca..147d2bdfbbc9afb5507327e305a8409c22ba848d 100644 --- a/src/dnode/src/dnodeWrite.c +++ b/src/dnode/src/dnodeVWrite.c @@ -24,8 +24,8 @@ #include "tglobal.h" #include "vnode.h" #include "tdataformat.h" -#include "dnodeLog.h" -#include "dnodeWrite.h" +#include "dnodeInt.h" +#include "dnodeVWrite.h" #include "dnodeMgmt.h" typedef struct { @@ -82,7 +82,7 @@ void dnodeCleanupWrite() { dPrint("dnode write is closed"); } -void dnodeWrite(SRpcMsg *pMsg) { +void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) { char *pCont = (char *)pMsg->pCont; if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT || pMsg->msgType == TSDB_MSG_TYPE_MD_DROP_STABLE) { diff --git a/src/inc/dnode.h b/src/inc/dnode.h index c4b893ab86f1f0b78ddf0053d4dd21d03cabef86..5145a46831bbbf98d88b44c48c8696b5f006d8f6 100644 --- a/src/inc/dnode.h +++ b/src/inc/dnode.h @@ -20,6 +20,8 @@ extern "C" { #endif +#include "trpc.h" + typedef struct { int32_t queryReqNum; int32_t submitReqNum; @@ -47,6 +49,10 @@ void dnodeGetMnodeDnodeIpSet(void *ipSet); void * dnodeGetMnodeInfos(); int32_t dnodeGetDnodeId(); +void dnodeAddClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)); +void dnodeAddServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)); +void dnodeSendMsgToDnode(SRpcIpSet *ipSet, SRpcMsg *rpcMsg); + #ifdef __cplusplus } #endif diff --git a/src/inc/mnode.h b/src/inc/mnode.h index 35f7650c20e344f42ba8821fc0abeba50d035fe1..37fec24c2052c7f2398596c0eba6fd1313c1b15d 100644 --- a/src/inc/mnode.h +++ b/src/inc/mnode.h @@ -26,6 +26,9 @@ void mgmtCleanUpSystem(); void mgmtStopSystem(); void sdbUpdateSync(); +void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg); +void mgmtProcessReqMsgFromDnode(SRpcMsg *rpcMsg); + #ifdef __cplusplus } #endif diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index 499f19b76db2525af59a93e4527aad1c08eb3bd3..571b551368c8139a7527965deb1549ac479866a4 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -339,11 +339,9 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_MAX_NORMAL_TABLES 1000 #define TSDB_MAX_CHILD_TABLES 100000 -#define TSDB_PORT_MNODESHELL 0 -#define TSDB_PORT_DNODESHELL 5 -#define TSDB_PORT_DNODEMNODE 10 -#define TSDB_PORT_MNODEDNODE 15 -#define TSDB_PORT_SYNC 20 +#define TSDB_PORT_DNODESHELL 0 +#define TSDB_PORT_DNODEDNODE 5 +#define TSDB_PORT_SYNC 10 #define TAOS_QTYPE_RPC 0 #define TAOS_QTYPE_FWD 1 diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 19bd96a0637097b626609c2b2c8428bc5ba28c60..fec14bd938687373bca8e0e5f5bf26358fbecb0c 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -39,56 +39,70 @@ enum { TSDB_MESSAGE_NULL = 0, #endif -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_REG, "registration" ) // 1 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" ) // 3 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" ) // 5 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_RETRIEVE, "retrieve" ) // 7 +// message from client to dnode +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_FETCH, "fetch" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY0, "dummy0" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY1, "dummy1" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY2, "dummy2" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY3, "dummy3" ) // message from mnode to dnode -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_TABLE, "create-table" ) // 9 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_TABLE, "drop-table" ) // 11 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_TABLE, "alter-table" ) // 13 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_VNODE, "create-vnode" ) // 15 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_VNODE, "drop-vnode" ) // 17 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_STABLE, "drop-stable" ) // 19 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_STREAM, "alter-stream" ) // 21 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CONFIG_DNODE, "config-dnode" ) // 23 +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_TABLE, "create-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_TABLE, "drop-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_TABLE, "alter-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_VNODE, "create-vnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_VNODE, "drop-vnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_DROP_STABLE, "drop-stable" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_STREAM, "alter-stream" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CONFIG_DNODE, "config-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY4, "dummy4" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY5, "dummy5" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY6, "dummy6" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY7, "dummy7" ) // message from client to mnode -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONNECT, "connect" ) // 31 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_ACCT, "create-acct" ) // 33 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_ACCT, "alter-acct" ) // 35 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_ACCT, "drop-acct" ) // 37 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_USER, "create-user" ) // 39 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_USER, "alter-user" ) // 41 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_USER, "drop-user" ) // 43 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DNODE, "create-dnode" ) // 45 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DNODE, "drop-dnode" ) // 47 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DB, "create-db" ) // 49 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DB, "drop-db" ) // 51 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_USE_DB, "use-db" ) // 53 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_DB, "alter-db" ) // 55 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_TABLE, "create-table" ) // 57 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" ) // 59 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TABLE, "alter-table" ) // 61 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLE_META, "table-meta" ) // 63 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_STABLE_VGROUP, "stable-vgroup" ) // 65 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLES_META, "tables-meta" ) // 67 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_STREAM, "alter-stream" ) // 69 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_SHOW, "show" ) // 71 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_QUERY, "kill-query" ) // 73 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_STREAM, "kill-stream" ) // 75 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_CONN, "kill-conn" ) // 77 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_HEARTBEAT, "heartbeat" ) // 79 +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONNECT, "connect" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_ACCT, "create-acct" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_ACCT, "alter-acct" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_ACCT, "drop-acct" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_USER, "create-user" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_USER, "alter-user" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_USER, "drop-user" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DNODE, "create-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DNODE, "drop-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_DB, "create-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_DB, "drop-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_USE_DB, "use-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_DB, "alter-db" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_TABLE, "create-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TABLE, "alter-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLE_META, "table-meta" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_STABLE_VGROUP, "stable-vgroup" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLES_META, "tables-meta" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_STREAM, "alter-stream" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_SHOW, "show" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_RETRIEVE, "retrieve" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_QUERY, "kill-query" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_STREAM, "kill-stream" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_KILL_CONN, "kill-conn" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONFIG_DNODE, "cm-config-dnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_HEARTBEAT, "heartbeat" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY8, "dummy8" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY9, "dummy9" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY10, "dummy10" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY11, "dummy11" ) // message from dnode to mnode -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_TABLE, "config-table" ) // 91 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_VNODE, "config-vnode" ) // 93 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_STATUS, "status" ) // 95 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_GRANT, "grant" ) // 97 - -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_SYNC, "sdb-sync" ) // 101 -TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_FORWARD, "sdb-forward" ) // 103 +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_TABLE, "config-table" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_CONFIG_VNODE, "config-vnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_STATUS, "status" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DM_GRANT, "grant" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY12, "dummy12" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY13, "dummy13" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY14, "dummy14" ) #ifndef TAOS_MESSAGE_C TSDB_MSG_TYPE_MAX // 105 @@ -96,9 +110,6 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SDB_FORWARD, "sdb-forward" ) // 10 }; -#define TSDB_MSG_TYPE_CM_CONFIG_DNODE TSDB_MSG_TYPE_MD_CONFIG_DNODE -#define TSDB_MSG_TYPE_CM_CONFIG_DNODE_RSP TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP - // IE type #define TSDB_IE_TYPE_SEC 1 #define TSDB_IE_TYPE_META 2 diff --git a/src/inc/tsync.h b/src/inc/tsync.h index 797de063b9a77d9780bbea25fcb4d21c1c316d4f..0d6004bba55f1bff3c4f4e17e14fb65b126dc209 100644 --- a/src/inc/tsync.h +++ b/src/inc/tsync.h @@ -54,8 +54,8 @@ typedef struct { int role[TAOS_SYNC_MAX_REPLICA]; } SNodesRole; -// if name is null, get the file from index or after, used by master -// if name is provided, get the named file at the specified index, used by unsynced node +// if name is empty(name[0] is zero), get the file from index or after, used by master +// if name is provided(name[0] is not zero), get the named file at the specified index, used by unsynced node // it returns the file magic number and size, if file not there, magic shall be 0. typedef uint32_t (*FGetFileInfo)(void *ahandle, char *name, uint32_t *index, int32_t *size); @@ -72,6 +72,9 @@ typedef void (*FConfirmForward)(void *ahandle, void *mhandle, int32_t code); // when role is changed, call this to notify app typedef void (*FNotifyRole)(void *ahandle, int8_t role); +// when data file is synced successfully, notity app +typedef void (*FNotifyFileSynced)(void *ahandle); + typedef struct { int32_t vgId; // vgroup ID uint64_t version; // initial version @@ -84,7 +87,7 @@ typedef struct { FWriteToCache writeToCache; FConfirmForward confirmForward; FNotifyRole notifyRole; - + FNotifyFileSynced notifyFileSynced; } SSyncInfo; typedef void* tsync_h; diff --git a/src/kit/shell/src/shellImport.c b/src/kit/shell/src/shellImport.c index e5c50bb74ef3dea925729056143742fd6101ce3f..b29b96379b5def3ddb60e58400b58c721dc27b7b 100644 --- a/src/kit/shell/src/shellImport.c +++ b/src/kit/shell/src/shellImport.c @@ -229,7 +229,7 @@ static void shellRunImportThreads(struct arguments* args) ShellThreadObj *pThread = threadObj + t; pThread->threadIndex = t; pThread->totalThreads = args->threadNum; - pThread->taos = taos_connect(args->host, args->user, args->password, args->database, tsMnodeShellPort); + pThread->taos = taos_connect(args->host, args->user, args->password, args->database, tsDnodeShellPort); if (pThread->taos == NULL) { fprintf(stderr, "ERROR: thread:%d failed connect to TDengine, error:%s\n", pThread->threadIndex, taos_errstr(pThread->taos)); exit(0); diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index 0d9458e00c5f3060b80bc45cdf8f0d1ac234ecbd..f5a1145cf8994c01dded1685b9e8e70406e51013 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -63,7 +63,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { break; case 'P': if (arg) { - arguments->port = atoi(arg); + tsDnodeShellPort = atoi(arg); } else { fprintf(stderr, "Invalid port\n"); return -1; diff --git a/src/mnode/inc/mgmtDServer.h b/src/mnode/inc/mgmtDServer.h deleted file mode 100644 index 937ae8f1acd46c48a4811195e7aa5916b0a1db73..0000000000000000000000000000000000000000 --- a/src/mnode/inc/mgmtDServer.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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_MGMT_DSERVER_H -#define TDENGINE_MGMT_DSERVER_H - -#ifdef __cplusplus -extern "C" { -#endif - -int32_t mgmtInitDServer(); -void mgmtCleanupDServer(); -void mgmtAddDServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/dnode/inc/dnodeMnode.h b/src/mnode/inc/mgmtServer.h similarity index 85% rename from src/dnode/inc/dnodeMnode.h rename to src/mnode/inc/mgmtServer.h index 76a65a06c9118f8221c1ccac7375280c57ff5bb6..08e4463ad83632d8142c2eb35034eb8523494d26 100644 --- a/src/dnode/inc/dnodeMnode.h +++ b/src/mnode/inc/mgmtServer.h @@ -13,15 +13,15 @@ * along with this program. If not, see . */ -#ifndef TDENGINE_DNODE_MNODE_H -#define TDENGINE_DNODE_MNODE_H +#ifndef TDENGINE_MGMT_DSERVER_H +#define TDENGINE_MGMT_DSERVER_H #ifdef __cplusplus extern "C" { #endif -int32_t dnodeInitMnode(); -void dnodeCleanupMnode(); +int32_t mgmtInitServer(); +void mgmtCleanupServer(); #ifdef __cplusplus } diff --git a/src/mnode/src/mgmtDClient.c b/src/mnode/src/mgmtDClient.c deleted file mode 100644 index 229964e1d612312b3e6084ab3f1fa18e98dfea86..0000000000000000000000000000000000000000 --- a/src/mnode/src/mgmtDClient.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 . - */ - -#define _DEFAULT_SOURCE -#include "os.h" -#include "taoserror.h" -#include "tsched.h" -#include "tsystem.h" -#include "tutil.h" -#include "tglobal.h" -#include "dnode.h" -#include "tgrant.h" -#include "mgmtDef.h" -#include "mgmtLog.h" -#include "mgmtMnode.h" -#include "mgmtDb.h" -#include "mgmtDnode.h" -#include "mgmtProfile.h" -#include "mgmtShell.h" -#include "mgmtTable.h" -#include "mgmtVgroup.h" - -static void mgmtProcessRspFromDnode(SRpcMsg *rpcMsg); -static void (*mgmtProcessDnodeRspFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *rpcMsg); -static void *tsMgmtDClientRpc = NULL; - -int32_t mgmtInitDClient() { - SRpcInit rpcInit = {0}; - rpcInit.localPort = 0; - rpcInit.label = "MND-DC"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = mgmtProcessRspFromDnode; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_CLIENT; - rpcInit.idleTime = tsShellActivityTimer * 1000; - rpcInit.user = "mgmtDClient"; - rpcInit.ckey = "key"; - rpcInit.secret = "secret"; - - tsMgmtDClientRpc = rpcOpen(&rpcInit); - if (tsMgmtDClientRpc == NULL) { - mError("failed to init client connection to dnode"); - return -1; - } - - mPrint("client connection to dnode is opened"); - return 0; -} - -void mgmtCleanupDClient() { - if (tsMgmtDClientRpc) { - rpcClose(tsMgmtDClientRpc); - tsMgmtDClientRpc = NULL; - } -} - -void mgmtAddDClientRspHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { - mgmtProcessDnodeRspFp[msgType] = fp; -} - -void mgmtSendMsgToDnode(SRpcIpSet *ipSet, SRpcMsg *rpcMsg) { - rpcSendRequest(tsMgmtDClientRpc, ipSet, rpcMsg); -} - -static void mgmtProcessRspFromDnode(SRpcMsg *rpcMsg) { - if (mgmtProcessDnodeRspFp[rpcMsg->msgType]) { - (*mgmtProcessDnodeRspFp[rpcMsg->msgType])(rpcMsg); - } else { - mError("%s is not processed in mgmt dclient", taosMsg[rpcMsg->msgType]); - SRpcMsg rpcRsp = {.pCont = 0, .contLen = 0, .code = TSDB_CODE_OPS_NOT_SUPPORT, .handle = rpcMsg->handle}; - rpcSendResponse(&rpcRsp); - } - - rpcFreeCont(rpcMsg->pCont); -} diff --git a/src/mnode/src/mgmtDb.c b/src/mnode/src/mgmtDb.c index c6506a350a56357b4f21d5ea0fa4d38bc13c74c2..5cee1f30cda5984ee8cda49eac9c4790dafa4946 100644 --- a/src/mnode/src/mgmtDb.c +++ b/src/mnode/src/mgmtDb.c @@ -803,7 +803,7 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { newCfg.daysToKeep2 = daysToKeep2; } - if (compression > 0 && compression != pDb->cfg.compression) { + if (compression >= 0 && compression != pDb->cfg.compression) { mTrace("db:%s, compression:%d change to %d", pDb->name, pDb->cfg.compression, compression); newCfg.compression = compression; } @@ -811,20 +811,20 @@ static SDbCfg mgmtGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) { if (replications > 0 && replications != pDb->cfg.replications) { mTrace("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications); newCfg.replications = replications; - } - if (replications > mgmtGetDnodesNum()) { - mError("db:%s, no enough dnode to change replica:%d", pDb->name, replications); - terrno = TSDB_CODE_NO_ENOUGH_DNODES; - } + if (replications > mgmtGetDnodesNum()) { + mError("db:%s, no enough dnode to change replica:%d", pDb->name, replications); + terrno = TSDB_CODE_NO_ENOUGH_DNODES; + } - if (pDb->cfg.replications - replications >= 2) { - mError("db:%s, replica number can't change from 3 to 1", pDb->name, replications); - terrno = TSDB_CODE_INVALID_OPTION; + if (pDb->cfg.replications - replications >= 2) { + mError("db:%s, replica number can't change from 3 to 1", pDb->name, replications); + terrno = TSDB_CODE_INVALID_OPTION; + } } - - if (walLevel < TSDB_MIN_WAL_LEVEL || walLevel > TSDB_MAX_WAL_LEVEL) { - mError("db:%s, wal level should be between 0-2", pDb->name); + + if (walLevel >= 0 && (walLevel < TSDB_MIN_WAL_LEVEL || walLevel > TSDB_MAX_WAL_LEVEL)) { + mError("db:%s, wal level %d should be between 0-2, origin:%d", pDb->name, walLevel, pDb->cfg.walLevel); terrno = TSDB_CODE_INVALID_OPTION; } diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index bb98e1c3e6d8ef43fa0bc3ace647b70f6dd02f83..030123b804869d8afb1be0d1b632be10efca8d0b 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -28,8 +28,6 @@ #include "dnode.h" #include "mgmtDef.h" #include "mgmtLog.h" -#include "mgmtDClient.h" -#include "mgmtDServer.h" #include "mgmtDnode.h" #include "mgmtMnode.h" #include "mgmtSdb.h" @@ -153,8 +151,8 @@ int32_t mgmtInitDnodes() { mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CREATE_DNODE, mgmtProcessCreateDnodeMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_DROP_DNODE, mgmtProcessDropDnodeMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONFIG_DNODE, mgmtProcessCfgDnodeMsg); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp); - mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_STATUS, mgmtProcessDnodeStatusMsg); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp); + dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_STATUS, mgmtProcessDnodeStatusMsg); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_MODULE, mgmtGetModuleMeta); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_MODULE, mgmtRetrieveModules); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_CONFIGS, mgmtGetConfigMeta); @@ -242,7 +240,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) { .pCont = pMdCfgDnode, .contLen = sizeof(SMDCfgDnodeMsg) }; - mgmtSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMdCfgDnodeMsg); rpcRsp.code = TSDB_CODE_SUCCESS; } diff --git a/src/mnode/src/mgmtMain.c b/src/mnode/src/mgmtMain.c index 0f18c95539520e637849dc873299c3eec6fc110b..aa95381df3759e3861bc1d7211ddebaee1894a51 100644 --- a/src/mnode/src/mgmtMain.c +++ b/src/mnode/src/mgmtMain.c @@ -24,12 +24,11 @@ #include "dnode.h" #include "mgmtDef.h" #include "mgmtLog.h" +#include "mgmtServer.h" #include "mgmtAcct.h" #include "mgmtDnode.h" #include "mgmtMnode.h" #include "mgmtDb.h" -#include "mgmtDClient.h" -#include "mgmtDServer.h" #include "mgmtSdb.h" #include "mgmtVgroup.h" #include "mgmtUser.h" @@ -100,11 +99,7 @@ int32_t mgmtStartSystem() { mError("failed to init balance") } - if (mgmtInitDClient() < 0) { - return -1; - } - - if (mgmtInitDServer() < 0) { + if (mgmtInitServer() < 0) { return -1; } @@ -141,8 +136,7 @@ void mgmtCleanUpSystem() { mgmtCleanupMnodes(); balanceCleanUp(); mgmtCleanUpShell(); - mgmtCleanupDClient(); - mgmtCleanupDServer(); + mgmtCleanupServer(); mgmtCleanUpAccts(); mgmtCleanUpTables(); mgmtCleanUpVgroups(); diff --git a/src/mnode/src/mgmtDServer.c b/src/mnode/src/mgmtServer.c similarity index 53% rename from src/mnode/src/mgmtDServer.c rename to src/mnode/src/mgmtServer.c index 1e820be0e961620ef1f7458fc9cdca66a3c8c9aa..2fa6e68f6593e5cd38add2745096606dc1a5447e 100644 --- a/src/mnode/src/mgmtDServer.c +++ b/src/mnode/src/mgmtServer.c @@ -27,7 +27,6 @@ #include "mgmtDef.h" #include "mgmtLog.h" #include "mgmtDb.h" -#include "mgmtDServer.h" #include "mgmtMnode.h" #include "mgmtProfile.h" #include "mgmtShell.h" @@ -35,67 +34,49 @@ #include "mgmtTable.h" #include "mgmtVgroup.h" -static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg); -static int mgmtDServerRetrieveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey); static void (*mgmtProcessDnodeMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *rpcMsg); -static void *tsMgmtDServerRpc; -static void *tsMgmtDServerQhandle = NULL; +static void *tsMgmtServerQhandle = NULL; -int32_t mgmtInitDServer() { - SRpcInit rpcInit = {0}; - rpcInit.localPort = tsMnodeDnodePort; - rpcInit.label = "MND-DS"; - rpcInit.numOfThreads = 1; - rpcInit.cfp = mgmtProcessMsgFromDnode; - rpcInit.sessions = 100; - rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 1000; - rpcInit.afp = mgmtDServerRetrieveAuth; +int32_t mgmtInitServer() { - tsMgmtDServerQhandle = taosInitScheduler(tsMaxShellConns, 1, "MS"); - - tsMgmtDServerRpc = rpcOpen(&rpcInit); - if (tsMgmtDServerRpc == NULL) { - mError("failed to init server connection to dnode"); - return -1; - } + tsMgmtServerQhandle = taosInitScheduler(tsMaxShellConns, 1, "MS"); mPrint("server connection to dnode is opened"); return 0; } -void mgmtCleanupDServer() { - if (tsMgmtDServerQhandle) { - taosCleanUpScheduler(tsMgmtDServerQhandle); - tsMgmtDServerQhandle = NULL; - } - - if (tsMgmtDServerRpc) { - rpcClose(tsMgmtDServerRpc); - tsMgmtDServerRpc = NULL; - mPrint("server connection to dnode is closed"); +void mgmtCleanupServer() { + if (tsMgmtServerQhandle) { + taosCleanUpScheduler(tsMgmtServerQhandle); + tsMgmtServerQhandle = NULL; } } -void mgmtAddDServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { +void dnodeAddServerMsgHandle(uint8_t msgType, void (*fp)(SRpcMsg *rpcMsg)) { mgmtProcessDnodeMsgFp[msgType] = fp; } -static void mgmtProcessDServerRequest(SSchedMsg *sched) { +static void mgmtProcessRequestFromDnode(SSchedMsg *sched) { SRpcMsg *pMsg = sched->msg; (*mgmtProcessDnodeMsgFp[pMsg->msgType])(pMsg); rpcFreeCont(pMsg->pCont); free(pMsg); } -static void mgmtAddToDServerQueue(SRpcMsg *pMsg) { +static void mgmtAddToServerQueue(SRpcMsg *pMsg) { SSchedMsg schedMsg; schedMsg.msg = pMsg; - schedMsg.fp = mgmtProcessDServerRequest; - taosScheduleTask(tsMgmtDServerQhandle, &schedMsg); + schedMsg.fp = mgmtProcessRequestFromDnode; + taosScheduleTask(tsMgmtServerQhandle, &schedMsg); } -static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) { +void mgmtProcessReqMsgFromDnode(SRpcMsg *rpcMsg) { + if (mgmtProcessDnodeMsgFp[rpcMsg->msgType] == NULL) { + mError("%s is not processed in mnode", taosMsg[rpcMsg->msgType]); + mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_MSG_NOT_PROCESSED); + rpcFreeCont(rpcMsg->pCont); + } + if (rpcMsg->pCont == NULL) { mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN); return; @@ -116,17 +97,8 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) { return; } - if (mgmtProcessDnodeMsgFp[rpcMsg->msgType]) { - SRpcMsg *pMsg = malloc(sizeof(SRpcMsg)); - memcpy(pMsg, rpcMsg, sizeof(SRpcMsg)); - mgmtAddToDServerQueue(pMsg); - } else { - mError("%s is not processed in mgmt dserver", taosMsg[rpcMsg->msgType]); - mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_MSG_NOT_PROCESSED); - rpcFreeCont(rpcMsg->pCont); - } + SRpcMsg *pMsg = malloc(sizeof(SRpcMsg)); + memcpy(pMsg, rpcMsg, sizeof(SRpcMsg)); + mgmtAddToServerQueue(pMsg); } -static int mgmtDServerRetrieveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey) { - return TSDB_CODE_SUCCESS; -} diff --git a/src/mnode/src/mgmtShell.c b/src/mnode/src/mgmtShell.c index c86bf2a2dd1334238e632792ff4bb05ee9c0b2f6..7264c850274609969254800592907081c994c7d9 100644 --- a/src/mnode/src/mgmtShell.c +++ b/src/mnode/src/mgmtShell.c @@ -41,9 +41,8 @@ typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn); typedef int32_t (*SShowRetrieveFp)(SShowObj *pShow, char *data, int32_t rows, void *pConn); -static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey); +//static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey); static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg); -static void mgmtProcessMsgFromShell(SRpcMsg *pMsg); static void mgmtProcessUnSupportMsg(SRpcMsg *rpcMsg); static void mgmtProcessShowMsg(SQueuedMsg *queuedMsg); static void mgmtProcessRetrieveMsg(SQueuedMsg *queuedMsg); @@ -52,7 +51,6 @@ static void mgmtProcessConnectMsg(SQueuedMsg *queuedMsg); static void mgmtProcessUseMsg(SQueuedMsg *queuedMsg); void *tsMgmtTmr; -static void *tsMgmtShellRpc = NULL; static void *tsMgmtTranQhandle = NULL; static void (*tsMgmtProcessShellMsgFp[TSDB_MSG_TYPE_MAX])(SQueuedMsg *) = {0}; static void *tsQhandleCache = NULL; @@ -61,7 +59,7 @@ static SShowRetrieveFp tsMgmtShowRetrieveFp[TSDB_MGMT_TABLE_MAX] = {0}; int32_t mgmtInitShell() { mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_SHOW, mgmtProcessShowMsg); - mgmtAddShellMsgHandle(TSDB_MSG_TYPE_RETRIEVE, mgmtProcessRetrieveMsg); + mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_RETRIEVE, mgmtProcessRetrieveMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_HEARTBEAT, mgmtProcessHeartBeatMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONNECT, mgmtProcessConnectMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_USE_DB, mgmtProcessUseMsg); @@ -70,28 +68,6 @@ int32_t mgmtInitShell() { tsMgmtTranQhandle = taosInitScheduler(tsMaxShellConns, 1, "mnodeT"); tsQhandleCache = taosCacheInit(tsMgmtTmr, 2); - int32_t numOfThreads = tsNumOfCores * tsNumOfThreadsPerCore / 4.0; - if (numOfThreads < 1) { - numOfThreads = 1; - } - - SRpcInit rpcInit = {0}; - rpcInit.localPort = tsMnodeShellPort; - rpcInit.label = "MND-shell"; - rpcInit.numOfThreads = numOfThreads; - rpcInit.cfp = mgmtProcessMsgFromShell; - rpcInit.sessions = tsMaxShellConns; - rpcInit.connType = TAOS_CONN_SERVER; - rpcInit.idleTime = tsShellActivityTimer * 1000; - rpcInit.afp = mgmtShellRetriveAuth; - - tsMgmtShellRpc = rpcOpen(&rpcInit); - if (tsMgmtShellRpc == NULL) { - mError("failed to init server connection to shell"); - return -1; - } - - mPrint("server connection to shell is opened"); return 0; } @@ -101,14 +77,7 @@ void mgmtCleanUpShell() { tsMgmtTranQhandle = NULL; } - if (tsMgmtShellRpc) { - rpcClose(tsMgmtShellRpc); - tsMgmtShellRpc = NULL; - mPrint("server connection to shell is closed"); - } - if (tsQhandleCache) { - taosCacheEmpty(tsQhandleCache); taosCacheCleanup(tsQhandleCache); tsQhandleCache = NULL; } @@ -148,8 +117,7 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) { taosTmrReset(mgmtDoDealyedAddToShellQueue, 1000, queuedMsg, tsMgmtTmr, &unUsed); } -static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) { - assert(rpcMsg); +void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) { if (rpcMsg->pCont == NULL) { mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN); @@ -370,6 +338,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) { rpcSendResponse(&rpcRsp); } +/* static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secret, char *ckey) { *spi = 1; *encrypt = 0; @@ -390,6 +359,7 @@ static int mgmtShellRetriveAuth(char *user, char *spi, char *encrypt, char *secr return TSDB_CODE_SUCCESS; } } +*/ static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) { SRpcMsg rpcRsp = {.handle = pMsg->thandle, .pCont = NULL, .contLen = 0, .code = 0, .msgType = 0}; @@ -490,7 +460,7 @@ static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg) { return mgmtCheckTableMetaMsgReadOnly(pMsg); } - if (pMsg->msgType == TSDB_MSG_TYPE_CM_STABLE_VGROUP || pMsg->msgType == TSDB_MSG_TYPE_RETRIEVE || + if (pMsg->msgType == TSDB_MSG_TYPE_CM_STABLE_VGROUP || pMsg->msgType == TSDB_MSG_TYPE_CM_RETRIEVE || pMsg->msgType == TSDB_MSG_TYPE_CM_SHOW || pMsg->msgType == TSDB_MSG_TYPE_CM_TABLES_META || pMsg->msgType == TSDB_MSG_TYPE_CM_CONNECT) { return true; diff --git a/src/mnode/src/mgmtTable.c b/src/mnode/src/mgmtTable.c index 53a208745c7c1e0e1906d10cc9a69d9c7a8ff6a9..9bd2cde2dc8aaa70b28da91d36a9a47503c2e894 100644 --- a/src/mnode/src/mgmtTable.c +++ b/src/mnode/src/mgmtTable.c @@ -24,13 +24,12 @@ #include "tname.h" #include "tidpool.h" #include "tglobal.h" +#include "dnode.h" #include "mgmtDef.h" #include "mgmtLog.h" #include "mgmtAcct.h" -#include "mgmtDClient.h" #include "mgmtDb.h" #include "mgmtDnode.h" -#include "mgmtDServer.h" #include "tgrant.h" #include "mgmtMnode.h" #include "mgmtProfile.h" @@ -539,12 +538,12 @@ int32_t mgmtInitTables() { mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_TABLE_META, mgmtProcessTableMetaMsg); mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_STABLE_VGROUP, mgmtProcessSuperTableVgroupMsg); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_TABLE_RSP, mgmtProcessCreateChildTableRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_TABLE_RSP, mgmtProcessDropChildTableRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_STABLE_RSP, mgmtProcessDropSuperTableRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_ALTER_TABLE_RSP, mgmtProcessAlterTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_TABLE_RSP, mgmtProcessCreateChildTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_TABLE_RSP, mgmtProcessDropChildTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_STABLE_RSP, mgmtProcessDropSuperTableRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_ALTER_TABLE_RSP, mgmtProcessAlterTableRsp); - mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_TABLE, mgmtProcessTableCfgMsg); + dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_TABLE, mgmtProcessTableCfgMsg); mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_TABLE, mgmtGetShowTableMeta); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_TABLE, mgmtRetrieveShowTables); @@ -812,7 +811,7 @@ static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) { if (pVgroup != NULL) { SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup); SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE}; - mgmtSendMsgToDnode(&ipSet, &rpcMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMsg); mgmtDecVgroupRef(pVgroup); } } @@ -1514,7 +1513,7 @@ static void mgmtProcessCreateChildTableMsg(SQueuedMsg *pMsg) { .msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE }; - mgmtSendMsgToDnode(&ipSet, &rpcMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMsg); } static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) { @@ -1552,7 +1551,7 @@ static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) { .msgType = TSDB_MSG_TYPE_MD_DROP_TABLE }; - mgmtSendMsgToDnode(&ipSet, &rpcMsg); + dnodeSendMsgToDnode(&ipSet, &rpcMsg); } static int32_t mgmtModifyChildTableTagValue(SChildTableObj *pTable, char *tagName, char *nContent) { @@ -1854,7 +1853,7 @@ static void mgmtProcessTableCfgMsg(SRpcMsg *rpcMsg) { .code = 0, .msgType = TSDB_MSG_TYPE_MD_CREATE_TABLE }; - mgmtSendMsgToDnode(&ipSet, &rpcRsp); + dnodeSendMsgToDnode(&ipSet, &rpcRsp); mgmtDecTableRef(pTable); mgmtDecDnodeRef(pDnode); diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index 8601be39371e4551303d8cd3eb556c6b739d2458..6be2a734440cbf1c9b7360a9f9a30a61614fb672 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -23,12 +23,11 @@ #include "ttime.h" #include "tbalance.h" #include "tglobal.h" +#include "dnode.h" #include "tdataformat.h" #include "mgmtDef.h" #include "mgmtLog.h" #include "mgmtDb.h" -#include "mgmtDClient.h" -#include "mgmtDServer.h" #include "mgmtDnode.h" #include "mgmtMnode.h" #include "mgmtProfile.h" @@ -218,9 +217,9 @@ int32_t mgmtInitVgroups() { mgmtAddShellShowMetaHandle(TSDB_MGMT_TABLE_VGROUP, mgmtGetVgroupMeta); mgmtAddShellShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mgmtRetrieveVgroups); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mgmtProcessCreateVnodeRsp); - mgmtAddDClientRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mgmtProcessDropVnodeRsp); - mgmtAddDServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mgmtProcessVnodeCfgMsg); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mgmtProcessCreateVnodeRsp); + dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mgmtProcessDropVnodeRsp); + dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mgmtProcessVnodeCfgMsg); mTrace("table:vgroups is created"); @@ -584,7 +583,7 @@ SRpcIpSet mgmtGetIpSetFromVgroup(SVgObj *pVgroup) { }; for (int i = 0; i < pVgroup->numOfVnodes; ++i) { strcpy(ipSet.fqdn[i], pVgroup->vnodeGid[i].pDnode->dnodeFqdn); - ipSet.port[i] = pVgroup->vnodeGid[i].pDnode->dnodePort + TSDB_PORT_DNODEMNODE; + ipSet.port[i] = pVgroup->vnodeGid[i].pDnode->dnodePort + TSDB_PORT_DNODEDNODE; } return ipSet; } @@ -595,7 +594,7 @@ SRpcIpSet mgmtGetIpSetFromIp(char *ep) { ipSet.numOfIps = 1; ipSet.inUse = 0; taosGetFqdnPortFromEp(ep, ipSet.fqdn[0], &ipSet.port[0]); - ipSet.port[0] += TSDB_PORT_DNODEMNODE; + ipSet.port[0] += TSDB_PORT_DNODEDNODE; return ipSet; } @@ -609,7 +608,7 @@ void mgmtSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) { .code = 0, .msgType = TSDB_MSG_TYPE_MD_CREATE_VNODE }; - mgmtSendMsgToDnode(ipSet, &rpcMsg); + dnodeSendMsgToDnode(ipSet, &rpcMsg); } void mgmtSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) { @@ -675,7 +674,7 @@ void mgmtSendDropVnodeMsg(int32_t vgId, SRpcIpSet *ipSet, void *ahandle) { .code = 0, .msgType = TSDB_MSG_TYPE_MD_DROP_VNODE }; - mgmtSendMsgToDnode(ipSet, &rpcMsg); + dnodeSendMsgToDnode(ipSet, &rpcMsg); } static void mgmtSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle) { diff --git a/src/plugins/http/src/httpServer.c b/src/plugins/http/src/httpServer.c index 9b8affcde256065ef97709976afa7b4f5dc8ada5..51795a570d2a25360561938642cd175623244bd7 100644 --- a/src/plugins/http/src/httpServer.c +++ b/src/plugins/http/src/httpServer.c @@ -269,11 +269,12 @@ void httpCleanUpConnect(HttpServer *pServer) { for (i = 0; i < pServer->numOfThreads; ++i) { pThread = pServer->pThreads + i; + if (pThread == NULL) continue; //taosCloseSocket(pThread->pollFd); - while (pThread->pHead) { - httpCleanUpContext(pThread->pHead, 0); - } + //while (pThread->pHead) { + // httpCleanUpContext(pThread->pHead, 0); + //} pthread_cancel(pThread->thread); pthread_join(pThread->thread, NULL); @@ -504,8 +505,8 @@ void httpAcceptHttpConnection(void *arg) { sockFd = taosOpenTcpServerSocket(pServer->serverIp, pServer->serverPort); if (sockFd < 0) { - httpError("http server:%s, failed to open http socket, ip:%s:%u", pServer->label, pServer->serverIp, - pServer->serverPort); + httpError("http server:%s, failed to open http socket, ip:%s:%u error:%s", pServer->label, taosIpStr(pServer->serverIp), + pServer->serverPort, strerror(errno)); return; } else { httpPrint("http service init success at %u", pServer->serverPort); @@ -645,7 +646,7 @@ bool httpInitConnect(HttpServer *pServer) { } pthread_attr_destroy(&thattr); - httpTrace("http server:%s, initialized, ip:%s:%u, numOfThreads:%d", pServer->label, pServer->serverIp, + httpTrace("http server:%s, initialized, ip:%s:%u, numOfThreads:%d", pServer->label, taosIpStr(pServer->serverIp), pServer->serverPort, pServer->numOfThreads); return true; } diff --git a/src/plugins/http/src/httpSystem.c b/src/plugins/http/src/httpSystem.c index 89dc11796faa043bb96e88566e0fd27cd7679f3b..8b95077632a48f09491cf2998b56500441a3be80 100644 --- a/src/plugins/http/src/httpSystem.c +++ b/src/plugins/http/src/httpSystem.c @@ -117,7 +117,7 @@ void httpCleanUpSystem() { httpPrint("http service cleanup"); httpStopSystem(); -#if 0 +//#if 0 if (httpServer == NULL) { return; } @@ -131,7 +131,13 @@ void httpCleanUpSystem() { httpServer->timerHandle = NULL; } - httpCleanUpConnect(httpServer); + if (httpServer->pThreads != NULL) { + httpCleanUpConnect(httpServer); + httpServer->pThreads = NULL; + } + + +#if 0 httpRemoveAllSessions(httpServer); if (httpServer->pContextPool != NULL) { diff --git a/src/plugins/monitor/src/monitorMain.c b/src/plugins/monitor/src/monitorMain.c index a4f9f320503ed99d6ca6b5b9941274829f6b3edd..7836dbae85369bac1dceec392f3f8da8ae4ce2df 100644 --- a/src/plugins/monitor/src/monitorMain.c +++ b/src/plugins/monitor/src/monitorMain.c @@ -44,7 +44,7 @@ #define SQL_LENGTH 1024 #define LOG_LEN_STR 80 -#define IP_LEN_STR 15 +#define IP_LEN_STR 18 #define CHECK_INTERVAL 1000 typedef enum { @@ -115,6 +115,13 @@ static void monitorInitConn(void *para, void *unused) { if (tsMonitorConn.ep[0] == 0) strcpy(tsMonitorConn.ep, tsLocalEp); + int len = strlen(tsMonitorConn.ep); + for (int i = 0; i < len; ++i) { + if (tsMonitorConn.ep[i] == ':' || tsMonitorConn.ep[i] == '-') { + tsMonitorConn.ep[i] = '_'; + } + } + if (tsMonitorConn.conn == NULL) { taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, monitorInitConnCb, &tsMonitorConn, &(tsMonitorConn.conn)); } else { @@ -141,8 +148,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { if (cmd == MONITOR_CMD_CREATE_DB) { snprintf(sql, SQL_LENGTH, - "create database if not exists %s replica 1 days 10 keep 30 rows 1024 cache 2048 " - "ablocks 2 tblocks 32 tables 32 precision 'us'", + "create database if not exists %s replica 1 days 10 keep 30 cache 2 " + "blocks 2 maxtables 32 precision 'us'", tsMonitorDbName); } else if (cmd == MONITOR_CMD_CREATE_MT_DN) { snprintf(sql, SQL_LENGTH, @@ -154,7 +161,7 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { ", io_read float, io_write float" ", req_http int, req_select int, req_insert int" ") tags (ipaddr binary(%d))", - tsMonitorDbName, IP_LEN_STR + 1); + tsMonitorDbName, TSDB_FQDN_LEN + 1); } else if (cmd == MONITOR_CMD_CREATE_TB_DN) { snprintf(sql, SQL_LENGTH, "create table if not exists %s.dn_%s using %s.dn tags('%s')", tsMonitorDbName, tsMonitorConn.ep, tsMonitorDbName, tsLocalEp); diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 20404511f68e8e34db4098d8297f733d75740ad8..39d773f6a298f2a8cb01162f39f55a72029b3aef 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -363,7 +363,7 @@ void rpcSendRequest(void *shandle, const SRpcIpSet *pIpSet, const SRpcMsg *pMsg) // connection type is application specific. // for TDengine, all the query, show commands shall have TCP connection char type = pMsg->msgType; - if (type == TSDB_MSG_TYPE_QUERY || type == TSDB_MSG_TYPE_RETRIEVE || + if (type == TSDB_MSG_TYPE_QUERY || type == TSDB_MSG_TYPE_CM_RETRIEVE || type == TSDB_MSG_TYPE_FETCH || type == TSDB_MSG_TYPE_CM_STABLE_VGROUP || type == TSDB_MSG_TYPE_CM_TABLES_META || type == TSDB_MSG_TYPE_CM_SHOW ) pContext->connType = RPC_CONN_TCPC; @@ -802,7 +802,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) { pHead->code = htonl(pHead->code); if (terrno == 0) { - if (pHead->msgType != TSDB_MSG_TYPE_REG && pHead->encrypt) { + if (pHead->encrypt) { // decrypt here } diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index 1260a34512531f5644f51419c676953ad44998a4..38458c71d21fed1b0eadd67afd80a9d542934de6 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -188,7 +188,7 @@ static void taosAcceptTcpConnection(void *arg) { sockFd = taosOpenTcpServerSocket(pServerObj->ip, pServerObj->port); if (sockFd < 0) return; - tTrace("%s TCP server is ready, ip:%s:%hu", pServerObj->label, pServerObj->ip, pServerObj->port); + tTrace("%s TCP server is ready, ip:0x%x:%hu", pServerObj->label, pServerObj->ip, pServerObj->port); while (1) { socklen_t addrlen = sizeof(caddr); diff --git a/src/rpc/test/rserver.c b/src/rpc/test/rserver.c index 0569a163d1207431589bac4aca0fd34779182748..9f781ef276dc2788ae5bf7470431465649d7e542 100644 --- a/src/rpc/test/rserver.c +++ b/src/rpc/test/rserver.c @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) { commit = atoi(argv[++i]); } else if (strcmp(argv[i], "-d")==0 && i < argc-1) { rpcDebugFlag = atoi(argv[++i]); - ddebugFlag = rpcDebugFlag; + dDebugFlag = rpcDebugFlag; uDebugFlag = rpcDebugFlag; } else { printf("\nusage: %s [options] \n", argv[0]); diff --git a/src/util/src/tcache.c b/src/util/src/tcache.c index 63fe124de28b982c46305af652eb2cad3c841754..02a5b931412c874d54dc3bb99e28574340e385d5 100644 --- a/src/util/src/tcache.c +++ b/src/util/src/tcache.c @@ -304,9 +304,9 @@ static FORCE_INLINE SCacheDataNode *taosAddToCacheImpl(SCacheObj *pCacheObj, con static void doCleanupDataCache(SCacheObj *pCacheObj) { __cache_wr_lock(pCacheObj); - if (taosHashGetSize(pCacheObj->pHashTable) > 0) { - taosHashCleanup(pCacheObj->pHashTable); - } + //if (taosHashGetSize(pCacheObj->pHashTable) > 0) { + taosHashCleanup(pCacheObj->pHashTable); + //} __cache_unlock(pCacheObj); diff --git a/src/vnode/inc/vnodeInt.h b/src/vnode/inc/vnodeInt.h index d99cb1c96c044f83305f05829b2565f79d4993d0..d4842fdf7fb305f41d2d39799cae98a746d2da52 100644 --- a/src/vnode/inc/vnodeInt.h +++ b/src/vnode/inc/vnodeInt.h @@ -20,8 +20,17 @@ extern "C" { #endif +#include "tlog.h" #include "tsync.h" #include "twal.h" +#include "tcq.h" + +extern int32_t vDebugFlag; + +#define vError(...) if (vDebugFlag & DEBUG_ERROR) {taosPrintLog("ERROR VND ", 255, __VA_ARGS__); } +#define vWarn(...) if (vDebugFlag & DEBUG_WARN) {taosPrintLog("WARN VND ", vDebugFlag, __VA_ARGS__); } +#define vTrace(...) if (vDebugFlag & DEBUG_TRACE) {taosPrintLog("VND ", vDebugFlag, __VA_ARGS__); } +#define vPrint(...) {taosPrintLog("VND ", 255, __VA_ARGS__); } typedef struct { int32_t vgId; // global vnode group ID diff --git a/src/vnode/inc/vnodeLog.h b/src/vnode/inc/vnodeLog.h index 450220e17f60e6e1c9e36cc3c301958fd146237b..bd8daae0b637c75188539e4cd7f9fb9579ede3c6 100644 --- a/src/vnode/inc/vnodeLog.h +++ b/src/vnode/inc/vnodeLog.h @@ -22,19 +22,19 @@ extern "C" { #include "tlog.h" -extern int32_t ddebugFlag; +extern int32_t dDebugFlag; #define dError(...) \ - if (ddebugFlag & DEBUG_ERROR) { \ + if (dDebugFlag & DEBUG_ERROR) { \ taosPrintLog("ERROR DND ", 255, __VA_ARGS__); \ } #define dWarn(...) \ - if (ddebugFlag & DEBUG_WARN) { \ - taosPrintLog("WARN DND ", ddebugFlag, __VA_ARGS__); \ + if (dDebugFlag & DEBUG_WARN) { \ + taosPrintLog("WARN DND ", dDebugFlag, __VA_ARGS__); \ } #define dTrace(...) \ - if (ddebugFlag & DEBUG_TRACE) { \ - taosPrintLog("DND ", ddebugFlag, __VA_ARGS__); \ + if (dDebugFlag & DEBUG_TRACE) { \ + taosPrintLog("DND ", dDebugFlag, __VA_ARGS__); \ } #define dPrint(...) \ { taosPrintLog("DND ", 255, __VA_ARGS__); } diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index f5d7bd45a74233c9245a1bcc47aa9ef50b18e781..6ffac08b4e5bd7c2bb3f4ce25292cc87276b1553 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -24,14 +24,10 @@ #include "ttime.h" #include "ttimer.h" #include "cJSON.h" -#include "twal.h" #include "tglobal.h" #include "dnode.h" #include "vnode.h" #include "vnodeInt.h" -#include "vnodeLog.h" -#include "tcq.h" -//#include "tsync.h" static int32_t tsOpennedVnodes; static void *tsDnodeVnodesHash; @@ -46,6 +42,7 @@ static int vnodeWalCallback(void *arg); static uint32_t vnodeGetFileInfo(void *ahandle, char *name, uint32_t *index, int32_t *size); static int vnodeGetWalInfo(void *ahandle, char *name, uint32_t *index); static void vnodeNotifyRole(void *ahandle, int8_t role); +static void vnodeNotifyFileSynced(void *ahandle); static pthread_once_t vnodeModuleInit = PTHREAD_ONCE_INIT; @@ -64,7 +61,7 @@ static void vnodeInit() { tsDnodeVnodesHash = taosInitIntHash(TSDB_MAX_VNODES, sizeof(SVnodeObj *), taosHashInt); if (tsDnodeVnodesHash == NULL) { - dError("failed to init vnode list"); + vError("failed to init vnode list"); } } @@ -74,7 +71,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { SVnodeObj *pTemp = (SVnodeObj *)taosGetIntHashData(tsDnodeVnodesHash, pVnodeCfg->cfg.vgId); if (pTemp != NULL) { - dPrint("vgId:%d, vnode already exist, pVnode:%p", pVnodeCfg->cfg.vgId, pTemp); + vPrint("vgId:%d, vnode already exist, pVnode:%p", pVnodeCfg->cfg.vgId, pTemp); return TSDB_CODE_SUCCESS; } @@ -93,7 +90,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { code = vnodeSaveCfg(pVnodeCfg); if (code != TSDB_CODE_SUCCESS) { - dError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); + vError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); return code; } @@ -113,11 +110,11 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { sprintf(tsdbDir, "%s/vnode%d/tsdb", tsVnodeDir, pVnodeCfg->cfg.vgId); code = tsdbCreateRepo(tsdbDir, &tsdbCfg, NULL); if (code != TSDB_CODE_SUCCESS) { - dError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); + vError("vgId:%d, failed to create tsdb in vnode, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); return TSDB_CODE_VG_INIT_FAILED; } - dPrint("vgId:%d, vnode is created, clog:%d", pVnodeCfg->cfg.vgId, pVnodeCfg->cfg.walLevel); + vPrint("vgId:%d, vnode is created, clog:%d", pVnodeCfg->cfg.vgId, pVnodeCfg->cfg.walLevel); code = vnodeOpen(pVnodeCfg->cfg.vgId, rootDir); return code; @@ -126,12 +123,12 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { int32_t vnodeDrop(int32_t vgId) { SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId); if (ppVnode == NULL || *ppVnode == NULL) { - dTrace("vgId:%d, failed to drop, vgId not exist", vgId); + vTrace("vgId:%d, failed to drop, vgId not exist", vgId); return TSDB_CODE_INVALID_VGROUP_ID; } SVnodeObj *pVnode = *ppVnode; - dTrace("pVnode:%p vgId:%d, vnode will be dropped", pVnode, pVnode->vgId); + vTrace("vgId:%d, vnode will be dropped", pVnode->vgId); pVnode->status = TAOS_VN_STATUS_DELETING; vnodeCleanUp(pVnode); @@ -144,34 +141,34 @@ int32_t vnodeAlter(void *param, SMDCreateVnodeMsg *pVnodeCfg) { int32_t code = vnodeSaveCfg(pVnodeCfg); if (code != TSDB_CODE_SUCCESS) { - dError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); + vError("vgId:%d, failed to save vnode cfg, reason:%s", pVnodeCfg->cfg.vgId, tstrerror(code)); return code; } code = vnodeReadCfg(pVnode); if (code != TSDB_CODE_SUCCESS) { - dError("pVnode:%p vgId:%d, failed to read cfg file", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read cfg file", pVnode->vgId); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId); return code; } code = syncReconfig(pVnode->sync, &pVnode->syncCfg); if (code != TSDB_CODE_SUCCESS) { - dTrace("pVnode:%p vgId:%d, failed to alter vnode, canot reconfig sync, result:%s", pVnode, pVnode->vgId, + vTrace("vgId:%d, failed to alter vnode, canot reconfig sync, result:%s", pVnode->vgId, tstrerror(code)); return code; } code = tsdbConfigRepo(pVnode->tsdb, &pVnode->tsdbCfg); if (code != TSDB_CODE_SUCCESS) { - dTrace("pVnode:%p vgId:%d, failed to alter vnode, canot reconfig tsdb, result:%s", pVnode, pVnode->vgId, + vTrace("vgId:%d, failed to alter vnode, canot reconfig tsdb, result:%s", pVnode->vgId, tstrerror(code)); return code; } pVnode->status = TAOS_VN_STATUS_READY; - dTrace("pVnode:%p vgId:%d, vnode is altered", pVnode, pVnode->vgId); + vTrace("vgId:%d, vnode is altered", pVnode->vgId); return TSDB_CODE_SUCCESS; } @@ -189,7 +186,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { int32_t code = vnodeReadCfg(pVnode); if (code != TSDB_CODE_SUCCESS) { - dError("pVnode:%p vgId:%d, failed to read cfg file", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read cfg file", pVnode->vgId); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId); return code; } @@ -214,7 +211,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { sprintf(temp, "%s/tsdb", rootDir); pVnode->tsdb = tsdbOpenRepo(temp, &appH); if (pVnode->tsdb == NULL) { - dError("pVnode:%p vgId:%d, failed to open tsdb at %s(%s)", pVnode, pVnode->vgId, temp, tstrerror(terrno)); + vError("vgId:%d, failed to open tsdb at %s(%s)", pVnode->vgId, temp, tstrerror(terrno)); taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId); return terrno; } @@ -234,6 +231,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { syncInfo.writeToCache = vnodeWriteToQueue; syncInfo.confirmForward = dnodeSendRpcWriteRsp; syncInfo.notifyRole = vnodeNotifyRole; + syncInfo.notifyFileSynced = vnodeNotifyFileSynced; pVnode->sync = syncStart(&syncInfo); // start continuous query @@ -243,7 +241,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { pVnode->events = NULL; pVnode->status = TAOS_VN_STATUS_READY; - dTrace("pVnode:%p vgId:%d, vnode is opened in %s", pVnode, pVnode->vgId, rootDir); + vTrace("vgId:%d, vnode is opened in %s, pVnode:%p", pVnode->vgId, rootDir, pVnode); atomic_add_fetch_32(&tsOpennedVnodes, 1); return TSDB_CODE_SUCCESS; @@ -254,7 +252,7 @@ int32_t vnodeClose(int32_t vgId) { if (ppVnode == NULL || *ppVnode == NULL) return 0; SVnodeObj *pVnode = *ppVnode; - dTrace("pVnode:%p vgId:%d, vnode will be closed", pVnode, pVnode->vgId); + vTrace("vgId:%d, vnode will be closed", pVnode->vgId); pVnode->status = TAOS_VN_STATUS_CLOSING; vnodeCleanUp(pVnode); @@ -269,7 +267,7 @@ void vnodeRelease(void *pVnodeRaw) { assert(refCount >= 0); if (refCount > 0) { - dTrace("pVnode:%p vgId:%d, release vnode, refCount:%d", pVnode, vgId, refCount); + vTrace("vgId:%d, release vnode, refCount:%d", pVnode, vgId, refCount); return; } @@ -290,7 +288,7 @@ void vnodeRelease(void *pVnodeRaw) { free(pVnode); int32_t count = atomic_sub_fetch_32(&tsOpennedVnodes, 1); - dTrace("pVnode:%p vgId:%d, vnode is released, vnodes:%d", pVnode, vgId, count); + vTrace("vgId:%d, vnode is released, vnodes:%d", pVnode, vgId, count); if (count <= 0) { taosCleanUpIntHash(tsDnodeVnodesHash); @@ -303,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; - dPrint("vgId:%d not exist", vgId); + vPrint("vgId:%d not exist", vgId); return NULL; } @@ -315,7 +313,7 @@ void *vnodeAccquireVnode(int32_t vgId) { if (pVnode == NULL) return pVnode; atomic_add_fetch_32(&pVnode->refCount, 1); - dTrace("pVnode:%p vgId:%d, get vnode, refCount:%d", pVnode, pVnode->vgId, pVnode->refCount); + vTrace("vgId:%d, get vnode, refCount:%d", pVnode->vgId, pVnode->refCount); return pVnode; } @@ -405,12 +403,19 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) { cqStop(pVnode->cq); } +static void vnodeNotifyFileSynced(void *ahandle) { + SVnodeObj *pVnode = ahandle; + vTrace("pVnode:%p vgId:%d, data file is synced", pVnode, pVnode->vgId); + + // clsoe tsdb, then open tsdb +} + static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) { char cfgFile[TSDB_FILENAME_LEN + 30] = {0}; sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnodeCfg->cfg.vgId); FILE *fp = fopen(cfgFile, "w"); if (!fp) { - dError("vgId:%d, failed to open vnode cfg file for write, file:%s error:%s", pVnodeCfg->cfg.vgId, cfgFile, + vError("vgId:%d, failed to open vnode cfg file for write, file:%s error:%s", pVnodeCfg->cfg.vgId, cfgFile, strerror(errno)); return errno; } @@ -456,7 +461,7 @@ static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) { fclose(fp); free(content); - dPrint("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId); + vPrint("vgId:%d, save vnode cfg successed", pVnodeCfg->cfg.vgId); return 0; } @@ -466,7 +471,7 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { sprintf(cfgFile, "%s/vnode%d/config.json", tsVnodeDir, pVnode->vgId); FILE *fp = fopen(cfgFile, "r"); if (!fp) { - dError("pVnode:%p vgId:%d, failed to open vnode cfg file for read, file:%s, error:%s", pVnode, pVnode->vgId, + vError("vgId:%d, failed to open vnode cfg file for read, file:%s, error:%s", pVnode->vgId, cfgFile, strerror(errno)); return errno; } @@ -478,117 +483,117 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { if (len <= 0) { free(content); fclose(fp); - dError("pVnode:%p vgId:%d, failed to read vnode cfg, content is null", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, content is null", pVnode->vgId); return false; } cJSON *root = cJSON_Parse(content); if (root == NULL) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, invalid json format", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, invalid json format", pVnode->vgId); goto PARSE_OVER; } cJSON *cfgVersion = cJSON_GetObjectItem(root, "cfgVersion"); if (!cfgVersion || cfgVersion->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, cfgVersion not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, cfgVersion not found", pVnode->vgId); goto PARSE_OVER; } pVnode->cfgVersion = cfgVersion->valueint; cJSON *cacheBlockSize = cJSON_GetObjectItem(root, "cacheBlockSize"); if (!cacheBlockSize || cacheBlockSize->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, cacheBlockSize not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, cacheBlockSize not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.cacheBlockSize = cacheBlockSize->valueint; cJSON *totalBlocks = cJSON_GetObjectItem(root, "totalBlocks"); if (!totalBlocks || totalBlocks->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, totalBlocks not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, totalBlocks not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.totalBlocks = totalBlocks->valueint; cJSON *maxTables = cJSON_GetObjectItem(root, "maxTables"); if (!maxTables || maxTables->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, maxTables not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, maxTables not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.maxTables = maxTables->valueint; cJSON *daysPerFile = cJSON_GetObjectItem(root, "daysPerFile"); if (!daysPerFile || daysPerFile->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysPerFile not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysPerFile not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.daysPerFile = daysPerFile->valueint; cJSON *daysToKeep = cJSON_GetObjectItem(root, "daysToKeep"); if (!daysToKeep || daysToKeep->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysToKeep not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysToKeep not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.keep = daysToKeep->valueint; cJSON *daysToKeep1 = cJSON_GetObjectItem(root, "daysToKeep1"); if (!daysToKeep1 || daysToKeep1->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysToKeep1 not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysToKeep1 not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.keep1 = daysToKeep1->valueint; cJSON *daysToKeep2 = cJSON_GetObjectItem(root, "daysToKeep2"); if (!daysToKeep2 || daysToKeep2->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, daysToKeep2 not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, daysToKeep2 not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.keep2 = daysToKeep2->valueint; cJSON *minRowsPerFileBlock = cJSON_GetObjectItem(root, "minRowsPerFileBlock"); if (!minRowsPerFileBlock || minRowsPerFileBlock->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, minRowsPerFileBlock not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, minRowsPerFileBlock not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.minRowsPerFileBlock = minRowsPerFileBlock->valueint; cJSON *maxRowsPerFileBlock = cJSON_GetObjectItem(root, "maxRowsPerFileBlock"); if (!maxRowsPerFileBlock || maxRowsPerFileBlock->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, maxRowsPerFileBlock not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, maxRowsPerFileBlock not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.maxRowsPerFileBlock = maxRowsPerFileBlock->valueint; cJSON *commitTime = cJSON_GetObjectItem(root, "commitTime"); if (!commitTime || commitTime->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, commitTime not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, commitTime not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.commitTime = (int8_t)commitTime->valueint; cJSON *precision = cJSON_GetObjectItem(root, "precision"); if (!precision || precision->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, precision not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, precision not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.precision = (int8_t)precision->valueint; cJSON *compression = cJSON_GetObjectItem(root, "compression"); if (!compression || compression->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, compression not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, compression not found", pVnode->vgId); goto PARSE_OVER; } pVnode->tsdbCfg.compression = (int8_t)compression->valueint; cJSON *walLevel = cJSON_GetObjectItem(root, "walLevel"); if (!walLevel || walLevel->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, walLevel not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, walLevel not found", pVnode->vgId); goto PARSE_OVER; } pVnode->walCfg.walLevel = (int8_t) walLevel->valueint; cJSON *wals = cJSON_GetObjectItem(root, "wals"); if (!wals || wals->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, wals not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, wals not found", pVnode->vgId); goto PARSE_OVER; } pVnode->walCfg.wals = (int8_t)wals->valueint; @@ -596,27 +601,27 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { cJSON *replica = cJSON_GetObjectItem(root, "replica"); if (!replica || replica->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, replica not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, replica not found", pVnode->vgId); goto PARSE_OVER; } pVnode->syncCfg.replica = (int8_t)replica->valueint; cJSON *quorum = cJSON_GetObjectItem(root, "quorum"); if (!quorum || quorum->type != cJSON_Number) { - dError("failed to read vnode cfg, quorum not found", pVnode, pVnode->vgId); + vError("failed to read vnode cfg, quorum not found", pVnode->vgId); goto PARSE_OVER; } pVnode->syncCfg.quorum = (int8_t)quorum->valueint; cJSON *nodeInfos = cJSON_GetObjectItem(root, "nodeInfos"); if (!nodeInfos || nodeInfos->type != cJSON_Array) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeInfos not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeInfos not found", pVnode->vgId); goto PARSE_OVER; } int size = cJSON_GetArraySize(nodeInfos); if (size != pVnode->syncCfg.replica) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeInfos size not matched", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeInfos size not matched", pVnode->vgId); goto PARSE_OVER; } @@ -626,14 +631,14 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { cJSON *nodeId = cJSON_GetObjectItem(nodeInfo, "nodeId"); if (!nodeId || nodeId->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeId not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeId not found", pVnode->vgId); goto PARSE_OVER; } pVnode->syncCfg.nodeInfo[i].nodeId = nodeId->valueint; cJSON *nodeEp = cJSON_GetObjectItem(nodeInfo, "nodeEp"); if (!nodeEp || nodeEp->type != cJSON_String || nodeEp->valuestring == NULL) { - dError("pVnode:%p vgId:%d, failed to read vnode cfg, nodeFqdn not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode cfg, nodeFqdn not found", pVnode->vgId); goto PARSE_OVER; } @@ -643,9 +648,9 @@ static int32_t vnodeReadCfg(SVnodeObj *pVnode) { ret = 0; - dPrint("pVnode:%p vgId:%d, read vnode cfg successed, replcia:%d", pVnode, pVnode->vgId, pVnode->syncCfg.replica); + vPrint("vgId:%d, read vnode cfg successed, replcia:%d", pVnode->vgId, pVnode->syncCfg.replica); for (int32_t i = 0; i < pVnode->syncCfg.replica; i++) { - dPrint("pVnode:%p vgId:%d, dnode:%d, %s:%d", pVnode, pVnode->vgId, pVnode->syncCfg.nodeInfo[i].nodeId, + vPrint("vgId:%d, dnode:%d, %s:%d", pVnode->vgId, pVnode->syncCfg.nodeInfo[i].nodeId, pVnode->syncCfg.nodeInfo[i].nodeFqdn, pVnode->syncCfg.nodeInfo[i].nodePort); } @@ -661,7 +666,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) { sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId); FILE *fp = fopen(versionFile, "w"); if (!fp) { - dError("pVnode:%p vgId:%d, failed to open vnode version file for write, file:%s error:%s", pVnode, pVnode->vgId, + vError("vgId:%d, failed to open vnode version file for write, file:%s error:%s", pVnode->vgId, versionFile, strerror(errno)); return errno; } @@ -678,7 +683,7 @@ static int32_t vnodeSaveVersion(SVnodeObj *pVnode) { fclose(fp); free(content); - dPrint("pVnode:%p vgId:%d, save vnode version:%" PRId64 " successed", pVnode, pVnode->vgId, pVnode->version); + vPrint("vgId:%d, save vnode version:%" PRId64 " successed", pVnode->vgId, pVnode->version); return 0; } @@ -688,7 +693,7 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) { sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId); FILE *fp = fopen(versionFile, "r"); if (!fp) { - dTrace("pVnode:%p vgId:%d, failed to open version file:%s error:%s", pVnode, pVnode->vgId, + vTrace("vgId:%d, failed to open version file:%s error:%s", pVnode->vgId, versionFile, strerror(errno)); return false; } @@ -700,26 +705,26 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) { if (len <= 0) { free(content); fclose(fp); - dPrint("pVnode:%p vgId:%d, failed to read vnode version, content is null", pVnode, pVnode->vgId); + vPrint("vgId:%d, failed to read vnode version, content is null", pVnode->vgId); return false; } cJSON *root = cJSON_Parse(content); if (root == NULL) { - dError("pVnode:%p vgId:%d, failed to read vnode version, invalid json format", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode version, invalid json format", pVnode->vgId); goto PARSE_OVER; } cJSON *version = cJSON_GetObjectItem(root, "version"); if (!version || version->type != cJSON_Number) { - dError("pVnode:%p vgId:%d, failed to read vnode version, version not found", pVnode, pVnode->vgId); + vError("vgId:%d, failed to read vnode version, version not found", pVnode->vgId); goto PARSE_OVER; } pVnode->version = version->valueint; ret = true; - dPrint("pVnode:%p vgId:%d, read vnode version successed, version:%%" PRId64, pVnode, pVnode->vgId, pVnode->version); + vPrint("vgId:%d, read vnode version successed, version:%%" PRId64, pVnode->vgId, pVnode->version); PARSE_OVER: free(content); diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c index b111f56e390cd1e69ed8d10591686db39b7ea44a..d2dd1811cf61cf3c5f30964942d428cebf570a77 100644 --- a/src/vnode/src/vnodeRead.c +++ b/src/vnode/src/vnodeRead.c @@ -29,11 +29,11 @@ static int32_t (*vnodeProcessReadMsgFp[TSDB_MSG_TYPE_MAX])(SVnodeObj *, void *pCont, int32_t contLen, SRspRet *pRet); static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet); -static int32_t vnodeProcessRetrieveMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet); +static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet); void vnodeInitReadFp(void) { - vnodeProcessReadMsgFp[TSDB_MSG_TYPE_QUERY] = vnodeProcessQueryMsg; - vnodeProcessReadMsgFp[TSDB_MSG_TYPE_RETRIEVE] = vnodeProcessRetrieveMsg; + vnodeProcessReadMsgFp[TSDB_MSG_TYPE_QUERY] = vnodeProcessQueryMsg; + vnodeProcessReadMsgFp[TSDB_MSG_TYPE_FETCH] = vnodeProcessFetchMsg; } int32_t vnodeProcessRead(void *param, int msgType, void *pCont, int32_t contLen, SRspRet *ret) { @@ -65,7 +65,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont pRet->len = sizeof(SQueryTableRsp); pRet->rsp = pRsp; - dTrace("pVnode:%p vgId:%d QInfo:%p, dnode query msg disposed", pVnode, pVnode->vgId, pQInfo); + vTrace("vgId:%d QInfo:%p, dnode query msg disposed", pVnode->vgId, pQInfo); } else { pQInfo = pCont; code = TSDB_CODE_ACTION_IN_PROGRESS; @@ -76,14 +76,14 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, void *pCont, int32_t cont return code; } -static int32_t vnodeProcessRetrieveMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet) { +static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, void *pCont, int32_t contLen, SRspRet *pRet) { SRetrieveTableMsg *pRetrieve = pCont; void *pQInfo = (void*) htobe64(pRetrieve->qhandle); memset(pRet, 0, sizeof(SRspRet)); int32_t code = TSDB_CODE_SUCCESS; - dTrace("pVnode:%p vgId:%d QInfo:%p, retrieve msg is received", pVnode, pVnode->vgId, pQInfo); + vTrace("vgId:%d QInfo:%p, retrieve msg is received", pVnode->vgId, pQInfo); pRet->code = qRetrieveQueryResultInfo(pQInfo); if (pRet->code != TSDB_CODE_SUCCESS) { @@ -104,6 +104,6 @@ static int32_t vnodeProcessRetrieveMsg(SVnodeObj *pVnode, void *pCont, int32_t c } } - dTrace("pVnode:%p vgId:%d QInfo:%p, retrieve msg is disposed", pVnode, pVnode->vgId, pQInfo); + vTrace("vgId:%d QInfo:%p, retrieve msg is disposed", pVnode->vgId, pQInfo); return code; } diff --git a/src/vnode/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c index 3541fc15b649c64dbb411c1b03b0763e3d329f67..6f0bc5fcced18af3a666a9ab93c1177374b6f9a5 100644 --- a/src/vnode/src/vnodeWrite.c +++ b/src/vnode/src/vnodeWrite.c @@ -51,7 +51,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) { if (vnodeProcessWriteMsgFp[pHead->msgType] == NULL) return TSDB_CODE_MSG_NOT_PROCESSED; - if (pVnode->status != TAOS_VN_STATUS_READY) + if (pVnode->status != TAOS_VN_STATUS_READY && qtype == TAOS_QTYPE_RPC) return TSDB_CODE_NOT_ACTIVE_VNODE; if (pHead->version == 0) { // from client @@ -91,7 +91,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR // save insert result into item - dTrace("pVnode:%p vgId:%d, submit msg is processed", pVnode, pVnode->vgId); + vTrace("vgId:%d, submit msg is processed", pVnode->vgId); code = tsdbInsertData(pVnode->tsdb, pCont); pRet->len = sizeof(SShellSubmitRspMsg); @@ -110,7 +110,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe SMDCreateTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, table:%s, start to create", pVnode, pVnode->vgId, pTable->tableId); + vTrace("vgId:%d, table:%s, start to create", pVnode->vgId, pTable->tableId); int16_t numOfColumns = htons(pTable->numOfColumns); int16_t numOfTags = htons(pTable->numOfTags); int32_t sid = htonl(pTable->sid); @@ -157,7 +157,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe tfree(pDestTagSchema); tfree(pDestSchema); - dTrace("pVnode:%p vgId:%d, table:%s is created, result:%x", pVnode, pVnode->vgId, pTable->tableId, code); + vTrace("vgId:%d, table:%s is created, result:%x", pVnode->vgId, pTable->tableId, code); return code; } @@ -165,7 +165,7 @@ static int32_t vnodeProcessDropTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet SMDDropTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, table:%s, start to drop", pVnode, pVnode->vgId, pTable->tableId); + vTrace("vgId:%d, table:%s, start to drop", pVnode->vgId, pTable->tableId); STableId tableId = { .uid = htobe64(pTable->uid), .tid = htonl(pTable->sid) @@ -180,7 +180,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet SMDCreateTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, table:%s, start to alter", pVnode, pVnode->vgId, pTable->tableId); + vTrace("vgId:%d, table:%s, start to alter", pVnode->vgId, pTable->tableId); int16_t numOfColumns = htons(pTable->numOfColumns); int16_t numOfTags = htons(pTable->numOfTags); int32_t sid = htonl(pTable->sid); @@ -221,7 +221,7 @@ static int32_t vnodeProcessAlterTableMsg(SVnodeObj *pVnode, void *pCont, SRspRet tfree(pDestSchema); - dTrace("pVnode:%p vgId:%d, table:%s, alter table result:%d", pVnode, pVnode->vgId, pTable->tableId, code); + vTrace("vgId:%d, table:%s, alter table result:%d", pVnode->vgId, pTable->tableId, code); return code; } @@ -230,14 +230,14 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet SMDDropSTableMsg *pTable = pCont; int32_t code = 0; - dTrace("pVnode:%p vgId:%d, stable:%s, start to drop", pVnode, pVnode->vgId, pTable->tableId); + 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); code = TSDB_CODE_SUCCESS; - dTrace("pVnode:%p vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code); + vTrace("vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code); return code; } diff --git a/src/wal/src/walMain.c b/src/wal/src/walMain.c index 5157d715bff44d34441686b4c3c8d86b6a91fad9..8d92fac926b2d54ecb7a022376d7ffc441ba454a 100644 --- a/src/wal/src/walMain.c +++ b/src/wal/src/walMain.c @@ -79,7 +79,9 @@ void *walOpen(const char *path, const SWalCfg *pCfg) { pthread_mutex_destroy(&pWal->mutex); free(pWal); pWal = NULL; - } + } else { + wTrace("wal:%s, it is open, level:%d", path, pWal->level); + } return pWal; } @@ -177,8 +179,11 @@ void walFsync(void *handle) { SWal *pWal = handle; - if (pWal->level == TAOS_WAL_FSYNC) - fsync(pWal->fd); + if (pWal->level == TAOS_WAL_FSYNC && pWal->fd >=0) { + if (fsync(pWal->fd) < 0) { + wError("wal:%s, fsync failed(%s)", pWal->name, strerror(errno)); + } + } } int walRestore(void *handle, void *pVnode, int (*writeFp)(void *, void *, int)) { diff --git a/src/wal/test/waltest.c b/src/wal/test/waltest.c index 5293c85443a7e18cd8f6dcc835f73c4649dbddba..cf9bf9542eb2ce71d8d0b4319bfe68faa0152429 100644 --- a/src/wal/test/waltest.c +++ b/src/wal/test/waltest.c @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) { } else if (strcmp(argv[i], "-v")==0 && i < argc-1) { ver = atoll(argv[++i]); } else if (strcmp(argv[i], "-d")==0 && i < argc-1) { - ddebugFlag = atoi(argv[++i]); + dDebugFlag = atoi(argv[++i]); } else { printf("\nusage: %s [options] \n", argv[0]); printf(" [-p path]: wal file path default is:%s\n", path); @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) { printf(" [-r rows]: rows of records per wal file, default is:%d\n", rows); printf(" [-k keep]: keep the wal after closing, default is:%d\n", keep); printf(" [-v version]: initial version, default is:%ld\n", ver); - printf(" [-d debugFlag]: debug flag, default:%d\n", ddebugFlag); + printf(" [-d debugFlag]: debug flag, default:%d\n", dDebugFlag); printf(" [-h help]: print out this help\n\n"); exit(0); } diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index ec06eb38ef038eab2d8cfa798070be84e7f7623e..cff6db202849c16e70476c887ce5d2512a3b4071 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -9,6 +9,11 @@ python3 ./test.py $1 -f insert/smallint.py python3 ./test.py $1 -f insert/tinyint.py python3 ./test.py $1 -f insert/date.py python3 ./test.py $1 -f insert/binary.py + +python3 ./test.py $1 -f table/column_name.py +python3 ./test.py $1 -f table/column_num.py +python3 ./test.py $1 -f table/db_table.py + python3 ./test.py $1 -f import_merge/importBlock1HO.py python3 ./test.py $1 -f import_merge/importBlock1HPO.py python3 ./test.py $1 -f import_merge/importBlock1H.py diff --git a/tests/pytest/import_merge/importDataH2.py b/tests/pytest/import_merge/importDataH2.py index d49abff374b864e80079996a9cb5c81be248d4ba..73a412fb8046ff1f6baf9c42d39221345c22fbee 100644 --- a/tests/pytest/import_merge/importDataH2.py +++ b/tests/pytest/import_merge/importDataH2.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,19 +43,19 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") - tdLog.info("import %d sequential data" % (self.rows / 2)) + tdLog.info("import %d sequential data" % (self.maxrows / 2)) startTime = self.startTime sqlcmd = ['import into tb1 values'] - for rid in range(1, self.rows / 2 + 1): + for rid in range(1, self.maxrows / 2 + 1): sqlcmd.append('(%ld, %d)' % (startTime + rid, rid)) tdSql.execute(" ".join(sqlcmd)) tdLog.info("================= step3") tdSql.query('select * from tb1') - tdSql.checkRows(self.rows / 2) + tdSql.checkRows(self.maxrows / 2) tdLog.info("================= step4") tdDnodes.stop(1) @@ -70,7 +70,7 @@ class TDTestCase: tdLog.info("================= step7") tdSql.execute('reset query cache') tdSql.query('select * from tb1 order by ts desc') - tdSql.checkRows(self.rows / 2 + 1) + tdSql.checkRows(self.maxrows / 2 + 1) tdLog.info("================= step8") tdLog.info("import 10 data in batch before") @@ -83,7 +83,7 @@ class TDTestCase: tdLog.info("================= step9") tdSql.execute('reset query cache') tdSql.query('select * from tb1 order by ts desc') - tdSql.checkRows(self.rows / 2 + 11) + tdSql.checkRows(self.maxrows / 2 + 11) def stop(self): tdSql.close() diff --git a/tests/pytest/import_merge/importDataHO.py b/tests/pytest/import_merge/importDataHO.py index 0483e6844c083766a36441926ec096c3219a9130..0fe6ab71d58dcd4849ca88bf22323cfc536b6135 100644 --- a/tests/pytest/import_merge/importDataHO.py +++ b/tests/pytest/import_merge/importDataHO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxwrows = 200 self.rowsPerTable = 20 tdDnodes.stop(1) @@ -36,7 +36,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -44,7 +44,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import %d sequential data" % self.rowsPerTable) diff --git a/tests/pytest/import_merge/importDataHO2.py b/tests/pytest/import_merge/importDataHO2.py index ab7044d2a745822e27f507b5fb20f1d058fa65f6..6246b55b324b5ccbd2543af0d7f68c153a89d0bd 100644 --- a/tests/pytest/import_merge/importDataHO2.py +++ b/tests/pytest/import_merge/importDataHO2.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 self.rowsPerTable = 100 tdDnodes.stop(1) @@ -36,7 +36,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -44,7 +44,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import %d sequential data" % self.rowsPerTable) diff --git a/tests/pytest/import_merge/importDataHPO.py b/tests/pytest/import_merge/importDataHPO.py index f165bd7b5a734bc21e5005e9413a095de5a202c4..c749dbd1138ac56942e4a38752e01d18226946e2 100644 --- a/tests/pytest/import_merge/importDataHPO.py +++ b/tests/pytest/import_merge/importDataHPO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 self.rowsPerTable = 20 tdDnodes.stop(1) @@ -36,7 +36,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -44,7 +44,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import %d sequential data" % self.rowsPerTable) diff --git a/tests/pytest/import_merge/importDataLastH.py b/tests/pytest/import_merge/importDataLastH.py index 319fd40677d96e447e167079c4a5cf19fdc63ba5..830711a420428e27dc5edf4b56b71d0dc866ba24 100644 --- a/tests/pytest/import_merge/importDataLastH.py +++ b/tests/pytest/import_merge/importDataLastH.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastHO.py b/tests/pytest/import_merge/importDataLastHO.py index 5a71c5db654a8b40ba1cee6f435b15d3ba6297e2..037c81f0872517e3343bb46aaa9694a658d38cc8 100644 --- a/tests/pytest/import_merge/importDataLastHO.py +++ b/tests/pytest/import_merge/importDataLastHO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastHPO.py b/tests/pytest/import_merge/importDataLastHPO.py index f2c95cbd4d735d1cf1648cd07754bc940a99523e..46a7e5909da922cbc554d4f5c9893346c19e9c87 100644 --- a/tests/pytest/import_merge/importDataLastHPO.py +++ b/tests/pytest/import_merge/importDataLastHPO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastS.py b/tests/pytest/import_merge/importDataLastS.py index 929e02dd1e5f134f229c101db1de9c5c7526ede1..2dd7cdb744e600c0d2b0508afe4b8ad46b139425 100644 --- a/tests/pytest/import_merge/importDataLastS.py +++ b/tests/pytest/import_merge/importDataLastS.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastSub.py b/tests/pytest/import_merge/importDataLastSub.py index 158fa0fb3c7950360979a16d5916719462b841a9..bb9953057e10a29298d613a1e4047d1d6e5d1299 100644 --- a/tests/pytest/import_merge/importDataLastSub.py +++ b/tests/pytest/import_merge/importDataLastSub.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,7 +43,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastT.py b/tests/pytest/import_merge/importDataLastT.py index 9bc90a8275d842e9b64de79e9c8c143e2d048ed2..29f0afaf1a3a003734c1cc42674e9b96b5a7ced2 100644 --- a/tests/pytest/import_merge/importDataLastT.py +++ b/tests/pytest/import_merge/importDataLastT.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastTO.py b/tests/pytest/import_merge/importDataLastTO.py index 0c93ac430b4fa90f9d535071869eb22ad122cb18..47639130b59f2cc67be66bbf9e2f4a2f35a50112 100644 --- a/tests/pytest/import_merge/importDataLastTO.py +++ b/tests/pytest/import_merge/importDataLastTO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataLastTPO.py b/tests/pytest/import_merge/importDataLastTPO.py index 188e93e0dbc2a4742308cb5a4a03fb7accfdba4e..41908365051586bbe4628582e0bfffa3bb97d838 100644 --- a/tests/pytest/import_merge/importDataLastTPO.py +++ b/tests/pytest/import_merge/importDataLastTPO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than %d rows less than %d rows will go to data and last file" % - (self.rows, 10 + self.rows)) + (self.maxrows, 10 + self.maxrows)) tdLog.info("================= step2") tdLog.info("import 205 sequential data") diff --git a/tests/pytest/import_merge/importDataS.py b/tests/pytest/import_merge/importDataS.py index 65d4087c3d79ebf266048d1971e1f4cac513cba4..daa4b2e0252920e8f98779f01d81c6a8353c4071 100644 --- a/tests/pytest/import_merge/importDataS.py +++ b/tests/pytest/import_merge/importDataS.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importDataSub.py b/tests/pytest/import_merge/importDataSub.py index 4bf85f2bdd39f1734d6e78ad8b9c813ce361b4fb..2359ca214fd7313b93802c3c34a0406f98745647 100644 --- a/tests/pytest/import_merge/importDataSub.py +++ b/tests/pytest/import_merge/importDataSub.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -43,19 +43,19 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") - tdLog.info("import %d sequential data" % (self.rows / 2)) + tdLog.info("import %d sequential data" % (self.maxrows / 2)) startTime = self.startTime sqlcmd = ['import into tb1 values'] - for rid in range(1, self.rows / 2 + 1): + for rid in range(1, self.maxrows / 2 + 1): sqlcmd.append('(%ld, %d)' % (startTime + rid, rid)) tdSql.execute(" ".join(sqlcmd)) tdLog.info("================= step3") tdSql.query('select * from tb1') - tdSql.checkRows(self.rows / 2) + tdSql.checkRows(self.maxrows / 2) tdLog.info("================= step4") tdDnodes.stop(1) @@ -73,7 +73,7 @@ class TDTestCase: tdLog.info("================= step9") tdSql.execute('reset query cache') tdSql.query('select * from tb1 order by ts desc') - tdSql.checkRows(self.rows / 2) + tdSql.checkRows(self.maxrows / 2) def stop(self): tdSql.close() diff --git a/tests/pytest/import_merge/importDataT.py b/tests/pytest/import_merge/importDataT.py index 66016c5555f2b1dcc3fcad8735d8142ae4575263..abb5e312ef5217e3b1b67583d28a09ea07d6a896 100644 --- a/tests/pytest/import_merge/importDataT.py +++ b/tests/pytest/import_merge/importDataT.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importDataTO.py b/tests/pytest/import_merge/importDataTO.py index a3c17b2846c2dbdfaa115212223568a802d458e4..2a6d9e272b1cbe5c5bb4925538ba54a2d54b2791 100644 --- a/tests/pytest/import_merge/importDataTO.py +++ b/tests/pytest/import_merge/importDataTO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importDataTPO.py b/tests/pytest/import_merge/importDataTPO.py index 20eb41cc08755ad09237568fc1f4973e55d354c8..06d5cf3c1a2ff2d9326065f45b2451807effbe22 100644 --- a/tests/pytest/import_merge/importDataTPO.py +++ b/tests/pytest/import_merge/importDataTPO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") @@ -39,7 +39,7 @@ class TDTestCase: tdSql.execute('create table tb1 (ts timestamp, speed int)') tdLog.info( "More than 10 rows less than %d rows will go to data file" % - self.rows) + self.maxrows) tdLog.info("================= step2") tdLog.info("import 20 sequential data") diff --git a/tests/pytest/import_merge/importLastH.py b/tests/pytest/import_merge/importLastH.py index c69f453971eb036382ad78cfc6c451dc6c8fad57..a6f9fa087c7db215a03745054ac6f8367d218e2f 100644 --- a/tests/pytest/import_merge/importLastH.py +++ b/tests/pytest/import_merge/importLastH.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastHO.py b/tests/pytest/import_merge/importLastHO.py index ec930d1807c3ed9cf1d9b3b4096921c9389f79be..e6468b243e05941cc82310de2c3dc197ab4da7d9 100644 --- a/tests/pytest/import_merge/importLastHO.py +++ b/tests/pytest/import_merge/importLastHO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastHPO.py b/tests/pytest/import_merge/importLastHPO.py index 9603a7b8529d2d435a1e5e174f1d3df7bc41fe30..4a299ed82369a1b81b2a419f3d0f45d0b64404f9 100644 --- a/tests/pytest/import_merge/importLastHPO.py +++ b/tests/pytest/import_merge/importLastHPO.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastS.py b/tests/pytest/import_merge/importLastS.py index 7dbe74e2ca0f802861c7b66c63e83fba296d0f14..2a5de46eb2d0a55039caddf352af9dba7f258fca 100644 --- a/tests/pytest/import_merge/importLastS.py +++ b/tests/pytest/import_merge/importLastS.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastSub.py b/tests/pytest/import_merge/importLastSub.py index f028ba5fd77603a283bd7e5daf02ffb5fb738813..fa1b2387f317560784bb2b0e28cfe6309a408c89 100644 --- a/tests/pytest/import_merge/importLastSub.py +++ b/tests/pytest/import_merge/importLastSub.py @@ -27,11 +27,11 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastT.py b/tests/pytest/import_merge/importLastT.py index 3fe4e0006c80958822e4ccd7dd1f14c562308820..b7a1e58bc5d19356c1228abe2bfb552aa0277f74 100644 --- a/tests/pytest/import_merge/importLastT.py +++ b/tests/pytest/import_merge/importLastT.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastTO.py b/tests/pytest/import_merge/importLastTO.py index 76e5016bdbf87d850caf9b39b9aa4b4277080b5d..541cbd29ca08b61f1a94b0180673552f66452c09 100644 --- a/tests/pytest/import_merge/importLastTO.py +++ b/tests/pytest/import_merge/importLastTO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/import_merge/importLastTPO.py b/tests/pytest/import_merge/importLastTPO.py index 08f416806328b0f3ba391bff350bd6aa954fb7f9..6ec21d0c79e935b7581d7414d3dc098217f76204 100644 --- a/tests/pytest/import_merge/importLastTPO.py +++ b/tests/pytest/import_merge/importLastTPO.py @@ -27,7 +27,7 @@ class TDTestCase: def run(self): self.ntables = 1 self.startTime = 1520000010000 - self.rows = 200 + self.maxrows = 200 tdDnodes.stop(1) tdDnodes.deploy(1) @@ -35,7 +35,7 @@ class TDTestCase: tdSql.execute('reset query cache') tdSql.execute('drop database if exists db') - tdSql.execute('create database db rows %d' % self.rows) + tdSql.execute('create database db maxrows %d' % self.maxrows) tdSql.execute('use db') tdLog.info("================= step1") diff --git a/tests/pytest/smoketest.sh b/tests/pytest/smoketest.sh index 7dbefa94023ce16ec769b203905a8d1d56f920d2..af597fb6c53123da7eb514967a93cf4d7d162642 100755 --- a/tests/pytest/smoketest.sh +++ b/tests/pytest/smoketest.sh @@ -34,12 +34,12 @@ python3 ./test.py $1 -f table/db_table.py python3 ./test.py -s $1 sleep 1 -#python3 ./test.py $1 -f import_merge/importDataLastTO.py -#python3 ./test.py -s $1 -#sleep 1 -#python3 ./test.py $1 -f import_merge/importDataLastT.py -#python3 ./test.py -s $1 -#sleep 1 +python3 ./test.py $1 -f import_merge/importDataLastTO.py +python3 ./test.py -s $1 +sleep 1 +python3 ./test.py $1 -f import_merge/importDataLastT.py +python3 ./test.py -s $1 +sleep 1 python3 ./test.py $1 -f import_merge/importDataTO.py python3 ./test.py -s $1 sleep 1 diff --git a/tests/script/general/agg/testSuite.sim b/tests/script/general/agg/testSuite.sim deleted file mode 100644 index 9aac0d70264194392600d552517460449975a3fb..0000000000000000000000000000000000000000 --- a/tests/script/general/agg/testSuite.sim +++ /dev/null @@ -1,2 +0,0 @@ -run general/agg/fill.sim -run general/agg/stream.sim \ No newline at end of file diff --git a/tests/script/general/alter/cached_schema_after_alter.sim b/tests/script/general/alter/cached_schema_after_alter.sim index d81720a1da41f52ce2aacf86b4cdd1a1722a6070..921cfee3d11fbaaff55cd945f18b3635fda9b0e1 100644 --- a/tests/script/general/alter/cached_schema_after_alter.sim +++ b/tests/script/general/alter/cached_schema_after_alter.sim @@ -117,3 +117,5 @@ endi if $data12 != 2 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/general/alter/count.sim b/tests/script/general/alter/count.sim index a6a2a13ef7345621833536917fbe46096f3829b1..a42fde74b7586d43904bb915a36eae11f05cccde 100644 --- a/tests/script/general/alter/count.sim +++ b/tests/script/general/alter/count.sim @@ -264,3 +264,4 @@ if $data00 != 31 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/general/alter/import.sim b/tests/script/general/alter/import.sim index 1771d472984ea135eac7a9221f07cca6aaff0ded..61297655133772ef45d6a28d9f140f0d7b60395f 100644 --- a/tests/script/general/alter/import.sim +++ b/tests/script/general/alter/import.sim @@ -47,3 +47,5 @@ sql select count(b) from tb if $data00 != 5 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/general/alter/insert1.sim b/tests/script/general/alter/insert1.sim index 7095313a0d24213f61b77907a6552780e0072e1e..4246bdc18e05bb4f2bf66352d9b8b0e417855191 100644 --- a/tests/script/general/alter/insert1.sim +++ b/tests/script/general/alter/insert1.sim @@ -20,25 +20,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi @@ -61,25 +61,25 @@ endi if $data02 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi @@ -95,25 +95,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -122,22 +122,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -149,19 +149,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi @@ -177,25 +177,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -204,22 +204,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -231,19 +231,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -258,16 +258,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi @@ -291,25 +291,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -318,22 +318,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -345,19 +345,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -372,16 +372,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -399,13 +399,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi @@ -421,25 +421,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -448,22 +448,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -475,19 +475,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -502,16 +502,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -529,13 +529,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -556,10 +556,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi @@ -575,25 +575,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -602,22 +602,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -629,19 +629,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -656,16 +656,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -683,13 +683,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -710,10 +710,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi if $data61 != -10 then @@ -737,7 +737,7 @@ endi if $data67 != 10.000000000 then return -1 endi -if $data68 != null then +if $data68 != NULL then return -1 endi @@ -753,25 +753,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -780,22 +780,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -807,19 +807,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -834,16 +834,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -861,13 +861,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -888,10 +888,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi if $data61 != -10 then @@ -915,7 +915,7 @@ endi if $data67 != 10.000000000 then return -1 endi -if $data68 != null then +if $data68 != NULL then return -1 endi if $data71 != -7 then @@ -942,7 +942,7 @@ endi if $data78 != 11 then return -1 endi -if $data79 != null then +if $data79 != NULL then return -1 endi @@ -959,25 +959,25 @@ endi if $data01 != -28 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -25 then @@ -986,22 +986,22 @@ endi if $data12 != 0 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != -22 then @@ -1013,19 +1013,19 @@ endi if $data23 != 0 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != -19 then @@ -1040,16 +1040,16 @@ endi if $data34 != 0 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != -16 then @@ -1067,13 +1067,13 @@ endi if $data45 != 3 then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != -13 then @@ -1094,10 +1094,10 @@ endi if $data56 != 8.00000 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi if $data61 != -10 then @@ -1121,7 +1121,7 @@ endi if $data67 != 10.000000000 then return -1 endi -if $data68 != null then +if $data68 != NULL then return -1 endi if $data71 != -7 then @@ -1148,3 +1148,5 @@ endi if $data78 != 11 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/general/alter/insert2.sim b/tests/script/general/alter/insert2.sim index a248c7cd2b3a0247468a23202c6cff9205ba2e3f..007060b7f061f5d50f7af13ddc9e1dfeaeddf8e2 100644 --- a/tests/script/general/alter/insert2.sim +++ b/tests/script/general/alter/insert2.sim @@ -74,7 +74,7 @@ endi if $data07 != 8 then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != 1 then @@ -98,7 +98,7 @@ endi if $data17 != 8 then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi @@ -129,10 +129,10 @@ endi if $data06 != 8 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != 2 then @@ -153,10 +153,10 @@ endi if $data16 != 8 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != 1 then @@ -177,10 +177,10 @@ endi if $data26 != 8 then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi @@ -206,16 +206,16 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != 3 then @@ -230,16 +230,16 @@ endi if $data14 != 8 then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != 2 then @@ -254,16 +254,16 @@ endi if $data24 != 8 then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != 1 then @@ -278,16 +278,16 @@ endi if $data34 != 8 then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi @@ -313,19 +313,19 @@ endi if $data03 != 5 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data11 != -19 then @@ -337,19 +337,19 @@ endi if $data13 != 0 then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data21 != 3 then @@ -361,19 +361,19 @@ endi if $data23 != 8 then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != 2 then @@ -385,19 +385,19 @@ endi if $data33 != 8 then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != 1 then @@ -409,19 +409,19 @@ endi if $data43 != 8 then return -1 endi -if $data44 != null then +if $data44 != NULL then return -1 endi -if $data45 != null then +if $data45 != NULL then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi @@ -443,22 +443,22 @@ endi if $data12 != 5 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi -if $data08 != null then +if $data08 != NULL then return -1 endi if $data21 != -19 then @@ -467,22 +467,22 @@ endi if $data22 != 0 then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi if $data31 != 3 then @@ -491,22 +491,22 @@ endi if $data32 != 8 then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data37 != null then +if $data37 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi if $data41 != 2 then @@ -515,22 +515,22 @@ endi if $data42 != 8 then return -1 endi -if $data43 != null then +if $data43 != NULL then return -1 endi -if $data44 != null then +if $data44 != NULL then return -1 endi -if $data45 != null then +if $data45 != NULL then return -1 endi -if $data46 != null then +if $data46 != NULL then return -1 endi -if $data47 != null then +if $data47 != NULL then return -1 endi -if $data48 != null then +if $data48 != NULL then return -1 endi if $data51 != 1 then @@ -539,19 +539,19 @@ endi if $data52 != 8 then return -1 endi -if $data53 != null then +if $data53 != NULL then return -1 endi -if $data54 != null then +if $data54 != NULL then return -1 endi -if $data55 != null then +if $data55 != NULL then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi -if $data58 != null then +if $data58 != NULL then return -1 endi @@ -568,52 +568,52 @@ print data01 = $data01 if $data01 != -10 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi if $data11 != -13 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data21 != -16 then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi if $data31 != -19 then return -1 endi -if $data32 != null then +if $data32 != NULL then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi if $data41 != 3 then return -1 endi -if $data42 != null then +if $data42 != NULL then return -1 endi if $data51 != 2 then return -1 endi -if $data52 != null then +if $data52 != NULL then return -1 endi -if $data53 != null then +if $data53 != NULL then return -1 endi if $data61 != 1 then return -1 endi -if $data62 != null then +if $data62 != NULL then return -1 endi @@ -632,52 +632,53 @@ endi if $data01 != -10 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi if $data11 != -13 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data21 != -16 then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi if $data31 != -19 then return -1 endi -if $data32 != null then +if $data32 != NULL then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi if $data41 != 3 then return -1 endi -if $data42 != null then +if $data42 != NULL then return -1 endi if $data51 != 2 then return -1 endi -if $data52 != null then +if $data52 != NULL then return -1 endi -if $data53 != null then +if $data53 != NULL then return -1 endi if $data61 != 1 then return -1 endi -if $data62 != null then +if $data62 != NULL 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/general/alter/metrics.sim b/tests/script/general/alter/metrics.sim index be11ddc7f577d014105ac6b76ba2b759b773238c..b346b3b2c039be2aed4b9f03b50944bf18a34004 100644 --- a/tests/script/general/alter/metrics.sim +++ b/tests/script/general/alter/metrics.sim @@ -770,7 +770,7 @@ endi if $data21 != INT then return -1 endi -if $data30 != null then +if $data30 != NULL then return -1 endi @@ -781,3 +781,4 @@ 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/general/alter/table.sim b/tests/script/general/alter/table.sim index 8660d0d31224e081fb35af033fb1bdcc875621c3..c6402b45f748a20957f14e60b6ce1075f587ec22 100644 --- a/tests/script/general/alter/table.sim +++ b/tests/script/general/alter/table.sim @@ -673,7 +673,7 @@ endi if $data11 != INT then return -1 endi -if $data20 != null then +if $data20 != NULL then return -1 endi @@ -684,3 +684,4 @@ 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/general/alter/testSuite.sim b/tests/script/general/alter/testSuite.sim index 33a926f7b2475b07d175f320a21e63267998948a..cfac68144c080593499159eec81325924e7f25e6 100644 --- a/tests/script/general/alter/testSuite.sim +++ b/tests/script/general/alter/testSuite.sim @@ -1,5 +1,5 @@ -run general/alter/count.sim run general/alter/cached_schema_after_alter.sim +run general/alter/count.sim run general/alter/import.sim run general/alter/insert1.sim run general/alter/insert2.sim diff --git a/tests/script/general/cache/new_metrics.sim b/tests/script/general/cache/new_metrics.sim index 2f7de7f1eb5facc97c488c5ff77df9548e3121fe..64170ec67ee7465dd75c87bca694048788ee183a 100644 --- a/tests/script/general/cache/new_metrics.sim +++ b/tests/script/general/cache/new_metrics.sim @@ -140,6 +140,4 @@ if $data04 != 10 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/general/cache/restart_metrics.sim b/tests/script/general/cache/restart_metrics.sim index 70f53ac69ea184544533b5be11a1265d056a64fc..dbd15b945f6cb855a67f2531547af8c95b874897 100644 --- a/tests/script/general/cache/restart_metrics.sim +++ b/tests/script/general/cache/restart_metrics.sim @@ -83,3 +83,4 @@ if $data02 != 3 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/general/cache/restart_table.sim b/tests/script/general/cache/restart_table.sim index 7ea4c24b4d86d0fb152177d51e5343cadcbfed5b..4e8bc92c1030df49acd01f1f5c4230a7578aa9ec 100644 --- a/tests/script/general/cache/restart_table.sim +++ b/tests/script/general/cache/restart_table.sim @@ -56,4 +56,4 @@ if $data01 != 1 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/general/cache/testSuite.sim b/tests/script/general/cache/testSuite.sim index 1265a1060eca95b0b0c517886a2b76e5ab2dfae2..f09ece89b6574af1261d6127624a78a222b5fbd5 100644 --- a/tests/script/general/cache/testSuite.sim +++ b/tests/script/general/cache/testSuite.sim @@ -1,5 +1,3 @@ +run general/cache/new_metrics.sim run general/cache/restart_table.sim run general/cache/restart_metrics.sim -run general/cache/restart_stream.sim -run general/cache/new_metrics.sim -run general/cache/new_stream.sim diff --git a/tests/script/general/column/commit.sim b/tests/script/general/column/commit.sim index f8fc85a109aa3e0d91059174ed12d1a5b0064be4..7bc62619f3b73aa26f413d12e0f12139cb494fff 100644 --- a/tests/script/general/column/commit.sim +++ b/tests/script/general/column/commit.sim @@ -151,4 +151,6 @@ if $data08 != 10 then endi if $data09 != 10 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/column/metrics.sim b/tests/script/general/column/metrics.sim index 23fbbfdbf57137ca46eb5c19828482cb561d9657..401a4ae54ea896e1ff72b17c58bf2275f9ce8cf0 100644 --- a/tests/script/general/column/metrics.sim +++ b/tests/script/general/column/metrics.sim @@ -215,3 +215,5 @@ endi if $data09 != 20 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/general/column/table.sim b/tests/script/general/column/table.sim index af357eea8604751e399be110425931bde2da6cb3..8e9c44fc466457e682848cd93de5359c8a213781 100644 --- a/tests/script/general/column/table.sim +++ b/tests/script/general/column/table.sim @@ -211,3 +211,5 @@ endi if $data07 != 2.872281323 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/general/column/testSuite.sim b/tests/script/general/column/testSuite.sim index 2a0b9efd451b35726e785ce447809141c12353c3..f60d197e95dd2285f2b5b155c0d361b8a28bd90e 100644 --- a/tests/script/general/column/testSuite.sim +++ b/tests/script/general/column/testSuite.sim @@ -1,4 +1,3 @@ -run general/column/table.sim -run general/column/metrics.sim -run general/column/stream.sim run general/column/commit.sim +run general/column/metrics.sim +run general/column/table.sim diff --git a/tests/script/general/compress/commitlog.sim b/tests/script/general/compress/commitlog.sim index e2c3964e1bd036cebcbdd643d6b82d0a09275135..2c69b809d1ffda90a8ad2e112541b19769fecb3b 100644 --- a/tests/script/general/compress/commitlog.sim +++ b/tests/script/general/compress/commitlog.sim @@ -1,9 +1,8 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1 -system sh/cfg.sh -n dnode1 -c compression -v 1 +system sh/cfg.sh -n dnode1 -c comp -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -88,9 +87,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 20000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -124,4 +123,4 @@ if $rows != $N 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/general/compress/compress.sim b/tests/script/general/compress/compress.sim index 276fba9f8c94747469cd5a9d370ee40658988b1e..bc56227c745aeafdc3bfd4629cdda06cae6da9d5 100644 --- a/tests/script/general/compress/compress.sim +++ b/tests/script/general/compress/compress.sim @@ -1,9 +1,8 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c compression -v 1 +system sh/cfg.sh -n dnode1 -c comp -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -83,9 +82,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 10000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -119,4 +118,4 @@ if $rows != $N 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/general/compress/compress2.sim b/tests/script/general/compress/compress2.sim index 29d14c2c75b2bb49cc26aa442dfe4437e72dfb9b..c3b445c04cd72064082f9434a8cf7e9502e1057e 100644 --- a/tests/script/general/compress/compress2.sim +++ b/tests/script/general/compress/compress2.sim @@ -1,9 +1,8 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c compression -v 2 +system sh/cfg.sh -n dnode1 -c comp -v 2 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -83,9 +82,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 10000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -119,4 +118,4 @@ if $rows != $N 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/general/compress/testSuite.sim b/tests/script/general/compress/testSuite.sim index 97c76aec155b225eeac04a3a5d0355cf7ed9de74..3573985c8a90be4cab0b5abeaa37dbae0b2eefdd 100644 --- a/tests/script/general/compress/testSuite.sim +++ b/tests/script/general/compress/testSuite.sim @@ -1,4 +1,4 @@ -run general/compress/compress.sim -run general/compress/uncompress.sim run general/compress/commitlog.sim run general/compress/compress2.sim +run general/compress/compress.sim +run general/compress/uncompress.sim diff --git a/tests/script/general/compress/uncompress.sim b/tests/script/general/compress/uncompress.sim index a7b8a95d524086a04188b29e4111c1ecba5953e9..8dde7fae342300ca584a1ac9759ee7421c6ceec2 100644 --- a/tests/script/general/compress/uncompress.sim +++ b/tests/script/general/compress/uncompress.sim @@ -1,9 +1,7 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 -system sh/cfg.sh -n dnode1 -c compression -v 1 +system sh/cfg.sh -n dnode1 -c comp -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -83,9 +81,9 @@ endi print =============== step4 system sh/exec.sh -n dnode1 -s stop -x SIGINT -sleep 10000 +sleep 5000 system sh/exec.sh -n dnode1 -s start -sleep 10000 +sleep 3000 print =============== step5 @@ -119,4 +117,4 @@ if $rows != $N 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/general/compute/avg.sim b/tests/script/general/compute/avg.sim index 21dea700717ec09ece1308cb03715bd0e3e2dc0b..9a37363a6052e1098d2aa92221044a067b3abee7 100644 --- a/tests/script/general/compute/avg.sim +++ b/tests/script/general/compute/avg.sim @@ -153,4 +153,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/bottom.sim b/tests/script/general/compute/bottom.sim index 241f775f34a2aeccf32913e6045e0e55527cf4fa..592f87651e118c0c7509cfcab26bbad4d9873047 100644 --- a/tests/script/general/compute/bottom.sim +++ b/tests/script/general/compute/bottom.sim @@ -94,4 +94,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/count.sim b/tests/script/general/compute/count.sim index bb087c0ffb61e5e2ce2fc6fbc8394ec2c2d079fa..aef30c8b6c9016c53619b17a8b50b6da136f69df 100644 --- a/tests/script/general/compute/count.sim +++ b/tests/script/general/compute/count.sim @@ -169,4 +169,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/diff.sim b/tests/script/general/compute/diff.sim index 00f13963194650248e38919e44acb317f3aee69c..8a60cd00bc745180d6f5d910e34650091b6b8945 100644 --- a/tests/script/general/compute/diff.sim +++ b/tests/script/general/compute/diff.sim @@ -86,4 +86,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/diff2.sim b/tests/script/general/compute/diff2.sim index ec23b2481b260f996c8a0ce0a578f80613def6dd..53b508ca6f99b2aaf9c26568ad0be3d583421dd9 100644 --- a/tests/script/general/compute/diff2.sim +++ b/tests/script/general/compute/diff2.sim @@ -153,3 +153,5 @@ print =============== clear #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/general/compute/first.sim b/tests/script/general/compute/first.sim index 39acb444abc1d9fe51660f96c4d635e9cadc3728..80f4f53cdbe8f498345a5f68e542b9914163485e 100644 --- a/tests/script/general/compute/first.sim +++ b/tests/script/general/compute/first.sim @@ -155,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/interval.sim b/tests/script/general/compute/interval.sim index f00d39bcefd19be1a3b8602ce6ba49f60a26aab0..26f40eda5ae78a3f49d1341c8aae25d549fdb52e 100644 --- a/tests/script/general/compute/interval.sim +++ b/tests/script/general/compute/interval.sim @@ -171,4 +171,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/last.sim b/tests/script/general/compute/last.sim index 779d1f3691d647fb48ea8cc33a659e3efbb8d04f..0e92bb6d456c92b8158faa59aa18d2bef82995e9 100644 --- a/tests/script/general/compute/last.sim +++ b/tests/script/general/compute/last.sim @@ -154,4 +154,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/leastsquare.sim b/tests/script/general/compute/leastsquare.sim index ebafa2baf503aaa5cea7ecd4f40ed64eb4047791..bbadd849cb48c8dff494a32e9d47abd5ca96dea3 100644 --- a/tests/script/general/compute/leastsquare.sim +++ b/tests/script/general/compute/leastsquare.sim @@ -96,3 +96,5 @@ sql show databases 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/general/compute/max.sim b/tests/script/general/compute/max.sim index 5a907398387ee5bb7848723638c9c3b68b75d75e..4fc760d66d1391e2b92ffc2fb01d00b4a0136c07 100644 --- a/tests/script/general/compute/max.sim +++ b/tests/script/general/compute/max.sim @@ -154,4 +154,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/min.sim b/tests/script/general/compute/min.sim index d87ca1ae9b07a92fafe3feef7aaa13c402381c68..82a22b642e3f8f912eadb2a525c4fa1d38a788b3 100644 --- a/tests/script/general/compute/min.sim +++ b/tests/script/general/compute/min.sim @@ -155,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/null.sim b/tests/script/general/compute/null.sim index 9f2e9ecf405cabaf955d22cf6351e1ce3416b425..cde95ca77f2ba741581a5ea82554b2b5112f662b 100644 --- a/tests/script/general/compute/null.sim +++ b/tests/script/general/compute/null.sim @@ -51,7 +51,7 @@ $tb = $tbPrefix . $i sql select * from $tb print $data00 $data01 $data02 -if $data01 != null then +if $data01 != NULL then return -1 endi if $data02 != 0 then @@ -165,7 +165,7 @@ sql select * from t2 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -173,7 +173,7 @@ sql select * from t3 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -181,7 +181,7 @@ sql select * from t4 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -189,7 +189,7 @@ sql select * from t5 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -197,7 +197,7 @@ sql select * from t6 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -205,7 +205,7 @@ sql select * from t7 if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -213,7 +213,7 @@ endi #if $rows != 1 then # return -1 #endi -#if $data01 != null then +#if $data01 != NULL then # return -1 #endi @@ -222,4 +222,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/percentile.sim b/tests/script/general/compute/percentile.sim index 5d3f40a6de73a0d44f59abff55b3de7a939afe7f..dd309c378943b69e87ea622bbdae133e7899209f 100644 --- a/tests/script/general/compute/percentile.sim +++ b/tests/script/general/compute/percentile.sim @@ -112,3 +112,5 @@ sql show databases 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/general/compute/stddev.sim b/tests/script/general/compute/stddev.sim index 4eaba1460551d0d76880933ec11a5ceae67305d6..7cea8726a9ed3d3d8215c97e368df623bb0a1c30 100644 --- a/tests/script/general/compute/stddev.sim +++ b/tests/script/general/compute/stddev.sim @@ -93,4 +93,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/sum.sim b/tests/script/general/compute/sum.sim index 79c7bc0762d83999ff4d2ccc76e11cc8ef705417..d05fe8930ecb882a14bd831e27925994179c888c 100644 --- a/tests/script/general/compute/sum.sim +++ b/tests/script/general/compute/sum.sim @@ -154,4 +154,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/compute/testSuite.sim b/tests/script/general/compute/testSuite.sim index 5539e08a9dd4980fa189d9eb6e9e3df2e828386a..6cd6badaeec40e6581c127cdf9328de70021a38d 100644 --- a/tests/script/general/compute/testSuite.sim +++ b/tests/script/general/compute/testSuite.sim @@ -1,16 +1,16 @@ -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/count.sim run general/compute/diff.sim +run general/compute/diff2.sim +run general/compute/first.sim run general/compute/interval.sim +run general/compute/last.sim +run general/compute/leastsquare.sim +run general/compute/max.sim +run general/compute/min.sim run general/compute/null.sim -run general/compute/diff2.sim +run general/compute/percentile.sim +run general/compute/stddev.sim +run general/compute/sum.sim +run general/compute/top.sim diff --git a/tests/script/general/compute/top.sim b/tests/script/general/compute/top.sim index 8f3797b67802e34bc655ae336ab40c1e8f4880cb..14b3b328a07e46759a17e206f1f3bc5d733e1c16 100644 --- a/tests/script/general/compute/top.sim +++ b/tests/script/general/compute/top.sim @@ -94,4 +94,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic.sim b/tests/script/general/db/basic.sim index dddc976ab3a4090b01b6e0915c52acf2177e90fe..43b18abd3231c135ab798f61d4aa70ed5abd2abe 100644 --- a/tests/script/general/db/basic.sim +++ b/tests/script/general/db/basic.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 @@ -202,3 +200,5 @@ sql show databases 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/general/db/basic1.sim b/tests/script/general/db/basic1.sim index 1fa6678ef84849d1eff27caa33c52245cf1dac30..302c5ac40992271e9ef757cb9704beb377a75d16 100644 --- a/tests/script/general/db/basic1.sim +++ b/tests/script/general/db/basic1.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -56,4 +57,6 @@ endi if $data03 != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/basic2.sim b/tests/script/general/db/basic2.sim index 945481d9bf964d52373409ae102f980bfe12bdb7..afe5ee5d95402fac985b9c5673fb43e35a285f22 100644 --- a/tests/script/general/db/basic2.sim +++ b/tests/script/general/db/basic2.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -49,3 +50,5 @@ sql show tables if $rows != 3 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/general/db/basic3.sim b/tests/script/general/db/basic3.sim index 00e3e9d106934fa6f6d61ba73d4033507844520c..88f5bf64604d2f1f6bd11040de844e871808c566 100644 --- a/tests/script/general/db/basic3.sim +++ b/tests/script/general/db/basic3.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -47,3 +48,5 @@ sql show d2.tables if $rows != 3 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/general/db/basic4.sim b/tests/script/general/db/basic4.sim index 9f8d463a7d8c65556a79e09b000eb5f2b8cb0f81..8494b0358a723589525684785d70c8039d43be03 100644 --- a/tests/script/general/db/basic4.sim +++ b/tests/script/general/db/basic4.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -116,3 +117,5 @@ sql show d1.vgroups 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/general/db/basic5.sim b/tests/script/general/db/basic5.sim index 09ace39bf438c64883e2dbfa04ab212dd5a6b9a0..3c59144387c32d46183ab9ef555bff6610193f24 100644 --- a/tests/script/general/db/basic5.sim +++ b/tests/script/general/db/basic5.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database d1 @@ -55,3 +56,5 @@ if $rows != 0 then endi sql_error show d1.vgroups + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reuse1.sim b/tests/script/general/db/delete_reuse1.sim index 8eb38ed1b108b34211386c621588cdea8cdc6ec5..1e4baeb57687fa13bc51401cd6f884498a9b9b77 100644 --- a/tests/script/general/db/delete_reuse1.sim +++ b/tests/script/general/db/delete_reuse1.sim @@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -107,3 +108,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reuse2.sim b/tests/script/general/db/delete_reuse2.sim index d7483a1b589e61acea069e01053153ac5b636097..0117d87104fc98ed01422c6534afdb57566b6284 100644 --- a/tests/script/general/db/delete_reuse2.sim +++ b/tests/script/general/db/delete_reuse2.sim @@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -115,3 +116,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_reusevnode.sim b/tests/script/general/db/delete_reusevnode.sim index 1328ae1a9c5af53a3e614a4ddf03d540e72e6321..c76a2e8bc78d4cd773e4b8cbe70fb4ff33ff4585 100644 --- a/tests/script/general/db/delete_reusevnode.sim +++ b/tests/script/general/db/delete_reusevnode.sim @@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -109,3 +110,5 @@ sql show databases 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/general/db/delete_reusevnode2.sim b/tests/script/general/db/delete_reusevnode2.sim index b0032e137bf3e3dba249aa6e0eb815296a9bdca1..12357b9e44303798f4f98e9c24f3787ada191ad0 100644 --- a/tests/script/general/db/delete_reusevnode2.sim +++ b/tests/script/general/db/delete_reusevnode2.sim @@ -8,6 +8,7 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print ======== step1 @@ -70,3 +71,5 @@ sql show databases 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/general/db/delete_writing1.sim b/tests/script/general/db/delete_writing1.sim index 134a34bf955b19d996bfa91e2703e141f1eaddb3..58fe68dd5f991098e0a6d33101f84effec0aa6c5 100644 --- a/tests/script/general/db/delete_writing1.sim +++ b/tests/script/general/db/delete_writing1.sim @@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect sql create database db @@ -52,3 +53,5 @@ while $x < 20 $x = $x + 1 endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/delete_writing2.sim b/tests/script/general/db/delete_writing2.sim index 819c16751a4d6d3257cb44bc5efb0e7293caaebf..00383d1341b120404167fe532a531531e5931a6f 100644 --- a/tests/script/general/db/delete_writing2.sim +++ b/tests/script/general/db/delete_writing2.sim @@ -6,6 +6,7 @@ system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 print ========= start dnodes system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect sql create database db @@ -43,3 +44,5 @@ while $x < 10 $x = $x + 1 endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/len.sim b/tests/script/general/db/len.sim index d8c0e9363ffb01d5991114593910cac777ef36c3..8add486658d1706348d9d1f3e6e443de262da54c 100644 --- a/tests/script/general/db/len.sim +++ b/tests/script/general/db/len.sim @@ -91,4 +91,6 @@ step8: sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/repeat.sim b/tests/script/general/db/repeat.sim index a69e3fa019b716852aa76ad3c4f05d88f883b5ec..ca68e6d8835a68f58ecae6ab6fe2b2e4716892f0 100644 --- a/tests/script/general/db/repeat.sim +++ b/tests/script/general/db/repeat.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 @@ -69,3 +67,5 @@ sql drop database d9 sql drop database d10 sql drop database d11 sql drop database d12 + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/tables.sim b/tests/script/general/db/tables.sim index 590c6fc4421d37daae61dd601ae68ca24e3cc585..bf714dbf56a9adf5d10e746fd03a01a89deefbd1 100644 --- a/tests/script/general/db/tables.sim +++ b/tests/script/general/db/tables.sim @@ -138,4 +138,6 @@ endi sql select * from t4 if $data01 != 4 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/db/testSuite.sim b/tests/script/general/db/testSuite.sim index 893d2040a970942b074f08228661ae2c12266529..2cac8b8fa882e10befcb6d6602665373cef1e8f6 100644 --- a/tests/script/general/db/testSuite.sim +++ b/tests/script/general/db/testSuite.sim @@ -7,7 +7,7 @@ run general/db/basic5.sim run general/db/delete_reuse1.sim run general/db/delete_reuse2.sim run general/db/delete_reusevnode.sim -#run general/db/delete_reusevnode2.sim +run general/db/delete_reusevnode2.sim run general/db/delete_writing1.sim run general/db/delete_writing2.sim run general/db/len.sim diff --git a/tests/script/general/field/2.sim b/tests/script/general/field/2.sim index dff0e6250cd61d3b0601f5707704be146a574593..28506b7cb82456ce424be5052a1f41269dcd56a3 100644 --- a/tests/script/general/field/2.sim +++ b/tests/script/general/field/2.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_bt_db -$tbPrefix = fi_bt_tb -$mtPrefix = fi_bt_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -233,6 +231,8 @@ if $data00 != 100 then return -1 endi +print sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 + sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 print $data00 $data01 $data02 $data03 $data04 $data05 $data06 if $data00 != 100 then @@ -292,4 +292,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/3.sim b/tests/script/general/field/3.sim index 05fed074284f823d04b414559fb8fbacf8bb1b9f..453f4968bfe1be218886bf958aaab44a287ba914 100644 --- a/tests/script/general/field/3.sim +++ b/tests/script/general/field/3.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_3_db -$tbPrefix = fi_3_tb -$mtPrefix = fi_3_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = mt $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -518,4 +516,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/4.sim b/tests/script/general/field/4.sim index ad84124b7d93adc732f82be0708535234d02cd7c..243424724fa8a487f8b8ea5394014c5913b097de 100644 --- a/tests/script/general/field/4.sim +++ b/tests/script/general/field/4.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_4_db -$tbPrefix = fi_4_tb -$mtPrefix = fi_4_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -708,4 +706,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/5.sim b/tests/script/general/field/5.sim index 63fec1f16935e8c1fdb0119d536b3556b9eb3787..ca1543b54bf83ee40b077e2542e43e7e5c8e4c03 100644 --- a/tests/script/general/field/5.sim +++ b/tests/script/general/field/5.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_5_db -$tbPrefix = fi_5_tb -$mtPrefix = fi_5_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -831,4 +829,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/6.sim b/tests/script/general/field/6.sim index 409c2e53c3e31cc11d04110fb1ae278216ea479e..23223e5c1502105b5df13f9d9cad5ad12b08944c 100644 --- a/tests/script/general/field/6.sim +++ b/tests/script/general/field/6.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_6_db -$tbPrefix = fi_6_tb -$mtPrefix = fi_6_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -986,4 +984,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/bigint.sim b/tests/script/general/field/bigint.sim index e355cb31615f28ee77326f8fb4a58779cf98bebb..5cca73595c9159c8da8cea31e24471814f8f9771 100644 --- a/tests/script/general/field/bigint.sim +++ b/tests/script/general/field/bigint.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_bi_db -$tbPrefix = fi_bi_tb -$mtPrefix = fi_bi_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/binary.sim b/tests/script/general/field/binary.sim index 3ac43760975fcd6ec9aa0a1fd0006c5a0b6e5a7b..8bf1c84b93f54be6a0bd9267abdf05d695cdc6d4 100644 --- a/tests/script/general/field/binary.sim +++ b/tests/script/general/field/binary.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_by_db -$tbPrefix = fi_by_tb -$mtPrefix = fi_by_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -81,4 +79,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/bool.sim b/tests/script/general/field/bool.sim index 8a1a7172259c351a3b46ecddf9e47ccdb3868527..4528f79bc79ddb9fb6c2eeeb54c13384eec7df99 100644 --- a/tests/script/general/field/bool.sim +++ b/tests/script/general/field/bool.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_bo_db -$tbPrefix = fi_bo_tb -$mtPrefix = fi_bo_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -158,4 +156,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/double.sim b/tests/script/general/field/double.sim index 2de34ad5b6b4de0450a80fbe600c38311baa9ea1..40650cb9bdbc3908892a6e6ee1958fa62c90d6bb 100644 --- a/tests/script/general/field/double.sim +++ b/tests/script/general/field/double.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_do_db -$tbPrefix = fi_do_tb -$mtPrefix = fi_do_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/float.sim b/tests/script/general/field/float.sim index 443a721340960e3173bde2cc274c71a02ef243ff..0ead9fb48a424e5d2c5d2ff3b69a6ecc21fbf540 100644 --- a/tests/script/general/field/float.sim +++ b/tests/script/general/field/float.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_fl_db -$tbPrefix = fi_fl_tb -$mtPrefix = fi_fl_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/int.sim b/tests/script/general/field/int.sim index 4ab10056713e69db01d4360a7473c592b4a88cbf..a095dc2176ad75c0123c7dcc9a1e0a5a1c75d75f 100644 --- a/tests/script/general/field/int.sim +++ b/tests/script/general/field/int.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_in_db -$tbPrefix = fi_in_tb -$mtPrefix = fi_in_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/single.sim b/tests/script/general/field/single.sim index 6d710614f2ea0077e39db749607229fed9ac0386..8540608e96aacfe50dc346a0bf4217f8c38db7b7 100644 --- a/tests/script/general/field/single.sim +++ b/tests/script/general/field/single.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_si_db -$tbPrefix = fi_si_tb -$mtPrefix = fi_si_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $rowNum = 20 print =============== step1 @@ -215,4 +213,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/smallint.sim b/tests/script/general/field/smallint.sim index 37ddadb271f1726f7351bb7a6593a193f6b8264c..578de4ea442b87bea61f24db8c24b71efe0e2621 100644 --- a/tests/script/general/field/smallint.sim +++ b/tests/script/general/field/smallint.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -9,9 +7,9 @@ sleep 3000 sql connect print ======================== dnode1 start -$dbPrefix = fi_sm_db -$tbPrefix = fi_sm_tb -$mtPrefix = fi_sm_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -157,4 +155,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/field/testSuite.sim b/tests/script/general/field/testSuite.sim index 9b58c77e929fedcceb0364d06602e15af641102e..807ee8e31575d87d94aa1a92dc12e01be7843d57 100644 --- a/tests/script/general/field/testSuite.sim +++ b/tests/script/general/field/testSuite.sim @@ -1,14 +1,11 @@ -run general/field/single.sim -run general/field/bool.sim -run general/field/smallint.sim -run general/field/tinyint.sim -run general/field/int.sim -run general/field/bigint.sim -run general/field/float.sim -run general/field/double.sim -run general/field/binary.sim run general/field/2.sim run general/field/3.sim run general/field/4.sim run general/field/5.sim -run general/field/6.sim \ No newline at end of file +run general/field/6.sim +run general/field/bigint.sim +run general/field/binary.sim +run general/field/bool.sim +run general/field/single.sim +run general/field/smallint.sim +run general/field/tinyint.sim diff --git a/tests/script/general/field/tinyint.sim b/tests/script/general/field/tinyint.sim index 65775c1145e3a9809aaf131546528d6caeea0502..f132b427025d4c706cdcf09b4ede678e36fbaaf8 100644 --- a/tests/script/general/field/tinyint.sim +++ b/tests/script/general/field/tinyint.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -10,9 +8,9 @@ sql connect print ======================== dnode1 start -$dbPrefix = fi_ti_db -$tbPrefix = fi_ti_tb -$mtPrefix = fi_ti_mt +$dbPrefix = db +$tbPrefix = tb +$mtPrefix = st $tbNum = 10 $rowNum = 20 $totalNum = 200 @@ -158,4 +156,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/grafana.sim b/tests/script/general/http/grafana.sim index f2f84f798525c49eed836a658bf7136b425547bf..a5cc7b323744e4ae7bafb5afb807026c8a5a8687 100644 --- a/tests/script/general/http/grafana.sim +++ b/tests/script/general/http/grafana.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode1 -c http -v 1 #system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10 system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135 system sh/exec.sh -n dnode1 -s start @@ -54,50 +52,50 @@ sql insert into t3 values('2017-12-25 21:27:41', 3) print =============== step2 - login -system_content curl 192.168.0.1:6020/grafana/ +system_content curl 127.0.0.1:6020/grafana/ print 1-> $system_content if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then return -1 endi -system_content curl 192.168.0.1:6020/grafana/xx +system_content curl 127.0.0.1:6020/grafana/xx print 2-> $system_content if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then return -1 endi -system_content curl 192.168.0.1:6020/grafana/login/xx/xx/ +system_content curl 127.0.0.1:6020/grafana/login/xx/xx/ print 3-> $system_content -if $system_content != @{"status":"error","code":35,"desc":"invalid user name"}@ then +if $system_content != @{"status":"error","code":1000,"desc":"invalid user"}@ then return -1 endi -system_content curl 192.168.0.1:6020/grafana/root/1/123/1/1/3 +system_content curl 127.0.0.1:6020/grafana/root/1/123/1/1/3 print 4-> $system_content if $system_content != @{"status":"error","code":1011,"desc":"no auth info input"}@ then return -1 endi -system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 192.168.0.1:6020/grafana/login/1/root/1/ +system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/grafana/login/1/root/1/ print 5-> $system_content -if $system_content != @{"status":"error","code":35,"desc":"invalid user name"}@ then +if $system_content != @{"status":"error","code":1000,"desc":"invalid user"}@ then return -1 endi -system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/grafana/root/1/login +system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/grafana/root/1/login print 6-> $system_content if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then return -1 endi -system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 192.168.0.1:6020/grafana/root/1/login +system_content curl -H 'Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwicGFzcyI6InRhb3NkYXRhIiwic3ViIjoicm9vdCJ9.xPv3b5odlR7YF8G_QWASjIRbMtA5v4ItToJ35fFgi' -d 'show databases' 127.0.0.1:6020/grafana/root/1/login print 7-> $system_content if $system_content != @{"status":"error","code":1010,"desc":"invalid type of Authorization"}@ then return -1 endi sleep 3000 -system_content curl 192.168.0.1:6020/grafana/login/root/taosdata +system_content curl 127.0.0.1:6020/grafana/login/root/taosdata print 8-> $system_content if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then return -1 @@ -180,3 +178,5 @@ print 19-> $system_content if $system_content != @[{"refId":"A","target":"3","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"15.299999714","datapoints":[[3,"-"]]}]@ 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/general/http/grafana_bug.sim b/tests/script/general/http/grafana_bug.sim index 41347d855fc65fec0fc684232c0575a3ba4c6d98..6f12849b2b718f671f083a8c3de49aeb0ef37052 100644 --- a/tests/script/general/http/grafana_bug.sim +++ b/tests/script/general/http/grafana_bug.sim @@ -1,9 +1,7 @@ system sh/stop_dnodes.sh - -sleep 2000 - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 #system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10 system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135 @@ -237,3 +235,4 @@ if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]}, return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/prepare.sim b/tests/script/general/http/prepare.sim index 17b6823e00c5ed984bbd2201a6e386e0ee884164..d5b89201905c70d8d4d7844557f9883dbe4cbca8 100644 --- a/tests/script/general/http/prepare.sim +++ b/tests/script/general/http/prepare.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode1 -c http -v 1 system sh/exec.sh -n dnode1 -s start sleep 3000 @@ -52,3 +50,5 @@ print curl 127.0.0.1:6020/rest/sql/d1 -----> $system_content if $system_content != @{"status":"succ","head":["ts","i","b"],"data":[["2017-12-25 21:28:54.022",14,"44\\\\\"\"44"],["2017-12-25 21:28:53.022",13,"33\\\\\"33"],["2017-12-25 21:28:52.022",12,"22\\\\11"],["2017-12-25 21:28:51.022",11,"11\\\\11"],["2017-12-25 21:28:49.022",9,"99\\99"],["2017-12-25 21:28:48.022",8,"88\"\"88"],["2017-12-25 21:28:47.022",7,"77\"7\""],["2017-12-25 21:28:46.022",6,"66'6'"],["2017-12-25 21:28:45.022",5,"55'"],["2017-12-25 21:28:44.022",4,"44\""],["2017-12-25 21:28:43.022",3,"33"],["2017-12-25 21:28:42.022",2,"22"],["2017-12-25 21:28:41.022",1,"11"]],"rows":13}@ 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/general/http/restful.sim b/tests/script/general/http/restful.sim index 894033e8f0c3eaff4e2fd1127f8901c3e1683498..5ee8bde46fd38aa99508673a7dded5bef3c630a2 100644 --- a/tests/script/general/http/restful.sim +++ b/tests/script/general/http/restful.sim @@ -1,5 +1,5 @@ system sh/stop_dnodes.sh -sleep 5000 +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/cfg.sh -n dnode1 -c http -v 1 @@ -80,3 +80,5 @@ print curl 127.0.0.1:6020/rest/login/u2/abcd_1234 -----> $system_content if $system_content != @{"status":"error","code":1000,"desc":"auth failure"}@ 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/general/http/restful_full.sim b/tests/script/general/http/restful_full.sim index a4c1bd1851162b967a2bb0d5669a5e7727fc79b7..a5defb5914d733147a88ca6024b61e8d183f0e03 100644 --- a/tests/script/general/http/restful_full.sim +++ b/tests/script/general/http/restful_full.sim @@ -1,5 +1,5 @@ system sh/stop_dnodes.sh -sleep 5000 +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/cfg.sh -n dnode1 -c http -v 1 @@ -81,7 +81,7 @@ print =============== step2 - no db #11 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:6020/rest/sql print 11-> $system_content -if $system_content != @{"status":"succ","head":["name","create time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","tables","cache(MB)","blocks","minrows","maxrows","ctime(s)","clog","comp","precision","status"],"data":[],"rows":0}@ then +if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","days","keep1,keep2,keep(D)","maxtables","cache(MB)","blocks","minrows","maxrows","ctime(Sec.)","wallevel","comp","precision","status"],"data":[],"rows":0}@ then return -1 endi @@ -93,7 +93,7 @@ endi system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'create database d1' 127.0.0.1:6020/rest/sql print 13-> $system_content -if $system_content != @{"status":"error","code":1000,"desc":"DB already there"}@ then +if $system_content != @{"status":"error","code":1000,"desc":"database aleady exist"}@ then return -1 endi @@ -230,3 +230,4 @@ if $system_content != @{"status":"succ","head":["ts","speed"],"data":[["2017-12- return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/restful_insert.sim b/tests/script/general/http/restful_insert.sim index 66f47728edc5f96bb1df1c744377447e90d68813..7b1e88a25f53c188072963f6bbd39c419a81dc12 100644 --- a/tests/script/general/http/restful_insert.sim +++ b/tests/script/general/http/restful_insert.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode1 -c httpEnableRecordSql -v 1 system sh/exec.sh -n dnode1 -s start @@ -51,3 +49,5 @@ print =============== step5 - query data system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_rest1' 127.0.0.1:6020/rest/sql print curl 127.0.0.1:6020/rest/sql -----> $system_content + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/restful_limit.sim b/tests/script/general/http/restful_limit.sim index 1cbbb221e34b0ed52d14ffdf41bacc7a9ed60a39..8ee12f1c375bc054c30b2e3e4b72cb3217e90278 100644 --- a/tests/script/general/http/restful_limit.sim +++ b/tests/script/general/http/restful_limit.sim @@ -1,6 +1,5 @@ system sh/stop_dnodes.sh - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -43,3 +42,5 @@ print curl 127.0.0.1:6020/rest/sql -----> $system_content #system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d "select * from db0.st0 where tbname in ('tb0', 'tb1') limit 1000" 127.0.0.1:6020/rest/sql #print curl 127.0.0.1:6020/rest/sql -----> $system_content + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/telegraf.sim b/tests/script/general/http/telegraf.sim index 7d687ff460166aaad38c4922c01fcd9ab3355d1c..60eeec652e8b5fa7be5488a4a85b8b258cf4495c 100644 --- a/tests/script/general/http/telegraf.sim +++ b/tests/script/general/http/telegraf.sim @@ -1,10 +1,8 @@ system sh/stop_dnodes.sh - -sleep 5000 - - +sleep 3000 system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode1 -c http -v 1 system sh/cfg.sh -n dnode1 -c httpEnableRecordSql -v 1 system sh/cfg.sh -n dnode1 -c telegrafUseFieldNum -v 0 system sh/exec.sh -n dnode1 -s start @@ -18,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 @@ -172,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 @@ -193,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 @@ -221,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 @@ -254,17 +252,17 @@ system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Perce print $system_content -if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":0,"status":"succ"}]}@ then - return -1 -endi +#if $system_content != @{"metrics":[{"metric":"win_cpu","stable":"win_cpu","table":"win_cpu_windows_1_Processor","timestamp":"1564641722000","affected_rows":1,"status":"succ"}]}@ then +# return -1 +#endi system_content curl -u root:taosdata -d 'select * from db.win_cpu_windows_1_Processor' 127.0.0.1:6020/rest/sql/ print $system_content -if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:02.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then - return -1 -endi +#if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 06:42:02.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then +# return -1 +#endi print =============== step3 - multi-query data system_content curl -u root:taosdata -d '{"metrics": [{"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":"window1","instance":"1","objectname":"Processor"},"timestamp":1564641723000},{"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":"window2","instance":"1","objectname":"Processor"},"timestamp":1564641723000}]}' 127.0.0.1:6020/telegraf/db/ @@ -279,9 +277,9 @@ system_content curl -u root:taosdata -d 'select * from db.win_cpu_window1_1_Pro print $system_content -if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:03.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then - return -1 -endi +#if $system_content != @{"status":"succ","head":["ts","f_percent_dpc_time","f_percent_idle_time","f_percent_interrupt_time","f_percent_privileged_time","f_percent_processor_time","f_percent_user_time"],"data":[["2019-08-01 14:42:03.000",0.000000000,95.598305000,0.000000000,0.000000000,0.000000000,0.000000000]],"rows":1}@ then +# return -1 +#endi system_content curl -u root:taosdata -d 'select count(*) from db.win_cpu' 127.0.0.1:6020/rest/sql/ @@ -291,3 +289,4 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[3]],"rows": return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/http/testSuite.sim b/tests/script/general/http/testSuite.sim index 336d606a378f2298593a55f849b4c91b4798e2ae..d91e9f452d17d4f46f82123b7e6911c094681971 100644 --- a/tests/script/general/http/testSuite.sim +++ b/tests/script/general/http/testSuite.sim @@ -1,8 +1,8 @@ run general/http/restful.sim run general/http/restful_insert.sim -#run general/http/restful_limit.sim -#run general/http/restful_full.sim -#run general/http/prepare.sim -#run general/http/telegraf.sim -#run general/http/grafana_bug.sim -#run general/http/grafana.sim +run general/http/restful_limit.sim +run general/http/restful_full.sim +run general/http/prepare.sim +run general/http/telegraf.sim +run general/http/grafana_bug.sim +run general/http/grafana.sim diff --git a/tests/script/general/import/basic.sim b/tests/script/general/import/basic.sim index 0623405c2f9f33352f6858f90da036baefc7835a..2b72d55cdaf76ed07cd3519053010c1186ccd28b 100644 --- a/tests/script/general/import/basic.sim +++ b/tests/script/general/import/basic.sim @@ -1,10 +1,4 @@ system sh/stop_dnodes.sh - - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode2 -c walLevel -v 0 +system sh/cfg.sh -n dnode3 -c walLevel -v 0 +system sh/cfg.sh -n dnode4 -c walLevel -v 0 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -50,14 +44,14 @@ endi print ================= step2 sql insert into tb values(1564641708000, 8000) sql select * from tb; -if $rows != 1 then +if $rows != 2 then return -1 endi print ================= step3 sql insert into tb values(1564641720000, 20000) sql select * from tb; -if $rows != 2 then +if $rows != 3 then return -1 endi @@ -76,7 +70,7 @@ sql insert into tb values(1564641714000, 14000) sql insert into tb values(1564641725000, 25000) sql insert into tb values(1564641740000, 40000) sql select * from tb; -if $rows != 6 then +if $rows != 8 then return -1 endi @@ -87,7 +81,7 @@ sql import into tb values(1564641723000, 23000) sql import into tb values(1564641734000, 34000) sql import into tb values(1564641750000, 50000) sql select * from tb; -if $rows != 11 then +if $rows != 13 then return -1 endi @@ -98,7 +92,7 @@ sql import into tb values(1564641723001, 23001) sql import into tb values(1564641734001, 34001) sql import into tb values(1564641750001, 50001) sql select * from tb; -if $rows != 16 then +if $rows != 18 then return -1 endi @@ -108,28 +102,28 @@ sql insert into tb values(1564641714002, 14002) sql insert into tb values(1564641725002, 25002) sql insert into tb values(1564641900000, 200000) sql select * from tb; -if $rows != 17 then +if $rows != 22 then return -1 endi print ================= step9 only insert last one sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000) sql select * from tb; -if $rows != 20 then +if $rows != 25 then return -1 endi print ================= step10 sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000) sql select * from tb; -if $rows != 20 then +if $rows != 25 then return -1 endi print ================= step11 sql import into tb values(1564642400000, 700000) sql select * from tb; -if $rows != 20 then +if $rows != 25 then return -1 endi @@ -137,7 +131,7 @@ print ================= step12 sql import into tb values(1564641709527, 9527)(1564641709527, 9528) sql select * from tb; print rows=> $rows -if $rows != 21 then +if $rows != 26 then return -1 endi @@ -145,7 +139,8 @@ print ================= step13 sql import into tb values(1564641709898, 9898)(1564641709897, 9897) sql select * from tb; print rows=> $rows -if $rows != 23 then +if $rows != 28 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/general/import/commit.sim b/tests/script/general/import/commit.sim index ce52b9496f675b9605ad26a074d9414ca9dd648e..64833fcd61677fd3e6a2ac5ee4f2e46b662ce4a7 100644 --- a/tests/script/general/import/commit.sim +++ b/tests/script/general/import/commit.sim @@ -1,10 +1,4 @@ system sh/stop_dnodes.sh - - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode2 -c walLevel -v 0 +system sh/cfg.sh -n dnode3 -c walLevel -v 0 +system sh/cfg.sh -n dnode4 -c walLevel -v 0 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -93,6 +87,4 @@ if $rows != 12 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/general/import/large.sim b/tests/script/general/import/large.sim index 6a0bbf28d277e22a11a7ea645e156b1fcbe8b14a..6f6889a226d8abdc9b2f1ffa026b57a0a55ae314 100644 --- a/tests/script/general/import/large.sim +++ b/tests/script/general/import/large.sim @@ -1,10 +1,4 @@ system sh/stop_dnodes.sh - - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -25,10 +19,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +system sh/cfg.sh -n dnode1 -c walLevel -v 0 +system sh/cfg.sh -n dnode2 -c walLevel -v 0 +system sh/cfg.sh -n dnode3 -c walLevel -v 0 +system sh/cfg.sh -n dnode4 -c walLevel -v 0 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -99,4 +93,6 @@ while $i < 1000 $i = $i + 1 endw -print ================= step2 \ No newline at end of file +print ================= step2 + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/import/replica1.sim b/tests/script/general/import/replica1.sim index 14e27ffa503d6a8e46af0e5b14a19e005cf3939a..b2b7291623a7a18320c78b36a14e20d940eedab6 100644 --- a/tests/script/general/import/replica1.sim +++ b/tests/script/general/import/replica1.sim @@ -1,10 +1,5 @@ system sh/stop_dnodes.sh - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -25,10 +20,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000 system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000 -system sh/cfg.sh -n dnode1 -c commitlog -v 0 -system sh/cfg.sh -n dnode2 -c commitlog -v 0 -system sh/cfg.sh -n dnode3 -c commitlog -v 0 -system sh/cfg.sh -n dnode4 -c commitlog -v 0 +system sh/cfg.sh -n dnode1 -c walLevel -v 2 +system sh/cfg.sh -n dnode2 -c walLevel -v 2 +system sh/cfg.sh -n dnode3 -c walLevel -v 2 +system sh/cfg.sh -n dnode4 -c walLevel -v 2 print ========= start dnode1 system sh/exec.sh -n dnode1 -s start @@ -40,53 +35,59 @@ sql use ir1db sql create table tb(ts timestamp, i int) print ================= step1 -sql import into tb values(now+10000a, 10000) +sql import into tb values(1520000010000, 10000) sql select * from tb; +print $rows if $rows != 1 then return -1 endi print ================= step2 -sql insert into tb values(now+8000a, 8000) +sql insert into tb values(1520000008000, 8000) +print $rows sql select * from tb; -if $rows != 1 then +if $rows != 2 then return -1 endi print ================= step3 -sql insert into tb values(now+20000a, 20000) +sql insert into tb values(1520000020000, 20000) sql select * from tb; -if $rows != 2 then +print $rows +if $rows != 3 then return -1 endi print ================= step4 -sql import into tb values(now+8000a, 9000) -sql import into tb values(now+15000a, 15000) -sql import into tb values(now+30000a, 30000) +sql import into tb values(1520000009000, 9000) +sql import into tb values(1520000015000, 15000) +sql import into tb values(1520000030000, 30000) sql select * from tb; -if $rows != 5 then +print $rows +if $rows != 6 then return -1 endi print ================= step5 -sql insert into tb values(now+8000a, 8000) -sql insert into tb values(now+14000a, 14000) -sql insert into tb values(now+25000a, 25000) -sql insert into tb values(now+40000a, 40000) +sql insert into tb values(1520000008000, 8000) +sql insert into tb values(1520000014000, 14000) +sql insert into tb values(1520000025000, 25000) +sql insert into tb values(1520000040000, 40000) sql select * from tb; -if $rows != 6 then +print $rows +if $rows != 9 then return -1 endi print ================= step6 -sql import into tb values(now+7000a, 7000) -sql import into tb values(now+12000a, 12000) -sql import into tb values(now+23000a, 23000) -sql import into tb values(now+34000a, 34000) -sql import into tb values(now+50000a, 50000) +sql import into tb values(1520000007000, 7000) +sql import into tb values(1520000012000, 12000) +sql import into tb values(1520000023000, 23000) +sql import into tb values(1520000034000, 34000) +sql import into tb values(1520000050000, 50000) sql select * from tb; -if $rows != 11 then +print $rows +if $rows != 14 then return -1 endi @@ -98,46 +99,63 @@ sleep 5000 sql use ir1db sql select * from tb; -if $rows != 11 then +if $rows != 14 then return -1 endi print ================= step7 -sql import into tb values(now+7001a, 7001) -sql import into tb values(now+12001a, 12001) -sql import into tb values(now+23001a, 23001) -sql import into tb values(now+34001a, 34001) -sql import into tb values(now+50001a, 50001) +sql import into tb values(1520000007001, 7001) +sql import into tb values(1520000012001, 12001) +sql import into tb values(1520000023001, 23001) +sql import into tb values(1520000034001, 34001) +sql import into tb values(1520000050001, 50001) sql select * from tb; -if $rows != 16 then +print $rows +if $rows != 19 then return -1 endi print ================= step8 -sql insert into tb values(now+8002a, 8002) -sql insert into tb values(now+14002a, 14002) -sql insert into tb values(now+25002a, 25002) -sql insert into tb values(now+200000a, 60000) +sql insert into tb values(1520000008002, 8002) +sql insert into tb values(1520000014002, 14002) +sql insert into tb values(1520000025002, 25002) +sql insert into tb values(1520000060000, 60000) sql select * from tb; -if $rows != 17 then +print $rows +if $rows != 24 then return -1 endi print ================= step9 -sql import into tb values(now-30d, 7003) -sql import into tb values(now-20d, 34003) -sql import into tb values(now-10d, 34003) -sql import into tb values(now-5d, 34003) -sql import into tb values(now+1m, 50001) -sql import into tb values(now+2m, 50001) -sql import into tb values(now+3m, 50001) -sql import into tb values(now+4m, 50002) -sql import into tb values(now+5m, 50003) -sql import into tb values(now+6m, 50004) -sql import into tb values(now+7m, 50001) -sql import into tb values(now+8m, 500051) +#1520000000000 +#sql import into tb values(now-30d, 7003) +#sql import into tb values(now-20d, 34003) +#sql import into tb values(now-10d, 34003) +#sql import into tb values(now-5d, 34003) +#sql import into tb values(now+1d, 50001) +#sql import into tb values(now+2d, 50001) +#sql import into tb values(now+6d, 50001) +#sql import into tb values(now+8d, 50002) +#sql import into tb values(now+10d, 50003) +#sql import into tb values(now+12d, 50004) +#sql import into tb values(now+14d, 50001) +#sql import into tb values(now+16d, 500051) + +sql import into tb values(1517408000000, 7003) +sql import into tb values(1518272000000, 34003) +sql import into tb values(1519136000000, 34003) +sql import into tb values(1519568000000, 34003) +sql import into tb values(1519654400000, 50001) +sql import into tb values(1519827200000, 50001) +sql import into tb values(1520345600000, 50001) +sql import into tb values(1520691200000, 50002) +sql import into tb values(1520864000000, 50003) +sql import into tb values(1521900800000, 50004) +sql import into tb values(1523110400000, 50001) +sql import into tb values(1521382400000, 500051) sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -149,23 +167,44 @@ sleep 5000 sql use ir1db sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi print ================= step11 -sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) + +#sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) +sql import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003) sql select * from tb; -if $rows != 34 then +if $rows != 41 then return -1 endi -sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +print ================= step12 +#1520000000000 +#sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +sql import into tb values(1518358400000, 7003) (1518444800000, 7003) (1518531200000, 7003) (1518617600000, 7003) (1518704000000, 7003) (1518790400000, 7003) (1518876800000, 7003) (1518963200000, 7003) (1519049600000, 7003) sql select * from tb; -if $rows != 43 then +print $rows +if $rows != 50 then return -1 endi +print ================= step14 +#1520000000000 +#sql import into tb values(now-48d, 34003) +#sql import into tb values(now-38d, 50001) +#sql import into tb values(now-28d, 50001) + +sql import into tb values(1515852800001, 34003) +sql import into tb values(1516716800000, 50001) +sql import into tb values(1517580800000, 50001) +sql select * from tb; +if $rows != 50 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/general/import/testSuite.sim b/tests/script/general/import/testSuite.sim index d340d90d6645a462be6511532fa9f08c8c629dbb..9157410ea562ed924725013b81cac2fd78946c75 100644 --- a/tests/script/general/import/testSuite.sim +++ b/tests/script/general/import/testSuite.sim @@ -1,4 +1,4 @@ run general/import/basic.sim -#run general/import/commit.sim +run general/import/commit.sim run general/import/large.sim run general/import/replica1.sim diff --git a/tests/script/general/insert/basic.sim b/tests/script/general/insert/basic.sim index ef8d71fd25d4b2f670d24fb985c2fbb63e1ba998..ba8cff83fa8b470af1b1f7fccf74d0e1d042049e 100644 --- a/tests/script/general/insert/basic.sim +++ b/tests/script/general/insert/basic.sim @@ -1,6 +1,5 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -29,21 +28,23 @@ while $x < 10 endw print =============== step 2 -sql insert into $tb values (now - 5m , 10) -x error_insert -sql insert into $tb values (now - 6m , 10) -x error_insert -sql insert into $tb values (now - 7m , 10) -x error_insert -sql insert into $tb values (now - 8m , 10) -x error_insert -error_insert: +sql insert into $tb values (now - 5m , 10) +sql insert into $tb values (now - 6m , 10) +sql insert into $tb values (now - 7m , 10) +sql insert into $tb values (now - 8m , 10) sql select * from $tb print $rows points data are retrieved -if $rows != 10 then +if $rows != 14 then return -1 endi sql drop database $db +sleep 1000 sql show databases 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/general/insert/insert_drop.sim b/tests/script/general/insert/insert_drop.sim index 04f9415e2fcb0790abea2ac5a795e25dbd18d469..087b9f6aa9231cea43740b151f127124bbc48cee 100644 --- a/tests/script/general/insert/insert_drop.sim +++ b/tests/script/general/insert/insert_drop.sim @@ -75,9 +75,11 @@ sql connect sleep 3000 sql use $db + sql create table tb5 using $stb tags(5) sql select * from tb5 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/general/insert/query_block1_file.sim b/tests/script/general/insert/query_block1_file.sim index 5a1298bfdfbc431b0cfccec98d58f23414f29fbb..6d6daca7b59dbd1a5fa5f1981aab6ca78691474a 100644 --- a/tests/script/general/insert/query_block1_file.sim +++ b/tests/script/general/insert/query_block1_file.sim @@ -193,3 +193,5 @@ sql show databases 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/general/insert/query_block1_memory.sim b/tests/script/general/insert/query_block1_memory.sim index 30af2579bca012debb41872cd3cf129e3b1df837..83509ad5b0de17500f87591f5cb0a9c3a3c21438 100644 --- a/tests/script/general/insert/query_block1_memory.sim +++ b/tests/script/general/insert/query_block1_memory.sim @@ -175,3 +175,4 @@ 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/general/insert/query_block2_file.sim b/tests/script/general/insert/query_block2_file.sim index 773602ceb62719bb2be9bb46a8ad63d7b265f686..34da170a9ee6cf3af09de374d8c1da54966a6382 100644 --- a/tests/script/general/insert/query_block2_file.sim +++ b/tests/script/general/insert/query_block2_file.sim @@ -208,3 +208,4 @@ 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/general/insert/query_block2_memory.sim b/tests/script/general/insert/query_block2_memory.sim index 2c90fe5d12c765153aec92468cf2901d7bfaac59..3f2c97a098c35847ae566f6d9fdba0fa85a674d4 100644 --- a/tests/script/general/insert/query_block2_memory.sim +++ b/tests/script/general/insert/query_block2_memory.sim @@ -170,3 +170,5 @@ sql show databases 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/general/insert/query_file_memory.sim b/tests/script/general/insert/query_file_memory.sim index f8de8f5fd675ed0e84eb90996e889959ee806eaa..f923ebed13c2f9c592b38dc98ace644fcd8fb671 100644 --- a/tests/script/general/insert/query_file_memory.sim +++ b/tests/script/general/insert/query_file_memory.sim @@ -206,4 +206,4 @@ 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/general/insert/query_multi_file.sim b/tests/script/general/insert/query_multi_file.sim index 81809b51b8094a370286ad9921288de6cb973976..8622fa6f9b47ff2b82305fdfff8d187d7b95c275 100644 --- a/tests/script/general/insert/query_multi_file.sim +++ b/tests/script/general/insert/query_multi_file.sim @@ -53,3 +53,4 @@ 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/general/insert/tcp.sim b/tests/script/general/insert/tcp.sim index 9cea0d6866730e3a7bed540563601c251e50bad8..6f9752087d9d5d099703dd851b55305d65726784 100644 --- a/tests/script/general/insert/tcp.sim +++ b/tests/script/general/insert/tcp.sim @@ -1,6 +1,5 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -20,7 +19,6 @@ sql create database db sql use db sql create table tb (ts timestamp, test binary(1000)) - $x = 0 while $x < 10000 $ms = $x . s @@ -30,11 +28,4 @@ endw sql select * from tb - -return - -sql drop database $db -sql show databases -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/general/insert/testSuite.sim b/tests/script/general/insert/testSuite.sim index 582351a218ea45df513e9f1044ff239dee5fc8bb..da44167be57a6a2083c49c73a02999ba647f513e 100644 --- a/tests/script/general/insert/testSuite.sim +++ b/tests/script/general/insert/testSuite.sim @@ -1,8 +1,9 @@ -#run general/insert/basic.sim -#run general/insert/insert_drop.sim -#run general/insert/query_block1_memory.sim -#run general/insert/query_block2_memory.sim -#run general/insert/query_block1_file.sim -#run general/insert/query_block2_file.sim -#run general/insert/query_file_memory.sim -#run general/insert/query_multi_file.sim +run general/insert/basic.sim +run general/insert/insert_drop.sim +run general/insert/query_block1_memory.sim +run general/insert/query_block2_memory.sim +run general/insert/query_block1_file.sim +run general/insert/query_block2_file.sim +run general/insert/query_file_memory.sim +run general/insert/query_multi_file.sim +run general/insert/tcp.sim diff --git a/tests/script/general/metrics/disk.sim b/tests/script/general/metrics/disk.sim index a23a117ac20ead141b2c23b9202446593b35c744..0865719a147c2ecde394af0b5758b73909b1d53a 100644 --- a/tests/script/general/metrics/disk.sim +++ b/tests/script/general/metrics/disk.sim @@ -194,4 +194,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/metrics/metrics.sim b/tests/script/general/metrics/metrics.sim index 52448a4002b1a544a55329e4b19af4d0a584abcf..b9367469b3b4c2a99bc3c7618f5100471aeda641 100644 --- a/tests/script/general/metrics/metrics.sim +++ b/tests/script/general/metrics/metrics.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 @@ -135,3 +133,5 @@ sql show databases 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/general/metrics/values.sim b/tests/script/general/metrics/values.sim index efabc67722080f345ffb55117722ec2531637fc8..f524eee4119801fda2604fa7b07e3dce491562e5 100644 --- a/tests/script/general/metrics/values.sim +++ b/tests/script/general/metrics/values.sim @@ -102,25 +102,4 @@ if $rows != 100 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/general/metrics/vnode3.sim b/tests/script/general/metrics/vnode3.sim index 5d4a9f7f5be0bdf25415bff7eb3e3d51e50349a9..73be7a1195739c10deed1dc9d840e8f436bae009 100644 --- a/tests/script/general/metrics/vnode3.sim +++ b/tests/script/general/metrics/vnode3.sim @@ -175,4 +175,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/parser/alter.sim b/tests/script/general/parser/alter.sim index 1b19101bc01580cf53cee08514fe9a27e1f9d57e..f97581c5f5be19323a927ede71f3b87a381b3c3f 100644 --- a/tests/script/general/parser/alter.sim +++ b/tests/script/general/parser/alter.sim @@ -38,7 +38,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi sql alter table tb add column c3 nchar(4) @@ -46,7 +46,7 @@ sql select * from tb order by ts desc if $rows != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi sql insert into tb values (now, 2, 2, 'taos') @@ -72,13 +72,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi sql alter table mt add column c3 nchar(4) sql select * from tb order by ts desc -if $data03 != null then +if $data03 != NULL then return -1 endi sql insert into tb values (now, 2, 2, 'taos') @@ -89,7 +89,7 @@ endi if $data03 != taos then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi sql drop table tb @@ -169,7 +169,7 @@ endi if $data01 != 2 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi sql alter table mt add column c2 int @@ -200,7 +200,7 @@ if $data02 != insert then endi sql alter table mt add column c3 nchar(4) sql select * from tb order by ts desc -if $data03 != null then +if $data03 != NULL then return -1 endi # the query below should be deleted after bug fix diff --git a/tests/script/general/parser/alter1.sim b/tests/script/general/parser/alter1.sim index c0221e1033d59c88140667e804f5eec1808eb1b2..7c4609a87d79db00d835ee517ecb1b7a0162be24 100644 --- a/tests/script/general/parser/alter1.sim +++ b/tests/script/general/parser/alter1.sim @@ -36,16 +36,16 @@ print rows = $rows if $rows != 4 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data33 != null then +if $data33 != NULL then return -1 endi @@ -53,10 +53,10 @@ sql select c1 from stb if $rows != 4 then return -1 endi -if $data00 != null then +if $data00 != NULL then return -1 endi -if $data30 != null then +if $data30 != NULL then return -1 endi @@ -69,10 +69,10 @@ sql select c1+speed from car1 if $rows != 2 then return -1 endi -if $data00 != null then +if $data00 != NULL then return -1 endi -if $data10 != null then +if $data10 != NULL then return -1 endi @@ -80,10 +80,10 @@ sql select * from car1 if $rows != 2 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi diff --git a/tests/script/general/parser/columnValue_bool.sim b/tests/script/general/parser/columnValue_bool.sim index 84ee53670ed7809e2be9f394ece6b9db6e433c88..7f3a6c3d6affaefcc2a8d47963ac065c2dc71b25 100644 --- a/tests/script/general/parser/columnValue_bool.sim +++ b/tests/script/general/parser/columnValue_bool.sim @@ -10,7 +10,7 @@ print ========== bool sql create table mt_bool (ts timestamp, c bool) tags (tagname bool) ## case 00: static create table for test tag values -sql create table st_bool_0 using mt_bool tags (null) +sql create table st_bool_0 using mt_bool tags (NULL) sql select tagname from st_bool_0 if $data00 != NULL then print ==1== expect: NULL, actually: $data00 @@ -22,7 +22,7 @@ if $data00 != NULL then print ==2== expect: NULL, actually: $data00 return -1 endi -sql create table st_bool_2 using mt_bool tags ('null') +sql create table st_bool_2 using mt_bool tags ('NULL') sql select tagname from st_bool_2 if $data00 != NULL then print ==3== expect: NULL, actually: $data00 @@ -34,7 +34,7 @@ if $data00 != NULL then print ==4== expect: NULL, actually: $data00 return -1 endi -sql create table st_bool_4 using mt_bool tags ("null") +sql create table st_bool_4 using mt_bool tags ("NULL") sql select tagname from st_bool_4 if $data00 != NULL then print ==5== expect: NULL, actually: $data00 @@ -120,7 +120,7 @@ if $data00 != 1 then endi ## case 01: insert values for test column values -sql insert into st_bool_0 values (now, null) +sql insert into st_bool_0 values (now, NULL) sql select * from st_bool_0 if $rows != 1 then return -1 @@ -138,7 +138,7 @@ if $data01 != NULL then print ==18== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_2 values (now, 'null') +sql insert into st_bool_2 values (now, 'NULL') sql select * from st_bool_2 if $rows != 1 then return -1 @@ -156,7 +156,7 @@ if $data01 != NULL then print ==20== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_4 values (now, "null") +sql insert into st_bool_4 values (now, "NULL") sql select * from st_bool_4 if $rows != 1 then return -1 @@ -284,7 +284,7 @@ if $data01 != 1 then endi ## case 02: dynamic create table for test tag values -sql insert into st_bool_16 using mt_bool tags (null) values (now, null) +sql insert into st_bool_16 using mt_bool tags (NULL) values (now, NULL) sql select tagname from st_bool_16 if $data00 != NULL then print ==33== expect: NULL, actually: $data00 @@ -307,7 +307,7 @@ if $data01 != NULL then print ==36== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_18 using mt_bool tags ('null') values (now, 'null') +sql insert into st_bool_18 using mt_bool tags ('NULL') values (now, 'NULL') sql select tagname from st_bool_18 if $data00 != NULL then print ==37== expect: NULL, actually: $data00 @@ -329,7 +329,7 @@ if $data01 != NULL then print ==40== expect: NULL, actually: $data01 return -1 endi -sql insert into st_bool_20 using mt_bool tags ("null") values (now, "null") +sql insert into st_bool_20 using mt_bool tags ("NULL") values (now, "NULL") sql select tagname from st_bool_20 if $data00 != NULL then print ==41== expect: NULL, actually: $data00 @@ -505,7 +505,7 @@ endi #if $data00 != false then # return -1 #endi -#sql alter table st_bool_0 set tag tagname=null +#sql alter table st_bool_0 set tag tagname=NULL #sql select tagname from st_bool_0 #if $data00 != NULL then # return -1 @@ -515,7 +515,7 @@ endi #if $data00 != true then # return -1 #endi -#sql alter table st_bool_0 set tag tagname='null' +#sql alter table st_bool_0 set tag tagname='NULL' #sql select tagname from st_bool_0 #if $data00 != NULL then # return -1 @@ -535,7 +535,7 @@ endi #if $data00 != true then # return -1 #endi -#sql alter table st_bool_0 set tag tagname="null" +#sql alter table st_bool_0 set tag tagname="NULL" #sql select tagname from st_bool_0 #if $data00 != NULL then # return -1 diff --git a/tests/script/general/parser/create_mt.sim b/tests/script/general/parser/create_mt.sim index f87033b71e835dd446259a17852113509577468c..76fb486f1ea4fb42439a00a8489990b2fc2e3ae2 100644 --- a/tests/script/general/parser/create_mt.sim +++ b/tests/script/general/parser/create_mt.sim @@ -46,7 +46,7 @@ if $rows != 0 then return -1 endi print data00 = $data00 -if $data00 != null then +if $data00 != NULL then return -1 endi print case_insensitivity test passed diff --git a/tests/script/general/parser/create_tb.sim b/tests/script/general/parser/create_tb.sim index c098da226d1254ff22caa1c2e753897076be3232..7df7d8a4da86e8beeacf6e75c300676ebef17828 100644 --- a/tests/script/general/parser/create_tb.sim +++ b/tests/script/general/parser/create_tb.sim @@ -45,7 +45,7 @@ if $rows != 0 then return -1 endi print data00 = $data00 -if $data00 != null then +if $data00 != NULL then return -1 endi print case_insensitivity test passed diff --git a/tests/script/general/parser/fill.sim b/tests/script/general/parser/fill.sim index c3966c47c130972112b50a2a4713cddeebe69b2d..459bc7611ed2e61f7913b1932c9a6a5d559f0594 100644 --- a/tests/script/general/parser/fill.sim +++ b/tests/script/general/parser/fill.sim @@ -390,7 +390,7 @@ sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $ sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1, 1e1, 1e1) sql select first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1') # fill quoted values into bool column will throw error unless the value is 'true' or 'false' Note:2018-10-24 -# fill values into binary or nchar columns will be set to null automatically Note:2018-10-24 +# fill values into binary or nchar columns will be set to NULL automatically Note:2018-10-24 sql_error select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1','1e1') sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, true, true, true) sql select first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true','true') @@ -649,25 +649,25 @@ endi if $data01 != 1 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 1 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 1 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 1 then @@ -686,25 +686,25 @@ endi if $data01 != 0.000000000 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2.000000000 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3.000000000 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4.000000000 then @@ -719,25 +719,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then @@ -752,25 +752,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then @@ -785,25 +785,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then @@ -818,25 +818,25 @@ endi if $data01 != 0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi if $data21 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data41 != 2 then return -1 endi -if $data51 != null then +if $data51 != NULL then return -1 endi if $data61 != 3 then return -1 endi -if $data71 != null then +if $data71 != NULL then return -1 endi if $data81 != 4 then diff --git a/tests/script/general/parser/fill_stb.sim b/tests/script/general/parser/fill_stb.sim index a40e5d15a41563c19111ab702a295e4c9f6f8fa2..113f4b68a45b795e04d64913bb56bb17efec321e 100644 --- a/tests/script/general/parser/fill_stb.sim +++ b/tests/script/general/parser/fill_stb.sim @@ -68,7 +68,7 @@ $tsu = $tsu + $ts0 #### fill test cases for stables -# null values in each group +# NULL values in each group #sql select count(*) from $stb where ts >= '2018-09-16 00:00:00.000' and ts <= $tsu interval(1d) fill(prev) group by t1 #$val = $tbNum * 2 #if rows != $val then @@ -227,7 +227,7 @@ sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1, 1e1, 1e1) sql select first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1') # fill quoted values into bool column will throw error unless the value is 'true' or 'false' Note:2018-10-24 -# fill values into binary or nchar columns will be set to null automatically Note:2018-10-24 +# fill values into binary or nchar columns will be set to NULL automatically Note:2018-10-24 sql_error select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e', '1e1','1e1') sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, true, true, true) sql select first(c7), first(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true', 'true','true') @@ -283,13 +283,13 @@ endi if $data08 != 0 then return -1 endi -if $data15 != null then +if $data15 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi if $data18 != 0 then @@ -313,16 +313,16 @@ endi if $data07 != nchar0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi if $data08 != 5 then @@ -341,7 +341,7 @@ endi if $data07 != nchar0 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi @@ -359,16 +359,16 @@ endi if $data01 != 0 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data09 != 5 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data19 != 5 then @@ -386,17 +386,17 @@ endi ## NULL fill print fill(NULL) -sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(value, null) group by t1 limit 5 +sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(value, NULL) group by t1 limit 5 if $rows != 25 then return -1 endi if $data01 != 0 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data06 != 1 then @@ -405,16 +405,16 @@ endi if $data09 != 5 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data19 != 5 then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data59 != 6 then diff --git a/tests/script/general/parser/first_last_query.sim b/tests/script/general/parser/first_last_query.sim index 3cad823dbfcb1b1fab885365f459c177cf273f43..c6237198c55f9b11c048fbea95e0b76d2ebad8c9 100644 --- a/tests/script/general/parser/first_last_query.sim +++ b/tests/script/general/parser/first_last_query.sim @@ -40,19 +40,19 @@ print data03 = $data03 if $data03 != 0.00000 then return -1 endi -#if $data04 != null then +#if $data04 != NULL then if $data04 != 0.000000000 then return -1 endi -#if $data05 != null then +#if $data05 != NULL then if $data05 != 0 then return -1 endi -#if $data06 != null then +#if $data06 != NULL then if $data06 != 0 then return -1 endi -#if $data07 != null then +#if $data07 != NULL then if $data07 != 1 then return -1 endi @@ -60,7 +60,7 @@ if $data08 != BINARY then print expect BINARY, actual: $data08 return -1 endi -#if $data09 != null then +#if $data09 != NULL then if $data09 != NCHAR then return -1 endi diff --git a/tests/script/general/parser/insert_tb.sim b/tests/script/general/parser/insert_tb.sim index 201bb2878642f20a87ead70c387851bcd8ba847e..4f2c5fcc7849a195470969abfc54025919b39e53 100644 --- a/tests/script/general/parser/insert_tb.sim +++ b/tests/script/general/parser/insert_tb.sim @@ -218,10 +218,10 @@ if $data46 != @quoted double@ then return -1 endi -# case: support null char of the binary field [TBASE-660] -sql create table nullb (ts timestamp, c1 binary(20), c2 binary(20), c3 float) -sql insert into nullb values ('2018-09-17 09:00:00.000', '', '', 3.746) -sql select * from nullb +# case: support NULL char of the binary field [TBASE-660] +sql create table NULLb (ts timestamp, c1 binary(20), c2 binary(20), c3 float) +sql insert into NULLb values ('2018-09-17 09:00:00.000', '', '', 3.746) +sql select * from NULLb if $rows != 1 then return -1 endi diff --git a/tests/script/general/parser/interp_test.sim b/tests/script/general/parser/interp_test.sim index 03e699732161fd6ccf0d3934afdc7a96b060fd35..3e6d5de85bd315886493985fc3d2ac7e324efbee 100644 --- a/tests/script/general/parser/interp_test.sim +++ b/tests/script/general/parser/interp_test.sim @@ -87,7 +87,7 @@ $tb = $tbPrefix . 0 ### illegal queries on a table sql_error select interp(ts), c1 from $tb where ts = $ts0 sql_error select interp(ts) from $tb where ts >= $ts0 - sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(null) + sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(NULL) ### interp from tb + fill $t = $ts0 + 1000 @@ -107,7 +107,7 @@ $tb = $tbPrefix . 0 return -1 endi - ## fill(null) + ## fill(NULL) $t = $tsu - 1000 sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, NULL) order by ts asc if $rows != 1 then @@ -116,31 +116,31 @@ $tb = $tbPrefix . 0 if $data00 != @18-11-25 19:29:59.000@ then return -1 endi - if $data01 != null then + if $data01 != NULL then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi - if $data03 != null then + if $data03 != NULL then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi - if $data05 != null then + if $data05 != NULL then return -1 endi - if $data06 != null then + if $data06 != NULL then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi @@ -209,7 +209,7 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00000 then @@ -254,13 +254,13 @@ $tb = $tbPrefix . 0 if $data06 != 0 then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi # columns contain NULL values @@ -276,13 +276,13 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00167 then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi if $data05 != 0 then @@ -291,13 +291,13 @@ $tb = $tbPrefix . 0 if $data06 != 0 then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi @@ -346,13 +346,13 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00000 then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi if $data05 != 0 then @@ -413,10 +413,10 @@ $tb = $tbPrefix . 0 if $data07 != 1 then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi @@ -454,7 +454,7 @@ $tb = $tbPrefix . 0 if $data09 != nchar0 then return -1 endi - # table has null columns + # table has NULL columns sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(value, -1, -2, -3) if $rows != 1 then return -1 @@ -465,13 +465,13 @@ $tb = $tbPrefix . 0 if $data01 != 0 then return -1 endi - if $data02 != null then + if $data02 != NULL then return -1 endi if $data03 != 0.00000 then return -1 endi - if $data04 != null then + if $data04 != NULL then return -1 endi @@ -521,10 +521,10 @@ $tb = $tbPrefix . 0 if $data08 != intp_tb0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi if $data28 != intp_tb2 then @@ -558,51 +558,51 @@ $tb = $tbPrefix . 0 if $data21 != 0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi ## interp(*) from stb + group by + fill(none) $t = $ts0 + 1000 - sql select interp(*) from $stb where ts = $t fill(null) group by tbname + sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname if $rows != $tbNum then return -1 endi if $data00 != @18-09-17 09:00:01.000@ then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data16 != null then +if $data16 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi -if $data09 != null then +if $data09 != NULL then return -1 endi -sql select interp(*) from $stb where ts = $ts0 fill(null) group by tbname +sql select interp(*) from $stb where ts = $ts0 fill(NULL) group by tbname print $rows if $rows != 4 then @@ -619,10 +619,10 @@ endi if $data21 != 0 then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi @@ -670,13 +670,13 @@ endi if $data21 != 0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi if $data23 != 0.00000 then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi if $data25 != 0 then @@ -724,13 +724,13 @@ endi if $data06 != 0 then return -1 endi - if $data07 != null then + if $data07 != NULL then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi if $data20 != @18-09-17 09:00:01.000@ then @@ -739,13 +739,13 @@ endi if $data21 != 0 then return -1 endi - if $data22 != null then + if $data22 != NULL then return -1 endi if $data23 != 0.00167 then return -1 endi - if $data24 != null then + if $data24 != NULL then return -1 endi if $data25 != 0 then @@ -754,13 +754,13 @@ endi if $data26 != 0 then return -1 endi - if $data27 != null then + if $data27 != NULL then return -1 endi - if $data28 != null then + if $data28 != NULL then return -1 endi - if $data29 != null then + if $data29 != NULL then return -1 endi @@ -796,10 +796,10 @@ endi if $data07 != 1 then return -1 endi - if $data08 != null then + if $data08 != NULL then return -1 endi - if $data09 != null then + if $data09 != NULL then return -1 endi if $data20 != @18-09-17 09:00:01.000@ then @@ -826,9 +826,9 @@ endi if $data27 != 1 then return -1 endi - if $data28 != null then + if $data28 != NULL then return -1 endi - if $data29 != null then + if $data29 != NULL then return -1 endi diff --git a/tests/script/general/parser/lastrow_query.sim b/tests/script/general/parser/lastrow_query.sim index 3ff0426dcd12d8464bebb9490803e804572b049d..a5e003fb651e69024326c58e5d8716d6509f28a2 100644 --- a/tests/script/general/parser/lastrow_query.sim +++ b/tests/script/general/parser/lastrow_query.sim @@ -27,7 +27,7 @@ endi if $data01 != 1439 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data03 != 1439.00000 then diff --git a/tests/script/general/parser/limit1_stb.sim b/tests/script/general/parser/limit1_stb.sim index b9ba90ef5098dcce003be1ce07af9c21bdfaf870..e69d6ab14ff99c9f2c623d2ca8f0a358a23f991c 100644 --- a/tests/script/general/parser/limit1_stb.sim +++ b/tests/script/general/parser/limit1_stb.sim @@ -62,13 +62,13 @@ endi if $data01 != 9 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data03 != 9.00000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data05 != 9 then @@ -130,13 +130,13 @@ endi if $data11 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data13 != 0.00000 then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi if $data15 != 0 then @@ -261,13 +261,13 @@ endi if $data01 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data23 != 2.00000 then return -1 endi -if $data34 != null then +if $data34 != NULL then return -1 endi if $data45 != 4 then @@ -428,7 +428,7 @@ endi if $data26 != 1 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data42 != 4.500000000 then @@ -458,7 +458,7 @@ endi if $data00 != 9 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi if $data12 != 4.500000000 then diff --git a/tests/script/general/parser/limit1_tb.sim b/tests/script/general/parser/limit1_tb.sim index a9484d10dbaaad1c8c08b2ae54caf85ad186207e..8ed21a47e6b928cbd3f9ab4019edd8c1f70e3190 100644 --- a/tests/script/general/parser/limit1_tb.sim +++ b/tests/script/general/parser/limit1_tb.sim @@ -111,16 +111,16 @@ endi if $data09 != nchar0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi @@ -543,7 +543,7 @@ endi if $data14 != 8.000000000 then return -1 endi -if $data21 != null then +if $data21 != NULL then return -1 endi @@ -613,7 +613,7 @@ endi if $data21 != 7.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi sql select avg(c1), avg(c2), avg(c3), avg(c4), avg(c5), avg(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 3 offset 1 diff --git a/tests/script/general/parser/limit2_query.sim b/tests/script/general/parser/limit2_query.sim index d5b4d3e5ff19759a2b24d2e950392f325ec048e9..57cd13abeec1d3487032d4bfa26c91a98c2a065f 100644 --- a/tests/script/general/parser/limit2_query.sim +++ b/tests/script/general/parser/limit2_query.sim @@ -166,13 +166,13 @@ endi if $data47 != 1 then return -1 endi -if $data57 != null then +if $data57 != NULL then return -1 endi if $data68 != binary3 then return -1 endi -if $data79 != null then +if $data79 != NULL then return -1 endi @@ -216,10 +216,10 @@ endi if $data09 != nchar5 then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi -if $data19 != null then +if $data19 != NULL then return -1 endi if $data16 != -2.000000000 then @@ -269,10 +269,10 @@ endi if $data27 != 1 then return -1 endi -if $data38 != null then +if $data38 != NULL then return -1 endi -if $data49 != null then +if $data49 != NULL then return -1 endi diff --git a/tests/script/general/parser/limit_stb.sim b/tests/script/general/parser/limit_stb.sim index 3e3c75ddacfc103e9e229b6406d81561beb182d4..c6a3766b7d41b690cda319859ad3186af23ef6dd 100644 --- a/tests/script/general/parser/limit_stb.sim +++ b/tests/script/general/parser/limit_stb.sim @@ -117,13 +117,13 @@ endi if $data01 != 9 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data03 != 9.00000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi if $data05 != 9 then @@ -185,13 +185,13 @@ endi if $data11 != 0 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi if $data13 != 0.00000 then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi if $data15 != 0 then @@ -405,7 +405,7 @@ endi if $data28 != 4 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi if $data47 != nchar0 then @@ -427,7 +427,7 @@ endi if $data00 != 9 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi if $data02 != 4.500000000 then @@ -726,16 +726,16 @@ endi if $data00 != @18-09-17 09:10:00.000@ then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi if $data09 != 5 then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi if $data19 != 5 then @@ -747,13 +747,13 @@ endi if $data24 != 0 then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi if $data28 != 1 then diff --git a/tests/script/general/parser/limit_tb.sim b/tests/script/general/parser/limit_tb.sim index 8fee85cece4d3b4deb1eb159dcb33d8a528970e1..00d49b556fa013383881fd2f25c0b171e1096618 100644 --- a/tests/script/general/parser/limit_tb.sim +++ b/tests/script/general/parser/limit_tb.sim @@ -111,16 +111,16 @@ endi if $data09 != nchar0 then return -1 endi -if $data11 != null then +if $data11 != NULL then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi -if $data14 != null then +if $data14 != NULL then return -1 endi @@ -537,7 +537,7 @@ endi if $data14 != 8.000000000 then return -1 endi -if $data21 != null then +if $data21 != NULL then return -1 endi @@ -554,7 +554,7 @@ endi if $data21 != 9 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi @@ -574,7 +574,7 @@ endi if $data31 != 9 then return -1 endi -if $data41 != null then +if $data41 != NULL then return -1 endi sql select sum(c1), sum(c2), sum(c3), sum(c4), sum(c5), sum(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 5 offset 1 @@ -590,7 +590,7 @@ endi if $data21 != 9 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi @@ -607,7 +607,7 @@ endi if $data21 != 7.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi sql select avg(c1), avg(c2), avg(c3), avg(c4), avg(c5), avg(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(30m) limit 3 offset 1 @@ -623,7 +623,7 @@ endi if $data21 != 9.000000000 then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi diff --git a/tests/script/general/parser/null_char.sim b/tests/script/general/parser/null_char.sim index ae402a477de2e4053479a32079d2dc3f9b9494bc..e4f6c5f84972319483061ae50f7c267bb97292fc 100644 --- a/tests/script/general/parser/null_char.sim +++ b/tests/script/general/parser/null_char.sim @@ -9,57 +9,57 @@ system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect -print ========== null_char.sim +print ========== NULL_char.sim $db = db sql drop database if exists $db sql create database $db sql use $db -#### case 0: field null, or 'null' +#### case 0: field NULL, or 'NULL' sql create table mt1 (ts timestamp, col1 int, col2 bigint, col3 float, col4 double, col5 binary(8), col6 bool, col7 smallint, col8 tinyint, col9 nchar(8)) tags (tag1 binary(8), tag2 nchar(8), tag3 int, tag4 bigint, tag5 bool, tag6 float) -sql create table st1 using mt1 tags (null, 'null', 100, 1000, 'false', 9.123) +sql create table st1 using mt1 tags (NULL, 'NULL', 100, 1000, 'false', 9.123) sql insert into st1 values ('2019-01-01 09:00:00.000', 123, -123, 3.0, 4.0, 'binary', true, 1000, 121, 'nchar') sql insert into st1 values ('2019-01-01 09:00:01.000', '456', '456', '3.33', '4.444', 'binary', 'true', '1001', '122', 'nchar') -sql insert into st1 values ('2019-01-01 09:00:02.000', null, null, null, null, null, null, null, null, null) -sql insert into st1 values ('2019-01-01 09:00:03.000', null, null, null, null, 'null', 'null', 2002, 127, 'null') +sql insert into st1 values ('2019-01-01 09:00:02.000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) +sql insert into st1 values ('2019-01-01 09:00:03.000', NULL, NULL, NULL, NULL, 'NULL', 'NULL', 2002, 127, 'NULL') sql select * from mt1 if $rows != 4 then return -1 endi -if $data21 != null then +if $data21 != NULL then return -1 endi -if $data22 != null then +if $data22 != NULL then return -1 endi -if $data23 != null then +if $data23 != NULL then return -1 endi -if $data24 != null then +if $data24 != NULL then return -1 endi -if $data25 != null then +if $data25 != NULL then return -1 endi -if $data26 != null then +if $data26 != NULL then return -1 endi -if $data27 != null then +if $data27 != NULL then return -1 endi -if $data28 != null then +if $data28 != NULL then return -1 endi -if $data29 != null then +if $data29 != NULL then return -1 endi -if $data31 != null then +if $data31 != NULL then return -1 endi -if $data32 != null then +if $data32 != NULL then return -1 endi #if $data33 != 0.00000 then @@ -70,20 +70,20 @@ endi # print === expect 0.00000, actually $data34 # return -1 #endi -if $data35 != null then +if $data35 != NULL then return -1 endi -if $data36 != null then +if $data36 != NULL then return -1 endi -if $data39 != null then +if $data39 != NULL then return -1 endi -#### case 1: tag null, or 'null' +#### case 1: tag NULL, or 'NULL' sql create table mt2 (ts timestamp, col1 int, col3 float, col5 binary(8), col6 bool, col9 nchar(8)) tags (tag1 binary(8), tag2 nchar(8), tag3 int, tag5 bool) -sql create table st2 using mt2 tags (null, 'null', 102, 'true') +sql create table st2 using mt2 tags (NULL, 'NULL', 102, 'true') sql describe st2 if $rows != 10 then return -1 @@ -92,7 +92,7 @@ if $data63 != NULL then print ==1== expect: NULL, actually: $data63 return -1 endi -if $data73 != null then +if $data73 != NULL then print ==2== expect: NULL, actually: $data73 return -1 endi @@ -127,7 +127,7 @@ endi ### bool: sql_error create table stx using mt2 tags ('NULL', '123aBc', 104, '123') sql_error create table sty using mt2 tags ('NULL', '123aBc', 104, 'xtz') -sql create table st4 using mt2 tags ('NULL', '123aBc', 104, 'null') +sql create table st4 using mt2 tags ('NULL', '123aBc', 104, 'NULL') sql describe st4 if $rows != 10 then return -1 @@ -168,9 +168,9 @@ endi #### case 2: dynamic create table using super table when insert into sql create table mt3 (ts timestamp, col1 int, col3 float, col5 binary(8), col6 bool, col9 nchar(8)) tags (tag1 binary(8), tag2 nchar(8), tag3 int, tag5 bool) -sql_error insert into st31 using mt3 tags (null, 'null', 102, 'true') values (now+1s, 31, 31, 'bin_31', '123', 'nchar_31') +sql_error insert into st31 using mt3 tags (NULL, 'NULL', 102, 'true') values (now+1s, 31, 31, 'bin_31', '123', 'nchar_31') sql_error insert into st32 using mt3 tags (NULL, 'ABC', 103, 'FALSE') values (now+2s, 32, 32.12345, 'bin_32', 'abc', 'nchar_32') -sql_error insert into st33 using mt3 tags ('NULL', '123aBc', 104, 'null') values (now+3s, 33, 33, 'bin_33', 'false123', 'nchar_33') +sql_error insert into st33 using mt3 tags ('NULL', '123aBc', 104, 'NULL') values (now+3s, 33, 33, 'bin_33', 'false123', 'nchar_33') sql_error insert into st34 using mt3 tags ('NULL', '123aBc', 105, NULL) values (now+4s, 34, 34.12345, 'bin_34', 'true123', 'nchar_34') @@ -214,9 +214,9 @@ sql alter table st41 set tag tag_binary = "" #if $data23 != $tagvalue then # return -1 #endi -sql alter table st41 set tag tag_binary = "null" +sql alter table st41 set tag tag_binary = "NULL" sql describe st41 -if $data23 != null then +if $data23 != NULL then return -1 endi sql alter table st41 set tag tag_binary = NULL @@ -242,9 +242,9 @@ sql alter table st41 set tag tag_nchar = '' #if $data33 != $tagvalue then # return -1 #endi -sql alter table st41 set tag tag_nchar = "null" +sql alter table st41 set tag tag_nchar = "NULL" sql describe st41 -if $data33 != null then +if $data33 != NULL then return -1 endi sql alter table st41 set tag tag_nchar = NULL @@ -279,13 +279,13 @@ sql describe st41 if $data43 != -2000 then return -1 endi -sql alter table st41 set tag tag_int = null +sql alter table st41 set tag tag_int = NULL sql describe st41 if $data43 != NULL then print ==10== expect: NULL, actually: $data43 return -1 endi -sql alter table st41 set tag tag_int = 'null' +sql alter table st41 set tag tag_int = 'NULL' sql_error alter table st41 set tag tag_int = '' sql_error alter table st41 set tag tag_int = abc379 @@ -310,13 +310,13 @@ sql describe st41 if $data53 != true then return -1 endi -sql alter table st41 set tag tag_bool = 'null' +sql alter table st41 set tag tag_bool = 'NULL' sql describe st41 if $data53 != NULL then print ==14== expect: NULL, actually: $data53 return -1 endi -sql alter table st41 set tag tag_bool = null +sql alter table st41 set tag tag_bool = NULL sql describe st41 if $data53 != NULL then return -1 @@ -350,13 +350,13 @@ if $data63 != 54.123455 then print ==11== expect: 54.123455, actually : $data63 return -1 endi -sql alter table st41 set tag tag_float = null +sql alter table st41 set tag tag_float = NULL sql describe st41 if $data63 != NULL then print ==12== expect: NULL, actually : $data63 return -1 endi -sql alter table st41 set tag tag_float = 'null' +sql alter table st41 set tag tag_float = 'NULL' sql describe st41 if $data63 != NULL then print ==17== expect: NULL, actually : $data63 @@ -396,13 +396,13 @@ sql describe st41 if $data73 != -2456.000000 then return -1 endi -sql alter table st41 set tag tag_double = null +sql alter table st41 set tag tag_double = NULL sql describe st41 if $data73 != NULL then print ==13== expect: NULL, actually : $data73 return -1 endi -sql alter table st41 set tag tag_double = 'null' +sql alter table st41 set tag tag_double = 'NULL' sql describe st41 if $data73 != NULL then print ==20== expect: NULL, actually : $data73 @@ -420,7 +420,7 @@ sql create table mt5 (ts timestamp, c1 int) tags (tag_bigint bigint, tag_smallin sql create table st51 using mt5 tags (1, 2, 3) sql alter table st51 set tag tag_bigint = '-379' sql alter table st51 set tag tag_bigint = -2000 -sql alter table st51 set tag tag_bigint = null +sql alter table st51 set tag tag_bigint = NULL sql alter table st51 set tag tag_bigint = 9223372036854775807 sql describe st51 if $data23 != 9223372036854775807 then @@ -439,13 +439,13 @@ endi sql_error alter table st51 set tag tag_bigint = -9223372036854775808 -sql alter table st51 set tag tag_bigint = 'null' +sql alter table st51 set tag tag_bigint = 'NULL' sql_error alter table st51 set tag tag_bigint = '' sql_error alter table st51 set tag tag_bigint = abc379 #### sql alter table st51 set tag tag_smallint = -2000 -sql alter table st51 set tag tag_smallint = null +sql alter table st51 set tag tag_smallint = NULL sql alter table st51 set tag tag_smallint = 32767 sql describe st51 if $data33 != 32767 then @@ -460,13 +460,13 @@ if $data33 != -32767 then endi sql_error alter table st51 set tag tag_smallint = -32768 -sql alter table st51 set tag tag_smallint = 'null' +sql alter table st51 set tag tag_smallint = 'NULL' sql_error alter table st51 set tag tag_smallint = '' sql_error alter table st51 set tag tag_smallint = abc379 #### sql alter table st51 set tag tag_tinyint = -127 -sql alter table st51 set tag tag_tinyint = null +sql alter table st51 set tag tag_tinyint = NULL sql alter table st51 set tag tag_tinyint = 127 sql describe st51 if $data43 != 127 then @@ -479,7 +479,7 @@ if $data43 != -127 then endi sql_error alter table st51 set tag tag_tinyint = '-128' sql_error alter table st51 set tag tag_tinyint = 128 -sql alter table st51 set tag tag_tinyint = 'null' +sql alter table st51 set tag tag_tinyint = 'NULL' sql_error alter table st51 set tag tag_tinyint = '' sql_error alter table st51 set tag tag_tinyint = abc379 diff --git a/tests/script/general/parser/projection_limit_offset.sim b/tests/script/general/parser/projection_limit_offset.sim index d990a79628e213502de73283999761755f572efa..4b10694190f29fc205caa96aa2d3c52897c0eff2 100644 --- a/tests/script/general/parser/projection_limit_offset.sim +++ b/tests/script/general/parser/projection_limit_offset.sim @@ -344,11 +344,11 @@ if $data11 != 1 then return -1 endi -if $data12 != null then +if $data12 != NULL then return -1 endi -if $data13 != null then +if $data13 != NULL then return -1 endi diff --git a/tests/script/general/parser/set_tag_vals.sim b/tests/script/general/parser/set_tag_vals.sim index 270b6ed0656515bc703dd43f39479cef828d2cf1..de29c28ba38550eab2d5b928d3aa3e86cddb0c73 100644 --- a/tests/script/general/parser/set_tag_vals.sim +++ b/tests/script/general/parser/set_tag_vals.sim @@ -87,7 +87,7 @@ if $rows != 0 then return -1 endi -print ================== set tag to null +print ================== set tag to NULL sql create table stb1_tg (ts timestamp, c1 int) tags(t1 int,t2 bigint,t3 double,t4 float,t5 smallint,t6 tinyint) sql create table stb2_tg (ts timestamp, c1 int) tags(t1 bool,t2 binary(10), t3 nchar(10)) sql create table tb1_tg1 using stb1_tg tags(1,2,3,4,5,6) @@ -195,33 +195,33 @@ sql select * from stb1_tg if $rows != 1 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi sql select * from stb2_tg -if $data02 != null then +if $data02 != NULL then return -1 endi print $data03 -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi diff --git a/tests/script/general/parser/slimit.sim b/tests/script/general/parser/slimit.sim index 7d2d3fc60b11e5b8d978030f430807fd6d598ba8..234e31d2618530171c5f58742474c98c6a358dda 100644 --- a/tests/script/general/parser/slimit.sim +++ b/tests/script/general/parser/slimit.sim @@ -57,7 +57,7 @@ while $i < $tbNum $x = $x + 1 endw $ts = $ts + $delta - sql insert into $tb values ( $ts , null, null, null, null, null, null, null, null, null ) + sql insert into $tb values ( $ts , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) $i = $i + 1 endw print ====== $db tables created @@ -87,7 +87,7 @@ while $i < $tbNum while $x < $rowNum $xs = $x * $delta $ts = $ts0 + $xs - sql insert into $tb values ( $ts , null , null , null , null , null , null , null , null , null ) + sql insert into $tb values ( $ts , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ) $x = $x + 1 endw $i = $i + 1 diff --git a/tests/script/general/parser/slimit_query.sim b/tests/script/general/parser/slimit_query.sim index 7735b1b84b4b81fd83050d07a2275f42e00b9f00..655bc5f8beab0209428a4796ba83ba10d8b3afde 100644 --- a/tests/script/general/parser/slimit_query.sim +++ b/tests/script/general/parser/slimit_query.sim @@ -219,10 +219,10 @@ endi if $data13 != -2.000000000 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data19 != slm_tb6 then @@ -293,10 +293,10 @@ endi if $data13 != -2.000000000 then return -1 endi -if $data17 != null then +if $data17 != NULL then return -1 endi -if $data18 != null then +if $data18 != NULL then return -1 endi if $data19 != slm_tb5 then diff --git a/tests/script/general/parser/timestamp.sim b/tests/script/general/parser/timestamp.sim index ce2b62fcc9a1aad21b41d8013cd9388929fbcdb3..9a1c793909e4b1dd19a9004f6a8bece0c1972ac5 100644 --- a/tests/script/general/parser/timestamp.sim +++ b/tests/script/general/parser/timestamp.sim @@ -49,7 +49,7 @@ while $i < $tbNum $x = $x + 1 endw $ts = $ts + $delta - sql insert into $tb values ( $ts , null, null ) + sql insert into $tb values ( $ts , NULL, NULL ) $i = $i + 1 endw print ====== $db tables created diff --git a/tests/script/general/parser/where.sim b/tests/script/general/parser/where.sim index c840bcf22e76c8db4da773c58464efde1e0674c4..fb3a0a69e7f28501a07ec3c1840ece094a473994 100644 --- a/tests/script/general/parser/where.sim +++ b/tests/script/general/parser/where.sim @@ -228,47 +228,47 @@ if $data11 != @19-01-01 09:10:00.000@ then return -1 endi -sql create table tb_where_null (ts timestamp, c1 float, c2 binary(10)) -sql insert into tb_where_null values ('2019-01-01 09:00:00.000', 1, 'val1') -sql insert into tb_where_null values ('2019-01-01 09:00:01.000', NULL, NULL) -sql insert into tb_where_null values ('2019-01-01 09:00:02.000', 2, 'val2') -sql_error select * from tb_where_null where c1 = NULL -sql_error select * from tb_where_null where c1 <> NULL -sql_error select * from tb_where_null where c1 < NULL -sql select * from tb_where_null where c1 = "NULL" +sql create table tb_where_NULL (ts timestamp, c1 float, c2 binary(10)) +sql insert into tb_where_NULL values ('2019-01-01 09:00:00.000', 1, 'val1') +sql insert into tb_where_NULL values ('2019-01-01 09:00:01.000', NULL, NULL) +sql insert into tb_where_NULL values ('2019-01-01 09:00:02.000', 2, 'val2') +sql_error select * from tb_where_NULL where c1 = NULL +sql_error select * from tb_where_NULL where c1 <> NULL +sql_error select * from tb_where_NULL where c1 < NULL +sql select * from tb_where_NULL where c1 = "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c1 <> "NULL" +sql select * from tb_where_NULL where c1 <> "NULL" if $rows != 2 then return -1 endi -sql select * from tb_where_null where c1 <> "nulL" +sql select * from tb_where_NULL where c1 <> "nulL" if $rows != 2 then return -1 endi -sql select * from tb_where_null where c1 > "NULL" +sql select * from tb_where_NULL where c1 > "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c1 >= "NULL" +sql select * from tb_where_NULL where c1 >= "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c2 = "NULL" +sql select * from tb_where_NULL where c2 = "NULL" if $rows != 0 then return -1 endi -sql select * from tb_where_null where c2 <> "NULL" +sql select * from tb_where_NULL where c2 <> "NULL" if $rows != 2 then return -1 endi -sql select * from tb_where_null where c2 <> "nUll" +sql select * from tb_where_NULL where c2 <> "nUll" if $rows != 2 then return -1 endi diff --git a/tests/script/general/show/dnodes.sim b/tests/script/general/show/dnodes.sim deleted file mode 100644 index 46091383259fc3b2040732e63fa1672596122fab..0000000000000000000000000000000000000000 --- a/tests/script/general/show/dnodes.sim +++ /dev/null @@ -1,16 +0,0 @@ -system sh/stop_dnodes.sh -system sh/deploy.sh -n dnode1 -i 1 -system sh/exec.sh -n dnode1 -s start -sql connect - -print =============== unsupport -sql_error create dnode $hostname2 -sql_error drop dnode $hostname2 - -print =============== show dnodes -sql show dnodes; -if $rows != 1 then - return -1 -endi - -print $data00 $data01 $data02 diff --git a/tests/script/general/agg/stream.sim b/tests/script/general/stream/agg_stream.sim similarity index 100% rename from tests/script/general/agg/stream.sim rename to tests/script/general/stream/agg_stream.sim diff --git a/tests/script/general/column/stream.sim b/tests/script/general/stream/column_stream.sim similarity index 100% rename from tests/script/general/column/stream.sim rename to tests/script/general/stream/column_stream.sim diff --git a/tests/script/general/stream/metrics_del.sim b/tests/script/general/stream/metrics_del.sim index 025f4cbdc0568ff2c5a821b17ca7aaa200870473..c856871e93b7be436cd7da6d665cb90439c9ae7f 100644 --- a/tests/script/general/stream/metrics_del.sim +++ b/tests/script/general/stream/metrics_del.sim @@ -84,12 +84,12 @@ $st = $stPrefix . c3 sql select * from $st print ===> select * from $st print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi diff --git a/tests/script/general/cache/new_stream.sim b/tests/script/general/stream/new_stream.sim similarity index 100% rename from tests/script/general/cache/new_stream.sim rename to tests/script/general/stream/new_stream.sim diff --git a/tests/script/general/cache/restart_stream.sim b/tests/script/general/stream/restart_stream.sim similarity index 100% rename from tests/script/general/cache/restart_stream.sim rename to tests/script/general/stream/restart_stream.sim diff --git a/tests/script/general/stream/stream_2.sim b/tests/script/general/stream/stream_2.sim index ed45784584120e25fe2c039e07d754d1309db958..13aac983374b40258f12f6a4b5d7e7e7dd143a0b 100644 --- a/tests/script/general/stream/stream_2.sim +++ b/tests/script/general/stream/stream_2.sim @@ -185,10 +185,10 @@ print select * from $st => $data01 $data02, $data03 if $data01 != 200 then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi diff --git a/tests/script/general/stream/table_del.sim b/tests/script/general/stream/table_del.sim index 16dc8c2bb12caf1dd5e4c31523fe03667b8335dd..66fd58308f06cd053e063cde8b77b1ec18515169 100644 --- a/tests/script/general/stream/table_del.sim +++ b/tests/script/general/stream/table_del.sim @@ -79,12 +79,12 @@ $st = $stPrefix . c3 sql select * from $st print ===> select * from $st print ===> $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09 -if $data01 != null then +if $data01 != NULL then return -1 endi -if $data02 != null then +if $data02 != NULL then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi diff --git a/tests/script/general/table/autocreate.sim b/tests/script/general/table/autocreate.sim index eac153e3c21581192eef02fb1c9e9822549b508f..02910c27378a19620ead9b7c047061a2bf676925 100644 --- a/tests/script/general/table/autocreate.sim +++ b/tests/script/general/table/autocreate.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -100,3 +101,5 @@ sql select * from db.s4 if $rows != 3 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/general/table/basic1.sim b/tests/script/general/table/basic1.sim index 0e425c95f9f7885ccd11af53d8def960f6f28ccf..e8d0cd7bd8bd0b6f3dd7193b12a33c70bb46f95b 100644 --- a/tests/script/general/table/basic1.sim +++ b/tests/script/general/table/basic1.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -69,3 +70,4 @@ if $data21 != 3 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/general/table/basic2.sim b/tests/script/general/table/basic2.sim index 40688403a86b536130794b0d70cd109d2cc5f694..d1678e8abd984b3aaa5061feb9430550d8909feb 100644 --- a/tests/script/general/table/basic2.sim +++ b/tests/script/general/table/basic2.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== one table @@ -65,3 +66,4 @@ if $data21 != 3 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/general/table/basic3.sim b/tests/script/general/table/basic3.sim index 18c3f9b6251324d19dd3f21edcd7b29707ab1fa2..7f90dc0c52f5ed5439e82f86c3318282d3dc39d7 100644 --- a/tests/script/general/table/basic3.sim +++ b/tests/script/general/table/basic3.sim @@ -1,6 +1,7 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start +sleep 3000 sql connect print =============== create database @@ -69,3 +70,4 @@ if $data21 != 3 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/general/table/bigint.sim b/tests/script/general/table/bigint.sim index 2b7da03366936738d9b91186ea4307d31e48f4fc..dd61d25ef9f2c300a33ef8a30bcc17a1ab5d867d 100644 --- a/tests/script/general/table/bigint.sim +++ b/tests/script/general/table/bigint.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -71,3 +69,5 @@ sql show databases 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/general/table/binary.sim b/tests/script/general/table/binary.sim index 28a09c5570644283e8838af382ba102a5c87f318..cdbfcd4cbfe15438db884cd69b149c6e3519b6e6 100644 --- a/tests/script/general/table/binary.sim +++ b/tests/script/general/table/binary.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -61,3 +59,5 @@ sql show databases 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/general/table/bool.sim b/tests/script/general/table/bool.sim index 4886159c264cc81ad4f00b6cf3ca47103f581e56..fbb6fe823cf30fc18302855aca9e847373cd1f6f 100644 --- a/tests/script/general/table/bool.sim +++ b/tests/script/general/table/bool.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -90,3 +88,5 @@ sql show databases 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/general/table/column2.sim b/tests/script/general/table/column2.sim index d8a58cc78aa8a1b4633c52f3233ae07d076197a7..9251e31daa633b45dae6ea7c6240d6c7a731f405 100644 --- a/tests/script/general/table/column2.sim +++ b/tests/script/general/table/column2.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -23,4 +21,6 @@ sql drop database db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/column_name.sim b/tests/script/general/table/column_name.sim index c029810be770495b6c27704cd695cf9f447e8a88..0b09f65129d2204c4088e5aff55c08384988a2b5 100644 --- a/tests/script/general/table/column_name.sim +++ b/tests/script/general/table/column_name.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -85,6 +83,4 @@ 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/general/table/column_num.sim b/tests/script/general/table/column_num.sim index 0a497d0b0bf5cb803811074f6beec7e70f3001e2..d1091528b249cc35f31ab623b29d4dc3148c9836 100644 --- a/tests/script/general/table/column_num.sim +++ b/tests/script/general/table/column_num.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -83,3 +81,5 @@ sql show databases 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/general/table/column_value.sim b/tests/script/general/table/column_value.sim index 245d8935a3c4c4ba7f7ffdb41058b870b521fc8b..bd98d3b2909eec26ceadbebdf35702f622622c50 100644 --- a/tests/script/general/table/column_value.sim +++ b/tests/script/general/table/column_value.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -77,6 +75,4 @@ 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/general/table/date.sim b/tests/script/general/table/date.sim index ac97d22902b9a986b64d5e4045233fb4de102fd4..2e73a217a616859781f709cfa9c7117f6e34b9ae 100644 --- a/tests/script/general/table/date.sim +++ b/tests/script/general/table/date.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -88,3 +86,5 @@ sql show databases 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/general/table/db.table.sim b/tests/script/general/table/db.table.sim index aa309a44172a5962ccb1e66a9fc576af189d687f..50224f83b554001cd725926986d4769d36a47cb7 100644 --- a/tests/script/general/table/db.table.sim +++ b/tests/script/general/table/db.table.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -44,4 +42,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/delete_reuse1.sim b/tests/script/general/table/delete_reuse1.sim index 3dc4b63bed0f3b01379585db9c18f97b3e970ab1..94f5bdb2876e60b773003bf5584f2a235fd1b500 100644 --- a/tests/script/general/table/delete_reuse1.sim +++ b/tests/script/general/table/delete_reuse1.sim @@ -1,9 +1,4 @@ system sh/stop_dnodes.sh - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -87,3 +82,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/delete_reuse2.sim b/tests/script/general/table/delete_reuse2.sim index d907bf4f7efed6a585111400f89e0e9684b8d1dc..1a9c80cff075bb06db5721bedca64ae4ba5bedc0 100644 --- a/tests/script/general/table/delete_reuse2.sim +++ b/tests/script/general/table/delete_reuse2.sim @@ -1,9 +1,4 @@ system sh/stop_dnodes.sh - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -89,3 +84,5 @@ while $x < 20 print ===> loop times: $x endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/table/delete_writing.sim b/tests/script/general/table/delete_writing.sim index 049b3037aa804f6c879e450b8f0f248c5a1ae884..73d028928fca665e643ce052c9e7592508950ee0 100644 --- a/tests/script/general/table/delete_writing.sim +++ b/tests/script/general/table/delete_writing.sim @@ -1,9 +1,4 @@ system sh/stop_dnodes.sh - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -57,3 +52,5 @@ while $x < 20 $x = $x + 1 endw + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/describe.sim b/tests/script/general/table/describe.sim index 822476ac1151e2ea913991370c1dcd200f64c6d7..ebec004f1964119d97504f8bc78a0b42941824ab 100644 --- a/tests/script/general/table/describe.sim +++ b/tests/script/general/table/describe.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -47,4 +45,5 @@ sql show databases if $rows != 0 then return -1 endi - \ No newline at end of file + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/double.sim b/tests/script/general/table/double.sim index f730d09f01237c23941696b3d3cfdc6a05384844..10239568fe488de55961e134a8e248cb83963393 100644 --- a/tests/script/general/table/double.sim +++ b/tests/script/general/table/double.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -96,3 +94,5 @@ sql show databases 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/general/agg/fill.sim b/tests/script/general/table/fill.sim similarity index 100% rename from tests/script/general/agg/fill.sim rename to tests/script/general/table/fill.sim diff --git a/tests/script/general/table/float.sim b/tests/script/general/table/float.sim index f7cc7e690e29177b74cf2dac04215141c1da8a90..e4ef8a42d67569aa75dda90236861ac11c951870 100644 --- a/tests/script/general/table/float.sim +++ b/tests/script/general/table/float.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -96,3 +94,5 @@ sql show databases 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/general/table/int.sim b/tests/script/general/table/int.sim index 1b0d7eec2fc23181f176fcc7704fae10fe82d0c3..81bdcda47dd14c59df6017a07dde64da87b6546f 100644 --- a/tests/script/general/table/int.sim +++ b/tests/script/general/table/int.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -24,7 +22,7 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -37,7 +35,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -60,7 +58,7 @@ sql select * from $tb order by ts desc if $rows != 4 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -98,22 +96,22 @@ if $data01 != 2 then endi print =============== step8 -sql insert into $tb values (now+8m, "null") +sql insert into $tb values (now+8m, "NULL") sql select * from $tb order by ts desc if $rows != 8 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi print =============== step9 -sql insert into $tb values (now+9m, 'null') +sql insert into $tb values (now+9m, 'NULL') sql select * from $tb order by ts desc if $rows != 9 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -133,3 +131,4 @@ if $rows != 0 then return -1 endi +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/table/limit.sim b/tests/script/general/table/limit.sim index 97541580a837ec11079f16cff6c24a490c3131a9..46fc5103c1b4272cdea09dc1a075d58964f1f042 100644 --- a/tests/script/general/table/limit.sim +++ b/tests/script/general/table/limit.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8 @@ -91,4 +89,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/smallint.sim b/tests/script/general/table/smallint.sim index 5f83c071e54172691eedd143426ae198c46ed34c..b6f0d6948faf9323085902cfc9b463238cb3f9ca 100644 --- a/tests/script/general/table/smallint.sim +++ b/tests/script/general/table/smallint.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -24,7 +22,8 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != null then +print $data01 +if $data01 != NULL then return -1 endi @@ -37,7 +36,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -60,7 +59,7 @@ sql select * from $tb order by ts desc if $rows != 4 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -102,4 +101,5 @@ sql show databases if $rows != 0 then return -1 endi - \ No newline at end of file + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/table.sim b/tests/script/general/table/table.sim index 3303527bdbb99170c9104cf6fee894cbc3d946b4..6ad1b13b1cae6cd05b3b0bd3de4c648e4aab1fde 100644 --- a/tests/script/general/table/table.sim +++ b/tests/script/general/table/table.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -223,4 +221,4 @@ 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/general/table/table_len.sim b/tests/script/general/table/table_len.sim index 5f675e792e64bbbe1510227465a0c0a7dbe209fa..2568ebc7a5e460284f8a4d620beffadd73e76baf 100644 --- a/tests/script/general/table/table_len.sim +++ b/tests/script/general/table/table_len.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -58,7 +56,7 @@ if $rows != 0 then endi print =============== step4 -sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 +sql create table ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789ab01234567890123456789a0123456789a0123456789 (ts timestamp, speed int) -x step4 return -1 step4: sql show tables @@ -102,4 +100,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/testSuite.sim b/tests/script/general/table/testSuite.sim index 5e4388619b51bb436bfdc640d0111789ba05e526..d6cc88b36a6bb695a34eab889f52bdcb525017fb 100644 --- a/tests/script/general/table/testSuite.sim +++ b/tests/script/general/table/testSuite.sim @@ -3,24 +3,25 @@ run general/table/basic1.sim run general/table/basic2.sim run general/table/basic3.sim run general/table/bigint.sim -#run general/table/binary.sim +run general/table/binary.sim run general/table/bool.sim run general/table/column_name.sim run general/table/column_num.sim -#run general/table/column_value.sim -#run general/table/column2.sim -#run general/table/date.sim +run general/table/column_value.sim +run general/table/column2.sim +run general/table/date.sim run general/table/db.table.sim -#run general/table/delete_reuse1.sim -#run general/table/delete_reuse2.sim -#run general/table/delete_writing.sim -#run general/table/describe.sim +run general/table/delete_reuse1.sim +run general/table/delete_reuse2.sim +run general/table/delete_writing.sim +run general/table/describe.sim run general/table/double.sim +run general/table/fill.sim run general/table/float.sim run general/table/int.sim -#run general/table/limit.sim +run general/table/limit.sim run general/table/smallint.sim -#run general/table/table_len.sim -#run general/table/table.sim +run general/table/table_len.sim +run general/table/table.sim run general/table/tinyint.sim -#run general/table/vgroup.sim +run general/table/vgroup.sim diff --git a/tests/script/general/table/tinyint.sim b/tests/script/general/table/tinyint.sim index 9c29d21d127fd38cc898e0ee367586450799c3e3..017c007e8425385c6045d8c4ea1d3f7335e62a0d 100644 --- a/tests/script/general/table/tinyint.sim +++ b/tests/script/general/table/tinyint.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -24,7 +22,7 @@ sql select * from $tb order by ts desc if $rows != 1 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -37,7 +35,7 @@ sql select * from $tb order by ts desc if $rows != 2 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -60,7 +58,7 @@ sql select * from $tb if $rows != 4 then return -1 endi -if $data01 != null then +if $data01 != NULL then return -1 endi @@ -101,4 +99,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/vgroup.sim b/tests/script/general/table/vgroup.sim index 7dbab1eabb2eccc4867585d7cb1947b9e1ebf619..7efa3e9f739cf84e3f8e02a5d781676519e9b2cb 100644 --- a/tests/script/general/table/vgroup.sim +++ b/tests/script/general/table/vgroup.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4 @@ -156,7 +154,4 @@ 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/general/tag/3.sim b/tests/script/general/tag/3.sim index e2a503ce8bfa612856b039a96ae28b0ed990b1d4..4b3104fe1bf591b69e4cc8837df9007ed2e815a5 100644 --- a/tests/script/general/tag/3.sim +++ b/tests/script/general/tag/3.sim @@ -1,13 +1,10 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 0 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect -sql reset query cache print ======================== dnode1 start @@ -521,3 +518,5 @@ sql show databases 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/general/tag/4.sim b/tests/script/general/tag/4.sim index 93c422bb31f08dde504cb137800141c64ac63449..120ef4e4e3ba4dd5446eff7143d2dd605374fa5d 100644 --- a/tests/script/general/tag/4.sim +++ b/tests/script/general/tag/4.sim @@ -711,3 +711,5 @@ sql show databases 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/general/tag/5.sim b/tests/script/general/tag/5.sim index 949c9c257ba7e68ac9ca7bb9a1b57cb108c22e0f..efe88b36503c5161179602afea18fcf6ea1a106a 100644 --- a/tests/script/general/tag/5.sim +++ b/tests/script/general/tag/5.sim @@ -834,3 +834,5 @@ sql show databases 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/general/tag/6.sim b/tests/script/general/tag/6.sim index de5542c635123ba42bd80f95a7f1f67ba0e31972..d5f0a6c4af9b13420a07d4140a456f2b5112acd2 100644 --- a/tests/script/general/tag/6.sim +++ b/tests/script/general/tag/6.sim @@ -989,3 +989,5 @@ sql show databases 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/general/tag/add.sim b/tests/script/general/tag/add.sim index 92fa80045065c52ad0ebea1a23019eba9ff3d97e..69fd909dcf33f0a268fa306955c4beae5da792b6 100644 --- a/tests/script/general/tag/add.sim +++ b/tests/script/general/tag/add.sim @@ -545,7 +545,7 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -851,4 +851,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bigint.sim b/tests/script/general/tag/bigint.sim index 736c30607f53a5163860a519c29a123c8cc36477..4fa22d3995617ec16d9ad85d5ef9a11bfe65ac06 100644 --- a/tests/script/general/tag/bigint.sim +++ b/tests/script/general/tag/bigint.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/binary.sim b/tests/script/general/tag/binary.sim index f57f5cc996cb4f90800a1fbd5b63f2c70547c68b..7c6f95b1ef785d5621d02e51e28fe96f7fe37f6c 100644 --- a/tests/script/general/tag/binary.sim +++ b/tests/script/general/tag/binary.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/binary_binary.sim b/tests/script/general/tag/binary_binary.sim index 5f001e028e265bfa3f9617992662b9632b93a33b..077ec85b523d9fa20a90c1ec8f0e9309dd2b3ea2 100644 --- a/tests/script/general/tag/binary_binary.sim +++ b/tests/script/general/tag/binary_binary.sim @@ -306,4 +306,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bool.sim b/tests/script/general/tag/bool.sim index 82d6cd14bf88063f1dd058095b6d348048e6028e..540eaf123872d3cbdba15fd3556866802992be9a 100644 --- a/tests/script/general/tag/bool.sim +++ b/tests/script/general/tag/bool.sim @@ -236,4 +236,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bool_binary.sim b/tests/script/general/tag/bool_binary.sim index c836dd227b76ea84e40da9bcf492d80ce8bb7ba5..a3f99e25ad8f62562cc70f3776e99397a815ae2f 100644 --- a/tests/script/general/tag/bool_binary.sim +++ b/tests/script/general/tag/bool_binary.sim @@ -306,4 +306,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/bool_int.sim b/tests/script/general/tag/bool_int.sim index 86a16fde9bdadeaa896ffd34bbd081dfd6cf26ae..1a2726dbaa684e2c39a37f1ef29827b480fc3617 100644 --- a/tests/script/general/tag/bool_int.sim +++ b/tests/script/general/tag/bool_int.sim @@ -322,4 +322,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/change.sim b/tests/script/general/tag/change.sim index 74431458f94febf71da647d340d9caccc4f41807..1577514765e9a851b659d3a1568d99857a2e65c6 100644 --- a/tests/script/general/tag/change.sim +++ b/tests/script/general/tag/change.sim @@ -394,7 +394,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -421,7 +421,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -448,7 +448,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -475,7 +475,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -502,7 +502,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -511,4 +511,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/column.sim b/tests/script/general/tag/column.sim index e9b89b7b46c2b783d7075b2238f7b7f7f4d0c4e4..4a36e832f1bf6f373a81318e483ee02ee6bf2e01 100644 --- a/tests/script/general/tag/column.sim +++ b/tests/script/general/tag/column.sim @@ -91,4 +91,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/commit.sim b/tests/script/general/tag/commit.sim index 1e78628b284ef571843135d6bbd73c4e5e395e92..94dc13f0cff9b6dc62024ce4f6138fe4f5f38311 100644 --- a/tests/script/general/tag/commit.sim +++ b/tests/script/general/tag/commit.sim @@ -544,7 +544,7 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -1054,7 +1054,7 @@ endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -1180,4 +1180,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/create.sim b/tests/script/general/tag/create.sim index 3d4ecf8bc34ba461d33ffa2d37c72432c1262349..c0cdbe87dc57f9efd761c0a163cee756b2bb466c 100644 --- a/tests/script/general/tag/create.sim +++ b/tests/script/general/tag/create.sim @@ -598,3 +598,5 @@ print $data00 $data01 $data02 if $data02 != 12345 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/general/tag/delete.sim b/tests/script/general/tag/delete.sim index ef886d76446cd44f87c0449140686c25ac98a6d7..3454ce9d822b74bf24430f227217b4e545adcdba 100644 --- a/tests/script/general/tag/delete.sim +++ b/tests/script/general/tag/delete.sim @@ -428,7 +428,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -452,7 +452,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -476,7 +476,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -500,7 +500,7 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -524,10 +524,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -554,10 +554,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -584,10 +584,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -614,10 +614,10 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -644,13 +644,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -683,13 +683,13 @@ endi if $data03 != 4.00000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi @@ -722,16 +722,16 @@ endi if $data03 != 4.000000000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -771,13 +771,13 @@ endi if $data04 != 5.000000000 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -823,4 +823,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/double.sim b/tests/script/general/tag/double.sim index 47c94d8ae61b1c3018bb95c014b8107807a7c00b..13dcb1fc72b7c760c325a09fe0589ce0a211e23a 100644 --- a/tests/script/general/tag/double.sim +++ b/tests/script/general/tag/double.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/filter.sim b/tests/script/general/tag/filter.sim index b10e8a03727a7740e407881e0e22650ef8587118..4388f029f9c84b707ae564962e398c098b4b5529 100644 --- a/tests/script/general/tag/filter.sim +++ b/tests/script/general/tag/filter.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start @@ -146,3 +144,5 @@ sql show databases 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/general/tag/float.sim b/tests/script/general/tag/float.sim index 4f86eec3389852d3bb8078a5105b54c80e9e1427..2352bbaf2e8a2c5e27158332434d59be62e8d9d6 100644 --- a/tests/script/general/tag/float.sim +++ b/tests/script/general/tag/float.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/int.sim b/tests/script/general/tag/int.sim index d0dea47cb1a7c190c8b6a02d69209377e18ce07b..a93df9a57afabdd59d22e1de44504db1bdbdaef4 100644 --- a/tests/script/general/tag/int.sim +++ b/tests/script/general/tag/int.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/int_binary.sim b/tests/script/general/tag/int_binary.sim index 234780d6d57d4deca010e280c99e740289c7878c..d3795006680a771190930b446c2390a5240dcb01 100644 --- a/tests/script/general/tag/int_binary.sim +++ b/tests/script/general/tag/int_binary.sim @@ -306,4 +306,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/int_float.sim b/tests/script/general/tag/int_float.sim index bfa3ed7f72ebf565420d2b3e75ad528c77da0cf0..510c4f92d0810f6a675f0b0180081c0bf552584e 100644 --- a/tests/script/general/tag/int_float.sim +++ b/tests/script/general/tag/int_float.sim @@ -322,4 +322,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/set.sim b/tests/script/general/tag/set.sim index e48db5a7a8a3f4087169607e5acbdb8a6d485655..917844c3e3272c9983d7bd24caeebdf92e821273 100644 --- a/tests/script/general/tag/set.sim +++ b/tests/script/general/tag/set.sim @@ -338,7 +338,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -365,7 +365,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -392,7 +392,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -419,7 +419,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -446,7 +446,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -455,4 +455,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/smallint.sim b/tests/script/general/tag/smallint.sim index 4ca945947788b76cfbf080aaf997146962a4626d..18b0957b1517560bca651ef9fbd4cc9325e94a22 100644 --- a/tests/script/general/tag/smallint.sim +++ b/tests/script/general/tag/smallint.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/tag/testSuite.sim b/tests/script/general/tag/testSuite.sim index 10874262d64b56112e6d3c4436f97f1c43ac437d..45356efac1daa4f8f5fae06b8aad8c7b139bc9a0 100644 --- a/tests/script/general/tag/testSuite.sim +++ b/tests/script/general/tag/testSuite.sim @@ -1,25 +1,25 @@ -run general/tag/filter.sim -run general/tag/column.sim -run general/tag/bool.sim -run general/tag/smallint.sim -run general/tag/tinyint.sim -run general/tag/int.sim -run general/tag/bigint.sim -run general/tag/float.sim -run general/tag/double.sim -run general/tag/binary.sim -run general/tag/bool_int.sim -run general/tag/bool_binary.sim -run general/tag/int_float.sim -run general/tag/int_binary.sim -run general/tag/binary_binary.sim run general/tag/3.sim run general/tag/4.sim run general/tag/5.sim run general/tag/6.sim +run general/tag/add.sim +run general/tag/bigint.sim +run general/tag/binary_binary.sim +run general/tag/binary.sim +run general/tag/bool_binary.sim +run general/tag/bool_int.sim +run general/tag/bool.sim +run general/tag/change.sim +run general/tag/column.sim +run general/tag/commit.sim run general/tag/create.sim run general/tag/delete.sim -run general/tag/change.sim +run general/tag/double.sim +run general/tag/filter.sim +run general/tag/float.sim +run general/tag/int_binary.sim +run general/tag/int_float.sim +run general/tag/int.sim run general/tag/set.sim -run general/tag/add.sim -run general/tag/commit.sim \ No newline at end of file +run general/tag/smallint.sim +run general/tag/tinyint.sim diff --git a/tests/script/general/tag/tinyint.sim b/tests/script/general/tag/tinyint.sim index 9e339a352c9cdb91b603c05b6b9b337827c5b156..f104f8df04356487999bd4232db70b9ea067dd73 100644 --- a/tests/script/general/tag/tinyint.sim +++ b/tests/script/general/tag/tinyint.sim @@ -239,4 +239,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/basic1.sim b/tests/script/general/user/basic1.sim index 1cff77d3170794a972d3f4ecf77b4db23029331d..3670c1ddb097146f97135b2cab0022c9531d89e0 100644 --- a/tests/script/general/user/basic1.sim +++ b/tests/script/general/user/basic1.sim @@ -71,4 +71,4 @@ print $data10 $data11 $data22 print $data20 $data11 $data22 print $data30 $data31 $data32 -system sh/exec.sh -n dnode1 -s stop \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/basicSuite.sim b/tests/script/general/user/basicSuite.sim deleted file mode 100644 index 199c8f39a154e6abd07f891b325f648c1f466529..0000000000000000000000000000000000000000 --- a/tests/script/general/user/basicSuite.sim +++ /dev/null @@ -1 +0,0 @@ -run general/user/basic1.sim \ No newline at end of file diff --git a/tests/script/general/user/monitor.sim b/tests/script/general/user/monitor.sim index 3c578ec73c17c98b7f4ae84c614f0e3bcf45c6fb..208b85f16ccf29b008caaa1ce0d2f064a5cab066 100644 --- a/tests/script/general/user/monitor.sim +++ b/tests/script/general/user/monitor.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 print ========== step1 @@ -16,7 +14,7 @@ print ========== step2 sql drop database log -x step21 return -1 step21: -sql drop table log.cpu -x step22 +sql drop table log.dn -x step22 return -1 step22: sql drop user log -x step23 @@ -31,6 +29,4 @@ 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/general/user/pass_alter.sim b/tests/script/general/user/pass_alter.sim index 22c0333227103aada5fd0ad92bc7a0eddff5e5fc..034e704a8780e37bab3b29f3b313e2b19db5e8d2 100644 --- a/tests/script/general/user/pass_alter.sim +++ b/tests/script/general/user/pass_alter.sim @@ -1,6 +1,4 @@ system sh/stop_dnodes.sh - - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -47,3 +45,5 @@ sql show users if $rows != 6 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/general/user/pass_len.sim b/tests/script/general/user/pass_len.sim index 2a4a007a1abcf747840882cec431ebf9d59da368..d5d7b3250fe18490f92a299d100990f8b0405bca 100644 --- a/tests/script/general/user/pass_len.sim +++ b/tests/script/general/user/pass_len.sim @@ -1,6 +1,5 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -80,4 +79,4 @@ if $rows != 3 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/general/user/testSuite.sim b/tests/script/general/user/testSuite.sim index 242e8ca27aa49ac5acfa0c2ac94f2f7078176c13..b4bf52cfd1dfd13e99306110a63a19e6dc8bb230 100644 --- a/tests/script/general/user/testSuite.sim +++ b/tests/script/general/user/testSuite.sim @@ -1,6 +1,6 @@ run general/user/basic1.sim +run general/user/monitor.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/user/monitor.sim \ No newline at end of file +run general/user/user_len.sim \ No newline at end of file diff --git a/tests/script/general/user/user_create.sim b/tests/script/general/user/user_create.sim index cb75c2f5a699dcbe6f320d09cbccf358843fa798..4da60b7e3952ea72cba5268c664184bfcdc05ab7 100644 --- a/tests/script/general/user/user_create.sim +++ b/tests/script/general/user/user_create.sim @@ -1,6 +1,5 @@ system sh/stop_dnodes.sh - system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/exec.sh -n dnode1 -s start @@ -82,7 +81,4 @@ step42: sql drop user read - - - - +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/user/user_len.sim b/tests/script/general/user/user_len.sim index fa1fd5c4eaf4b701104e1dd6e4380236a559ffd6..79b72468bbf64a5f834c34979391f43c25809c0c 100644 --- a/tests/script/general/user/user_len.sim +++ b/tests/script/general/user/user_len.sim @@ -86,3 +86,5 @@ sql show users if $rows != 3 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/general/vector/metrics_field.sim b/tests/script/general/vector/metrics_field.sim index 1b96b8c36d2513cbf32657c753e5690fabaea445..2a03ccea19a46771a89755791c7b696f547d296c 100644 --- a/tests/script/general/vector/metrics_field.sim +++ b/tests/script/general/vector/metrics_field.sim @@ -618,4 +618,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_mix.sim b/tests/script/general/vector/metrics_mix.sim index 992ce6e18949d9d5812d68cdec0e847c9986b8ec..96b2f6a7a013d4bd323de7db9c39dfcf433421b2 100644 --- a/tests/script/general/vector/metrics_mix.sim +++ b/tests/script/general/vector/metrics_mix.sim @@ -618,4 +618,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_query.sim b/tests/script/general/vector/metrics_query.sim index 8e3833f7a43d0324022c60a5db595b63aaeb99aa..824aa6f22e45153b295f2b42afe9ebcf45d00642 100644 --- a/tests/script/general/vector/metrics_query.sim +++ b/tests/script/general/vector/metrics_query.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_tag.sim b/tests/script/general/vector/metrics_tag.sim index 81f15a194fd0c9f135ff91af4b3402ad6a25db27..e7575cc9df5e9c0c49af8ec21ed629c73cd7a0e6 100644 --- a/tests/script/general/vector/metrics_tag.sim +++ b/tests/script/general/vector/metrics_tag.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/metrics_time.sim b/tests/script/general/vector/metrics_time.sim index f7e78ae5211c1650a9058e27938a16f4aee1228f..bbcabfd1b7f81dc65f8c61f4c46d09bd18d1c35b 100644 --- a/tests/script/general/vector/metrics_time.sim +++ b/tests/script/general/vector/metrics_time.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/multi.sim b/tests/script/general/vector/multi.sim index 3a607b24105f537f51ce42b6e8e89618c1450b65..105f210950960ac8dc75dd38e22af1fb8dd5b060 100644 --- a/tests/script/general/vector/multi.sim +++ b/tests/script/general/vector/multi.sim @@ -206,10 +206,11 @@ sql select a + f from $tb where g = 2 and ts > now + 4m order by ts asc -x step return -1 step74: - print =============== clear sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/single.sim b/tests/script/general/vector/single.sim index 8eff3e1fb194c3426d27aa4ff2fcf07601b24054..2292d6f44ae43286d619a560320c31b3085ea267 100644 --- a/tests/script/general/vector/single.sim +++ b/tests/script/general/vector/single.sim @@ -298,4 +298,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_field.sim b/tests/script/general/vector/table_field.sim index 96adf54f1d282f6246a372160ae5dfa8207870c2..a9d6910f4da4c1258d7a2efdf592352e7d043349 100644 --- a/tests/script/general/vector/table_field.sim +++ b/tests/script/general/vector/table_field.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_mix.sim b/tests/script/general/vector/table_mix.sim index c994697ff2a4f3202cc48b78e86a4d5275e41d81..a6c4dc92da51d312c2a65561ecb8fcbf4737239a 100644 --- a/tests/script/general/vector/table_mix.sim +++ b/tests/script/general/vector/table_mix.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_query.sim b/tests/script/general/vector/table_query.sim index ce3acc1d660993337bbbad46378e1fea0ea6435d..812229afc4acaf7cb8515c3cbb483bad302b8ac0 100644 --- a/tests/script/general/vector/table_query.sim +++ b/tests/script/general/vector/table_query.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/table_time.sim b/tests/script/general/vector/table_time.sim index 3c2ff183ed078d04157fb6a6477675bd7ab01c53..a83195beba2fe0dec305098407ec872aa47e8535 100644 --- a/tests/script/general/vector/table_time.sim +++ b/tests/script/general/vector/table_time.sim @@ -614,4 +614,6 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/vector/testSuite.sim b/tests/script/general/vector/testSuite.sim index e660fd90a971203323e8b1db829ceac64d6747dd..f0b9fef9912699f5e8ed86b322c30db2d4210c83 100644 --- a/tests/script/general/vector/testSuite.sim +++ b/tests/script/general/vector/testSuite.sim @@ -1,12 +1,11 @@ -run general/vector/single.sim -run general/vector/multi.sim -run general/vector/table_query.sim -run general/vector/table_time.sim -run general/vector/table_field.sim -run general/vector/table_mix.sim +run general/vector/metrics_field.sim +run general/vector/metrics_mix.sim run general/vector/metrics_query.sim run general/vector/metrics_tag.sim run general/vector/metrics_time.sim -run general/vector/metrics_field.sim -run general/vector/metrics_mix.sim - +run general/vector/multi.sim +run general/vector/single.sim +run general/vector/table_field.sim +run general/vector/table_mix.sim +run general/vector/table_query.sim +run general/vector/table_time.sim diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index e0590b50ef4b26e593f93e2572007cec52256fe5..1a9862e4ede76ca6e9045cdd16e7f2b52a6900c8 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -6,10 +6,45 @@ cd ../../../debug; cmake .. #cd ../../../debug; make clean cd ../../../debug; make +#./test.sh -f general/alter/cached_schema_after_alter.sim +#./test.sh -f general/alter/count.sim +#./test.sh -f general/alter/import.sim +#./test.sh -f general/alter/insert1.sim +#./test.sh -f general/alter/insert2.sim +#./test.sh -f general/alter/metrics.sim +#./test.sh -f general/alter/table.sim -#general +./test.sh -f general/cache/new_metrics.sim +#./test.sh -f general/cache/restart_metrics.sim +./test.sh -f general/cache/restart_table.sim -./test.sh -f general//db/basic.sim +#./test.sh -f general/column/commit.sim +#./test.sh -f general/column/metrics.sim +#./test.sh -f general/column/table.sim + +./test.sh -f general/compress/commitlog.sim +./test.sh -f general/compress/compress.sim +./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/bottom.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/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/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/top.sim + +./test.sh -f general/db/basic.sim ./test.sh -f general/db/basic1.sim ./test.sh -f general/db/basic2.sim ./test.sh -f general/db/basic3.sim @@ -25,29 +60,124 @@ cd ../../../debug; make ./test.sh -f general/db/repeat.sim ./test.sh -f general/db/tables.sim +#./test.sh -f general/field/2.sim +#./test.sh -f general/field/3.sim +#./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/binary.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/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/prepare.sim +./test.sh -f general/http/telegraf.sim +#./test.sh -f general/http/grafana_bug.sim +#./test.sh -f general/http/grafana.sim + +./test.sh -f general/import/basic.sim +./test.sh -f general/import/commit.sim +./test.sh -f general/import/large.sim +#./test.sh -f general/import/replica1.sim + +./test.sh -f general/insert/basic.sim +#./test.sh -f general/insert/insert_drop.sim +./test.sh -f general/insert/query_block1_memory.sim +./test.sh -f general/insert/query_block2_memory.sim +./test.sh -f general/insert/query_block1_file.sim +./test.sh -f general/insert/query_block2_file.sim +./test.sh -f general/insert/query_file_memory.sim +./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 +#stream + ./test.sh -f general/table/autocreate.sim ./test.sh -f general/table/basic1.sim ./test.sh -f general/table/basic2.sim ./test.sh -f general/table/basic3.sim ./test.sh -f general/table/bigint.sim +./test.sh -f general/table/binary.sim ./test.sh -f general/table/bool.sim ./test.sh -f general/table/column_name.sim ./test.sh -f general/table/column_num.sim +./test.sh -f general/table/column_value.sim +./test.sh -f general/table/column2.sim +./test.sh -f general/table/date.sim ./test.sh -f general/table/db.table.sim +#./test.sh -f general/table/delete_reuse1.sim +#./test.sh -f general/table/delete_reuse2.sim +#./test.sh -f general/table/delete_writing.sim +#./test.sh -f general/table/describe.sim ./test.sh -f general/table/double.sim +#./test.sh -f general/table/fill.sim ./test.sh -f general/table/float.sim ./test.sh -f general/table/int.sim +./test.sh -f general/table/limit.sim ./test.sh -f general/table/smallint.sim +#./test.sh -f general/table/table_len.sim +./test.sh -f general/table/table.sim ./test.sh -f general/table/tinyint.sim +./test.sh -f general/table/vgroup.sim + +#./test.sh -f general/tag/3.sim +#./test.sh -f general/tag/4.sim +#./test.sh -f general/tag/5.sim +#./test.sh -f general/tag/6.sim +#./test.sh -f general/tag/add.sim +#./test.sh -f general/tag/bigint.sim +#./test.sh -f general/tag/binary_binary.sim +#./test.sh -f general/tag/binary.sim +#./test.sh -f general/tag/bool_binary.sim +#./test.sh -f general/tag/bool_int.sim +#./test.sh -f general/tag/bool.sim +#./test.sh -f general/tag/change.sim +#./test.sh -f general/tag/column.sim +#./test.sh -f general/tag/commit.sim +#./test.sh -f general/tag/create.sim +#./test.sh -f general/tag/delete.sim +#./test.sh -f general/tag/double.sim +#./test.sh -f general/tag/filter.sim +#./test.sh -f general/tag/float.sim +#./test.sh -f general/tag/int_binary.sim +#./test.sh -f general/tag/int_float.sim +#./test.sh -f general/tag/int.sim +#./test.sh -f general/tag/set.sim +#./test.sh -f general/tag/smallint.sim +#./test.sh -f general/tag/tinyint.sim ./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_len.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 +#./test.sh -f general/vector/metrics_mix.sim +#./test.sh -f general/vector/metrics_query.sim +#./test.sh -f general/vector/metrics_tag.sim +#./test.sh -f general/vector/metrics_time.sim +#./test.sh -f general/vector/multi.sim +./test.sh -f general/vector/single.sim +#./test.sh -f general/vector/table_field.sim +#./test.sh -f general/vector/table_mix.sim +#./test.sh -f general/vector/table_query.sim +#./test.sh -f general/vector/table_time.sim -# unique +################################# ./test.sh -u -f unique/account/account_create.sim ./test.sh -u -f unique/account/account_delete.sim @@ -61,14 +191,20 @@ cd ../../../debug; make ./test.sh -u -f unique/account/user_create.sim ./test.sh -u -f unique/account/user_len.sim -#big +#./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/cache.sim ./test.sh -u -f unique/column/replica3.sim +#./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 @@ -83,12 +219,24 @@ cd ../../../debug; make ./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 -#import +#./test.sh -u -f unique/import/replica2.sim +#./test.sh -u -f unique/import/replica3.sim -#metrics +#./test.sh -u -f unique/metrics/balance_replica1.sim +#./test.sh -u -f unique/metrics/dnode2_stop.sim +#./test.sh -u -f unique/metrics/dnode2.sim +#./test.sh -u -f unique/metrics/dnode3.sim +#./test.sh -u -f unique/metrics/replica2_dnode4.sim +#./test.sh -u -f unique/metrics/replica2_vnode3.sim +#./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 @@ -97,10 +245,21 @@ cd ../../../debug; make ./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 -#table +./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/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/replica3_basic.sim \ No newline at end of file +#./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_repeat.sim +#./test.sh -u -f unique/vnode/replica3_vgroup.sim diff --git a/tests/script/unique/account/account_create.sim b/tests/script/unique/account/account_create.sim index 30dd96075c0c72895a44650a430c92b696d559dc..d1d5ebece037cec40f895ca1e3f02e2991c27923 100644 --- a/tests/script/unique/account/account_create.sim +++ b/tests/script/unique/account/account_create.sim @@ -4,6 +4,7 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 0 system sh/exec_up.sh -n dnode1 -s start sql connect +sleep 3000 print ============================ dnode1 start diff --git a/tests/script/unique/account/user_len.sim b/tests/script/unique/account/user_len.sim index fcc344d115e07d0bb79f5ee0ba98cd4f731bc040..918551fa66375291f0cdee31af2317a4ade76621 100644 --- a/tests/script/unique/account/user_len.sim +++ b/tests/script/unique/account/user_len.sim @@ -29,6 +29,7 @@ endi print =============== step2 sql drop user a -x step2 step2: +sleep 1000 sql create user a PASS '123' sql show users if $rows != 4 then diff --git a/tests/script/unique/big/balance.sim b/tests/script/unique/big/balance.sim index 3d4d39af536a3ccb5ffbb609a36b3dcc34413e4c..52199f046e1c44d15957cda38003c62215779a97 100644 --- a/tests/script/unique/big/balance.sim +++ b/tests/script/unique/big/balance.sim @@ -160,7 +160,7 @@ print dnode3 freeVnodes $data3_192.168.0.3 if $data3_192.168.0.1 != 2 then goto show3 endi -if $data3_192.168.0.2 != null then +if $data3_192.168.0.2 != NULL then goto show3 endi if $data3_192.168.0.3 != 2 then @@ -216,7 +216,7 @@ print dnode3 freeVnodes $data3_192.168.0.3 if $data3_192.168.0.1 != 0 then goto show4 endi -if $data3_192.168.0.3 != null then +if $data3_192.168.0.3 != NULL then goto show4 endi @@ -304,3 +304,12 @@ print select count(*) from mt $data00 expect $rowNum if $data00 != $totalNum then goto show5 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/big/maxvnodes.sim b/tests/script/unique/big/maxvnodes.sim index 738fd0704def9871b7f850b0970968a5421e570c..00995ba32c4e57f957557bf1ac72423244c75192 100644 --- a/tests/script/unique/big/maxvnodes.sim +++ b/tests/script/unique/big/maxvnodes.sim @@ -79,3 +79,12 @@ sql select count(*) from mt if $data00 != 25600 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/big/tcp.sim b/tests/script/unique/big/tcp.sim index 795744961730cfa61a32df9a4fb9650d8212f494..1fb414ec748a290db1bd6ec5987ab335f3aa1c20 100644 --- a/tests/script/unique/big/tcp.sim +++ b/tests/script/unique/big/tcp.sim @@ -103,5 +103,12 @@ while $i < 100 $i = $i + 1 endw -system sh/stop_dnodes.sh -sleep 10000 + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/unique/big/testSuite.sim b/tests/script/unique/big/testSuite.sim index 5881d1fb67471f69da76e05b191259fab8692181..2cead5626a5f5dd53ffbc30a0a8502ee70da25d1 100644 --- a/tests/script/unique/big/testSuite.sim +++ b/tests/script/unique/big/testSuite.sim @@ -1,3 +1,3 @@ -#run unique/big/balance.sim -#run unique/big/maxvnodes.sim -#run unique/big/tcp.sim +run unique/big/balance.sim +run unique/big/maxvnodes.sim +run unique/big/tcp.sim diff --git a/tests/script/unique/cluster/balance1.sim b/tests/script/unique/cluster/balance1.sim index 424a80d25aa397837fd4598ccd0a48c77e27f140..10e05971d7f0f01a1641f615cef2097417793e9a 100644 --- a/tests/script/unique/cluster/balance1.sim +++ b/tests/script/unique/cluster/balance1.sim @@ -77,7 +77,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 2 then return -1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then return -1 endi @@ -146,7 +146,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 3 then goto show4 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show4 endi @@ -229,7 +229,7 @@ print dnode3 $dnode3Vnodes if $dnode1Vnodes != 3 then goto show8 endi -if $dnode3Vnodes != null then +if $dnode3Vnodes != NULL then goto show8 endi @@ -245,7 +245,7 @@ if $dnode1Role != master then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi diff --git a/tests/script/unique/cluster/balance2.sim b/tests/script/unique/cluster/balance2.sim index 08fdd233e012f89a29bcaca938fb34f73aeb224a..d741e03eec9723a7e191c35138836b784a8658bc 100644 --- a/tests/script/unique/cluster/balance2.sim +++ b/tests/script/unique/cluster/balance2.sim @@ -131,7 +131,7 @@ print dnode3 $dnode3Vnodes if $dnode1Vnodes != 3 then goto show2 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show2 endi if $dnode3Vnodes != 3 then @@ -194,7 +194,7 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -231,7 +231,7 @@ endi if $dnode4Vnodes != 3 then goto show4 endi -if $dnode3Vnodes != null then +if $dnode3Vnodes != NULL then goto show4 endi @@ -248,10 +248,10 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -339,7 +339,7 @@ print dnode4 $dnode4Vnodes $dnode5Vnodes = $data2_5 print dnode5 $dnode5Vnodes -if $dnode1Vnodes != null then +if $dnode1Vnodes != NULL then goto show6 endi if $dnode4Vnodes != 3 then diff --git a/tests/script/unique/cluster/balance3.sim b/tests/script/unique/cluster/balance3.sim index 407adc7f3b61301d6a5d08047160ae0b4d3fac27..e9847e21dac7af4deeb8e92b8ff59b2b5bc8a821 100644 --- a/tests/script/unique/cluster/balance3.sim +++ b/tests/script/unique/cluster/balance3.sim @@ -110,7 +110,7 @@ endi if $dnode3Vnodes != 3 then goto show1 endi -if $dnode4Vnodes != null then +if $dnode4Vnodes != NULL then goto show1 endi @@ -166,7 +166,7 @@ print dnode4 $dnode4Vnodes if $dnode1Vnodes != 3 then goto show3 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show3 endi if $dnode3Vnodes != 3 then @@ -232,7 +232,7 @@ endi if $dnode5Vnodes != 3 then goto show5 endi -if $dnode3Vnodes != null then +if $dnode3Vnodes != NULL then goto show5 endi if $dnode4Vnodes != 3 then @@ -298,7 +298,7 @@ endi if $dnode6Vnodes != 3 then goto show7 endi -if $dnode4Vnodes != null then +if $dnode4Vnodes != NULL then goto show7 endi diff --git a/tests/script/general/cache/cache_balance.sim b/tests/script/unique/cluster/cache.sim similarity index 100% rename from tests/script/general/cache/cache_balance.sim rename to tests/script/unique/cluster/cache.sim diff --git a/tests/script/unique/cluster/testSuite.sim b/tests/script/unique/cluster/testSuite.sim index 34cdda85dd2e984e509941a97269a984592d4118..9657558c12a0a47441127f64a25541ebc15390e6 100644 --- a/tests/script/unique/cluster/testSuite.sim +++ b/tests/script/unique/cluster/testSuite.sim @@ -1,3 +1,4 @@ run unique/cluster/balance1.sim run unique/cluster/balance2.sim run unique/cluster/balance3.sim +run unique/cluster/cache.sim diff --git a/tests/script/unique/db/commit.sim b/tests/script/unique/db/commit.sim index 0e58c6ed76e72957dd5e1731c91855702776d417..648cd8db2fe592b2405017d9d850c76ffeefb117 100644 --- a/tests/script/unique/db/commit.sim +++ b/tests/script/unique/db/commit.sim @@ -1,7 +1,4 @@ system sh/stop_dnodes.sh - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -118,3 +115,11 @@ if $data01 != 40 then return -1 endi +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/db/delete.sim b/tests/script/unique/db/delete.sim index 5100b93dcdde560eadb868b166e77750e88314d2..e222db8d70fff0dfb17d2731a346557b5ddb0b8e 100644 --- a/tests/script/unique/db/delete.sim +++ b/tests/script/unique/db/delete.sim @@ -44,3 +44,12 @@ sql show databases if $rows != 0 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/db/delete_part.sim b/tests/script/unique/db/delete_part.sim index 3ed4f5d7534595d1701446df585b601efef29a6e..3d1cc5dc633dd143d5cef3397a8e7b234cadaf5f 100644 --- a/tests/script/unique/db/delete_part.sim +++ b/tests/script/unique/db/delete_part.sim @@ -1,9 +1,4 @@ system sh/stop_dnodes.sh - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -77,3 +72,11 @@ begin: goto begin +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/db/testSuite.sim b/tests/script/unique/db/testSuite.sim index 49188504262736820daf9eee7f8e17b85fdfbee5..adc1883a71c32d0b18e17a994f32e7ddd9577e9b 100644 --- a/tests/script/unique/db/testSuite.sim +++ b/tests/script/unique/db/testSuite.sim @@ -1,5 +1,5 @@ -#run unique/db/commit.sim -#run unique/db/delete.sim +run unique/db/commit.sim +run unique/db/delete.sim run unique/db/replica_add12.sim run unique/db/replica_add13.sim run unique/db/replica_add23.sim @@ -7,4 +7,4 @@ run unique/db/replica_reduce21.sim run unique/db/replica_reduce32.sim run unique/db/replica_reduce31.sim run unique/db/replica_part.sim -#run unique/db/delete_part.sim +run unique/db/delete_part.sim diff --git a/tests/script/unique/dnode/balance1.sim b/tests/script/unique/dnode/balance1.sim index 79f22c42ff6cd875af09b3baf56fef8a57872347..34d3310394ea6d071965878a9450fb75c53254c0 100644 --- a/tests/script/unique/dnode/balance1.sim +++ b/tests/script/unique/dnode/balance1.sim @@ -103,7 +103,7 @@ print dnode2 openVnodes $data2_2 if $data2_1 != 2 then goto show4 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $rows != 1 then @@ -131,7 +131,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 0 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 2 then @@ -155,7 +155,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 0 then return -1 endi -if $data2_2 != null then +if $data2_2 != NULL then return -1 endi if $data2_3 != 3 then @@ -182,7 +182,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then goto show7 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show7 endi if $data2_3 != 2 then @@ -210,7 +210,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then return -1 endi -if $data2_2 != null then +if $data2_2 != NULL then return -1 endi if $data2_3 != 2 then @@ -240,10 +240,10 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then goto show9 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show9 endi -if $data2_3 != null then +if $data2_3 != NULL then goto show9 endi if $data2_4 != 4 then diff --git a/tests/script/unique/dnode/balance2.sim b/tests/script/unique/dnode/balance2.sim index 4518c4262230f15c1f2e7d4e3cfe06ddc1960600..9786a854a5845ba4981f49265b98394893f4ba8c 100644 --- a/tests/script/unique/dnode/balance2.sim +++ b/tests/script/unique/dnode/balance2.sim @@ -76,7 +76,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 2 then goto show2 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show2 endi if $data2_3 != 2 then @@ -105,7 +105,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then goto show3 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show3 endi if $data2_3 != 2 then @@ -132,7 +132,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 0 then return -1 endi -if $data2_2 != null then +if $data2_2 != NULL then return -1 endi if $data2_3 != 3 then @@ -163,7 +163,7 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 2 then @@ -196,10 +196,10 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show6 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show6 endi -if $data2_3 != null then +if $data2_3 != NULL then goto show6 endi if $data2_4 != 3 then diff --git a/tests/script/unique/dnode/balance3.sim b/tests/script/unique/dnode/balance3.sim index acb0d033d4a21ed7bb262b9437cdb4d404fe437f..6d5bbc77a53cbd72a58d97506bdcd7ee0efcbaf2 100644 --- a/tests/script/unique/dnode/balance3.sim +++ b/tests/script/unique/dnode/balance3.sim @@ -88,7 +88,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 2 then goto show2 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show2 endi if $data2_3 != 2 then @@ -122,7 +122,7 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show3 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show3 endi if $data2_3 != 2 then @@ -162,7 +162,7 @@ print dnode5 openVnodes $data2_5 if $data2_1 != 0 then goto show4 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $data2_3 != 3 then @@ -228,7 +228,7 @@ endi if $data2_6 != 3 then goto show6 endi -if $data2_3 != null then +if $data2_3 != NULL then goto show6 endi if $data2_4 != 3 then diff --git a/tests/script/unique/dnode/balancex.sim b/tests/script/unique/dnode/balancex.sim index d717250a796af420ef589f43b176a137b4460271..4b46db4b4900a3da083eb8c9e2eee25516363cb2 100644 --- a/tests/script/unique/dnode/balancex.sim +++ b/tests/script/unique/dnode/balancex.sim @@ -132,7 +132,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 1 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 3 then diff --git a/tests/script/unique/dnode/offline1.sim b/tests/script/unique/dnode/offline1.sim index 5e4ab65be37e90a4cf6737d6fa7b485c16dd61ae..4d67b5f55ca9ef1d8bd27e8eab1688ed600cf598 100644 --- a/tests/script/unique/dnode/offline1.sim +++ b/tests/script/unique/dnode/offline1.sim @@ -63,7 +63,7 @@ print dnode1 $data4_2 if $data4_1 != ready then return -1 endi -if $data4_2 != null then +if $data4_2 != NULL then return -1 endi diff --git a/tests/script/unique/dnode/offline2.sim b/tests/script/unique/dnode/offline2.sim index 2615746e05ab0dcfb22caccd42f4fc3cead7e931..6aa85465dded7acbe45d2071e8970eab1060b38e 100644 --- a/tests/script/unique/dnode/offline2.sim +++ b/tests/script/unique/dnode/offline2.sim @@ -90,7 +90,7 @@ sql show dnodes if $data4_1 != ready then goto show4 endi -if $data4_2 != null then +if $data4_2 != NULL then goto show4 endi if $data4_3 != ready then diff --git a/tests/script/unique/dnode/remove1.sim b/tests/script/unique/dnode/remove1.sim index c69c51fa96ba1c18f93bd1d0ec6f1043e4d412cb..545c28a4ea14cd3c1d29a4d19a3011158f522850 100644 --- a/tests/script/unique/dnode/remove1.sim +++ b/tests/script/unique/dnode/remove1.sim @@ -105,7 +105,7 @@ sql show dnodes print dnode1 openVnodes $data2_1 print dnode2 openVnodes $data2_2 print dnode3 openVnodes $data2_3 -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi @@ -130,7 +130,7 @@ print dnode4 openVnodes $data2_4 if $data2_1 != 4 then goto show5 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show5 endi if $data2_3 != 2 then @@ -194,3 +194,12 @@ endi if $data41 != 35 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/remove2.sim b/tests/script/unique/dnode/remove2.sim index c9e48d9283c929ef388fcf38f27342dd8c01dbd0..972b77a35d240cd3f491c156daa310e8279780c2 100644 --- a/tests/script/unique/dnode/remove2.sim +++ b/tests/script/unique/dnode/remove2.sim @@ -106,7 +106,7 @@ sql show dnodes print dnode1 openVnodes $data2_1 print dnode2 openVnodes $data2_2 print dnode3 openVnodes $data2_3 -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $data2_1 != 3 then @@ -140,3 +140,12 @@ endi if $data41 != 35 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/dnode/testSuite.sim b/tests/script/unique/dnode/testSuite.sim index 9921cbf378e149b07f64caf217bbe3242a5838b4..ecd43cc224136deaa615fb04f0e6c21fa8ee50d5 100644 --- a/tests/script/unique/dnode/testSuite.sim +++ b/tests/script/unique/dnode/testSuite.sim @@ -4,6 +4,6 @@ run unique/dnode/balance3.sim run unique/dnode/balancex.sim run unique/dnode/offline1.sim run unique/dnode/offline2.sim -#run unique/dnode/remove1.sim -#run unique/dnode/remove2.sim -#run unique/dnode/vnode_clean.sim +run unique/dnode/remove1.sim +run unique/dnode/remove2.sim +run unique/dnode/vnode_clean.sim diff --git a/tests/script/unique/dnode/vnode_clean.sim b/tests/script/unique/dnode/vnode_clean.sim index 6b3c8ebeb243b96cad8b4b33ede5ad92977a2f41..da34c7bc9b3b26f0a6bad497ae02ea253b97bb7a 100644 --- a/tests/script/unique/dnode/vnode_clean.sim +++ b/tests/script/unique/dnode/vnode_clean.sim @@ -91,7 +91,7 @@ print dnode2 openVnodes $data2_2 if $data2_1 != 2 then goto show4 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show4 endi if $rows != 1 then @@ -220,7 +220,7 @@ print dnode3 openVnodes $data2_3 if $data2_1 != 4 then goto show9 endi -if $data2_2 != null then +if $data2_2 != NULL then goto show9 endi if $data2_3 != 0 then @@ -302,3 +302,11 @@ if $data41 != 45 then return -1 endi +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/http/opentsdb.sim b/tests/script/unique/http/opentsdb.sim index d1b193173e451f7c01829608c8a7845b1d58ba17..914838361ae8dddcddf5d5e2cf21fcd31fb020cb 100644 --- a/tests/script/unique/http/opentsdb.sim +++ b/tests/script/unique/http/opentsdb.sim @@ -12,7 +12,7 @@ print ============================ dnode1 start print =============== step1 - parse system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/ print $system_content -if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then +if $system_content != @{"status":"error","code":1057,"desc":"database name can not be NULL"}@ then return -1 endi @@ -24,7 +24,7 @@ endi system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/ print $system_content -if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then +if $system_content != @{"status":"error","code":1057,"desc":"database name can not be NULL"}@ then return -1 endi @@ -129,7 +129,7 @@ endi system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:6020/opentsdb/db/put print $system_content -if $system_content != @{"status":"error","code":1073,"desc":"tag name is null"}@ then +if $system_content != @{"status":"error","code":1073,"desc":"tag name is NULL"}@ then return -1 endi @@ -147,7 +147,7 @@ endi system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": ""}}]' 127.0.0.1:6020/opentsdb/db/put print $system_content -if $system_content != @{"status":"error","code":1076,"desc":"tag value is null"}@ then +if $system_content != @{"status":"error","code":1076,"desc":"tag value is NULL"}@ then return -1 endi @@ -234,4 +234,13 @@ system_content curl -u root:taosdata -d 'select count(*) from db.sys_cpu_d_bbb' print $system_content if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":1}@ then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/http/testSuite.sim b/tests/script/unique/http/testSuite.sim index d4a6b1f5f5c7e677c081126cad91647190d30a82..3a9753e744b84bfea28e40e8b3554cb82d2ebb40 100644 --- a/tests/script/unique/http/testSuite.sim +++ b/tests/script/unique/http/testSuite.sim @@ -1,2 +1,2 @@ run unique/http/admin.sim -#run general/http/opentsdb.sim \ No newline at end of file +run general/http/opentsdb.sim \ No newline at end of file diff --git a/tests/script/unique/import/replica2.sim b/tests/script/unique/import/replica2.sim index bab04bd21133ffc468046a2f104d6539c959b179..bcb4179c12b1b3f9045a4690e7ecaa5685aa1f1e 100644 --- a/tests/script/unique/import/replica2.sim +++ b/tests/script/unique/import/replica2.sim @@ -40,14 +40,16 @@ sql create table tb(ts timestamp, i int) print ================= step1 sql import into tb values(1520000010000, 10000) sql select * from tb; +print $rows if $rows != 1 then return -1 endi print ================= step2 sql insert into tb values(1520000008000, 8000) +print $rows sql select * from tb; -if $rows != 1 then +if $rows != 2 then return -1 endi @@ -55,7 +57,7 @@ print ================= step3 sql insert into tb values(1520000020000, 20000) sql select * from tb; print $rows -if $rows != 2 then +if $rows != 3 then return -1 endi @@ -64,7 +66,8 @@ sql import into tb values(1520000009000, 9000) sql import into tb values(1520000015000, 15000) sql import into tb values(1520000030000, 30000) sql select * from tb; -if $rows != 5 then +print $rows +if $rows != 6 then return -1 endi @@ -74,7 +77,8 @@ sql insert into tb values(1520000014000, 14000) sql insert into tb values(1520000025000, 25000) sql insert into tb values(1520000040000, 40000) sql select * from tb; -if $rows != 6 then +print $rows +if $rows != 9 then return -1 endi @@ -85,7 +89,8 @@ sql import into tb values(1520000023000, 23000) sql import into tb values(1520000034000, 34000) sql import into tb values(1520000050000, 50000) sql select * from tb; -if $rows != 11 then +print $rows +if $rows != 14 then return -1 endi @@ -95,7 +100,7 @@ sleep 5000 system sh/exec_up.sh -n dnode1 -s start sleep 5000 sql select * from tb; -if $rows != 11 then +if $rows != 14 then return -1 endi @@ -106,7 +111,8 @@ sql import into tb values(1520000023001, 23001) sql import into tb values(1520000034001, 34001) sql import into tb values(1520000050001, 50001) sql select * from tb; -if $rows != 16 then +print $rows +if $rows != 19 then return -1 endi @@ -116,7 +122,8 @@ sql insert into tb values(1520000014002, 14002) sql insert into tb values(1520000025002, 25002) sql insert into tb values(1520000060000, 60000) sql select * from tb; -if $rows != 17 then +print $rows +if $rows != 24 then return -1 endi @@ -148,7 +155,8 @@ sql import into tb values(1521900800000, 50004) sql import into tb values(1523110400000, 50001) sql import into tb values(1521382400000, 500051) sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -158,7 +166,8 @@ sleep 5000 system sh/exec_up.sh -n dnode1 -s start sleep 5000 sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -167,7 +176,7 @@ print ================= step11 #sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) sql import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003) sql select * from tb; -if $rows != 34 then +if $rows != 41 then return -1 endi @@ -176,7 +185,8 @@ print ================= step12 #sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) sql import into tb values(1518358400000, 7003) (1518444800000, 7003) (1518531200000, 7003) (1518617600000, 7003) (1518704000000, 7003) (1518790400000, 7003) (1518876800000, 7003) (1518963200000, 7003) (1519049600000, 7003) sql select * from tb; -if $rows != 43 then +print $rows +if $rows != 50 then return -1 endi @@ -195,7 +205,7 @@ sql import into tb values(1516716800000, 50001) sql import into tb values(1517580800000, 50001) sql select * from tb; -if $rows != 46 then +if $rows != 50 then return -1 endi @@ -205,6 +215,15 @@ sleep 8000 system sh/exec_up.sh -n dnode1 -s stop sleep 10000 -if $rows != 46 then +if $rows != 50 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/import/replica3.sim b/tests/script/unique/import/replica3.sim index c10f2da2f1ebe1592c5f828cbeadbcf1eadc6e5b..8d70d227a5033b837bb0faf3940b18f81ed0be38 100644 --- a/tests/script/unique/import/replica3.sim +++ b/tests/script/unique/import/replica3.sim @@ -41,53 +41,59 @@ sql use ir3db sql create table tb(ts timestamp, i int) print ================= step1 -sql import into tb values(now+10000a, 10000) +sql import into tb values(1520000010000, 10000) sql select * from tb; +print $rows if $rows != 1 then return -1 endi print ================= step2 -sql insert into tb values(now+8000a, 8000) +sql insert into tb values(1520000008000, 8000) +print $rows sql select * from tb; -if $rows != 1 then +if $rows != 2 then return -1 endi print ================= step3 -sql insert into tb values(now+20000a, 20000) +sql insert into tb values(1520000020000, 20000) sql select * from tb; -if $rows != 2 then +print $rows +if $rows != 3 then return -1 endi print ================= step4 -sql import into tb values(now+8000a, 9000) -sql import into tb values(now+15000a, 15000) -sql import into tb values(now+30000a, 30000) +sql import into tb values(1520000009000, 9000) +sql import into tb values(1520000015000, 15000) +sql import into tb values(1520000030000, 30000) sql select * from tb; -if $rows != 5 then +print $rows +if $rows != 6 then return -1 endi print ================= step5 -sql insert into tb values(now+8000a, 8000) -sql insert into tb values(now+14000a, 14000) -sql insert into tb values(now+25000a, 25000) -sql insert into tb values(now+40000a, 40000) +sql insert into tb values(1520000008000, 8000) +sql insert into tb values(1520000014000, 14000) +sql insert into tb values(1520000025000, 25000) +sql insert into tb values(1520000040000, 40000) sql select * from tb; -if $rows != 6 then +print $rows +if $rows != 9 then return -1 endi print ================= step6 -sql import into tb values(now+7000a, 7000) -sql import into tb values(now+12000a, 12000) -sql import into tb values(now+23000a, 23000) -sql import into tb values(now+34000a, 34000) -sql import into tb values(now+50000a, 50000) +sql import into tb values(1520000007000, 7000) +sql import into tb values(1520000012000, 12000) +sql import into tb values(1520000023000, 23000) +sql import into tb values(1520000034000, 34000) +sql import into tb values(1520000050000, 50000) sql select * from tb; -if $rows != 11 then +print $rows +if $rows != 14 then return -1 endi @@ -97,46 +103,63 @@ endi #system sh/exec_up.sh -n dnode1 -s start #sleep 5000 #sql select * from tb; -#if $rows != 11 then +#if $rows != 14 then # return -1 #endi print ================= step7 -sql import into tb values(now+7001a, 7001) -sql import into tb values(now+12001a, 12001) -sql import into tb values(now+23001a, 23001) -sql import into tb values(now+34001a, 34001) -sql import into tb values(now+50001a, 50001) +sql import into tb values(1520000007001, 7001) +sql import into tb values(1520000012001, 12001) +sql import into tb values(1520000023001, 23001) +sql import into tb values(1520000034001, 34001) +sql import into tb values(1520000050001, 50001) sql select * from tb; -if $rows != 16 then +print $rows +if $rows != 19 then return -1 endi print ================= step8 -sql insert into tb values(now+8002a, 8002) -sql insert into tb values(now+14002a, 14002) -sql insert into tb values(now+25002a, 25002) -sql insert into tb values(now+200000a, 60000) +sql insert into tb values(1520000008002, 8002) +sql insert into tb values(1520000014002, 14002) +sql insert into tb values(1520000025002, 25002) +sql insert into tb values(1520000060000, 60000) sql select * from tb; -if $rows != 17 then +print $rows +if $rows != 24 then return -1 endi print ================= step9 -sql import into tb values(now-30d, 7003) -sql import into tb values(now-20d, 34003) -sql import into tb values(now-10d, 34003) -sql import into tb values(now-5d, 34003) -sql import into tb values(now+1m, 50001) -sql import into tb values(now+2m, 50001) -sql import into tb values(now+6m, 50001) -sql import into tb values(now+8m, 50002) -sql import into tb values(now+10m, 50003) -sql import into tb values(now+12m, 50004) -sql import into tb values(now+14m, 50001) -sql import into tb values(now+16m, 500051) +#1520000000000 +#sql import into tb values(now-30d, 7003) +#sql import into tb values(now-20d, 34003) +#sql import into tb values(now-10d, 34003) +#sql import into tb values(now-5d, 34003) +#sql import into tb values(now+1d, 50001) +#sql import into tb values(now+2d, 50001) +#sql import into tb values(now+6d, 50001) +#sql import into tb values(now+8d, 50002) +#sql import into tb values(now+10d, 50003) +#sql import into tb values(now+12d, 50004) +#sql import into tb values(now+14d, 50001) +#sql import into tb values(now+16d, 500051) + +sql import into tb values(1517408000000, 7003) +sql import into tb values(1518272000000, 34003) +sql import into tb values(1519136000000, 34003) +sql import into tb values(1519568000000, 34003) +sql import into tb values(1519654400000, 50001) +sql import into tb values(1519827200000, 50001) +sql import into tb values(1520345600000, 50001) +sql import into tb values(1520691200000, 50002) +sql import into tb values(1520864000000, 50003) +sql import into tb values(1521900800000, 50004) +sql import into tb values(1523110400000, 50001) +sql import into tb values(1521382400000, 500051) sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi @@ -146,21 +169,27 @@ sleep 5000 system sh/exec_up.sh -n dnode1 -s start sleep 5000 sql select * from tb; -if $rows != 29 then +print $rows +if $rows != 36 then return -1 endi print ================= step11 -sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) + +#sql import into tb values(now-50d, 7003) (now-48d, 7003) (now-46d, 7003) (now-44d, 7003) (now-42d, 7003) +sql import into tb values(1515680000000, 7003) (1515852800000, 7003) (1516025600000, 7003) (1516198400000, 7003) (1516371200000, 7003) sql select * from tb; -if $rows != 34 then +if $rows != 41 then return -1 endi print ================= step12 -sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +#1520000000000 +#sql import into tb values(now-19d, 7003) (now-18d, 7003) (now-17d, 7003) (now-16d, 7003) (now-15d, 7003) (now-14d, 7003) (now-13d, 7003) (now-12d, 7003) (now-11d, 7003) +sql import into tb values(1518358400000, 7003) (1518444800000, 7003) (1518531200000, 7003) (1518617600000, 7003) (1518704000000, 7003) (1518790400000, 7003) (1518876800000, 7003) (1518963200000, 7003) (1519049600000, 7003) sql select * from tb; -if $rows != 43 then +print $rows +if $rows != 50 then return -1 endi @@ -169,11 +198,17 @@ system sh/exec_up.sh -n dnode2 -s stop sleep 5000 print ================= step14 -sql import into tb values(now-48d, 34003) -sql import into tb values(now-38d, 50001) -sql import into tb values(now-28d, 50001) +#1520000000000 +#sql import into tb values(now-48d, 34003) +#sql import into tb values(now-38d, 50001) +#sql import into tb values(now-28d, 50001) + +sql import into tb values(1515852800001, 34003) +sql import into tb values(1516716800000, 50001) +sql import into tb values(1517580800000, 50001) + sql select * from tb; -if $rows != 46 then +if $rows != 50 then return -1 endi @@ -183,6 +218,15 @@ sleep 8000 system sh/exec_up.sh -n dnode3 -s stop sleep 3000 -if $rows != 46 then +if $rows != 50 then return -1 endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/import/testSuite.sim b/tests/script/unique/import/testSuite.sim index df87ebf1be099abf712a131ad5bcc77998deb5d5..8be358ce17ee864538c47137630520cd3e69c337 100644 --- a/tests/script/unique/import/testSuite.sim +++ b/tests/script/unique/import/testSuite.sim @@ -1,2 +1,2 @@ -#run unique/import/replica2.sim -#run unique/import/replica3.sim \ No newline at end of file +run unique/import/replica2.sim +run unique/import/replica3.sim \ No newline at end of file diff --git a/tests/script/unique/metrics/balance_replica1.sim b/tests/script/unique/metrics/balance_replica1.sim index eb502762608cc911517505fed6c1455d4d3c7645..52bf558faa46395682e4bad34073f9e3f8fce286 100644 --- a/tests/script/unique/metrics/balance_replica1.sim +++ b/tests/script/unique/metrics/balance_replica1.sim @@ -76,7 +76,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 0 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi print =============== step3 start dnode2 @@ -136,4 +136,13 @@ sql select * from $mt print select * from $mt ==> $rows if $rows != 2600 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/dnode2.sim b/tests/script/unique/metrics/dnode2.sim index 03a881ea49722bf93082a7c2910918d8f701fb95..cd76b39ba0dfaa49495c513bfcc2e7a748fd1ab1 100644 --- a/tests/script/unique/metrics/dnode2.sim +++ b/tests/script/unique/metrics/dnode2.sim @@ -195,4 +195,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/dnode2_stop.sim b/tests/script/unique/metrics/dnode2_stop.sim index 58a46f9be9ab5b29155a4b0ffaedf0acbc3ae670..996482d11ebcfda55a1734bf233bd6e21ae8a44c 100644 --- a/tests/script/unique/metrics/dnode2_stop.sim +++ b/tests/script/unique/metrics/dnode2_stop.sim @@ -148,4 +148,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/dnode3.sim b/tests/script/unique/metrics/dnode3.sim index 503ce6c47af5f40b432f15d7355394547c7c7d4d..3a5419dff4e579507d9b7eebb72d5bc6921a5c2d 100644 --- a/tests/script/unique/metrics/dnode3.sim +++ b/tests/script/unique/metrics/dnode3.sim @@ -224,4 +224,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica2_dnode4.sim b/tests/script/unique/metrics/replica2_dnode4.sim index 7672b19ad9a5ebc7752d968e4d65a355ae399fb6..bedc895dd180dcb14a0adf34a91361ad01b0c723 100644 --- a/tests/script/unique/metrics/replica2_dnode4.sim +++ b/tests/script/unique/metrics/replica2_dnode4.sim @@ -215,4 +215,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica2_vnode3.sim b/tests/script/unique/metrics/replica2_vnode3.sim index e7163e826decf5a3caab7e9d25cf5abd9d0f9d82..9a1d3477be9344d8451eec158e32209ca1b7b40d 100644 --- a/tests/script/unique/metrics/replica2_vnode3.sim +++ b/tests/script/unique/metrics/replica2_vnode3.sim @@ -192,4 +192,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica3_dnode6.sim b/tests/script/unique/metrics/replica3_dnode6.sim index ef70bf5cc35ab91323a17b7891dc176226c2ec04..135e594cdcfdc5f9e85cab1aeb531f6349eafa81 100644 --- a/tests/script/unique/metrics/replica3_dnode6.sim +++ b/tests/script/unique/metrics/replica3_dnode6.sim @@ -245,4 +245,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/replica3_vnode3.sim b/tests/script/unique/metrics/replica3_vnode3.sim index 50ad6d7584b1c2aec2e64b68da6d1a7b8b7c9189..ca147c1ef5af4b74462267a6554589e8da01f24c 100644 --- a/tests/script/unique/metrics/replica3_vnode3.sim +++ b/tests/script/unique/metrics/replica3_vnode3.sim @@ -214,4 +214,13 @@ sql drop database $db sql show databases if $rows != 0 then return -1 -endi \ No newline at end of file +endi + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/metrics/testSuite.sim b/tests/script/unique/metrics/testSuite.sim index dd8ab53aa1de5fd93181169a991b6d8266914a9c..2e3ab31a44201f8e01fd70d8a0b2dffe8f51d7df 100644 --- a/tests/script/unique/metrics/testSuite.sim +++ b/tests/script/unique/metrics/testSuite.sim @@ -1,4 +1,8 @@ -#run unique/metrics/disk.sim -#run unique/metrics/metrics.sim -#run unique/metrics/values.sim -#run unique/metrics/vnode3.sim \ No newline at end of file +run unique/metrics/balance_replica1.sim +run unique/metrics/dnode2_stop.sim +run unique/metrics/dnode2.sim +run unique/metrics/dnode3.sim +run unique/metrics/replica2_dnode4.sim +run unique/metrics/replica2_vnode3.sim +run unique/metrics/replica3_dnode6.sim +run unique/metrics/replica3_vnode3.sim \ No newline at end of file diff --git a/tests/script/unique/mnode/mgmt22.sim b/tests/script/unique/mnode/mgmt22.sim index 3275a233ad091742cd26af356fd1905d5b77c6d5..ae3c386122102fa13ccc75de90ee90709ccbadc7 100644 --- a/tests/script/unique/mnode/mgmt22.sim +++ b/tests/script/unique/mnode/mgmt22.sim @@ -100,7 +100,7 @@ endi if $data2_2 != slave then goto show7 endi -if $data3_3 != null then +if $data3_3 != NULL then goto show7 endi diff --git a/tests/script/unique/mnode/mgmt23.sim b/tests/script/unique/mnode/mgmt23.sim index 8c144dd0c44e23dc381ead7aa3ff32815965b6e1..99d91595735e5b71d480b9bb0514808e3c8d7c86 100644 --- a/tests/script/unique/mnode/mgmt23.sim +++ b/tests/script/unique/mnode/mgmt23.sim @@ -59,7 +59,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then diff --git a/tests/script/unique/mnode/mgmt25.sim b/tests/script/unique/mnode/mgmt25.sim index 8c8eeba466c31ab6efabd00e129a78d13c13ecd3..ba545f94797261c8f394128027cba86718e0b1cc 100644 --- a/tests/script/unique/mnode/mgmt25.sim +++ b/tests/script/unique/mnode/mgmt25.sim @@ -59,7 +59,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -78,7 +78,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then diff --git a/tests/script/unique/mnode/mgmt26.sim b/tests/script/unique/mnode/mgmt26.sim index 373a0abaed191075666085574dc013c3f1cb0721..e5ead5bb3915d950ce5cd9999867647f671a85a2 100644 --- a/tests/script/unique/mnode/mgmt26.sim +++ b/tests/script/unique/mnode/mgmt26.sim @@ -59,7 +59,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -79,7 +79,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -106,7 +106,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then diff --git a/tests/script/unique/mnode/mgmt33.sim b/tests/script/unique/mnode/mgmt33.sim index e3a62a2d22cae72ef7a12d9f85dc5da1046a88a3..36b7ba81394d6055305f7b7dabf6b504e140720c 100644 --- a/tests/script/unique/mnode/mgmt33.sim +++ b/tests/script/unique/mnode/mgmt33.sim @@ -18,10 +18,10 @@ print dnode3 ==> $data3_3 if $data2_1 != master then return -1 endi -if $data3_2 != null then +if $data3_2 != NULL then return -1 endi -if $data3_3 != null then +if $data3_3 != NULL then return -1 endi @@ -44,7 +44,7 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -86,7 +86,7 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -156,7 +156,7 @@ print dnode1 ==> $dnode1Role print dnode2 ==> $dnode2Role print dnode3 ==> $dnode3Role -if $dnode1Role != null then +if $dnode1Role != NULL then return -1 endi #if $dnode2Role != master then diff --git a/tests/script/unique/mnode/mgmt34.sim b/tests/script/unique/mnode/mgmt34.sim index 4409c825c8138420ab853a787b8d8041bf544584..1139daea1cccfb87962aebc3a9fec1c63f2cd53b 100644 --- a/tests/script/unique/mnode/mgmt34.sim +++ b/tests/script/unique/mnode/mgmt34.sim @@ -22,10 +22,10 @@ print dnode3 ==> $data3_3 if $data2_1 != master then return -1 endi -if $data3_2 != null then +if $data3_2 != NULL then return -1 endi -if $data3_3 != null then +if $data3_3 != NULL then return -1 endi @@ -50,10 +50,10 @@ endi if $dnode2Role != slave then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi -if $dnode4Role != null then +if $dnode4Role != NULL then return -1 endi @@ -81,7 +81,7 @@ endi if $dnode3Role != slave then return -1 endi -if $dnode4Role != null then +if $dnode4Role != NULL then return -1 endi @@ -110,7 +110,7 @@ endi if $dnode3Role != slave then return -1 endi -if $dnode4Role != null then +if $dnode4Role != NULL then return -1 endi @@ -131,7 +131,7 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -165,7 +165,7 @@ print dnode4 ==> $dnode4Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi if $dnode3Role != slave then @@ -207,7 +207,7 @@ print dnode2 ==> $dnode2Role print dnode3 ==> $dnode3Role print dnode4 ==> $dnode4Role -if $dnode1Role != null then +if $dnode1Role != NULL then return -1 endi if $dnode2Role != slave then diff --git a/tests/script/unique/mnode/mgmtr2.sim b/tests/script/unique/mnode/mgmtr2.sim index 097d5109296eb1447b5d3b8d5960b27cb0437518..56a4b305737cf0fb22a0aafbb7ae5357f425bd28 100644 --- a/tests/script/unique/mnode/mgmtr2.sim +++ b/tests/script/unique/mnode/mgmtr2.sim @@ -23,10 +23,10 @@ print dnode3 ==> $dnode3Role if $dnode1Role != master then return -1 endi -if $dnode2Role != null then +if $dnode2Role != NULL then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi @@ -71,10 +71,15 @@ endi if $rows != 2 then return -1 endi -if $dnode3Role != null then +if $dnode3Role != NULL then return -1 endi -system sh/exec_up.sh -n dnode1 -s stop -system sh/exec_up.sh -n dnode2 -s stop -system sh/exec_up.sh -n dnode3 -s stop \ No newline at end of file +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/mnode/secondIp.sim b/tests/script/unique/mnode/secondIp.sim index 71c2cdfb769d57c72d7b281589982d31ac2e5659..cfe75ffc842859d325ee589055513466f02ceb5c 100644 --- a/tests/script/unique/mnode/secondIp.sim +++ b/tests/script/unique/mnode/secondIp.sim @@ -34,6 +34,11 @@ if $data4_2 != 4 then return -1 endi -system sh/exec_up.sh -n dnode1 -s stop -system sh/exec_up.sh -n dnode2 -s stop -system sh/exec_up.sh -n dnode3 -s stop \ No newline at end of file +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/stream/metrics_balance.sim b/tests/script/unique/stream/metrics_balance.sim index ff6ca9d1f0b64cac4ed17e1ecc5f1ac8ddd5859d..e711baf2066f39a9a6614da36058e0d2fbfbb87b 100644 --- a/tests/script/unique/stream/metrics_balance.sim +++ b/tests/script/unique/stream/metrics_balance.sim @@ -192,7 +192,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 0 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi diff --git a/tests/script/unique/stream/table_balance.sim b/tests/script/unique/stream/table_balance.sim index 015f9f1f17485724618dd72cd0b304774e0809f6..7e33005b9b963b26f428ac6ee52a0fa83f243e5b 100644 --- a/tests/script/unique/stream/table_balance.sim +++ b/tests/script/unique/stream/table_balance.sim @@ -129,7 +129,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 0 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi diff --git a/tests/script/unique/stream/table_move.sim b/tests/script/unique/stream/table_move.sim index 6589ed941e74c17a0d39b03a058b198fb969e356..54cd3195dbba171c62aadad2beb9b66d1d75e2e8 100644 --- a/tests/script/unique/stream/table_move.sim +++ b/tests/script/unique/stream/table_move.sim @@ -163,7 +163,7 @@ print dnode2 $dnode2Vnodes if $dnode1Vnodes != 6 then goto show1 endi -if $dnode2Vnodes != null then +if $dnode2Vnodes != NULL then goto show1 endi @@ -214,7 +214,7 @@ print dnode1 $dnode1Vnodes $dnode2Vnodes = $data3_192.168.0.2 print dnode2 $dnode2Vnodes -if $dnode1Vnodes != null then +if $dnode1Vnodes != NULL then goto show6 endi if $dnode2Vnodes != 6 then diff --git a/tests/script/unique/table/delete_part.sim b/tests/script/unique/table/delete_part.sim index f4a7b6fce443568bcd6b86ca0a0ca7de7bf8f79b..04cb03598ccd207b8790d3262f8271ecff743812 100644 --- a/tests/script/unique/table/delete_part.sim +++ b/tests/script/unique/table/delete_part.sim @@ -1,9 +1,4 @@ system sh/stop_dnodes.sh - - - - - system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 @@ -79,4 +74,12 @@ begin: $loop = $loop + 1 goto begin - \ No newline at end of file + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/table/testSuite.sim b/tests/script/unique/table/testSuite.sim index 373f358ac8bdaaacfb769d3fb2e09b76b55a83ad..e0c0a1f2fabdaa079deb8b8db08db2095d1148fd 100644 --- a/tests/script/unique/table/testSuite.sim +++ b/tests/script/unique/table/testSuite.sim @@ -1 +1 @@ -#run unique/table/delete_part.sim +run unique/table/delete_part.sim diff --git a/tests/script/unique/vnode/commit.sim b/tests/script/unique/vnode/commit.sim index dae657166719b44753eb035b151b6f8a719155c3..29c9f72335fc01f156045396452e57f03ca3b590 100644 --- a/tests/script/unique/vnode/commit.sim +++ b/tests/script/unique/vnode/commit.sim @@ -148,4 +148,11 @@ if $rows != $remainRows then return -1 endi -system sh/exec_up.sh -n dnode1 -s start +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT diff --git a/tests/script/unique/vnode/many.sim b/tests/script/unique/vnode/many.sim index 544f7d5b55870abe6e2357991c4e76721d8cc70f..0504207c2ed57ca6735a582c35740f68bc3df898 100644 --- a/tests/script/unique/vnode/many.sim +++ b/tests/script/unique/vnode/many.sim @@ -113,4 +113,11 @@ if $x < 5 then goto loop endi - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica2_basic.sim b/tests/script/unique/vnode/replica2_basic.sim index 8e18c3b9e77b868d00bbbfc05bff0021658ce88c..a0ea7085cb08922303dda014e3fd4322f6a71773 100644 --- a/tests/script/unique/vnode/replica2_basic.sim +++ b/tests/script/unique/vnode/replica2_basic.sim @@ -188,5 +188,12 @@ if $rows != $expect then endi print =================== step 12 -system sh/exec_up.sh -n dnode1 -s stop -system sh/exec_up.sh -n dnode2 -s stop + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica2_repeat.sim b/tests/script/unique/vnode/replica2_repeat.sim index cc1feecb07b2802146d8eb3789dbe1713d03e6b0..f7da1babb73914d58661a180b5cc7b3ddc8681ba 100644 --- a/tests/script/unique/vnode/replica2_repeat.sim +++ b/tests/script/unique/vnode/replica2_repeat.sim @@ -71,4 +71,11 @@ if $x < 5 then goto loop endi - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica3_repeat.sim b/tests/script/unique/vnode/replica3_repeat.sim index 0ed16e0729edfd5ac1843b3886ef2ba50f9796a7..8c3ed902fb1508f4ce0d714f1455ad5546826957 100644 --- a/tests/script/unique/vnode/replica3_repeat.sim +++ b/tests/script/unique/vnode/replica3_repeat.sim @@ -80,4 +80,11 @@ if $x < 5 then goto loop endi - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/replica3_vgroup.sim b/tests/script/unique/vnode/replica3_vgroup.sim index 2763ed7c67c47496c3976cd9467b814d3f1e58f2..f63bf1783d60f67c81a51a104f737033ccceb237 100644 --- a/tests/script/unique/vnode/replica3_vgroup.sim +++ b/tests/script/unique/vnode/replica3_vgroup.sim @@ -61,5 +61,11 @@ endw # return -1 #endi - - +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT +system sh/exec_up.sh -n dnode2 -s stop -x SIGINT +system sh/exec_up.sh -n dnode3 -s stop -x SIGINT +system sh/exec_up.sh -n dnode4 -s stop -x SIGINT +system sh/exec_up.sh -n dnode5 -s stop -x SIGINT +system sh/exec_up.sh -n dnode6 -s stop -x SIGINT +system sh/exec_up.sh -n dnode7 -s stop -x SIGINT +system sh/exec_up.sh -n dnode8 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/unique/vnode/testSuite.sim b/tests/script/unique/vnode/testSuite.sim index 9cf8ed0fc16239e1cc0010bdcbabd8f85e3afee2..46b01aaa45f2eef6fc37e523c724d6bab1244662 100644 --- a/tests/script/unique/vnode/testSuite.sim +++ b/tests/script/unique/vnode/testSuite.sim @@ -1,7 +1,8 @@ +run unique/vnode/commit.sim +run unique/vnode/many.sim +run unique/vnode/replica2_basic.sim run unique/vnode/replica2_basic2.sim -#run unique/vnode/replica2_basic.sim -#run unique/vnode/replica2_repeat.sim +run unique/vnode/replica2_repeat.sim run unique/vnode/replica3_basic.sim -#run unique/vnode/replica3_repeat.sim -#run unique/vnode/commit.sim -#run unique/vnode/many.sim +run unique/vnode/replica3_repeat.sim +run unique/vnode/replica3_vgroup.sim diff --git a/tests/script/windows/alter/metrics.sim b/tests/script/windows/alter/metrics.sim index 7cfee695d0022a1871efbf5fa9cfeb6882f46036..ce003a98363488f1be2969104420c59a10628a1f 100644 --- a/tests/script/windows/alter/metrics.sim +++ b/tests/script/windows/alter/metrics.sim @@ -763,7 +763,7 @@ endi if $data21 != INT then return -1 endi -if $data30 != null then +if $data30 != NULL then return -1 endi diff --git a/tests/script/windows/alter/table.sim b/tests/script/windows/alter/table.sim index a05b6559dd14a5e107ca07c7c663db950510dd90..155debda0de7f5617d33fc20146c578dae344ebb 100644 --- a/tests/script/windows/alter/table.sim +++ b/tests/script/windows/alter/table.sim @@ -666,7 +666,7 @@ endi if $data11 != INT then return -1 endi -if $data20 != null then +if $data20 != NULL then return -1 endi diff --git a/tests/script/windows/tag/add.sim b/tests/script/windows/tag/add.sim index b7348466866e7739f2ad31f305a3a1b3baf2259c..adcff4f62d8551f287d34e626396a7173f112665 100644 --- a/tests/script/windows/tag/add.sim +++ b/tests/script/windows/tag/add.sim @@ -537,7 +537,7 @@ endi if $data04 != false then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi diff --git a/tests/script/windows/tag/change.sim b/tests/script/windows/tag/change.sim index 201c74c0bf36664c7354e4b98dabac0eb8ac1d38..95a767da496b336d65e140203b51850235ec8433 100644 --- a/tests/script/windows/tag/change.sim +++ b/tests/script/windows/tag/change.sim @@ -386,7 +386,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -413,7 +413,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -440,7 +440,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -467,7 +467,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -494,7 +494,7 @@ endi if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi diff --git a/tests/script/windows/tag/delete.sim b/tests/script/windows/tag/delete.sim index d671b61abe604636d25bbe3baa390ab06b2c179c..75702fe9eee4eb22a0dc90b17805f01ae182fd8e 100644 --- a/tests/script/windows/tag/delete.sim +++ b/tests/script/windows/tag/delete.sim @@ -420,7 +420,7 @@ endi if $data02 != true then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -444,7 +444,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -468,7 +468,7 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -492,7 +492,7 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi @@ -516,10 +516,10 @@ endi if $data02 != true then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -546,10 +546,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -576,10 +576,10 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -606,10 +606,10 @@ endi if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi @@ -636,13 +636,13 @@ endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != NULL then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi @@ -675,13 +675,13 @@ endi if $data03 != 4.0000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi @@ -714,16 +714,16 @@ endi if $data03 != 4.000000000 then return -1 endi -if $data04 != null then +if $data04 != NULL then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -763,13 +763,13 @@ endi if $data04 != 5.000000000 then return -1 endi -if $data05 != null then +if $data05 != NULL then return -1 endi -if $data06 != null then +if $data06 != NULL then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi diff --git a/tests/script/windows/tag/set.sim b/tests/script/windows/tag/set.sim index 7f8cf3b0a7236e7c60ed3edf279584300d40b8d9..b264164604cf09f37938c51d3186b5f79e9a49f4 100644 --- a/tests/script/windows/tag/set.sim +++ b/tests/script/windows/tag/set.sim @@ -330,7 +330,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -357,7 +357,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -384,7 +384,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -411,7 +411,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi @@ -438,7 +438,7 @@ endi if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != NULL then return -1 endi diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 660ed6f44fbf1092cbc96f44d28dfb433617ea98..bd07918ddc85c019c7be891a68dea3a5afa92ace 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -584,7 +584,7 @@ bool simCreateNativeConnect(SScript *script, char *user, char *pass) { void *taos = NULL; taosMsleep(2000); for (int attempt = 0; attempt < 10; ++attempt) { - taos = taos_connect(NULL, user, pass, NULL, tsMnodeShellPort); + taos = taos_connect(NULL, user, pass, NULL, tsDnodeShellPort); if (taos == NULL) { simTrace("script:%s, user:%s connect taosd failed:%s, attempt:%d", script->fileName, user, taos_errstr(NULL), attempt); taosMsleep(1000);