Merge branch 'develop' into feature/2.0tsdb
This commit is contained in:
commit
899b2a77ae
|
@ -59,12 +59,12 @@ matrix:
|
||||||
GREEN_UNDERLINE='\033[4;32m'
|
GREEN_UNDERLINE='\033[4;32m'
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
grep 'ERROR SUMMARY' mem-error-out.txt | uniq | tee uniq-mem-error-out.txt
|
grep 'ERROR SUMMARY' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-mem-error-out.txt
|
||||||
|
|
||||||
for memError in `cat uniq-mem-error-out.txt | awk '{print $4}'`
|
for memError in `cat uniq-mem-error-out.txt | awk '{print $4}'`
|
||||||
do
|
do
|
||||||
if [ -n "$memError" ]; then
|
if [ -n "$memError" ]; then
|
||||||
if [ "$memError" -gt 16 ]; then
|
if [ "$memError" -gt 5 ]; then
|
||||||
echo -e "${RED} ## Memory errors number valgrind reports is $memError.\
|
echo -e "${RED} ## Memory errors number valgrind reports is $memError.\
|
||||||
More than our threshold! ## ${NC}"
|
More than our threshold! ## ${NC}"
|
||||||
travis_terminate $memError
|
travis_terminate $memError
|
||||||
|
@ -72,11 +72,11 @@ matrix:
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
grep 'definitely lost' mem-error-out.txt | uniq | tee uniq-definitely-lost-out.txt
|
grep 'definitely lost:' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-definitely-lost-out.txt
|
||||||
for defiMemError in `cat uniq-definitely-lost-out.txt | awk '{print $7}'`
|
for defiMemError in `cat uniq-definitely-lost-out.txt | awk '{print $7}'`
|
||||||
do
|
do
|
||||||
if [ -n "$defiMemError" ]; then
|
if [ -n "$defiMemError" ]; then
|
||||||
if [ "$defiMemError" -gt 16 ]; then
|
if [ "$defiMemError" -gt 3 ]; then
|
||||||
echo -e "${RED} ## Memory errors number valgrind reports \
|
echo -e "${RED} ## Memory errors number valgrind reports \
|
||||||
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
|
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
|
||||||
travis_terminate $defiMemError
|
travis_terminate $defiMemError
|
||||||
|
|
|
@ -22,25 +22,25 @@ extern "C" {
|
||||||
|
|
||||||
#include "tlog.h"
|
#include "tlog.h"
|
||||||
|
|
||||||
extern int32_t cdebugFlag;
|
extern int32_t cDebugFlag;
|
||||||
|
|
||||||
#define tscError(...) \
|
#define tscError(...) \
|
||||||
if (cdebugFlag & DEBUG_ERROR) { \
|
if (cDebugFlag & DEBUG_ERROR) { \
|
||||||
taosPrintLog("ERROR TSC ", 255, __VA_ARGS__); \
|
taosPrintLog("ERROR TSC ", 255, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
#define tscWarn(...) \
|
#define tscWarn(...) \
|
||||||
if (cdebugFlag & DEBUG_WARN) { \
|
if (cDebugFlag & DEBUG_WARN) { \
|
||||||
taosPrintLog("WARN TSC ", cdebugFlag, __VA_ARGS__); \
|
taosPrintLog("WARN TSC ", cDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
#define tscTrace(...) \
|
#define tscTrace(...) \
|
||||||
if (cdebugFlag & DEBUG_TRACE) { \
|
if (cDebugFlag & DEBUG_TRACE) { \
|
||||||
taosPrintLog("TSC ", cdebugFlag, __VA_ARGS__); \
|
taosPrintLog("TSC ", cDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
#define tscPrint(...) \
|
#define tscPrint(...) \
|
||||||
{ taosPrintLog("TSC ", 255, __VA_ARGS__); }
|
{ taosPrintLog("TSC ", 255, __VA_ARGS__); }
|
||||||
#define tscDump(...) \
|
#define tscDump(...) \
|
||||||
if (cdebugFlag & DEBUG_TRACE) { \
|
if (cDebugFlag & DEBUG_TRACE) { \
|
||||||
taosPrintLongString("TSC ", cdebugFlag, __VA_ARGS__); \
|
taosPrintLongString("TSC ", cDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -23,16 +23,16 @@
|
||||||
#include "ttime.h"
|
#include "ttime.h"
|
||||||
|
|
||||||
#define jniError(...) \
|
#define jniError(...) \
|
||||||
if (jnidebugFlag & DEBUG_ERROR) { \
|
if (jniDebugFlag & DEBUG_ERROR) { \
|
||||||
taosPrintLog("ERROR JNI ", jnidebugFlag, __VA_ARGS__); \
|
taosPrintLog("ERROR JNI ", jniDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
#define jniWarn(...) \
|
#define jniWarn(...) \
|
||||||
if (jnidebugFlag & DEBUG_WARN) { \
|
if (jniDebugFlag & DEBUG_WARN) { \
|
||||||
taosPrintLog("WARN JNI ", jnidebugFlag, __VA_ARGS__); \
|
taosPrintLog("WARN JNI ", jniDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
#define jniTrace(...) \
|
#define jniTrace(...) \
|
||||||
if (jnidebugFlag & DEBUG_TRACE) { \
|
if (jniDebugFlag & DEBUG_TRACE) { \
|
||||||
taosPrintLog("JNI ", jnidebugFlag, __VA_ARGS__); \
|
taosPrintLog("JNI ", jniDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
#define jniPrint(...) \
|
#define jniPrint(...) \
|
||||||
{ taosPrintLog("JNI ", 255, __VA_ARGS__); }
|
{ taosPrintLog("JNI ", 255, __VA_ARGS__); }
|
||||||
|
|
|
@ -156,7 +156,8 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
|
||||||
pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, 3);
|
pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, 3);
|
||||||
if (i >= tscGetNumOfColumns(pMeta) && tscGetNumOfTags(pMeta) != 0) {
|
if (i >= tscGetNumOfColumns(pMeta) && tscGetNumOfTags(pMeta) != 0) {
|
||||||
char* output = pRes->data + tscFieldInfoGetOffset(pQueryInfo, 3) * totalNumOfRows + pField->bytes * i;
|
char* output = pRes->data + tscFieldInfoGetOffset(pQueryInfo, 3) * totalNumOfRows + pField->bytes * i;
|
||||||
STR_WITH_SIZE_TO_VARSTR(output, "TAG", 3);
|
const char *src = "TAG";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(output, src, strlen(src));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +192,8 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
|
||||||
// tag value
|
// tag value
|
||||||
pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, 3);
|
pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, 3);
|
||||||
char *target = pRes->data + tscFieldInfoGetOffset(pQueryInfo, 3) * totalNumOfRows + pField->bytes * i;
|
char *target = pRes->data + tscFieldInfoGetOffset(pQueryInfo, 3) * totalNumOfRows + pField->bytes * i;
|
||||||
STR_WITH_SIZE_TO_VARSTR(target, "TAG", 3);
|
const char *src = "TAG";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(target, src, strlen(src));
|
||||||
|
|
||||||
pTagValue += pSchema[i].bytes;
|
pTagValue += pSchema[i].bytes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,10 +370,11 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* pMsg = pCmd->payload + tsRpcHeadSize;
|
char* pMsg = pCmd->payload;
|
||||||
pMsg += sizeof(SMgmtHead);
|
|
||||||
|
|
||||||
SCMCfgDnodeMsg* pCfg = (SCMCfgDnodeMsg*)pMsg;
|
SCMCfgDnodeMsg* pCfg = (SCMCfgDnodeMsg*)pMsg;
|
||||||
|
pDCL->a[0].n = strdequote(pDCL->a[0].z);
|
||||||
|
|
||||||
strncpy(pCfg->ep, pDCL->a[0].z, pDCL->a[0].n);
|
strncpy(pCfg->ep, pDCL->a[0].z, pDCL->a[0].n);
|
||||||
|
|
||||||
strncpy(pCfg->config, pDCL->a[1].z, pDCL->a[1].n);
|
strncpy(pCfg->config, pDCL->a[1].z, pDCL->a[1].n);
|
||||||
|
@ -2254,14 +2255,14 @@ int32_t setKillInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||||
char* portStr = strtok(NULL, &delim);
|
char* portStr = strtok(NULL, &delim);
|
||||||
|
|
||||||
if (!validateIpAddress(ipStr, strlen(ipStr))) {
|
if (!validateIpAddress(ipStr, strlen(ipStr))) {
|
||||||
memset(pCmd->payload, 0, tListLen(pCmd->payload));
|
memset(pCmd->payload, 0, strlen(pCmd->payload));
|
||||||
|
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t port = (uint16_t)strtol(portStr, NULL, 10);
|
uint16_t port = (uint16_t)strtol(portStr, NULL, 10);
|
||||||
if (port <= 0 || port > 65535) {
|
if (port <= 0 || port > 65535) {
|
||||||
memset(pCmd->payload, 0, tListLen(pCmd->payload));
|
memset(pCmd->payload, 0, strlen(pCmd->payload));
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1005,13 +1005,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
int32_t tscBuildCfgDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
int32_t tscBuildCfgDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
SSqlCmd *pCmd = &pSql->cmd;
|
SSqlCmd *pCmd = &pSql->cmd;
|
||||||
pCmd->payloadLen = sizeof(SCMCfgDnodeMsg);
|
pCmd->payloadLen = sizeof(SCMCfgDnodeMsg);
|
||||||
|
pCmd->msgType = TSDB_MSG_TYPE_CM_CONFIG_DNODE;
|
||||||
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) {
|
|
||||||
tscError("%p failed to malloc for query msg", pSql);
|
|
||||||
return TSDB_CODE_CLI_OUT_OF_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
pCmd->msgType = TSDB_MSG_TYPE_MD_CONFIG_DNODE;
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1189,7 +1183,7 @@ int32_t tscBuildKillMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
int tscEstimateCreateTableMsgLength(SSqlObj *pSql, SSqlInfo *pInfo) {
|
int tscEstimateCreateTableMsgLength(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
SSqlCmd *pCmd = &(pSql->cmd);
|
SSqlCmd *pCmd = &(pSql->cmd);
|
||||||
|
|
||||||
int32_t size = minMsgSize() + sizeof(SMgmtHead) + sizeof(SCMCreateTableMsg);
|
int32_t size = minMsgSize() + sizeof(SCMCreateTableMsg);
|
||||||
|
|
||||||
SCreateTableSQL *pCreateTableInfo = pInfo->pCreateTableInfo;
|
SCreateTableSQL *pCreateTableInfo = pInfo->pCreateTableInfo;
|
||||||
if (pCreateTableInfo->type == TSQL_CREATE_TABLE_FROM_STABLE) {
|
if (pCreateTableInfo->type == TSQL_CREATE_TABLE_FROM_STABLE) {
|
||||||
|
@ -1277,7 +1271,7 @@ int tscBuildCreateTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
|
|
||||||
int tscEstimateAlterTableMsgLength(SSqlCmd *pCmd) {
|
int tscEstimateAlterTableMsgLength(SSqlCmd *pCmd) {
|
||||||
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
|
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
|
||||||
return minMsgSize() + sizeof(SMgmtHead) + sizeof(SCMAlterTableMsg) + sizeof(SSchema) * tscNumOfFields(pQueryInfo) +
|
return minMsgSize() + sizeof(SCMAlterTableMsg) + sizeof(SSchema) * tscNumOfFields(pQueryInfo) +
|
||||||
TSDB_EXTRA_PAYLOAD_SIZE;
|
TSDB_EXTRA_PAYLOAD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1534,6 +1528,7 @@ int tscBuildTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
* no used 4B
|
* no used 4B
|
||||||
**/
|
**/
|
||||||
int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
|
#if 0
|
||||||
SSqlCmd *pCmd = &pSql->cmd;
|
SSqlCmd *pCmd = &pSql->cmd;
|
||||||
|
|
||||||
// copy payload content to temp buff
|
// copy payload content to temp buff
|
||||||
|
@ -1566,6 +1561,8 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
pCmd->payloadLen);
|
pCmd->payloadLen);
|
||||||
|
|
||||||
return pCmd->payloadLen;
|
return pCmd->payloadLen;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static UNUSED_FUNC int32_t tscEstimateMetricMetaMsgSize(SSqlCmd *pCmd) {
|
//static UNUSED_FUNC int32_t tscEstimateMetricMetaMsgSize(SSqlCmd *pCmd) {
|
||||||
|
@ -1765,7 +1762,7 @@ int tscEstimateHeartBeatMsgLength(SSqlObj *pSql) {
|
||||||
int size = 0;
|
int size = 0;
|
||||||
STscObj *pObj = pSql->pTscObj;
|
STscObj *pObj = pSql->pTscObj;
|
||||||
|
|
||||||
size += tsRpcHeadSize + sizeof(SMgmtHead);
|
size += tsRpcHeadSize;
|
||||||
size += sizeof(SQqueryList);
|
size += sizeof(SQqueryList);
|
||||||
|
|
||||||
SSqlObj *tpSql = pObj->sqlList;
|
SSqlObj *tpSql = pObj->sqlList;
|
||||||
|
@ -1801,13 +1798,9 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pMsg = pCmd->payload + tsRpcHeadSize;
|
pMsg = pCmd->payload;
|
||||||
pStart = pMsg;
|
pStart = pMsg;
|
||||||
|
|
||||||
SMgmtHead *pMgmt = (SMgmtHead *)pMsg;
|
|
||||||
strcpy(pMgmt->db, pObj->db);
|
|
||||||
pMsg += sizeof(SMgmtHead);
|
|
||||||
|
|
||||||
pMsg = tscBuildQueryStreamDesc(pMsg, pObj);
|
pMsg = tscBuildQueryStreamDesc(pMsg, pObj);
|
||||||
pthread_mutex_unlock(&pObj->mutex);
|
pthread_mutex_unlock(&pObj->mutex);
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ 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) {
|
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);
|
tscTrace("try to create a connection to %s:%u, user:%s db:%s", ip, port, user, db);
|
||||||
|
|
||||||
STscObj *pObj = taosConnectImpl(ip, user, pass, db, port, NULL, NULL, NULL);
|
STscObj *pObj = taosConnectImpl(ip, user, pass, db, port, NULL, NULL, NULL);
|
||||||
if (pObj != NULL) {
|
if (pObj != NULL) {
|
||||||
|
@ -191,7 +191,7 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
tscTrace("%p DB connection is opening", pObj);
|
tscTrace("%p DB connection is opening, dnodeConn:%p", pObj, pObj->pDnodeConn);
|
||||||
|
|
||||||
// version compare only requires the first 3 segments of the version string
|
// version compare only requires the first 3 segments of the version string
|
||||||
int code = taosCheckVersion(version, taos_get_server_info(pObj), 3);
|
int code = taosCheckVersion(version, taos_get_server_info(pObj), 3);
|
||||||
|
|
|
@ -69,6 +69,8 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pDnodeConn) {
|
||||||
if (*pDnodeConn == NULL) {
|
if (*pDnodeConn == NULL) {
|
||||||
tscError("failed to init connection to TDengine");
|
tscError("failed to init connection to TDengine");
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
tscTrace("dnodeConn:%p is created, user:%s", *pDnodeConn, user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -766,7 +766,7 @@ void tscCloseTscObj(STscObj* pObj) {
|
||||||
rpcClose(pObj->pDnodeConn);
|
rpcClose(pObj->pDnodeConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
tscTrace("%p DB connection is closed", pObj);
|
tscTrace("%p DB connection is closed, dnodeConn:%p", pObj, pObj->pDnodeConn);
|
||||||
tfree(pObj);
|
tfree(pObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,9 +141,9 @@ extern int32_t tsAsyncLog;
|
||||||
extern int32_t tsNumOfLogLines;
|
extern int32_t tsNumOfLogLines;
|
||||||
extern int32_t dDebugFlag;
|
extern int32_t dDebugFlag;
|
||||||
extern int32_t vDebugFlag;
|
extern int32_t vDebugFlag;
|
||||||
extern int32_t mdebugFlag;
|
extern int32_t mDebugFlag;
|
||||||
extern int32_t cdebugFlag;
|
extern int32_t cDebugFlag;
|
||||||
extern int32_t jnidebugFlag;
|
extern int32_t jniDebugFlag;
|
||||||
extern int32_t tmrDebugFlag;
|
extern int32_t tmrDebugFlag;
|
||||||
extern int32_t sdbDebugFlag;
|
extern int32_t sdbDebugFlag;
|
||||||
extern int32_t httpDebugFlag;
|
extern int32_t httpDebugFlag;
|
||||||
|
@ -151,8 +151,8 @@ extern int32_t monitorDebugFlag;
|
||||||
extern int32_t uDebugFlag;
|
extern int32_t uDebugFlag;
|
||||||
extern int32_t rpcDebugFlag;
|
extern int32_t rpcDebugFlag;
|
||||||
extern int32_t debugFlag;
|
extern int32_t debugFlag;
|
||||||
extern int32_t odbcdebugFlag;
|
extern int32_t odbcDebugFlag;
|
||||||
extern int32_t qdebugFlag;
|
extern int32_t qDebugFlag;
|
||||||
|
|
||||||
extern uint32_t taosMaxTmrCtrl;
|
extern uint32_t taosMaxTmrCtrl;
|
||||||
|
|
||||||
|
|
|
@ -127,16 +127,16 @@ int32_t tsRestRowLimit = 10240;
|
||||||
int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN;
|
int32_t tsMaxSQLStringLen = TSDB_MAX_SQL_LEN;
|
||||||
|
|
||||||
int32_t tsNumOfLogLines = 10000000;
|
int32_t tsNumOfLogLines = 10000000;
|
||||||
int32_t mdebugFlag = 135;
|
int32_t mDebugFlag = 135;
|
||||||
int32_t sdbDebugFlag = 135;
|
int32_t sdbDebugFlag = 135;
|
||||||
int32_t dDebugFlag = 135;
|
int32_t dDebugFlag = 135;
|
||||||
int32_t vDebugFlag = 135;
|
int32_t vDebugFlag = 135;
|
||||||
int32_t cdebugFlag = 135;
|
int32_t cDebugFlag = 135;
|
||||||
int32_t jnidebugFlag = 131;
|
int32_t jniDebugFlag = 131;
|
||||||
int32_t odbcdebugFlag = 131;
|
int32_t odbcDebugFlag = 131;
|
||||||
int32_t httpDebugFlag = 131;
|
int32_t httpDebugFlag = 131;
|
||||||
int32_t monitorDebugFlag = 131;
|
int32_t monitorDebugFlag = 131;
|
||||||
int32_t qdebugFlag = 131;
|
int32_t qDebugFlag = 131;
|
||||||
int32_t rpcDebugFlag = 135;
|
int32_t rpcDebugFlag = 135;
|
||||||
int32_t uDebugFlag = 131;
|
int32_t uDebugFlag = 131;
|
||||||
int32_t debugFlag = 131;
|
int32_t debugFlag = 131;
|
||||||
|
@ -204,10 +204,19 @@ static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT;
|
||||||
|
|
||||||
void taosSetAllDebugFlag() {
|
void taosSetAllDebugFlag() {
|
||||||
for (int32_t i = 0; i < tsGlobalConfigNum; ++i) {
|
for (int32_t i = 0; i < tsGlobalConfigNum; ++i) {
|
||||||
SGlobalCfg *cfg = &tsGlobalConfig[i];
|
mDebugFlag = debugFlag;
|
||||||
if ((cfg->cfgType & TSDB_CFG_CTYPE_B_LOG) && cfg->cfgType == TAOS_CFG_VTYPE_INT32) {
|
sdbDebugFlag = debugFlag;
|
||||||
*((int32_t*)cfg->ptr) = debugFlag;
|
dDebugFlag = debugFlag;
|
||||||
}
|
vDebugFlag = debugFlag;
|
||||||
|
cDebugFlag = debugFlag;
|
||||||
|
jniDebugFlag = debugFlag;
|
||||||
|
odbcDebugFlag = debugFlag;
|
||||||
|
httpDebugFlag = debugFlag;
|
||||||
|
monitorDebugFlag = debugFlag;
|
||||||
|
rpcDebugFlag = debugFlag;
|
||||||
|
uDebugFlag = debugFlag;
|
||||||
|
sDebugFlag = debugFlag;
|
||||||
|
//qDebugFlag = debugFlag;
|
||||||
}
|
}
|
||||||
uPrint("all debug flag are set to %d", debugFlag);
|
uPrint("all debug flag are set to %d", debugFlag);
|
||||||
}
|
}
|
||||||
|
@ -993,7 +1002,7 @@ static void doInitGlobalConfig() {
|
||||||
taosInitConfigOption(cfg);
|
taosInitConfigOption(cfg);
|
||||||
|
|
||||||
cfg.option = "mDebugFlag";
|
cfg.option = "mDebugFlag";
|
||||||
cfg.ptr = &mdebugFlag;
|
cfg.ptr = &mDebugFlag;
|
||||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG;
|
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG;
|
||||||
cfg.minValue = 0;
|
cfg.minValue = 0;
|
||||||
|
@ -1053,7 +1062,7 @@ static void doInitGlobalConfig() {
|
||||||
taosInitConfigOption(cfg);
|
taosInitConfigOption(cfg);
|
||||||
|
|
||||||
cfg.option = "cDebugFlag";
|
cfg.option = "cDebugFlag";
|
||||||
cfg.ptr = &cdebugFlag;
|
cfg.ptr = &cDebugFlag;
|
||||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
||||||
cfg.minValue = 0;
|
cfg.minValue = 0;
|
||||||
|
@ -1063,7 +1072,7 @@ static void doInitGlobalConfig() {
|
||||||
taosInitConfigOption(cfg);
|
taosInitConfigOption(cfg);
|
||||||
|
|
||||||
cfg.option = "jniDebugFlag";
|
cfg.option = "jniDebugFlag";
|
||||||
cfg.ptr = &jnidebugFlag;
|
cfg.ptr = &jniDebugFlag;
|
||||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
||||||
cfg.minValue = 0;
|
cfg.minValue = 0;
|
||||||
|
@ -1073,7 +1082,7 @@ static void doInitGlobalConfig() {
|
||||||
taosInitConfigOption(cfg);
|
taosInitConfigOption(cfg);
|
||||||
|
|
||||||
cfg.option = "odbcDebugFlag";
|
cfg.option = "odbcDebugFlag";
|
||||||
cfg.ptr = &odbcdebugFlag;
|
cfg.ptr = &odbcDebugFlag;
|
||||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
||||||
cfg.minValue = 0;
|
cfg.minValue = 0;
|
||||||
|
@ -1113,7 +1122,7 @@ static void doInitGlobalConfig() {
|
||||||
taosInitConfigOption(cfg);
|
taosInitConfigOption(cfg);
|
||||||
|
|
||||||
cfg.option = "qDebugFlag";
|
cfg.option = "qDebugFlag";
|
||||||
cfg.ptr = &qdebugFlag;
|
cfg.ptr = &qDebugFlag;
|
||||||
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
cfg.valType = TAOS_CFG_VTYPE_INT32;
|
||||||
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_LOG | TSDB_CFG_CTYPE_B_CLIENT;
|
||||||
cfg.minValue = 0;
|
cfg.minValue = 0;
|
||||||
|
@ -1189,6 +1198,10 @@ void taosInitGlobalCfg() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool taosCheckGlobalCfg() {
|
bool taosCheckGlobalCfg() {
|
||||||
|
if (debugFlag == 135 || debugFlag == 199) {
|
||||||
|
taosSetAllDebugFlag();
|
||||||
|
}
|
||||||
|
|
||||||
taosGetFqdn(tsLocalEp);
|
taosGetFqdn(tsLocalEp);
|
||||||
sprintf(tsLocalEp + strlen(tsLocalEp), ":%d", tsServerPort);
|
sprintf(tsLocalEp + strlen(tsLocalEp), ":%d", tsServerPort);
|
||||||
uPrint("localEp is %s", tsLocalEp);
|
uPrint("localEp is %s", tsLocalEp);
|
||||||
|
|
|
@ -167,9 +167,9 @@ static int32_t dnodeInitSystem() {
|
||||||
if (dnodeInitRead() != 0) return -1;
|
if (dnodeInitRead() != 0) return -1;
|
||||||
if (dnodeInitWrite() != 0) return -1;
|
if (dnodeInitWrite() != 0) return -1;
|
||||||
if (dnodeInitClient() != 0) return -1;
|
if (dnodeInitClient() != 0) return -1;
|
||||||
if (dnodeInitModules() != 0) return -1;
|
|
||||||
if (dnodeInitServer() != 0) return -1;
|
if (dnodeInitServer() != 0) return -1;
|
||||||
if (dnodeInitMgmt() != 0) return -1;
|
if (dnodeInitMgmt() != 0) return -1;
|
||||||
|
if (dnodeInitModules() != 0) return -1;
|
||||||
if (dnodeInitShell() != 0) return -1;
|
if (dnodeInitShell() != 0) return -1;
|
||||||
|
|
||||||
dnodeStartModules();
|
dnodeStartModules();
|
||||||
|
@ -184,14 +184,14 @@ static void dnodeCleanUpSystem() {
|
||||||
if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_STOPPED) {
|
if (dnodeGetRunStatus() != TSDB_DNODE_RUN_STATUS_STOPPED) {
|
||||||
dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_STOPPED);
|
dnodeSetRunStatus(TSDB_DNODE_RUN_STATUS_STOPPED);
|
||||||
dnodeCleanupShell();
|
dnodeCleanupShell();
|
||||||
dnodeCleanupServer();
|
dnodeCleanUpModules();
|
||||||
dnodeCleanupMgmt();
|
dnodeCleanupMgmt();
|
||||||
|
dnodeCleanupServer();
|
||||||
dnodeCleanupClient();
|
dnodeCleanupClient();
|
||||||
dnodeCleanupWrite();
|
dnodeCleanupWrite();
|
||||||
dnodeCleanupRead();
|
dnodeCleanupRead();
|
||||||
dnodeCleanUpModules();
|
|
||||||
taos_cleanup();
|
|
||||||
dnodeCleanupStorage();
|
dnodeCleanupStorage();
|
||||||
|
taos_cleanup();
|
||||||
taosCloseLog();
|
taosCloseLog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ int32_t dnodeInitServer() {
|
||||||
rpcInit.cfp = dnodeProcessReqMsgFromDnode;
|
rpcInit.cfp = dnodeProcessReqMsgFromDnode;
|
||||||
rpcInit.sessions = 100;
|
rpcInit.sessions = 100;
|
||||||
rpcInit.connType = TAOS_CONN_SERVER;
|
rpcInit.connType = TAOS_CONN_SERVER;
|
||||||
rpcInit.idleTime = tsShellActivityTimer * 2000;
|
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||||
|
|
||||||
tsDnodeServerRpc = rpcOpen(&rpcInit);
|
tsDnodeServerRpc = rpcOpen(&rpcInit);
|
||||||
if (tsDnodeServerRpc == NULL) {
|
if (tsDnodeServerRpc == NULL) {
|
||||||
|
@ -122,7 +122,7 @@ int32_t dnodeInitClient() {
|
||||||
rpcInit.ufp = dnodeUpdateIpSet;
|
rpcInit.ufp = dnodeUpdateIpSet;
|
||||||
rpcInit.sessions = 100;
|
rpcInit.sessions = 100;
|
||||||
rpcInit.connType = TAOS_CONN_CLIENT;
|
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||||
rpcInit.idleTime = tsShellActivityTimer * 2000;
|
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||||
rpcInit.user = "t";
|
rpcInit.user = "t";
|
||||||
rpcInit.ckey = "key";
|
rpcInit.ckey = "key";
|
||||||
rpcInit.secret = "secret";
|
rpcInit.secret = "secret";
|
||||||
|
|
|
@ -86,7 +86,7 @@ int32_t dnodeInitShell() {
|
||||||
rpcInit.cfp = dnodeProcessMsgFromShell;
|
rpcInit.cfp = dnodeProcessMsgFromShell;
|
||||||
rpcInit.sessions = TSDB_SESSIONS_PER_DNODE;
|
rpcInit.sessions = TSDB_SESSIONS_PER_DNODE;
|
||||||
rpcInit.connType = TAOS_CONN_SERVER;
|
rpcInit.connType = TAOS_CONN_SERVER;
|
||||||
rpcInit.idleTime = tsShellActivityTimer * 1500;
|
rpcInit.idleTime = tsShellActivityTimer * 1000;
|
||||||
rpcInit.afp = dnodeRetrieveUserAuthInfo;
|
rpcInit.afp = dnodeRetrieveUserAuthInfo;
|
||||||
|
|
||||||
tsDnodeShellRpc = rpcOpen(&rpcInit);
|
tsDnodeShellRpc = rpcOpen(&rpcInit);
|
||||||
|
@ -137,7 +137,6 @@ void dnodeProcessMsgFromShell(SRpcMsg *pMsg) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) {
|
static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char *secret, char *ckey) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ void dnodeCleanupWrite() {
|
||||||
void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) {
|
void dnodeDispatchToVnodeWriteQueue(SRpcMsg *pMsg) {
|
||||||
char *pCont = (char *)pMsg->pCont;
|
char *pCont = (char *)pMsg->pCont;
|
||||||
|
|
||||||
if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT || pMsg->msgType == TSDB_MSG_TYPE_MD_DROP_STABLE) {
|
if (pMsg->msgType == TSDB_MSG_TYPE_SUBMIT) {
|
||||||
SMsgDesc *pDesc = (SMsgDesc *)pCont;
|
SMsgDesc *pDesc = (SMsgDesc *)pCont;
|
||||||
pDesc->numOfVnodes = htonl(pDesc->numOfVnodes);
|
pDesc->numOfVnodes = htonl(pDesc->numOfVnodes);
|
||||||
pCont += sizeof(SMsgDesc);
|
pCont += sizeof(SMsgDesc);
|
||||||
|
|
|
@ -317,10 +317,6 @@ typedef struct {
|
||||||
int8_t flag;
|
int8_t flag;
|
||||||
} SCMCreateUserMsg, SCMAlterUserMsg;
|
} SCMCreateUserMsg, SCMAlterUserMsg;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
char db[TSDB_TABLE_ID_LEN + 1];
|
|
||||||
} SMgmtHead;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int32_t contLen;
|
int32_t contLen;
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
|
@ -330,6 +326,7 @@ typedef struct {
|
||||||
} SMDDropTableMsg;
|
} SMDDropTableMsg;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
int32_t contLen;
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
int64_t uid;
|
int64_t uid;
|
||||||
char tableId[TSDB_TABLE_ID_LEN + 1];
|
char tableId[TSDB_TABLE_ID_LEN + 1];
|
||||||
|
|
|
@ -634,7 +634,7 @@ void *readMetric(void *sarg) {
|
||||||
fprintf(fp, "Querying On %d records:\n", totalData);
|
fprintf(fp, "Querying On %d records:\n", totalData);
|
||||||
|
|
||||||
for (int j = 0; j < n; j++) {
|
for (int j = 0; j < n; j++) {
|
||||||
char condition[BUFFER_SIZE] = "\0";
|
char condition[BUFFER_SIZE - 30] = "\0";
|
||||||
char tempS[BUFFER_SIZE] = "\0";
|
char tempS[BUFFER_SIZE] = "\0";
|
||||||
|
|
||||||
int m = 10 < num_of_tables ? 10 : num_of_tables;
|
int m = 10 < num_of_tables ? 10 : num_of_tables;
|
||||||
|
|
|
@ -23,13 +23,13 @@ extern "C" {
|
||||||
#include "tlog.h"
|
#include "tlog.h"
|
||||||
#include "monitor.h"
|
#include "monitor.h"
|
||||||
|
|
||||||
extern int32_t mdebugFlag;
|
extern int32_t mDebugFlag;
|
||||||
extern int32_t sdbDebugFlag;
|
extern int32_t sdbDebugFlag;
|
||||||
|
|
||||||
// mnode log function
|
// mnode log function
|
||||||
#define mError(...) if (mdebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND ", 255, __VA_ARGS__); }
|
#define mError(...) if (mDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND ", 255, __VA_ARGS__); }
|
||||||
#define mWarn(...) if (mdebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND ", mdebugFlag, __VA_ARGS__); }
|
#define mWarn(...) if (mDebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND ", mDebugFlag, __VA_ARGS__); }
|
||||||
#define mTrace(...) if (mdebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", mdebugFlag, __VA_ARGS__); }
|
#define mTrace(...) if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", mDebugFlag, __VA_ARGS__); }
|
||||||
#define mPrint(...) { taosPrintLog("MND ", 255, __VA_ARGS__); }
|
#define mPrint(...) { taosPrintLog("MND ", 255, __VA_ARGS__); }
|
||||||
|
|
||||||
#define mLError(...) monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__)
|
#define mLError(...) monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__)
|
||||||
|
|
|
@ -677,9 +677,11 @@ static int32_t mgmtRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void *
|
||||||
|
|
||||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
if (pDb->status == TSDB_DB_STATUS_READY) {
|
if (pDb->status == TSDB_DB_STATUS_READY) {
|
||||||
STR_WITH_SIZE_TO_VARSTR(pWrite, "ready", 5);
|
const char *src = "ready";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
|
||||||
} else {
|
} else {
|
||||||
STR_WITH_SIZE_TO_VARSTR(pWrite, "dropping", 8);
|
const char *src = "dropping";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
|
||||||
}
|
}
|
||||||
cols++;
|
cols++;
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
|
||||||
if (pCmCfgDnode->ep[0] == 0) {
|
if (pCmCfgDnode->ep[0] == 0) {
|
||||||
strcpy(pCmCfgDnode->ep, tsLocalEp);
|
strcpy(pCmCfgDnode->ep, tsLocalEp);
|
||||||
} else {
|
} else {
|
||||||
strcpy(pCmCfgDnode->ep, pCmCfgDnode->ep);
|
// TODO temporary disabled for compiling: strcpy(pCmCfgDnode->ep, pCmCfgDnode->ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(pMsg->pUser->user, "root") != 0) {
|
if (strcmp(pMsg->pUser->user, "root") != 0) {
|
||||||
|
@ -252,7 +252,7 @@ void mgmtProcessCfgDnodeMsg(SQueuedMsg *pMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mgmtProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) {
|
static void mgmtProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) {
|
||||||
mPrint("cfg vnode rsp is received, result:%s", tstrerror(rpcMsg->code));
|
mPrint("cfg dnode rsp is received");
|
||||||
}
|
}
|
||||||
|
|
||||||
void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
|
void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
|
||||||
|
|
|
@ -132,6 +132,7 @@ int32_t mgmtInitSystem() {
|
||||||
|
|
||||||
void mgmtCleanUpSystem() {
|
void mgmtCleanUpSystem() {
|
||||||
mPrint("starting to clean up mgmt");
|
mPrint("starting to clean up mgmt");
|
||||||
|
tsMgmtIsRunning = false;
|
||||||
mgmtCleanUpShell();
|
mgmtCleanUpShell();
|
||||||
mgmtCleanupServer();
|
mgmtCleanupServer();
|
||||||
grantCleanUp();
|
grantCleanUp();
|
||||||
|
@ -144,7 +145,6 @@ void mgmtCleanUpSystem() {
|
||||||
mgmtCleanupDnodes();
|
mgmtCleanupDnodes();
|
||||||
mgmtCleanUpUsers();
|
mgmtCleanUpUsers();
|
||||||
mgmtCleanUpAccts();
|
mgmtCleanUpAccts();
|
||||||
tsMgmtIsRunning = false;
|
|
||||||
mPrint("mgmt is cleaned up");
|
mPrint("mgmt is cleaned up");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ void sdbUpdateSync() {
|
||||||
sdbPrint("mnode:%d, %s:%d", syncCfg.nodeInfo[i].nodeId, syncCfg.nodeInfo[i].nodeFqdn, syncCfg.nodeInfo[i].nodePort);
|
sdbPrint("mnode:%d, %s:%d", syncCfg.nodeInfo[i].nodeId, syncCfg.nodeInfo[i].nodeFqdn, syncCfg.nodeInfo[i].nodePort);
|
||||||
}
|
}
|
||||||
|
|
||||||
SSyncInfo syncInfo;
|
SSyncInfo syncInfo = {0};
|
||||||
syncInfo.vgId = 1;
|
syncInfo.vgId = 1;
|
||||||
syncInfo.version = sdbGetVersion();
|
syncInfo.version = sdbGetVersion();
|
||||||
syncInfo.syncCfg = syncCfg;
|
syncInfo.syncCfg = syncCfg;
|
||||||
|
@ -323,11 +323,19 @@ void sdbCleanUp() {
|
||||||
if (tsSdbObj.status != SDB_STATUS_SERVING) return;
|
if (tsSdbObj.status != SDB_STATUS_SERVING) return;
|
||||||
|
|
||||||
tsSdbObj.status = SDB_STATUS_CLOSING;
|
tsSdbObj.status = SDB_STATUS_CLOSING;
|
||||||
|
|
||||||
|
if (tsSdbObj.sync) {
|
||||||
syncStop(tsSdbObj.sync);
|
syncStop(tsSdbObj.sync);
|
||||||
|
tsSdbObj.sync = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tsSdbObj.wal) {
|
||||||
walClose(tsSdbObj.wal);
|
walClose(tsSdbObj.wal);
|
||||||
|
tsSdbObj.wal = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
sem_destroy(&tsSdbObj.sem);
|
sem_destroy(&tsSdbObj.sem);
|
||||||
pthread_mutex_destroy(&tsSdbObj.mutex);
|
pthread_mutex_destroy(&tsSdbObj.mutex);
|
||||||
memset(&tsSdbObj, 0, sizeof(tsSdbObj));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sdbIncRef(void *handle, void *pRow) {
|
void sdbIncRef(void *handle, void *pRow) {
|
||||||
|
|
|
@ -88,10 +88,12 @@ void mgmtProcessReqMsgFromDnode(SRpcMsg *rpcMsg) {
|
||||||
|
|
||||||
SRpcIpSet ipSet = {0};
|
SRpcIpSet ipSet = {0};
|
||||||
dnodeGetMnodeDnodeIpSet(&ipSet);
|
dnodeGetMnodeDnodeIpSet(&ipSet);
|
||||||
|
for (int i = 0; i < ipSet.numOfIps; ++i)
|
||||||
|
ipSet.port[i] = htons(ipSet.port[i]);
|
||||||
|
|
||||||
mTrace("conn from dnode ip:%s user:%s redirect msg, inUse:%d", taosIpStr(connInfo.clientIp), connInfo.user, ipSet.inUse);
|
mTrace("conn from dnode ip:%s user:%s redirect msg, inUse:%d", taosIpStr(connInfo.clientIp), connInfo.user, ipSet.inUse);
|
||||||
for (int32_t i = 0; i < ipSet.numOfIps; ++i) {
|
for (int32_t i = 0; i < ipSet.numOfIps; ++i) {
|
||||||
mTrace("index:%d %s:%d", i, ipSet.fqdn[i], ipSet.port[i]);
|
mTrace("mnode index:%d %s:%d", i, ipSet.fqdn[i], htons(ipSet.port[i]));
|
||||||
}
|
}
|
||||||
rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
|
rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -137,7 +137,7 @@ void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
|
||||||
mgmtGetMnodeIpSet(&ipSet);
|
mgmtGetMnodeIpSet(&ipSet);
|
||||||
mTrace("conn from shell ip:%s user:%s redirect msg, inUse:%d", taosIpStr(connInfo.clientIp), connInfo.user, ipSet.inUse);
|
mTrace("conn from shell ip:%s user:%s redirect msg, inUse:%d", taosIpStr(connInfo.clientIp), connInfo.user, ipSet.inUse);
|
||||||
for (int32_t i = 0; i < ipSet.numOfIps; ++i) {
|
for (int32_t i = 0; i < ipSet.numOfIps; ++i) {
|
||||||
mTrace("index:%d ip:%s:%d", i, ipSet.fqdn[i], ipSet.port[i]);
|
mTrace("mnode index:%d ip:%s:%d", i, ipSet.fqdn[i], htons(ipSet.port[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
|
rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
|
||||||
|
|
|
@ -701,10 +701,10 @@ static void mgmtProcessDropTableMsg(SQueuedMsg *pMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMsg->pTable->type == TSDB_SUPER_TABLE) {
|
if (pMsg->pTable->type == TSDB_SUPER_TABLE) {
|
||||||
mTrace("table:%s, start to drop stable", pDrop->tableId);
|
mPrint("table:%s, start to drop stable", pDrop->tableId);
|
||||||
mgmtProcessDropSuperTableMsg(pMsg);
|
mgmtProcessDropSuperTableMsg(pMsg);
|
||||||
} else {
|
} else {
|
||||||
mTrace("table:%s, start to drop ctable", pDrop->tableId);
|
mPrint("table:%s, start to drop ctable", pDrop->tableId);
|
||||||
mgmtProcessDropChildTableMsg(pMsg);
|
mgmtProcessDropChildTableMsg(pMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -802,30 +802,33 @@ static void mgmtProcessDropSuperTableMsg(SQueuedMsg *pMsg) {
|
||||||
int32_t vgId = pStable->vgList[vg];
|
int32_t vgId = pStable->vgList[vg];
|
||||||
if (vgId == 0) break;
|
if (vgId == 0) break;
|
||||||
|
|
||||||
|
SVgObj *pVgroup = mgmtGetVgroup(vgId);
|
||||||
|
if (pVgroup == NULL) break;
|
||||||
|
|
||||||
SMDDropSTableMsg *pDrop = rpcMallocCont(sizeof(SMDDropSTableMsg));
|
SMDDropSTableMsg *pDrop = rpcMallocCont(sizeof(SMDDropSTableMsg));
|
||||||
|
pDrop->contLen = htonl(sizeof(SMDDropSTableMsg));
|
||||||
pDrop->vgId = htonl(vgId);
|
pDrop->vgId = htonl(vgId);
|
||||||
pDrop->uid = htobe64(pStable->uid);
|
pDrop->uid = htobe64(pStable->uid);
|
||||||
mgmtExtractTableName(pStable->info.tableId, pDrop->tableId);
|
mgmtExtractTableName(pStable->info.tableId, pDrop->tableId);
|
||||||
|
|
||||||
SVgObj *pVgroup = mgmtGetVgroup(vgId);
|
mPrint("stable:%s, send drop stable msg to vgId:%d", pStable->info.tableId, vgId);
|
||||||
if (pVgroup != NULL) {
|
|
||||||
SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup);
|
SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pVgroup);
|
||||||
SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE};
|
SRpcMsg rpcMsg = {.pCont = pDrop, .contLen = sizeof(SMDDropSTableMsg), .msgType = TSDB_MSG_TYPE_MD_DROP_STABLE};
|
||||||
dnodeSendMsgToDnode(&ipSet, &rpcMsg);
|
dnodeSendMsgToDnode(&ipSet, &rpcMsg);
|
||||||
mgmtDecVgroupRef(pVgroup);
|
mgmtDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
SSdbOper oper = {
|
SSdbOper oper = {
|
||||||
.type = SDB_OPER_GLOBAL,
|
.type = SDB_OPER_GLOBAL,
|
||||||
.table = tsSuperTableSdb,
|
.table = tsSuperTableSdb,
|
||||||
.pObj = pStable
|
.pObj = pStable
|
||||||
};
|
};
|
||||||
|
|
||||||
int32_t code = sdbDeleteRow(&oper);
|
int32_t code = sdbDeleteRow(&oper);
|
||||||
mLPrint("stable:%s, is dropped from sdb, result:%s", pStable->info.tableId, tstrerror(code));
|
mLPrint("stable:%s, is dropped from sdb, result:%s", pStable->info.tableId, tstrerror(code));
|
||||||
mgmtSendSimpleResp(pMsg->thandle, code);
|
mgmtSendSimpleResp(pMsg->thandle, code);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static int32_t mgmtFindSuperTableTagIndex(SSuperTableObj *pStable, const char *tagName) {
|
static int32_t mgmtFindSuperTableTagIndex(SSuperTableObj *pStable, const char *tagName) {
|
||||||
SSchema *schema = (SSchema *) pStable->schema;
|
SSchema *schema = (SSchema *) pStable->schema;
|
||||||
|
@ -1303,7 +1306,7 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mgmtProcessDropSuperTableRsp(SRpcMsg *rpcMsg) {
|
static void mgmtProcessDropSuperTableRsp(SRpcMsg *rpcMsg) {
|
||||||
mTrace("drop stable rsp received, handle:%p code:%s", rpcMsg->handle, tstrerror(rpcMsg->code));
|
mPrint("drop stable rsp received, result:%s", tstrerror(rpcMsg->code));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *mgmtBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableObj *pTable) {
|
static void *mgmtBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableObj *pTable) {
|
||||||
|
@ -1540,7 +1543,7 @@ static void mgmtProcessDropChildTableMsg(SQueuedMsg *pMsg) {
|
||||||
|
|
||||||
SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pMsg->pVgroup);
|
SRpcIpSet ipSet = mgmtGetIpSetFromVgroup(pMsg->pVgroup);
|
||||||
|
|
||||||
mTrace("table:%s, send drop ctable msg", pDrop->tableId);
|
mPrint("table:%s, send drop ctable msg", pDrop->tableId);
|
||||||
SQueuedMsg *newMsg = mgmtCloneQueuedMsg(pMsg);
|
SQueuedMsg *newMsg = mgmtCloneQueuedMsg(pMsg);
|
||||||
newMsg->ahandle = pMsg->pTable;
|
newMsg->ahandle = pMsg->pTable;
|
||||||
SRpcMsg rpcMsg = {
|
SRpcMsg rpcMsg = {
|
||||||
|
@ -1867,7 +1870,7 @@ static void mgmtProcessDropChildTableRsp(SRpcMsg *rpcMsg) {
|
||||||
queueMsg->received++;
|
queueMsg->received++;
|
||||||
|
|
||||||
SChildTableObj *pTable = queueMsg->ahandle;
|
SChildTableObj *pTable = queueMsg->ahandle;
|
||||||
mTrace("table:%s, drop table rsp received, thandle:%p result:%s", pTable->info.tableId, queueMsg->thandle, tstrerror(rpcMsg->code));
|
mPrint("table:%s, drop table rsp received, thandle:%p result:%s", pTable->info.tableId, queueMsg->thandle, tstrerror(rpcMsg->code));
|
||||||
|
|
||||||
if (rpcMsg->code != TSDB_CODE_SUCCESS) {
|
if (rpcMsg->code != TSDB_CODE_SUCCESS) {
|
||||||
mError("table:%s, failed to drop in dnode, reason:%s", pTable->info.tableId, tstrerror(rpcMsg->code));
|
mError("table:%s, failed to drop in dnode, reason:%s", pTable->info.tableId, tstrerror(rpcMsg->code));
|
||||||
|
|
|
@ -309,11 +309,14 @@ static int32_t mgmtRetrieveUsers(SShowObj *pShow, char *data, int32_t rows, void
|
||||||
|
|
||||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
if (pUser->superAuth) {
|
if (pUser->superAuth) {
|
||||||
STR_WITH_SIZE_TO_VARSTR(pWrite, "super", 5);
|
const char *src = "super";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
|
||||||
} else if (pUser->writeAuth) {
|
} else if (pUser->writeAuth) {
|
||||||
STR_WITH_SIZE_TO_VARSTR(pWrite, "writable", 8);
|
const char *src = "writable";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
|
||||||
} else {
|
} else {
|
||||||
STR_WITH_SIZE_TO_VARSTR(pWrite, "readable", 8);
|
const char *src = "readable";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
|
||||||
}
|
}
|
||||||
cols++;
|
cols++;
|
||||||
|
|
||||||
|
|
|
@ -494,11 +494,12 @@ int32_t mgmtRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pCo
|
||||||
cols++;
|
cols++;
|
||||||
} else {
|
} else {
|
||||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
STR_WITH_SIZE_TO_VARSTR(pWrite, "NULL", 4);
|
const char *src = "NULL";
|
||||||
|
STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
|
||||||
cols++;
|
cols++;
|
||||||
|
|
||||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
STR_WITH_SIZE_TO_VARSTR(pWrite, "NULL", 4);
|
STR_WITH_SIZE_TO_VARSTR(pWrite, src, strlen(src));
|
||||||
cols++;
|
cols++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,3 +12,5 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
|
||||||
ADD_LIBRARY(os ${SRC})
|
ADD_LIBRARY(os ${SRC})
|
||||||
TARGET_LINK_LIBRARIES(os m rt)
|
TARGET_LINK_LIBRARIES(os m rt)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
SET_SOURCE_FILES_PROPERTIES(src/linuxSysPara.c PROPERTIES COMPILE_FLAGS -w)
|
||||||
|
|
|
@ -23,13 +23,6 @@ extern "C" {
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifndef _ALPINE
|
|
||||||
#include <error.h>
|
|
||||||
#include <sys/sysctl.h>
|
|
||||||
#else
|
|
||||||
#include <linux/sysctl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <argp.h>
|
#include <argp.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -82,6 +75,7 @@ extern "C" {
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
#include <error.h>
|
||||||
|
|
||||||
#define taosCloseSocket(x) \
|
#define taosCloseSocket(x) \
|
||||||
{ \
|
{ \
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TDENGINE_TSYSCTL_H
|
||||||
|
#define TDENGINE_TSYSCTL_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _ALPINE
|
||||||
|
#include <error.h>
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#else
|
||||||
|
#include <linux/sysctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
#include "tsysctl.h"
|
||||||
#include "tconfig.h"
|
#include "tconfig.h"
|
||||||
#include "tglobal.h"
|
#include "tglobal.h"
|
||||||
#include "tulog.h"
|
#include "tulog.h"
|
||||||
|
|
|
@ -22,20 +22,20 @@ extern "C" {
|
||||||
|
|
||||||
#include "tlog.h"
|
#include "tlog.h"
|
||||||
|
|
||||||
extern int32_t qdebugFlag;
|
extern int32_t qDebugFlag;
|
||||||
|
|
||||||
#define qTrace(...) \
|
#define qTrace(...) \
|
||||||
if (qdebugFlag & DEBUG_TRACE) { \
|
if (qDebugFlag & DEBUG_TRACE) { \
|
||||||
taosPrintLog("DND QRY ", qdebugFlag, __VA_ARGS__); \
|
taosPrintLog("DND QRY ", qDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define qError(...) \
|
#define qError(...) \
|
||||||
if (qdebugFlag & DEBUG_ERROR) { \
|
if (qDebugFlag & DEBUG_ERROR) { \
|
||||||
taosPrintLog("ERROR QRY ", qdebugFlag, __VA_ARGS__); \
|
taosPrintLog("ERROR QRY ", qDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
#define qWarn(...) \
|
#define qWarn(...) \
|
||||||
if (qdebugFlag & DEBUG_WARN) { \
|
if (qDebugFlag & DEBUG_WARN) { \
|
||||||
taosPrintLog("WARN QRY ", qdebugFlag, __VA_ARGS__); \
|
taosPrintLog("WARN QRY ", qDebugFlag, __VA_ARGS__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -793,7 +793,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) {
|
||||||
|
|
||||||
pConn->chandle = pRecv->chandle;
|
pConn->chandle = pRecv->chandle;
|
||||||
pConn->peerIp = pRecv->ip;
|
pConn->peerIp = pRecv->ip;
|
||||||
if (pConn->peerPort == 0) pConn->peerPort = pRecv->port;
|
pConn->peerPort = pRecv->port;
|
||||||
if (pHead->port) pConn->peerPort = htons(pHead->port);
|
if (pHead->port) pConn->peerPort = htons(pHead->port);
|
||||||
|
|
||||||
terrno = rpcCheckAuthentication(pConn, (char *)pHead, pRecv->msgLen);
|
terrno = rpcCheckAuthentication(pConn, (char *)pHead, pRecv->msgLen);
|
||||||
|
@ -1094,8 +1094,8 @@ static void rpcSendMsgToPeer(SRpcConn *pConn, void *msg, int msgLen) {
|
||||||
} else {
|
} else {
|
||||||
if (pHead->code == 0) pConn->secured = 1; // for success response, set link as secured
|
if (pHead->code == 0) pConn->secured = 1; // for success response, set link as secured
|
||||||
if (pHead->msgType < TSDB_MSG_TYPE_CM_HEARTBEAT || (rpcDebugFlag & 16))
|
if (pHead->msgType < TSDB_MSG_TYPE_CM_HEARTBEAT || (rpcDebugFlag & 16))
|
||||||
tTrace( "%s %p, %s is sent to %s:%hu, code:0x%x len:%d sig:0x%08x:0x%08x:%d",
|
tTrace( "%s %p, %s is sent to 0x%x:%hu, code:0x%x len:%d sig:0x%08x:0x%08x:%d",
|
||||||
pRpc->label, pConn, taosMsg[pHead->msgType], pConn->peerFqdn, pConn->peerPort,
|
pRpc->label, pConn, taosMsg[pHead->msgType], pConn->peerIp, pConn->peerPort,
|
||||||
htonl(pHead->code), msgLen, pHead->sourceId, pHead->destId, pHead->tranId);
|
htonl(pHead->code), msgLen, pHead->sourceId, pHead->destId, pHead->tranId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ void taosReadGlobalLogCfg() {
|
||||||
int olen, vlen;
|
int olen, vlen;
|
||||||
char fileName[PATH_MAX] = {0};
|
char fileName[PATH_MAX] = {0};
|
||||||
|
|
||||||
mdebugFlag = 135;
|
mDebugFlag = 135;
|
||||||
sdbDebugFlag = 135;
|
sdbDebugFlag = 135;
|
||||||
|
|
||||||
wordexp_t full_path;
|
wordexp_t full_path;
|
||||||
|
|
|
@ -267,7 +267,7 @@ void vnodeRelease(void *pVnodeRaw) {
|
||||||
assert(refCount >= 0);
|
assert(refCount >= 0);
|
||||||
|
|
||||||
if (refCount > 0) {
|
if (refCount > 0) {
|
||||||
vTrace("vgId:%d, release vnode, refCount:%d", pVnode, vgId, refCount);
|
vTrace("vgId:%d, release vnode, refCount:%d", vgId, refCount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ void *vnodeGetVnode(int32_t vgId) {
|
||||||
SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId);
|
SVnodeObj **ppVnode = (SVnodeObj **)taosGetIntHashData(tsDnodeVnodesHash, vgId);
|
||||||
if (ppVnode == NULL || *ppVnode == NULL) {
|
if (ppVnode == NULL || *ppVnode == NULL) {
|
||||||
terrno = TSDB_CODE_INVALID_VGROUP_ID;
|
terrno = TSDB_CODE_INVALID_VGROUP_ID;
|
||||||
vPrint("vgId:%d not exist", vgId);
|
vPrint("vgId:%d, not exist", vgId);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,8 +692,9 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) {
|
||||||
sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId);
|
sprintf(versionFile, "%s/vnode%d/version.json", tsVnodeDir, pVnode->vgId);
|
||||||
FILE *fp = fopen(versionFile, "r");
|
FILE *fp = fopen(versionFile, "r");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
vTrace("vgId:%d, failed to open version file:%s error:%s", pVnode->vgId,
|
if (errno != ENOENT) {
|
||||||
versionFile, strerror(errno));
|
vError("vgId:%d, failed to open version file:%s error:%s", pVnode->vgId, versionFile, strerror(errno));
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,13 +231,15 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
vTrace("vgId:%d, stable:%s, start to drop", 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;
|
STableId stableId = {
|
||||||
vTrace("vgId:%d, stable:%s, drop stable result:%x", pVnode, pTable->tableId, code);
|
.uid = htobe64(pTable->uid),
|
||||||
|
.tid = -1
|
||||||
|
};
|
||||||
|
|
||||||
|
code = tsdbDropTable(pVnode->tsdb, stableId);
|
||||||
|
|
||||||
|
vTrace("vgId:%d, stable:%s, drop stable result:%s", pVnode->vgId, pTable->tableId, tstrerror(code));
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import taos
|
||||||
|
from util.log import tdLog
|
||||||
|
from util.cases import tdCases
|
||||||
|
from util.sql import tdSql
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn):
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
try:
|
||||||
|
tdSql.execute("create account a&cc PASS 'pass123'")
|
||||||
|
except Exception as e:
|
||||||
|
print("create account a&cc PASS 'pass123'")
|
||||||
|
return
|
||||||
|
|
||||||
|
tdLog.exit("drop built-in user is error.")
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
|
@ -0,0 +1,52 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import taos
|
||||||
|
from util.log import tdLog
|
||||||
|
from util.cases import tdCases
|
||||||
|
from util.sql import tdSql
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn):
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("==========step1")
|
||||||
|
print("drop built-in account")
|
||||||
|
try:
|
||||||
|
tdSql.execute("drop account root")
|
||||||
|
except Exception as e:
|
||||||
|
if len(e.args) > 0 and 'no rights' != e.args[0]:
|
||||||
|
tdLog.exit(e)
|
||||||
|
|
||||||
|
print("==========step2")
|
||||||
|
print("drop built-in user")
|
||||||
|
try:
|
||||||
|
tdSql.execute("drop user root")
|
||||||
|
except Exception as e:
|
||||||
|
if len(e.args) > 0 and 'no rights' != e.args[0]:
|
||||||
|
tdLog.exit(e)
|
||||||
|
return
|
||||||
|
|
||||||
|
tdLog.exit("drop built-in user is error.")
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
|
@ -81,3 +81,7 @@ python3 ./test.py $1 -f import_merge/importToCommit.py
|
||||||
python3 ./test.py $1 -f import_merge/importTORestart.py
|
python3 ./test.py $1 -f import_merge/importTORestart.py
|
||||||
python3 ./test.py $1 -f import_merge/importTPORestart.py
|
python3 ./test.py $1 -f import_merge/importTPORestart.py
|
||||||
python3 ./test.py $1 -f import_merge/importTRestart.py
|
python3 ./test.py $1 -f import_merge/importTRestart.py
|
||||||
|
|
||||||
|
# user
|
||||||
|
python3 ./test.py $1 -f user/user_create.py
|
||||||
|
python3 ./test.py $1 -f user/pass_len.py
|
|
@ -14,7 +14,6 @@ class TDTestCase:
|
||||||
def run(self):
|
def run(self):
|
||||||
tdSql.prepare()
|
tdSql.prepare()
|
||||||
|
|
||||||
|
|
||||||
tdLog.info('=============== step1')
|
tdLog.info('=============== step1')
|
||||||
tdLog.info('create table tb (ts timestamp, speed binary(5))')
|
tdLog.info('create table tb (ts timestamp, speed binary(5))')
|
||||||
tdSql.execute('create table tb (ts timestamp, speed binary(5))')
|
tdSql.execute('create table tb (ts timestamp, speed binary(5))')
|
||||||
|
|
|
@ -1,172 +1,116 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
python3 ./test.py $1 -f insert/basic.py
|
python3 ./test.py $1 -f insert/basic.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/int.py
|
python3 ./test.py $1 -f insert/int.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/float.py
|
python3 ./test.py $1 -f insert/float.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/bigint.py
|
python3 ./test.py $1 -f insert/bigint.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/bool.py
|
python3 ./test.py $1 -f insert/bool.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/double.py
|
python3 ./test.py $1 -f insert/double.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/smallint.py
|
python3 ./test.py $1 -f insert/smallint.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/tinyint.py
|
python3 ./test.py $1 -f insert/tinyint.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/binary.py
|
python3 ./test.py $1 -f insert/binary.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/date.py
|
python3 ./test.py $1 -f insert/date.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f insert/nchar.py
|
python3 ./test.py $1 -f insert/nchar.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
|
|
||||||
python3 ./test.py $1 -f table/column_name.py
|
python3 ./test.py $1 -f table/column_name.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f table/column_num.py
|
python3 ./test.py $1 -f table/column_num.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f table/db_table.py
|
python3 ./test.py $1 -f table/db_table.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
|
|
||||||
python3 ./test.py $1 -f import_merge/importDataLastTO.py
|
python3 ./test.py $1 -f import_merge/importDataLastTO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importDataLastT.py
|
python3 ./test.py $1 -f import_merge/importDataLastT.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importDataTO.py
|
python3 ./test.py $1 -f import_merge/importDataTO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importDataT.py
|
python3 ./test.py $1 -f import_merge/importDataT.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importHeadOverlap.py
|
python3 ./test.py $1 -f import_merge/importHeadOverlap.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importHeadPartOverlap.py
|
python3 ./test.py $1 -f import_merge/importHeadPartOverlap.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importHORestart.py
|
python3 ./test.py $1 -f import_merge/importHORestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importHPORestart.py
|
python3 ./test.py $1 -f import_merge/importHPORestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importHRestart.py
|
python3 ./test.py $1 -f import_merge/importHRestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importLastSub.py
|
python3 ./test.py $1 -f import_merge/importLastSub.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1HO.py
|
python3 ./test.py $1 -f import_merge/importBlock1HO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1HPO.py
|
python3 ./test.py $1 -f import_merge/importBlock1HPO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1H.py
|
python3 ./test.py $1 -f import_merge/importBlock1H.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1S.py
|
python3 ./test.py $1 -f import_merge/importBlock1S.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1Sub.py
|
python3 ./test.py $1 -f import_merge/importBlock1Sub.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1TO.py
|
python3 ./test.py $1 -f import_merge/importBlock1TO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1TPO.py
|
python3 ./test.py $1 -f import_merge/importBlock1TPO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock1T.py
|
python3 ./test.py $1 -f import_merge/importBlock1T.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2HO.py
|
python3 ./test.py $1 -f import_merge/importBlock2HO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2HPO.py
|
python3 ./test.py $1 -f import_merge/importBlock2HPO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2H.py
|
python3 ./test.py $1 -f import_merge/importBlock2H.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2S.py
|
python3 ./test.py $1 -f import_merge/importBlock2S.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2Sub.py
|
python3 ./test.py $1 -f import_merge/importBlock2Sub.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2TO.py
|
python3 ./test.py $1 -f import_merge/importBlock2TO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2TPO.py
|
python3 ./test.py $1 -f import_merge/importBlock2TPO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlock2T.py
|
python3 ./test.py $1 -f import_merge/importBlock2T.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importBlockbetween.py
|
python3 ./test.py $1 -f import_merge/importBlockbetween.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importCacheFileSub.py
|
python3 ./test.py $1 -f import_merge/importCacheFileSub.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importCacheFileTO.py
|
python3 ./test.py $1 -f import_merge/importCacheFileTO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importCacheFileT.py
|
python3 ./test.py $1 -f import_merge/importCacheFileT.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importDataLastSub.py
|
python3 ./test.py $1 -f import_merge/importDataLastSub.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importHead.py
|
python3 ./test.py $1 -f import_merge/importHead.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importLastTO.py
|
python3 ./test.py $1 -f import_merge/importLastTO.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importLastT.py
|
python3 ./test.py $1 -f import_merge/importLastT.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importSpan.py
|
python3 ./test.py $1 -f import_merge/importSpan.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importSRestart.py
|
python3 ./test.py $1 -f import_merge/importSRestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importSubRestart.py
|
python3 ./test.py $1 -f import_merge/importSubRestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importTailOverlap.py
|
python3 ./test.py $1 -f import_merge/importTailOverlap.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importTail.py
|
python3 ./test.py $1 -f import_merge/importTail.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importTORestart.py
|
python3 ./test.py $1 -f import_merge/importTORestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importTPORestart.py
|
python3 ./test.py $1 -f import_merge/importTPORestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
python3 ./test.py $1 -f import_merge/importTRestart.py
|
python3 ./test.py $1 -f import_merge/importTRestart.py
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py $1 -s && sleep 1
|
||||||
sleep 1
|
|
||||||
|
|
|
@ -96,16 +96,16 @@ if __name__ == "__main__":
|
||||||
else:
|
else:
|
||||||
host = masterIp
|
host = masterIp
|
||||||
|
|
||||||
tdLog.notice("Procedures for tdengine deployed in %s" % (host))
|
tdLog.info("Procedures for tdengine deployed in %s" % (host))
|
||||||
|
|
||||||
if testCluster:
|
if testCluster:
|
||||||
tdLog.notice("Procedures for testing cluster")
|
tdLog.info("Procedures for testing cluster")
|
||||||
if fileName == "all":
|
if fileName == "all":
|
||||||
tdCases.runAllCluster()
|
tdCases.runAllCluster()
|
||||||
else:
|
else:
|
||||||
tdCases.runOneCluster(fileName)
|
tdCases.runOneCluster(fileName)
|
||||||
else:
|
else:
|
||||||
tdLog.notice("Procedures for testing self-deployment")
|
tdLog.info("Procedures for testing self-deployment")
|
||||||
conn = taos.connect(
|
conn = taos.connect(
|
||||||
host,
|
host,
|
||||||
config=tdDnodes.getSimCfgPath())
|
config=tdDnodes.getSimCfgPath())
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import taos
|
||||||
|
from util.log import tdLog
|
||||||
|
from util.cases import tdCases
|
||||||
|
from util.sql import tdSql
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn):
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("==============step1")
|
||||||
|
try:
|
||||||
|
tdSql.execute("create user abc pass '123456'")
|
||||||
|
except Exception as e:
|
||||||
|
tdLog.exit(e)
|
||||||
|
print("create user abc pass '123456'")
|
||||||
|
|
||||||
|
print("==============step2")
|
||||||
|
try:
|
||||||
|
tdSql.execute("alter user abc pass 'taosdata'")
|
||||||
|
except Exception as e:
|
||||||
|
tdLog.exit(e)
|
||||||
|
print("alter user abc pass 'taosdata'")
|
||||||
|
|
||||||
|
print("==============step3")
|
||||||
|
try:
|
||||||
|
tdSql.execute("alter user abc pass ''")
|
||||||
|
except Exception as e:
|
||||||
|
print("alter user abc pass ''")
|
||||||
|
else:
|
||||||
|
tdLog.exit("Error: alert user abc pass''")
|
||||||
|
|
||||||
|
print("==============step4")
|
||||||
|
try:
|
||||||
|
tdSql.execute("alter user abc pass null")
|
||||||
|
except Exception as e:
|
||||||
|
print("alter user abc pass null")
|
||||||
|
else:
|
||||||
|
tdLog.exit("Error: alter user abc pass null")
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
|
@ -0,0 +1,54 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import taos
|
||||||
|
from util.log import tdLog
|
||||||
|
from util.cases import tdCases
|
||||||
|
from util.sql import tdSql
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn):
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("==============step1")
|
||||||
|
try:
|
||||||
|
tdSql.execute("create user &abc PASS 'pass123'")
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
print("==============step2")
|
||||||
|
try:
|
||||||
|
tdSql.execute("create user a&bc PASS 'pass123'")
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
|
print("==============step3")
|
||||||
|
try:
|
||||||
|
tdSql.execute("create user '涛思' PASS 'pass123'")
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
return
|
||||||
|
|
||||||
|
tdLog.exit("create user with special character.")
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
|
@ -205,24 +205,47 @@ class TDDnode:
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
if self.valgrind == 0:
|
||||||
|
toBeKilled = "taosd"
|
||||||
|
else:
|
||||||
|
toBeKilled = "valgrind.bin"
|
||||||
|
|
||||||
if self.running != 0:
|
if self.running != 0:
|
||||||
cmd = "ps -ef|grep -w taosd | grep '%s' | grep -v grep | awk '{print $2}' && pkill -sigint taosd" % (
|
killCmd = "ps -ef|grep -w %s| grep '%s' | grep -v grep | awk '{print $2}' | xargs kill -INT" % (
|
||||||
self.cfgDir)
|
toBeKilled, self.cfgDir)
|
||||||
if os.system(cmd) != 0:
|
|
||||||
tdLog.exit(cmd)
|
psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled
|
||||||
tdLog.debug("dnode:%d is stopped by kill -SIGINT" % (self.index))
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
|
||||||
|
while(processID):
|
||||||
|
os.system(killCmd)
|
||||||
|
time.sleep(1)
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
|
||||||
|
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))
|
||||||
tdLog.debug(
|
tdLog.debug(
|
||||||
"wait 2 seconds for the dnode:%d to stop." %
|
"wait 2 seconds for the dnode:%d to stop." %
|
||||||
(self.index))
|
(self.index))
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
def forcestop(self):
|
def forcestop(self):
|
||||||
|
if self.valgrind == 0:
|
||||||
|
toBeKilled = "taosd"
|
||||||
|
else:
|
||||||
|
toBeKilled = "valgrind.bin"
|
||||||
|
|
||||||
if self.running != 0:
|
if self.running != 0:
|
||||||
cmd = "ps -ef|grep -w taosd | grep '%s' | grep -v grep | awk '{print $2}' && pkill -sigkill taosd" % (
|
killCmd = "ps -ef|grep -w %s| grep '%s' | grep -v grep | awk '{print $2}' | xargs kill -KILL" % (
|
||||||
self.cfgDir)
|
toBeKilled, self.cfgDir)
|
||||||
if os.system(cmd) != 0:
|
psCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}'" % toBeKilled
|
||||||
tdLog.exit(cmd)
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
tdLog.debug("dnode:%d is stopped by kill -9" % (self.index))
|
|
||||||
|
while(processID):
|
||||||
|
os.system(killCmd)
|
||||||
|
time.sleep(1)
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
|
||||||
|
tdLog.debug("dnode:%d is stopped by kill -KILL" % (self.index))
|
||||||
tdLog.debug(
|
tdLog.debug(
|
||||||
"wait 2 seconds for the dnode:%d to stop." %
|
"wait 2 seconds for the dnode:%d to stop." %
|
||||||
(self.index))
|
(self.index))
|
||||||
|
@ -268,8 +291,21 @@ class TDDnodes:
|
||||||
self.dnodes.append(TDDnode(10))
|
self.dnodes.append(TDDnode(10))
|
||||||
|
|
||||||
def init(self, path):
|
def init(self, path):
|
||||||
cmd = "ps -ef|grep -w taosd | grep 'taosd' | grep -v grep | awk '{print $2}' && pkill -sigkill taosd"
|
killCmd = "ps -ef|grep -w taosd | grep -v grep | awk '{print $2}' | xargs kill -KILL"
|
||||||
os.system(cmd)
|
psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'"
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
while(processID):
|
||||||
|
os.system(killCmd)
|
||||||
|
time.sleep(1)
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
|
||||||
|
killCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}' | xargs kill -KILL"
|
||||||
|
psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
while(processID):
|
||||||
|
os.system(killCmd)
|
||||||
|
time.sleep(1)
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
|
||||||
binPath = os.path.dirname(os.path.realpath(__file__))
|
binPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
binPath = binPath + "/../../../debug/"
|
binPath = binPath + "/../../../debug/"
|
||||||
|
@ -361,8 +397,22 @@ class TDDnodes:
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
# if os.system(cmd) != 0 :
|
# if os.system(cmd) != 0 :
|
||||||
# tdLog.exit(cmd)
|
# tdLog.exit(cmd)
|
||||||
cmd = "ps -ef | grep -w taosd | grep 'dnode' | grep -v grep | awk '{print $2}' && pkill -sigkill taosd"
|
killCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}' | xargs kill -KILL"
|
||||||
os.system(cmd)
|
psCmd = "ps -ef|grep -w taosd| grep -v grep | awk '{print $2}'"
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
while(processID):
|
||||||
|
os.system(killCmd)
|
||||||
|
time.sleep(1)
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
|
||||||
|
killCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}' | xargs kill -KILL"
|
||||||
|
psCmd = "ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
while(processID):
|
||||||
|
os.system(killCmd)
|
||||||
|
time.sleep(1)
|
||||||
|
processID = subprocess.check_output(psCmd, shell=True)
|
||||||
|
|
||||||
# if os.system(cmd) != 0 :
|
# if os.system(cmd) != 0 :
|
||||||
# tdLog.exit(cmd)
|
# tdLog.exit(cmd)
|
||||||
|
|
||||||
|
|
|
@ -1,49 +1,26 @@
|
||||||
#################################
|
#################################
|
||||||
run general/db/basic1.sim
|
run general/cache/new_metrics.sim
|
||||||
run general/db/basic2.sim
|
run general/compress/compress.sim
|
||||||
run general/db/basic3.sim
|
run general/compute/avg.sim
|
||||||
|
run general/compute/bottom.sim
|
||||||
|
run general/compute/count.sim
|
||||||
|
run general/db/len.sim
|
||||||
run general/db/basic4.sim
|
run general/db/basic4.sim
|
||||||
run general/db/basic5.sim
|
run general/http/restful_insert.sim
|
||||||
|
run general/import/basic.sim
|
||||||
run general/table/basic1.sim
|
run general/import/commit.sim
|
||||||
run general/table/basic2.sim
|
run general/insert/basic.sim
|
||||||
|
run general/insert/query_file_memory.sim
|
||||||
|
run general/parser/binary_escapeCharacter.sim
|
||||||
|
run general/parser/columnValue_bigint.sim
|
||||||
|
run general/parser/select_from_cache_disk.sim
|
||||||
|
run general/table/autocreate.sim
|
||||||
run general/table/basic3.sim
|
run general/table/basic3.sim
|
||||||
run general/table/column_num.sim
|
|
||||||
run general/table/column_name.sim
|
run general/table/column_name.sim
|
||||||
run general/table/bigint.sim
|
|
||||||
run general/table/bool.sim
|
|
||||||
run general/table/double.sim
|
|
||||||
run general/table/float.sim
|
|
||||||
run general/table/int.sim
|
run general/table/int.sim
|
||||||
run general/table/smallint.sim
|
run general/table/vgroup.sim
|
||||||
run general/table/tinyint.sim
|
|
||||||
run general/table/db.table.sim
|
|
||||||
|
|
||||||
run general/user/basic1.sim
|
run general/user/basic1.sim
|
||||||
run general/user/pass_alter.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/user_len.sim
|
||||||
|
run general/vector/single.sim
|
||||||
# run general/compute/count.sim
|
|
||||||
# run general/compute/avg.sim
|
|
||||||
# run general/compute/sum.sim
|
|
||||||
# run general/compute/min.sim
|
|
||||||
# run general/compute/max.sim
|
|
||||||
# run general/compute/first.sim
|
|
||||||
# run general/compute/last.sim
|
|
||||||
run general/compute/stddev.sim
|
|
||||||
# run general/compute/leastsquare.sim
|
|
||||||
run general/compute/top.sim
|
|
||||||
run general/compute/bottom.sim
|
|
||||||
run general/compute/percentile.sim
|
|
||||||
run general/compute/diff.sim
|
|
||||||
# run general/compute/interval.sim
|
|
||||||
run general/compute/null.sim
|
|
||||||
# run general/compute/diff2.sim
|
|
||||||
|
|
||||||
run general/parse/testSuite.sim
|
|
||||||
run general/field/testSuite.sim
|
|
||||||
|
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
|
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
|
||||||
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
|
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
|
||||||
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
|
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
|
||||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
|
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
|
||||||
|
@ -36,7 +34,7 @@ while $i < 10
|
||||||
sql create table $tb1 using st tags(1)
|
sql create table $tb1 using st tags(1)
|
||||||
sql insert into $tb1 values(now, 1);
|
sql insert into $tb1 values(now, 1);
|
||||||
|
|
||||||
$tb1 = $tb . 5
|
$tb1 = $tb . 4
|
||||||
sql create table $tb1 using st tags(1)
|
sql create table $tb1 using st tags(1)
|
||||||
sql insert into $tb1 values(now, 1);
|
sql insert into $tb1 values(now, 1);
|
||||||
|
|
||||||
|
@ -58,7 +56,7 @@ while $i < 10
|
||||||
|
|
||||||
sql drop table st
|
sql drop table st
|
||||||
|
|
||||||
sleep 1000
|
sleep 2000
|
||||||
print times $i
|
print times $i
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ print =============== step1 - one query, 1 column, with timestamp
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"A","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then
|
if $system_content != @[{"refId":"A","target":"A","datapoints":[[null,1577980800000],[null,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -51,32 +51,32 @@ print =============== step3 - one query, 3 column, with timestamp
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step3.1-> $system_content
|
print step3.1-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,}","datapoints":[[2,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step3.2-> $system_content
|
print step3.2-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"11","datapoints":[[1,1577808000000]]},{"refId":"A","target":"12","datapoints":[[1,1577894400000]]},{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val1:11,}","datapoints":[[1,1577808000000]]},{"refId":"A","target":"{val1:12,}","datapoints":[[1,1577894400000]]},{"refId":"A","target":"{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,}","datapoints":[[2,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step3.3-> $system_content
|
print step3.3-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"1","datapoints":[[11,1577808000000],[12,1577894400000]]},{"refId":"A","target":"2","datapoints":[[13,1577980800000],[14,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val:1,}","datapoints":[[11,1577808000000],[12,1577894400000]]},{"refId":"A","target":"{val:2,}","datapoints":[[13,1577980800000],[14,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step4 - one query, 4 column, with timestamp
|
print =============== step4 - one query, 4 column, with timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val2,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val2,val1,val from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step4.1-> $system_content
|
print step4.1-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"1","datapoints":[[21,1577808000000],[22,1577894400000]]},{"refId":"A","target":"2","datapoints":[[23,1577980800000],[24,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val1:11,, val:1,}","datapoints":[[21,1577808000000]]},{"refId":"A","target":"{val1:12,, val:1,}","datapoints":[[22,1577894400000]]},{"refId":"A","target":"{val1:13,, val:2,}","datapoints":[[23,1577980800000]]},{"refId":"A","target":"{val1:14,, val:2,}","datapoints":[[24,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1,val2 from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select ts,val,val1,val2 from db.tb "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step4.2-> $system_content
|
print step4.2-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"21","datapoints":[[1,1577808000000]]},{"refId":"A","target":"22","datapoints":[[1,1577894400000]]},{"refId":"A","target":"23","datapoints":[[2,1577980800000]]},{"refId":"A","target":"24","datapoints":[[2,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val1:11,, val2:21,}","datapoints":[[1,1577808000000]]},{"refId":"A","target":"{val1:12,, val2:22,}","datapoints":[[1,1577894400000]]},{"refId":"A","target":"{val1:13,, val2:23,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,, val2:24,}","datapoints":[[2,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -90,20 +90,20 @@ endi
|
||||||
print =============== step6 - one query, 2 column, no timestamp
|
print =============== step6 - one query, 2 column, no timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"23","datapoints":[[13,"-"]]},{"refId":"A","target":"24","datapoints":[[14,"-"]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val2:23,}","datapoints":[[13,"-"]]},{"refId":"A","target":"{val2:24,}","datapoints":[[14,"-"]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step7 - one query, 3 column, no timestamp
|
print =============== step7 - one query, 3 column, no timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"2","datapoints":[[13,"-"],[14,"-"]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val2:23,, val:2,}","datapoints":[[13,"-"]]},{"refId":"A","target":"{val2:24,, val:2,}","datapoints":[[14,"-"]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb"} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"A","alias":"","sql":"select val1,val2,val from db.tb"} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"A","target":"1","datapoints":[[11,"-"],[12,"-"]]},{"refId":"A","target":"2","datapoints":[[13,"-"],[14,"-"]]}]@ then
|
if $system_content != @[{"refId":"A","target":"{val2:21,, val:1,}","datapoints":[[11,"-"]]},{"refId":"A","target":"{val2:22,, val:1,}","datapoints":[[12,"-"]]},{"refId":"A","target":"{val2:23,, val:2,}","datapoints":[[13,"-"]]},{"refId":"A","target":"{val2:24,, val:2,}","datapoints":[[14,"-"]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ print =============== step11 - two query, 1 column, with timestamp, 1 column, w
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"A","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[null,1577980800000],[null,1578067200000]]},{"refId":"A","target":"A","datapoints":[[null,1577980800000],[null,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -140,14 +140,14 @@ print =============== step12 - two query, 1 column, with timestamp, 2 column, w
|
||||||
|
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"A","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[null,1577980800000],[null,1578067200000]]},{"refId":"A","target":"A","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step13 - two query, 1 column, with timestamp, 3 column, with timestamp
|
print =============== step13 - two query, 1 column, with timestamp, 3 column, with timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB","datapoints":[["-",1577980800000],["-",1578067200000]]},{"refId":"A","target":"13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"14","datapoints":[[2,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[null,1577980800000],[null,1578067200000]]},{"refId":"A","target":"{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"{val1:14,}","datapoints":[[2,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -161,14 +161,14 @@ endi
|
||||||
print =============== step15 - two query, 2 column, with timestamp, 3 column, with timestamp
|
print =============== step15 - two query, 2 column, with timestamp, 3 column, with timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB213","datapoints":[[223,1577980800000]]},{"refId":"B","target":"BB214","datapoints":[[224,1578067200000]]},{"refId":"A","target":"AA","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB{val1:213,}","datapoints":[[223,1577980800000]]},{"refId":"B","target":"BB{val1:214,}","datapoints":[[224,1578067200000]]},{"refId":"A","target":"AA","datapoints":[[2,1577980800000],[2,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step16 - two query, 3 column, with timestamp, 4 column, with timestamp
|
print =============== step16 - two query, 3 column, with timestamp, 4 column, with timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val, val1, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select ts, val, val1, val2, val1 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val,val1 from db.tb where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB213","datapoints":[[22,1577980800000]]},{"refId":"B","target":"BB214","datapoints":[[22,1578067200000]]},{"refId":"A","target":"AA13","datapoints":[[2,1577980800000]]},{"refId":"A","target":"AA14","datapoints":[[2,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB{val1:213,, val2:223,, val1:213,}","datapoints":[[22,1577980800000]]},{"refId":"B","target":"BB{val1:214,, val2:224,, val1:214,}","datapoints":[[22,1578067200000]]},{"refId":"A","target":"AA{val1:13,}","datapoints":[[2,1577980800000]]},{"refId":"A","target":"AA{val1:14,}","datapoints":[[2,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ endi
|
||||||
print =============== step20 - two query, 1 column, no timestamp, 1 column, with timestamp
|
print =============== step20 - two query, 1 column, no timestamp, 1 column, with timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA","datapoints":[["-",1577980800000],["-",1578067200000]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA","datapoints":[[null,1577980800000],[null,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -210,28 +210,28 @@ endi
|
||||||
print =============== step22 - two query, 1 column, no timestamp, 3 column, with timestamp
|
print =============== step22 - two query, 1 column, no timestamp, 3 column, with timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val1, val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select ts,val1, val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA223","datapoints":[[213,1577980800000]]},{"refId":"A","target":"AA224","datapoints":[[214,1578067200000]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB","datapoints":[[22,"-"],[22,"-"]]},{"refId":"A","target":"AA{val2:223,}","datapoints":[[213,1577980800000]]},{"refId":"A","target":"AA{val2:224,}","datapoints":[[214,1578067200000]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step23 - two query, 2 column, no timestamp, 1 column, no timestamp
|
print =============== step23 - two query, 2 column, no timestamp, 1 column, no timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA","datapoints":[[213,"-"],[214,"-"]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB{val2:223,}","datapoints":[[213,"-"]]},{"refId":"B","target":"BB{val2:224,}","datapoints":[[214,"-"]]},{"refId":"A","target":"AA","datapoints":[[213,"-"],[214,"-"]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step24 - two query, 2 column, no timestamp, 2 column, no timestamp
|
print =============== step24 - two query, 2 column, no timestamp, 2 column, no timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA213","datapoints":[[22,"-"]]},{"refId":"A","target":"AA214","datapoints":[[22,"-"]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB{val2:223,}","datapoints":[[213,"-"]]},{"refId":"B","target":"BB{val2:224,}","datapoints":[[214,"-"]]},{"refId":"A","target":"AA{val1:213,}","datapoints":[[22,"-"]]},{"refId":"A","target":"AA{val1:214,}","datapoints":[[22,"-"]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step25 - two query, 2 column, no timestamp, 3 column, no timestamp
|
print =============== step25 - two query, 2 column, no timestamp, 3 column, no timestamp
|
||||||
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1,val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
system_content curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d '[ {"refId":"B","alias":"BB","sql":"select val1,val2 from db.tb2 where ts >= 1577980800000 "},{"refId":"A","alias":"AA","sql":"select val,val1,val2 from db.tb2 where ts >= 1577980800000 "} ]' 127.0.0.1:6020/grafana/query
|
||||||
print step1-> $system_content
|
print step1-> $system_content
|
||||||
if $system_content != @[{"refId":"B","target":"BB223","datapoints":[[213,"-"]]},{"refId":"B","target":"BB224","datapoints":[[214,"-"]]},{"refId":"A","target":"AA223","datapoints":[[22,"-"]]},{"refId":"A","target":"AA224","datapoints":[[22,"-"]]}]@ then
|
if $system_content != @[{"refId":"B","target":"BB{val2:223,}","datapoints":[[213,"-"]]},{"refId":"B","target":"BB{val2:224,}","datapoints":[[214,"-"]]},{"refId":"A","target":"AA{val1:213,, val2:223,}","datapoints":[[22,"-"]]},{"refId":"A","target":"AA{val1:214,, val2:224,}","datapoints":[[22,"-"]]}]@ then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,14 @@ print =============== step1 - parse
|
||||||
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/
|
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
|
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
|
return -1
|
||||||
endi
|
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/
|
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
|
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
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ endi
|
||||||
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"":"windows"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
|
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
|
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
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -191,14 +191,14 @@ endi
|
||||||
system_content curl -u root:taosdata -d '{"fields":{"Percent_DPC_Time":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":""},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
|
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
|
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
|
return -1
|
||||||
endi
|
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
|
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
|
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
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -219,14 +219,14 @@ endi
|
||||||
system_content curl -u root:taosdata -d '{"fields":{"":0,"Percent_Idle_Time":95.59830474853516,"Percent_Interrupt_Time":0,"Percent_Privileged_Time":0,"Percent_Processor_Time":0,"Percent_User_Time":0},"name":"win_cpu","tags":{"host":"windows","instance":"1","objectname":"Processor"},"timestamp":1535784122}' 127.0.0.1:6020/telegraf/db/root/taosdata1
|
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
|
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
|
return -1
|
||||||
endi
|
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
|
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
|
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
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,9 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 2000
|
sleep 2000
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
print ================== server restart completed
|
print ================== server restart completed
|
||||||
sql connect
|
|
||||||
sleep 3000
|
sql reset query cache
|
||||||
|
sleep 1000
|
||||||
|
|
||||||
sql use $db
|
sql use $db
|
||||||
sql drop table tb5
|
sql drop table tb5
|
||||||
|
@ -71,13 +72,15 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 2000
|
sleep 2000
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
print ================== server restart completed
|
print ================== server restart completed
|
||||||
sql connect
|
|
||||||
sleep 3000
|
sql reset query cache
|
||||||
|
sleep 1000
|
||||||
|
|
||||||
sql use $db
|
sql use $db
|
||||||
|
|
||||||
sql create table tb5 using $stb tags(5)
|
sql create table tb5 using $stb tags(5)
|
||||||
sql select * from tb5
|
sql select * from tb5
|
||||||
|
print $rows should be 0
|
||||||
if $rows != 0 then
|
if $rows != 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
run general/metrics/disk.sim
|
|
||||||
run general/metrics/metrics.sim
|
|
||||||
run general/metrics/values.sim
|
|
||||||
run general/metrics/vnode3.sim
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
run general/stable/disk.sim
|
||||||
|
run general/stable/metrics.sim
|
||||||
|
run general/stable/values.sim
|
||||||
|
run general/stable/vnode3.sim
|
|
@ -70,4 +70,11 @@ if $data21 != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
print =============== drop stable
|
||||||
|
sql drop table db.st
|
||||||
|
sql show db.stables
|
||||||
|
if $rows != 0 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -19,28 +19,47 @@ endi
|
||||||
|
|
||||||
print ============= step2
|
print ============= step2
|
||||||
sql close
|
sql close
|
||||||
|
sleep 2500
|
||||||
|
print user read login
|
||||||
sql connect read
|
sql connect read
|
||||||
sleep 2000
|
|
||||||
sql alter user read pass 'taosdata'
|
sql alter user read pass 'taosdata'
|
||||||
sql alter user write pass 'taosdata1' -x step2
|
sql alter user write pass 'taosdata1' -x step2
|
||||||
return -1
|
return -1
|
||||||
step2:
|
step2:
|
||||||
|
|
||||||
|
sql_error create user read pass 'taosdata1'
|
||||||
|
sql_error create user write pass 'taosdata1'
|
||||||
|
|
||||||
|
sql show users
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
print ============= step3
|
print ============= step3
|
||||||
sql close
|
sql close
|
||||||
|
sleep 2500
|
||||||
|
print user write login
|
||||||
sql connect write
|
sql connect write
|
||||||
sleep 2000
|
|
||||||
|
sql_error create user read pass 'taosdata1'
|
||||||
|
sql_error create user write pass 'taosdata1'
|
||||||
sql alter user write pass 'taosdata'
|
sql alter user write pass 'taosdata'
|
||||||
sql alter user read pass 'taosdata' -x step3
|
sql alter user read pass 'taosdata' -x step3
|
||||||
return -1
|
return -1
|
||||||
step3:
|
step3:
|
||||||
|
|
||||||
|
sql show users
|
||||||
|
if $rows != 5 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
print ============= step4
|
print ============= step4
|
||||||
sql close
|
sql close
|
||||||
|
sleep 2500
|
||||||
|
print root write login
|
||||||
sql connect
|
sql connect
|
||||||
sleep 2000
|
|
||||||
sql create user oroot pass 'taosdata'
|
sql create user oroot pass 'taosdata'
|
||||||
|
|
||||||
sql show users
|
sql show users
|
||||||
if $rows != 6 then
|
if $rows != 6 then
|
||||||
return -1
|
return -1
|
||||||
|
|
|
@ -34,10 +34,10 @@ print =============== step3
|
||||||
sql drop user read -x step31
|
sql drop user read -x step31
|
||||||
return -1
|
return -1
|
||||||
step31:
|
step31:
|
||||||
sql drop user sys -x step32
|
sql drop user _root -x step32
|
||||||
return -1
|
return -1
|
||||||
step32:
|
step32:
|
||||||
sql drop user stream -x step33
|
sql drop user monitor -x step33
|
||||||
return -1
|
return -1
|
||||||
step33:
|
step33:
|
||||||
|
|
||||||
|
@ -71,11 +71,11 @@ sql alter user read privilege 1 -x step43
|
||||||
return -1
|
return -1
|
||||||
step43:
|
step43:
|
||||||
|
|
||||||
sql drop user sys -x step41
|
sql drop user _root -x step41
|
||||||
return -1
|
return -1
|
||||||
step41:
|
step41:
|
||||||
|
|
||||||
sql drop user stream -x step42
|
sql drop user monitor -x step42
|
||||||
return -1
|
return -1
|
||||||
step42:
|
step42:
|
||||||
|
|
||||||
|
|
|
@ -27,21 +27,21 @@ cd ../../../debug; make
|
||||||
./test.sh -f general/compress/compress2.sim
|
./test.sh -f general/compress/compress2.sim
|
||||||
./test.sh -f general/compress/uncompress.sim
|
./test.sh -f general/compress/uncompress.sim
|
||||||
|
|
||||||
#./test.sh -f general/compute/avg.sim
|
./test.sh -f general/compute/avg.sim
|
||||||
./test.sh -f general/compute/bottom.sim
|
./test.sh -f general/compute/bottom.sim
|
||||||
#./test.sh -f general/compute/count.sim
|
./test.sh -f general/compute/count.sim
|
||||||
./test.sh -f general/compute/diff.sim
|
./test.sh -f general/compute/diff.sim
|
||||||
#./test.sh -f general/compute/diff2.sim
|
#./test.sh -f general/compute/diff2.sim
|
||||||
#./test.sh -f general/compute/first.sim
|
./test.sh -f general/compute/first.sim
|
||||||
#./test.sh -f general/compute/interval.sim
|
#./test.sh -f general/compute/interval.sim
|
||||||
#./test.sh -f general/compute/last.sim
|
#./test.sh -f general/compute/last.sim
|
||||||
#./test.sh -f general/compute/leastsquare.sim
|
#./test.sh -f general/compute/leastsquare.sim
|
||||||
#./test.sh -f general/compute/max.sim
|
./test.sh -f general/compute/max.sim
|
||||||
#./test.sh -f general/compute/min.sim
|
./test.sh -f general/compute/min.sim
|
||||||
./test.sh -f general/compute/null.sim
|
./test.sh -f general/compute/null.sim
|
||||||
./test.sh -f general/compute/percentile.sim
|
./test.sh -f general/compute/percentile.sim
|
||||||
./test.sh -f general/compute/stddev.sim
|
./test.sh -f general/compute/stddev.sim
|
||||||
#./test.sh -f general/compute/sum.sim
|
./test.sh -f general/compute/sum.sim
|
||||||
./test.sh -f general/compute/top.sim
|
./test.sh -f general/compute/top.sim
|
||||||
|
|
||||||
./test.sh -f general/db/basic.sim
|
./test.sh -f general/db/basic.sim
|
||||||
|
@ -65,20 +65,20 @@ cd ../../../debug; make
|
||||||
#./test.sh -f general/field/4.sim
|
#./test.sh -f general/field/4.sim
|
||||||
#./test.sh -f general/field/5.sim
|
#./test.sh -f general/field/5.sim
|
||||||
#./test.sh -f general/field/6.sim
|
#./test.sh -f general/field/6.sim
|
||||||
./test.sh -f general/field/bigint.sim
|
##./test.sh -f general/field/bigint.sim
|
||||||
#./test.sh -f general/field/binary.sim
|
#./test.sh -f general/field/binary.sim
|
||||||
./test.sh -f general/field/bool.sim
|
##./test.sh -f general/field/bool.sim
|
||||||
#./test.sh -f general/field/single.sim
|
#./test.sh -f general/field/single.sim
|
||||||
./test.sh -f general/field/smallint.sim
|
##./test.sh -f general/field/smallint.sim
|
||||||
./test.sh -f general/field/tinyint.sim
|
##./test.sh -f general/field/tinyint.sim
|
||||||
|
|
||||||
./test.sh -f general/http/restful.sim
|
##./test.sh -f general/http/restful.sim
|
||||||
./test.sh -f general/http/restful_insert.sim
|
./test.sh -f general/http/restful_insert.sim
|
||||||
./test.sh -f general/http/restful_limit.sim
|
./test.sh -f general/http/restful_limit.sim
|
||||||
./test.sh -f general/http/restful_full.sim
|
##./test.sh -f general/http/restful_full.sim
|
||||||
./test.sh -f general/http/prepare.sim
|
./test.sh -f general/http/prepare.sim
|
||||||
./test.sh -f general/http/telegraf.sim
|
./test.sh -f general/http/telegraf.sim
|
||||||
#./test.sh -f general/http/grafana_bug.sim
|
./test.sh -f general/http/grafana_bug.sim
|
||||||
#./test.sh -f general/http/grafana.sim
|
#./test.sh -f general/http/grafana.sim
|
||||||
|
|
||||||
./test.sh -f general/import/basic.sim
|
./test.sh -f general/import/basic.sim
|
||||||
|
@ -96,11 +96,6 @@ cd ../../../debug; make
|
||||||
./test.sh -f general/insert/query_multi_file.sim
|
./test.sh -f general/insert/query_multi_file.sim
|
||||||
./test.sh -f general/insert/tcp.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
|
#parser
|
||||||
|
|
||||||
# ./test.sh -f general/parser/alter.sim
|
# ./test.sh -f general/parser/alter.sim
|
||||||
|
@ -109,7 +104,7 @@ cd ../../../debug; make
|
||||||
# ./test.sh -f general/parser/auto_create_tb.sim
|
# ./test.sh -f general/parser/auto_create_tb.sim
|
||||||
# ./test.sh -f general/parser/auto_create_tb_drop_tb.sim
|
# ./test.sh -f general/parser/auto_create_tb_drop_tb.sim
|
||||||
./test.sh -f general/parser/binary_escapeCharacter.sim
|
./test.sh -f general/parser/binary_escapeCharacter.sim
|
||||||
./test.sh -f general/parser/bug.sim
|
#./test.sh -f general/parser/bug.sim
|
||||||
./test.sh -f general/parser/col_arithmetic_operation.sim
|
./test.sh -f general/parser/col_arithmetic_operation.sim
|
||||||
./test.sh -f general/parser/columnValue_bigint.sim
|
./test.sh -f general/parser/columnValue_bigint.sim
|
||||||
./test.sh -f general/parser/columnValue_bool.sim
|
./test.sh -f general/parser/columnValue_bool.sim
|
||||||
|
@ -162,6 +157,11 @@ cd ../../../debug; make
|
||||||
# ./test.sh -f general/parser/select_with_tags.sim
|
# ./test.sh -f general/parser/select_with_tags.sim
|
||||||
# ./test.sh -f general/parser/groupby.sim
|
# ./test.sh -f general/parser/groupby.sim
|
||||||
|
|
||||||
|
#./test.sh -f general/stable/disk.sim
|
||||||
|
#./test.sh -f general/stable/metrics.sim
|
||||||
|
#./test.sh -f general/stable/values.sim
|
||||||
|
#./test.sh -f general/stable/vnode3.sim
|
||||||
|
|
||||||
#stream
|
#stream
|
||||||
|
|
||||||
./test.sh -f general/table/autocreate.sim
|
./test.sh -f general/table/autocreate.sim
|
||||||
|
@ -255,9 +255,9 @@ cd ../../../debug; make
|
||||||
#./test.sh -u -f unique/big/maxvnodes.sim
|
#./test.sh -u -f unique/big/maxvnodes.sim
|
||||||
#./test.sh -u -f unique/big/tcp.sim
|
#./test.sh -u -f unique/big/tcp.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/cluster/balance1.sim
|
##./test.sh -u -f unique/cluster/balance1.sim
|
||||||
./test.sh -u -f unique/cluster/balance2.sim
|
##./test.sh -u -f unique/cluster/balance2.sim
|
||||||
./test.sh -u -f unique/cluster/balance3.sim
|
##./test.sh -u -f unique/cluster/balance3.sim
|
||||||
#./test.sh -u -f unique/cluster/cache.sim
|
#./test.sh -u -f unique/cluster/cache.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/column/replica3.sim
|
./test.sh -u -f unique/column/replica3.sim
|
||||||
|
@ -265,26 +265,26 @@ cd ../../../debug; make
|
||||||
#./test.sh -u -f unique/db/commit.sim
|
#./test.sh -u -f unique/db/commit.sim
|
||||||
#./test.sh -u -f unique/db/delete.sim
|
#./test.sh -u -f unique/db/delete.sim
|
||||||
#./test.sh -u -f unique/db/delete_part.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_add12.sim
|
||||||
./test.sh -u -f unique/db/replica_add13.sim
|
##./test.sh -u -f unique/db/replica_add13.sim
|
||||||
./test.sh -u -f unique/db/replica_add23.sim
|
##./test.sh -u -f unique/db/replica_add23.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce21.sim
|
##./test.sh -u -f unique/db/replica_reduce21.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce32.sim
|
##./test.sh -u -f unique/db/replica_reduce32.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce31.sim
|
##./test.sh -u -f unique/db/replica_reduce31.sim
|
||||||
./test.sh -u -f unique/db/replica_part.sim
|
##./test.sh -u -f unique/db/replica_part.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/dnode/balance1.sim
|
##./test.sh -u -f unique/dnode/balance1.sim
|
||||||
./test.sh -u -f unique/dnode/balance2.sim
|
##./test.sh -u -f unique/dnode/balance2.sim
|
||||||
./test.sh -u -f unique/dnode/balance3.sim
|
##./test.sh -u -f unique/dnode/balance3.sim
|
||||||
./test.sh -u -f unique/dnode/balancex.sim
|
##./test.sh -u -f unique/dnode/balancex.sim
|
||||||
./test.sh -u -f unique/dnode/offline1.sim
|
##./test.sh -u -f unique/dnode/offline1.sim
|
||||||
./test.sh -u -f unique/dnode/offline2.sim
|
##./test.sh -u -f unique/dnode/offline2.sim
|
||||||
#./test.sh -u -f unique/dnode/remove1.sim
|
#./test.sh -u -f unique/dnode/remove1.sim
|
||||||
#./test.sh -u -f unique/dnode/remove2.sim
|
#./test.sh -u -f unique/dnode/remove2.sim
|
||||||
#./test.sh -u -f unique/dnode/vnode_clean.sim
|
#./test.sh -u -f unique/dnode/vnode_clean.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/http/admin.sim
|
##./test.sh -u -f unique/http/admin.sim
|
||||||
./test.sh -u -f unique/http/opentsdb.sim
|
##./test.sh -u -f unique/http/opentsdb.sim
|
||||||
|
|
||||||
#./test.sh -u -f unique/import/replica2.sim
|
#./test.sh -u -f unique/import/replica2.sim
|
||||||
#./test.sh -u -f unique/import/replica3.sim
|
#./test.sh -u -f unique/import/replica3.sim
|
||||||
|
@ -298,28 +298,28 @@ cd ../../../debug; make
|
||||||
#./test.sh -u -f unique/metrics/replica3_dnode6.sim
|
#./test.sh -u -f unique/metrics/replica3_dnode6.sim
|
||||||
#./test.sh -u -f unique/metrics/replica3_vnode3.sim
|
#./test.sh -u -f unique/metrics/replica3_vnode3.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/mnode/mgmt22.sim
|
##./test.sh -u -f unique/mnode/mgmt22.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt23.sim
|
##./test.sh -u -f unique/mnode/mgmt23.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt24.sim
|
##./test.sh -u -f unique/mnode/mgmt24.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt25.sim
|
##./test.sh -u -f unique/mnode/mgmt25.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt26.sim
|
##./test.sh -u -f unique/mnode/mgmt26.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt33.sim
|
##./test.sh -u -f unique/mnode/mgmt33.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt34.sim
|
##./test.sh -u -f unique/mnode/mgmt34.sim
|
||||||
#./test.sh -u -f unique/mnode/mgmtr2.sim
|
#./test.sh -u -f unique/mnode/mgmtr2.sim
|
||||||
#./test.sh -u -f unique/mnode/secondIp.sim
|
#./test.sh -u -f unique/mnode/secondIp.sim
|
||||||
|
|
||||||
#stream
|
#stream
|
||||||
|
|
||||||
./test.sh -u -f unique/table/delete_part.sim
|
##./test.sh -u -f unique/table/delete_part.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/vnode/replica2_basic2.sim
|
##./test.sh -u -f unique/vnode/replica2_basic2.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_basic.sim
|
##./test.sh -u -f unique/vnode/replica3_basic.sim
|
||||||
|
|
||||||
#./test.sh -u -f unique/vnode/commit.sim
|
#./test.sh -u -f unique/vnode/commit.sim
|
||||||
#./test.sh -u -f unique/vnode/many.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_basic.sim
|
||||||
./test.sh -u -f unique/vnode/replica2_basic2.sim
|
##./test.sh -u -f unique/vnode/replica2_basic2.sim
|
||||||
#./test.sh -u -f unique/vnode/replica2_repeat.sim
|
#./test.sh -u -f unique/vnode/replica2_repeat.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_basic.sim
|
##./test.sh -u -f unique/vnode/replica3_basic.sim
|
||||||
#./test.sh -u -f unique/vnode/replica3_repeat.sim
|
#./test.sh -u -f unique/vnode/replica3_repeat.sim
|
||||||
#./test.sh -u -f unique/vnode/replica3_vgroup.sim
|
#./test.sh -u -f unique/vnode/replica3_vgroup.sim
|
||||||
|
|
|
@ -108,6 +108,7 @@ echo "udebugFlag 131" >> $TAOS_CFG
|
||||||
echo "jnidebugFlag 131" >> $TAOS_CFG
|
echo "jnidebugFlag 131" >> $TAOS_CFG
|
||||||
echo "sdebugFlag 135" >> $TAOS_CFG
|
echo "sdebugFlag 135" >> $TAOS_CFG
|
||||||
echo "monitor 0" >> $TAOS_CFG
|
echo "monitor 0" >> $TAOS_CFG
|
||||||
|
echo "monitorInterval 1" >> $TAOS_CFG
|
||||||
echo "http 0" >> $TAOS_CFG
|
echo "http 0" >> $TAOS_CFG
|
||||||
echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG
|
echo "numOfThreadsPerCore 2.0" >> $TAOS_CFG
|
||||||
echo "defaultPass taosdata" >> $TAOS_CFG
|
echo "defaultPass taosdata" >> $TAOS_CFG
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
|
PID=`ps -ef|grep /usr/bin/taosd | grep -v grep | awk '{print $2}'`
|
||||||
if [ -n "$PID" ]; then
|
if [ -n "$PID" ]; then
|
||||||
echo sudo systemctl stop taosd
|
echo systemctl stop taosd
|
||||||
sudo systemctl stop taosd
|
systemctl stop taosd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
||||||
while [ -n "$PID" ]; do
|
while [ -n "$PID" ]; do
|
||||||
echo sudo kill -9 $PID
|
echo kill -9 $PID
|
||||||
sudo pkill -9 taosd
|
pkill -9 taosd
|
||||||
sudo fuser -k -n tcp 6030
|
fuser -k -n tcp 6030
|
||||||
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
|
||||||
done
|
done
|
||||||
|
|
|
@ -35,10 +35,10 @@ print =============== step3
|
||||||
sql drop user read -x step31
|
sql drop user read -x step31
|
||||||
return -1
|
return -1
|
||||||
step31:
|
step31:
|
||||||
sql drop user sys -x step32
|
sql drop user _root -x step32
|
||||||
return -1
|
return -1
|
||||||
step32:
|
step32:
|
||||||
sql drop user stream -x step33
|
sql drop user monitor -x step33
|
||||||
return -1
|
return -1
|
||||||
step33:
|
step33:
|
||||||
|
|
||||||
|
@ -71,11 +71,11 @@ sql alter user read privilege 1 -x step43
|
||||||
return -1
|
return -1
|
||||||
step43:
|
step43:
|
||||||
|
|
||||||
sql drop user sys -x step41
|
sql drop user _root -x step41
|
||||||
return -1
|
return -1
|
||||||
step41:
|
step41:
|
||||||
|
|
||||||
sql drop user stream -x step42
|
sql drop user monitor -x step42
|
||||||
return -1
|
return -1
|
||||||
step42:
|
step42:
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
|
||||||
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
|
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start -t
|
system sh/exec_up.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ if $data2_1 != master then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step2
|
print ============== step2
|
||||||
system sh/exec_up.sh -n dnode2 -s start -t
|
system sh/exec_up.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -45,10 +45,6 @@ print ============== step3
|
||||||
sql_error drop dnode $hostname1 -x error1
|
sql_error drop dnode $hostname1 -x error1
|
||||||
print should not drop master
|
print should not drop master
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
|
||||||
return
|
|
||||||
|
|
||||||
print ============== step4
|
print ============== step4
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
||||||
sql_error show mnodes
|
sql_error show mnodes
|
||||||
|
@ -83,7 +79,7 @@ if $data2_2 != slave then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step7
|
print ============== step7
|
||||||
system sh/exec_up.sh -n dnode3 -s start -t
|
system sh/exec_up.sh -n dnode3 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
|
@ -105,7 +101,7 @@ endi
|
||||||
if $data2_2 != slave then
|
if $data2_2 != slave then
|
||||||
goto show7
|
goto show7
|
||||||
endi
|
endi
|
||||||
if $data3_3 != NULL then
|
if $data3_3 != null then
|
||||||
goto show7
|
goto show7
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec_up.sh -n dnode1 -s start
|
||||||
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec_up.sh -n dnode2 -s start
|
||||||
|
@ -89,6 +90,19 @@ if $data2_3 != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
if $data4_1 != ready then
|
||||||
|
print dnode1 status should ready but is $data4_1
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data4_2 != ready then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $data4_3 != ready then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
print ========= step2
|
print ========= step2
|
||||||
sql insert into d1.t1 values(now, 2)
|
sql insert into d1.t1 values(now, 2)
|
||||||
sql insert into d2.t2 values(now, 2)
|
sql insert into d2.t2 values(now, 2)
|
||||||
|
|
|
@ -30,10 +30,10 @@ print =============== step3
|
||||||
sql drop user read -x step31
|
sql drop user read -x step31
|
||||||
return -1
|
return -1
|
||||||
step31:
|
step31:
|
||||||
sql drop user sys -x step32
|
sql drop user _root -x step32
|
||||||
return -1
|
return -1
|
||||||
step32:
|
step32:
|
||||||
sql drop user stream -x step33
|
sql drop user monitor -x step33
|
||||||
return -1
|
return -1
|
||||||
step33:
|
step33:
|
||||||
|
|
||||||
|
@ -64,11 +64,11 @@ sql alter user read privilege 1 -x step43
|
||||||
return -1
|
return -1
|
||||||
step43:
|
step43:
|
||||||
|
|
||||||
sql drop user sys -x step41
|
sql drop user _root -x step41
|
||||||
return -1
|
return -1
|
||||||
step41:
|
step41:
|
||||||
|
|
||||||
sql drop user stream -x step42
|
sql drop user monitor -x step42
|
||||||
return -1
|
return -1
|
||||||
step42:
|
step42:
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ char *simGetVariable(SScript *script, char *varName, int varLen) {
|
||||||
int simExecuteExpression(SScript *script, char *exp) {
|
int simExecuteExpression(SScript *script, char *exp) {
|
||||||
char *op1, *op2, *var1, *var2, *var3, *rest;
|
char *op1, *op2, *var1, *var2, *var3, *rest;
|
||||||
int op1Len, op2Len, var1Len, var2Len, var3Len, val0, val1;
|
int op1Len, op2Len, var1Len, var2Len, var3Len, val0, val1;
|
||||||
char t0[512], t1[512], t2[512], t3[512];
|
char t0[512], t1[512], t2[512], t3[1024];
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
rest = paGetToken(exp, &var1, &var1Len);
|
rest = paGetToken(exp, &var1, &var1Len);
|
||||||
|
@ -310,14 +310,15 @@ void simStoreSystemContentResult(SScript *script, char *filename) {
|
||||||
|
|
||||||
bool simExecuteSystemContentCmd(SScript *script, char *option) {
|
bool simExecuteSystemContentCmd(SScript *script, char *option) {
|
||||||
char buf[4096] = {0};
|
char buf[4096] = {0};
|
||||||
|
char buf1[4096 + 512] = {0};
|
||||||
char filename[400] = {0};
|
char filename[400] = {0};
|
||||||
sprintf(filename, "%s/%s.tmp", tsScriptDir, script->fileName);
|
sprintf(filename, "%s/%s.tmp", tsScriptDir, script->fileName);
|
||||||
|
|
||||||
sprintf(buf, "cd %s; ", tsScriptDir);
|
sprintf(buf, "cd %s; ", tsScriptDir);
|
||||||
simVisuallizeOption(script, option, buf + strlen(buf));
|
simVisuallizeOption(script, option, buf + strlen(buf));
|
||||||
sprintf(buf, "%s > %s 2>/dev/null", buf, filename);
|
sprintf(buf1, "%s > %s 2>/dev/null", buf, filename);
|
||||||
|
|
||||||
sprintf(script->system_exit_code, "%d", system(buf));
|
sprintf(script->system_exit_code, "%d", system(buf1));
|
||||||
simStoreSystemContentResult(script, filename);
|
simStoreSystemContentResult(script, filename);
|
||||||
|
|
||||||
script->linePos++;
|
script->linePos++;
|
||||||
|
@ -414,7 +415,7 @@ void simCloseNativeConnect(SScript *script) {
|
||||||
|
|
||||||
simTrace("script:%s, taos:%p closed", script->fileName, script->taos);
|
simTrace("script:%s, taos:%p closed", script->fileName, script->taos);
|
||||||
taos_close(script->taos);
|
taos_close(script->taos);
|
||||||
taosMsleep(1000);
|
taosMsleep(1200);
|
||||||
|
|
||||||
script->taos = NULL;
|
script->taos = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue