提交 9491a806 编写于 作者: C changshuaiqiang

Merge branch 'develop' into feature/changshuaiqiang/testcase

* develop:
  if link is new, server force the client to do authentication
  scripts
  [TD-275] fix drop table error while query from super table
  scripts
  fix column/metircs.sim
  [TD-292] client may crash if column too log
  [TD-292] scripts
  [TD-292] fix bug while columns too large
  restart TSDB when sync finished
...@@ -562,15 +562,15 @@ static int32_t tscEstimateQueryMsgSize(SSqlCmd *pCmd, int32_t clauseIndex) { ...@@ -562,15 +562,15 @@ static int32_t tscEstimateQueryMsgSize(SSqlCmd *pCmd, int32_t clauseIndex) {
size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo); size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo);
int32_t exprSize = sizeof(SSqlFuncMsg) * numOfExprs; int32_t exprSize = sizeof(SSqlFuncMsg) * numOfExprs;
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); //STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
// meter query without tags values // table query without tags values
if (!UTIL_TABLE_IS_SUPERTABLE(pTableMetaInfo)) { //if (!UTIL_TABLE_IS_SUPERTABLE(pTableMetaInfo)) {
return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + exprSize; return MIN_QUERY_MSG_PKT_SIZE + minMsgSize() + sizeof(SQueryTableMsg) + srcColListSize + exprSize + 4096;
} //}
int32_t size = 4096; //int32_t size = 4096;
return size; //return size;
} }
static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char *pMsg) { static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char *pMsg) {
......
...@@ -74,6 +74,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_OPTION, 0, 26, "invalid option") ...@@ -74,6 +74,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_INVALID_OPTION, 0, 26, "invalid option")
TAOS_DEFINE_ERROR(TSDB_CODE_NOT_CONFIGURED, 0, 27, "not configured") TAOS_DEFINE_ERROR(TSDB_CODE_NOT_CONFIGURED, 0, 27, "not configured")
TAOS_DEFINE_ERROR(TSDB_CODE_NODE_OFFLINE, 0, 28, "node offline") TAOS_DEFINE_ERROR(TSDB_CODE_NODE_OFFLINE, 0, 28, "node offline")
TAOS_DEFINE_ERROR(TSDB_CODE_NETWORK_UNAVAIL, 0, 29, "network unavailable") TAOS_DEFINE_ERROR(TSDB_CODE_NETWORK_UNAVAIL, 0, 29, "network unavailable")
TAOS_DEFINE_ERROR(TSDB_CODE_AUTH_REQUIRED, 0, 30, "auth required")
// db // db
TAOS_DEFINE_ERROR(TSDB_CODE_DB_NOT_SELECTED, 0, 100, "db not selected") TAOS_DEFINE_ERROR(TSDB_CODE_DB_NOT_SELECTED, 0, 100, "db not selected")
......
...@@ -195,7 +195,7 @@ static int32_t mgmtChildTableActionUpdate(SSdbOper *pOper) { ...@@ -195,7 +195,7 @@ static int32_t mgmtChildTableActionUpdate(SSdbOper *pOper) {
} }
static int32_t mgmtChildTableActionEncode(SSdbOper *pOper) { static int32_t mgmtChildTableActionEncode(SSdbOper *pOper) {
const int32_t maxRowSize = sizeof(SChildTableObj) + sizeof(SSchema) * TSDB_MAX_COLUMNS; const int32_t maxRowSize = sizeof(SChildTableObj) + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16);
SChildTableObj *pTable = pOper->pObj; SChildTableObj *pTable = pOper->pObj;
assert(pTable != NULL && pOper->rowData != NULL); assert(pTable != NULL && pOper->rowData != NULL);
...@@ -337,7 +337,7 @@ static int32_t mgmtInitChildTables() { ...@@ -337,7 +337,7 @@ static int32_t mgmtInitChildTables() {
.tableId = SDB_TABLE_CTABLE, .tableId = SDB_TABLE_CTABLE,
.tableName = "ctables", .tableName = "ctables",
.hashSessions = tsMaxTables, .hashSessions = tsMaxTables,
.maxRowSize = sizeof(SChildTableObj) + sizeof(SSchema) * TSDB_MAX_COLUMNS, .maxRowSize = sizeof(SChildTableObj) + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16),
.refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj,
.keyType = SDB_KEY_STRING, .keyType = SDB_KEY_STRING,
.insertFp = mgmtChildTableActionInsert, .insertFp = mgmtChildTableActionInsert,
...@@ -381,7 +381,7 @@ static void mgmtRemoveTableFromStable(SSuperTableObj *pStable, SChildTableObj *p ...@@ -381,7 +381,7 @@ static void mgmtRemoveTableFromStable(SSuperTableObj *pStable, SChildTableObj *p
if (pStable->vgHash == NULL) return; if (pStable->vgHash == NULL) return;
SVgObj *pVgroup = mgmtGetVgroup(pCtable->vgId); SVgObj *pVgroup = mgmtGetVgroup(pCtable->vgId);
if (pVgroup != NULL) { if (pVgroup == NULL) {
taosHashRemove(pStable->vgHash, (char *)&pCtable->vgId, sizeof(pCtable->vgId)); taosHashRemove(pStable->vgHash, (char *)&pCtable->vgId, sizeof(pCtable->vgId));
} }
mgmtDecVgroupRef(pVgroup); mgmtDecVgroupRef(pVgroup);
...@@ -440,7 +440,7 @@ static int32_t mgmtSuperTableActionUpdate(SSdbOper *pOper) { ...@@ -440,7 +440,7 @@ static int32_t mgmtSuperTableActionUpdate(SSdbOper *pOper) {
} }
static int32_t mgmtSuperTableActionEncode(SSdbOper *pOper) { static int32_t mgmtSuperTableActionEncode(SSdbOper *pOper) {
const int32_t maxRowSize = sizeof(SChildTableObj) + sizeof(SSchema) * TSDB_MAX_COLUMNS; const int32_t maxRowSize = sizeof(SChildTableObj) + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16);
SSuperTableObj *pStable = pOper->pObj; SSuperTableObj *pStable = pOper->pObj;
assert(pOper->pObj != NULL && pOper->rowData != NULL); assert(pOper->pObj != NULL && pOper->rowData != NULL);
...@@ -491,7 +491,7 @@ static int32_t mgmtInitSuperTables() { ...@@ -491,7 +491,7 @@ static int32_t mgmtInitSuperTables() {
.tableId = SDB_TABLE_STABLE, .tableId = SDB_TABLE_STABLE,
.tableName = "stables", .tableName = "stables",
.hashSessions = TSDB_MAX_SUPER_TABLES, .hashSessions = TSDB_MAX_SUPER_TABLES,
.maxRowSize = tsSuperTableUpdateSize + sizeof(SSchema) * TSDB_MAX_COLUMNS, .maxRowSize = tsSuperTableUpdateSize + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16),
.refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj, .refCountPos = (int8_t *)(&tObj.refCount) - (int8_t *)&tObj,
.keyType = SDB_KEY_STRING, .keyType = SDB_KEY_STRING,
.insertFp = mgmtSuperTableActionInsert, .insertFp = mgmtSuperTableActionInsert,
...@@ -1216,7 +1216,7 @@ static int32_t mgmtSetSchemaFromSuperTable(SSchema *pSchema, SSuperTableObj *pTa ...@@ -1216,7 +1216,7 @@ static int32_t mgmtSetSchemaFromSuperTable(SSchema *pSchema, SSuperTableObj *pTa
static void mgmtGetSuperTableMeta(SQueuedMsg *pMsg) { static void mgmtGetSuperTableMeta(SQueuedMsg *pMsg) {
SSuperTableObj *pTable = (SSuperTableObj *)pMsg->pTable; SSuperTableObj *pTable = (SSuperTableObj *)pMsg->pTable;
STableMetaMsg *pMeta = rpcMallocCont(sizeof(STableMetaMsg) + sizeof(SSchema) * TSDB_MAX_COLUMNS); STableMetaMsg *pMeta = rpcMallocCont(sizeof(STableMetaMsg) + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16));
pMeta->uid = htobe64(pTable->uid); pMeta->uid = htobe64(pTable->uid);
pMeta->sversion = htons(pTable->sversion); pMeta->sversion = htons(pTable->sversion);
pMeta->precision = pMsg->pDb->cfg.precision; pMeta->precision = pMsg->pDb->cfg.precision;
...@@ -1731,7 +1731,7 @@ static void mgmtAutoCreateChildTable(SQueuedMsg *pMsg) { ...@@ -1731,7 +1731,7 @@ static void mgmtAutoCreateChildTable(SQueuedMsg *pMsg) {
} }
static void mgmtGetChildTableMeta(SQueuedMsg *pMsg) { static void mgmtGetChildTableMeta(SQueuedMsg *pMsg) {
STableMetaMsg *pMeta = rpcMallocCont(sizeof(STableMetaMsg) + sizeof(SSchema) * TSDB_MAX_COLUMNS); STableMetaMsg *pMeta = rpcMallocCont(sizeof(STableMetaMsg) + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16));
if (pMeta == NULL) { if (pMeta == NULL) {
mError("table:%s, failed to get table meta, no enough memory", pMsg->pTable->tableId); mError("table:%s, failed to get table meta, no enough memory", pMsg->pTable->tableId);
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_SERV_OUT_OF_MEMORY); mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_SERV_OUT_OF_MEMORY);
...@@ -1979,7 +1979,7 @@ static void mgmtProcessMultiTableMetaMsg(SQueuedMsg *pMsg) { ...@@ -1979,7 +1979,7 @@ static void mgmtProcessMultiTableMetaMsg(SQueuedMsg *pMsg) {
if (pMsg->pDb == NULL) continue; if (pMsg->pDb == NULL) continue;
int availLen = totalMallocLen - pMultiMeta->contLen; int availLen = totalMallocLen - pMultiMeta->contLen;
if (availLen <= sizeof(STableMetaMsg) + sizeof(SSchema) * TSDB_MAX_COLUMNS) { if (availLen <= sizeof(STableMetaMsg) + sizeof(SSchema) * (TSDB_MAX_TAGS + TSDB_MAX_COLUMNS + 16)) {
//TODO realloc //TODO realloc
//totalMallocLen *= 2; //totalMallocLen *= 2;
//pMultiMeta = rpcReMalloc(pMultiMeta, totalMallocLen); //pMultiMeta = rpcReMalloc(pMultiMeta, totalMallocLen);
......
...@@ -612,7 +612,12 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) { ...@@ -612,7 +612,12 @@ static SRpcConn *rpcAllocateServerConn(SRpcInfo *pRpc, SRecvInfo *pRecv) {
pConn->ownId = htonl(pConn->sid); pConn->ownId = htonl(pConn->sid);
pConn->linkUid = pHead->linkUid; pConn->linkUid = pHead->linkUid;
if (pRpc->afp) { if (pRpc->afp) {
if (pConn->user[0] == 0) {
terrno = TSDB_CODE_AUTH_REQUIRED;
} else {
terrno = (*pRpc->afp)(pConn->user, &pConn->spi, &pConn->encrypt, pConn->secret, pConn->ckey); terrno = (*pRpc->afp)(pConn->user, &pConn->spi, &pConn->encrypt, pConn->secret, pConn->ckey);
}
if (terrno != 0) { if (terrno != 0) {
tWarn("%s %p, user not there or server not ready", pRpc->label, pConn); tWarn("%s %p, user not there or server not ready", pRpc->label, pConn);
taosFreeId(pRpc->idPool, sid); // sid shall be released taosFreeId(pRpc->idPool, sid); // sid shall be released
...@@ -930,6 +935,12 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) { ...@@ -930,6 +935,12 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
rpcMsg.handle = pContext->ahandle; rpcMsg.handle = pContext->ahandle;
pConn->pContext = NULL; pConn->pContext = NULL;
if (pHead->code == TSDB_CODE_AUTH_REQUIRED) {
pConn->secured = 0;
rpcSendReqToServer(pRpc, pContext);
return;
}
// for UDP, port may be changed by server, the port in ipSet shall be used for cache // for UDP, port may be changed by server, the port in ipSet shall be used for cache
rpcAddConnIntoCache(pRpc->pCache, pConn, pConn->peerFqdn, pContext->ipSet.port[pContext->ipSet.inUse], pConn->connType); rpcAddConnIntoCache(pRpc->pCache, pConn, pConn->peerFqdn, pContext->ipSet.port[pContext->ipSet.inUse], pConn->connType);
......
...@@ -414,6 +414,7 @@ static void filterDataInDataBlock(STsdbQueryHandle* pQueryHandle, STableCheck ...@@ -414,6 +414,7 @@ static void filterDataInDataBlock(STsdbQueryHandle* pQueryHandle, STableCheck
static int32_t binarySearchForKey(char* pValue, int num, TSKEY key, int order); static int32_t binarySearchForKey(char* pValue, int num, TSKEY key, int order);
static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlock, STableCheckInfo* pCheckInfo) { static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlock, STableCheckInfo* pCheckInfo) {
STsdbRepo *pRepo = pQueryHandle->pTsdb;
SCompData* data = calloc(1, sizeof(SCompData) + sizeof(SCompCol) * pBlock->numOfCols); SCompData* data = calloc(1, sizeof(SCompData) + sizeof(SCompCol) * pBlock->numOfCols);
data->numOfCols = pBlock->numOfCols; data->numOfCols = pBlock->numOfCols;
...@@ -423,7 +424,7 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo ...@@ -423,7 +424,7 @@ static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlo
SArray* sa = getDefaultLoadColumns(pQueryHandle, true); SArray* sa = getDefaultLoadColumns(pQueryHandle, true);
if (pCheckInfo->pDataCols == NULL) { if (pCheckInfo->pDataCols == NULL) {
pCheckInfo->pDataCols = tdNewDataCols(1000, 100, 4096); //todo fix me pCheckInfo->pDataCols = tdNewDataCols(pRepo->tsdbMeta->maxRowBytes, pRepo->tsdbMeta->maxCols, pRepo->config.maxRowsPerFileBlock);
} }
tdInitDataCols(pCheckInfo->pDataCols, tsdbGetTableSchema(tsdbGetMeta(pQueryHandle->pTsdb), pCheckInfo->pTableObj)); tdInitDataCols(pCheckInfo->pDataCols, tsdbGetTableSchema(tsdbGetMeta(pQueryHandle->pTsdb), pCheckInfo->pTableObj));
......
...@@ -49,6 +49,7 @@ typedef struct { ...@@ -49,6 +49,7 @@ typedef struct {
STsdbCfg tsdbCfg; STsdbCfg tsdbCfg;
SSyncCfg syncCfg; SSyncCfg syncCfg;
SWalCfg walCfg; SWalCfg walCfg;
char * rootDir;
} SVnodeObj; } SVnodeObj;
int vnodeWriteToQueue(void *param, void *pHead, int type); int vnodeWriteToQueue(void *param, void *pHead, int type);
......
...@@ -182,6 +182,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) { ...@@ -182,6 +182,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
pVnode->refCount = 1; pVnode->refCount = 1;
pVnode->version = 0; pVnode->version = 0;
pVnode->tsdbCfg.tsdbId = pVnode->vgId; pVnode->tsdbCfg.tsdbId = pVnode->vgId;
pVnode->rootDir = strdup(rootDir);
taosAddIntHash(tsDnodeVnodesHash, pVnode->vgId, (char *)(&pVnode)); taosAddIntHash(tsDnodeVnodesHash, pVnode->vgId, (char *)(&pVnode));
int32_t code = vnodeReadCfg(pVnode); int32_t code = vnodeReadCfg(pVnode);
...@@ -271,6 +272,7 @@ void vnodeRelease(void *pVnodeRaw) { ...@@ -271,6 +272,7 @@ void vnodeRelease(void *pVnodeRaw) {
return; return;
} }
tfree(pVnode->rootDir);
// remove read queue // remove read queue
dnodeFreeRqueue(pVnode->rqueue); dnodeFreeRqueue(pVnode->rqueue);
pVnode->rqueue = NULL; pVnode->rqueue = NULL;
...@@ -288,7 +290,7 @@ void vnodeRelease(void *pVnodeRaw) { ...@@ -288,7 +290,7 @@ void vnodeRelease(void *pVnodeRaw) {
free(pVnode); free(pVnode);
int32_t count = atomic_sub_fetch_32(&tsOpennedVnodes, 1); int32_t count = atomic_sub_fetch_32(&tsOpennedVnodes, 1);
vTrace("vgId:%d, vnode is released, vnodes:%d", pVnode, vgId, count); vTrace("vgId:%d, vnode is released, vnodes:%d", vgId, count);
if (count <= 0) { if (count <= 0) {
taosCleanUpIntHash(tsDnodeVnodesHash); taosCleanUpIntHash(tsDnodeVnodesHash);
...@@ -406,7 +408,15 @@ static void vnodeNotifyFileSynced(void *ahandle) { ...@@ -406,7 +408,15 @@ static void vnodeNotifyFileSynced(void *ahandle) {
SVnodeObj *pVnode = ahandle; SVnodeObj *pVnode = ahandle;
vTrace("vgId:%d, data file is synced", pVnode->vgId); vTrace("vgId:%d, data file is synced", pVnode->vgId);
// close tsdb, then open tsdb char rootDir[128] = "\0";
sprintf(rootDir, "%s/tsdb", pVnode->rootDir);
// clsoe tsdb, then open tsdb
tsdbCloseRepo(pVnode->tsdb);
STsdbAppH appH = {0};
appH.appH = (void *)pVnode;
appH.walCallBack = vnodeWalCallback;
appH.cqH = pVnode->cq;
pVnode->tsdb = tsdbOpenRepo(rootDir, &appH);
} }
static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) { static int32_t vnodeSaveCfg(SMDCreateVnodeMsg *pVnodeCfg) {
......
...@@ -157,25 +157,25 @@ endi ...@@ -157,25 +157,25 @@ endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query
print 16-> $system_content print 16-> $system_content
if $system_content != @[{"refId":"A","target":"1","datapoints":[[5,"-"]]},{"refId":"A","target":"2","datapoints":[[4,"-"]]},{"refId":"A","target":"3","datapoints":[[3,"-"]]},{"refId":"B","target":"a","datapoints":[[5,"-"]]},{"refId":"B","target":"b","datapoints":[[8,"-"]]},{"refId":"B","target":"c","datapoints":[[9,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"{a:1,}","datapoints":[[5,"-"]]},{"refId":"A","target":"{a:2,}","datapoints":[[4,"-"]]},{"refId":"A","target":"{a:3,}","datapoints":[[3,"-"]]},{"refId":"B","target":"{b:a}","datapoints":[[5,"-"]]},{"refId":"B","target":"{b:b}","datapoints":[[8,"-"]]},{"refId":"B","target":"{b:c}","datapoints":[[9,"-"]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"sum-","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt group by a"},{"refId":"B","alias":"sum-","sql":"select sum(i) from d1.mt group by b"}]' 127.0.0.1:6020/grafana/query
print 17-> $system_content print 17-> $system_content
if $system_content != @[{"refId":"A","target":"count1","datapoints":[[5,"-"]]},{"refId":"A","target":"count2","datapoints":[[4,"-"]]},{"refId":"A","target":"count3","datapoints":[[3,"-"]]},{"refId":"B","target":"sum-a","datapoints":[[5,"-"]]},{"refId":"B","target":"sum-b","datapoints":[[8,"-"]]},{"refId":"B","target":"sum-c","datapoints":[[9,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"count{a:1,}","datapoints":[[5,"-"]]},{"refId":"A","target":"count{a:2,}","datapoints":[[4,"-"]]},{"refId":"A","target":"count{a:3,}","datapoints":[[3,"-"]]},{"refId":"B","target":"sum-{b:a}","datapoints":[[5,"-"]]},{"refId":"B","target":"sum-{b:b}","datapoints":[[8,"-"]]},{"refId":"B","target":"sum-{b:c}","datapoints":[[9,"-"]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt interval(1m) group by a "}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"count","sql":"select count(i) from d1.mt interval(1m) group by a "}]' 127.0.0.1:6020/grafana/query
print 18-> $system_content print 18-> $system_content
if $system_content != @[{"refId":"A","target":"count1","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000],[1,1514208540000]]},{"refId":"A","target":"count2","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000]]},{"refId":"A","target":"count3","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000]]}]@ then if $system_content != @[{"refId":"A","target":"count{a:1,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000],[1,1514208540000]]},{"refId":"A","target":"count{a:2,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000],[1,1514208480000]]},{"refId":"A","target":"count{a:3,}","datapoints":[[1,1514208300000],[1,1514208360000],[1,1514208420000]]}]@ then
return -1 return -1
endi endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select sum(v2), count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2), sum(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"refId":"A","alias":"","sql":"select sum(v2), count(v1) from d1.m1"},{"refId":"B","alias":"","sql":"select count(v2), sum(v2) from d1.m1"}]' 127.0.0.1:6020/grafana/query
print 19-> $system_content print 19-> $system_content
if $system_content != @[{"refId":"A","target":"3","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"15.299999714","datapoints":[[3,"-"]]}]@ then if $system_content != @[{"refId":"A","target":"{count(v1):3}","datapoints":[[15.299999714,"-"]]},{"refId":"B","target":"{sum(v2):15.299999714}","datapoints":[[3,"-"]]}]@ then
return -1 return -1
endi endi
......
...@@ -43,7 +43,7 @@ print ====== tables created ...@@ -43,7 +43,7 @@ print ====== tables created
print ================== restart server to commit data into disk print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 2000 sleep 3000
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
print ================== server restart completed print ================== server restart completed
...@@ -69,7 +69,7 @@ endw ...@@ -69,7 +69,7 @@ endw
print ================== restart server to commit data into disk print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 2000 sleep 4000
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
print ================== server restart completed print ================== server restart completed
......
...@@ -222,13 +222,13 @@ sql show tables ...@@ -222,13 +222,13 @@ sql show tables
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
if $data00 != tb3 then if $data00 != tb1 then
return -1 return -1
endi endi
if $data10 != tb2 then if $data10 != tb2 then
return -1 return -1
endi endi
if $data20 != tb1 then if $data20 != tb3 then
return -1 return -1
endi endi
...@@ -301,6 +301,7 @@ sql_error create table txu using tu tags(0) values(now, 1); ...@@ -301,6 +301,7 @@ sql_error create table txu using tu tags(0) values(now, 1);
#[TBASE-675] #[TBASE-675]
sql insert into tu values(1565971200000, 1) (1565971200000,2) (1565971200001, 3)(1565971200001, 4) sql insert into tu values(1565971200000, 1) (1565971200000,2) (1565971200001, 3)(1565971200001, 4)
sql select * from tu
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
...@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh ...@@ -2,7 +2,7 @@ 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 walLevel -v 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c commitTime -v 30 system sh/cfg.sh -n dnode1 -c ctime -v 30
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
sql connect sql connect
......
...@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh ...@@ -2,7 +2,7 @@ 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 walLevel -v 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c commitTime -v 30 system sh/cfg.sh -n dnode1 -c ctime -v 30
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
sql connect sql connect
......
...@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh ...@@ -2,7 +2,7 @@ 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 walLevel -v 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c commitTime -v 30 system sh/cfg.sh -n dnode1 -c ctime -v 30
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
sql connect sql connect
......
...@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh ...@@ -2,7 +2,7 @@ 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 walLevel -v 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c commitTime -v 30 system sh/cfg.sh -n dnode1 -c ctime -v 30
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 3000 sleep 3000
sql connect sql connect
......
...@@ -3,21 +3,21 @@ cd ../../debug; make ...@@ -3,21 +3,21 @@ cd ../../debug; make
cd ../../../debug; cmake .. cd ../../../debug; cmake ..
cd ../../../debug; make cd ../../../debug; make
#./test.sh -f general/alter/cached_schema_after_alter.sim #unsupport ./test.sh -f general/alter/cached_schema_after_alter.sim
#./test.sh -f general/alter/count.sim #unsupport ./test.sh -f general/alter/count.sim
#./test.sh -f general/alter/import.sim #unsupport ./test.sh -f general/alter/import.sim
#./test.sh -f general/alter/insert1.sim #unsupport ./test.sh -f general/alter/insert1.sim
#./test.sh -f general/alter/insert2.sim #unsupport ./test.sh -f general/alter/insert2.sim
#./test.sh -f general/alter/metrics.sim #unsupport ./test.sh -f general/alter/metrics.sim
#./test.sh -f general/alter/table.sim #unsupport ./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim ./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim #jeff ./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim #jeff ./test.sh -f general/cache/restart_table.sim
#hongze ./test.sh -f general/column/commit.sim #hongze ./test.sh -f general/column/commit.sim
#hongze ./test.sh -f general/column/metrics.sim ./test.sh -f general/column/metrics.sim
#hongze ./test.sh -f general/column/table.sim ./test.sh -f general/column/table.sim
./test.sh -f general/compress/commitlog.sim ./test.sh -f general/compress/commitlog.sim
./test.sh -f general/compress/compress.sim ./test.sh -f general/compress/compress.sim
...@@ -28,11 +28,11 @@ cd ../../../debug; make ...@@ -28,11 +28,11 @@ cd ../../../debug; make
./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
# liao./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
# liao./test.sh -f general/compute/interval.sim # liao ./test.sh -f general/compute/interval.sim
# liao./test.sh -f general/compute/last.sim ./test.sh -f general/compute/last.sim
# liao./test.sh -f general/compute/leastsquare.sim # liao ./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
...@@ -54,30 +54,30 @@ cd ../../../debug; make ...@@ -54,30 +54,30 @@ cd ../../../debug; make
./test.sh -f general/db/delete_writing1.sim ./test.sh -f general/db/delete_writing1.sim
./test.sh -f general/db/delete_writing2.sim ./test.sh -f general/db/delete_writing2.sim
./test.sh -f general/db/len.sim ./test.sh -f general/db/len.sim
#./test.sh -u -f general/db/vnodes.sim #liao ./test.sh -f general/db/vnodes.sim
./test.sh -f general/db/repeat.sim ./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.sim ./test.sh -f general/db/tables.sim
./test.sh -f general/field/2.sim ./test.sh -f general/field/2.sim
#./test.sh -f general/field/3.sim #liao ./test.sh -f general/field/3.sim
#./test.sh -f general/field/4.sim #liao? ./test.sh -f general/field/4.sim
#./test.sh -f general/field/5.sim #liao? ./test.sh -f general/field/5.sim
#./test.sh -f general/field/6.sim #liao? ./test.sh -f general/field/6.sim
./test.sh -f general/field/bigint.sim ./test.sh -f general/field/bigint.sim
# liao./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
# jeff ./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
# jeff ./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
# jeff ./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
./test.sh -f general/import/commit.sim ./test.sh -f general/import/commit.sim
...@@ -94,10 +94,10 @@ cd ../../../debug; make ...@@ -94,10 +94,10 @@ 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/parser/alter.sim #unsupport ./test.sh -f general/parser/alter.sim
# ./test.sh -f general/parser/alter1.sim #unsupport ./test.sh -f general/parser/alter1.sim
# ./test.sh -f general/parser/alter_stable.sim #unsupport ./test.sh -f general/parser/alter_stable.sim
# ./test.sh -f general/parser/auto_create_tb.sim #rpc error? ./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
...@@ -145,23 +145,23 @@ cd ../../../debug; make ...@@ -145,23 +145,23 @@ cd ../../../debug; make
# ./test.sh -f general/parser/stream.sim # ./test.sh -f general/parser/stream.sim
# ./test.sh -f general/parser/tbnameIn.sim # ./test.sh -f general/parser/tbnameIn.sim
# ./test.sh -f general/parser/where.sim # ./test.sh -f general/parser/where.sim
# #./test.sh -f general/parser/repeatAlter.sim # ./test.sh -f general/parser/repeatAlter.sim
# #./test.sh -f general/parser/repeatStream.sim # ./test.sh -f general/parser/repeatStream.sim
# ./test.sh -f general/parser/join.sim # ./test.sh -f general/parser/join.sim
# ./test.sh -f general/parser/join_multivnode.sim # ./test.sh -f general/parser/join_multivnode.sim
# ./test.sh -f general/parser/projection_limit_offset.sim # ./test.sh -f general/parser/projection_limit_offset.sim
# ./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/disk.sim
#./test.sh -f general/stable/metrics.sim ./test.sh -f general/stable/metrics.sim
#./test.sh -f general/stable/values.sim #liao? ./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim ./test.sh -f general/stable/vnode3.sim
./test.sh -f general/table/autocreate.sim ./test.sh -f general/table/autocreate.sim
./test.sh -f general/table/basic1.sim ./test.sh -f general/table/basic1.sim
./test.sh -f general/table/basic2.sim ./test.sh -f general/table/basic2.sim
#hongze ./test.sh -f general/table/basic3.sim ./test.sh -f general/table/basic3.sim
./test.sh -f general/table/bigint.sim ./test.sh -f general/table/bigint.sim
./test.sh -f general/table/binary.sim ./test.sh -f general/table/binary.sim
./test.sh -f general/table/bool.sim ./test.sh -f general/table/bool.sim
...@@ -186,29 +186,29 @@ cd ../../../debug; make ...@@ -186,29 +186,29 @@ cd ../../../debug; make
./test.sh -f general/table/tinyint.sim ./test.sh -f general/table/tinyint.sim
./test.sh -f general/table/vgroup.sim ./test.sh -f general/table/vgroup.sim
#./test.sh -f general/tag/3.sim #liao ./test.sh -f general/tag/3.sim
#./test.sh -f general/tag/4.sim #liao? ./test.sh -f general/tag/4.sim
#./test.sh -f general/tag/5.sim #liao? ./test.sh -f general/tag/5.sim
#./test.sh -f general/tag/6.sim #liao? ./test.sh -f general/tag/6.sim
#./test.sh -f general/tag/add.sim #unsupport ./test.sh -f general/tag/add.sim
./test.sh -f general/tag/bigint.sim ./test.sh -f general/tag/bigint.sim
#./test.sh -f general/tag/binary_binary.sim ./test.sh -f general/tag/binary_binary.sim
#./test.sh -f general/tag/binary.sim ./test.sh -f general/tag/binary.sim
#./test.sh -f general/tag/bool_binary.sim ./test.sh -f general/tag/bool_binary.sim
#./test.sh -f general/tag/bool_int.sim ./test.sh -f general/tag/bool_int.sim
./test.sh -f general/tag/bool.sim ./test.sh -f general/tag/bool.sim
#./test.sh -f general/tag/change.sim #unsupport ./test.sh -f general/tag/change.sim
#liao ./test.sh -f general/tag/column.sim ./test.sh -f general/tag/column.sim
#./test.sh -f general/tag/commit.sim #unsupport ./test.sh -f general/tag/commit.sim
#liao ./test.sh -f general/tag/create.sim ./test.sh -f general/tag/create.sim
#./test.sh -f general/tag/delete.sim #unsupport ./test.sh -f general/tag/delete.sim
#./test.sh -f general/tag/double.sim #./test.sh -f general/tag/double.sim
./test.sh -f general/tag/filter.sim ./test.sh -f general/tag/filter.sim
#./test.sh -f general/tag/float.sim #liao? ./test.sh -f general/tag/float.sim
#./test.sh -f general/tag/int_binary.sim #liao? ./test.sh -f general/tag/int_binary.sim
#./test.sh -f general/tag/int_float.sim ./test.sh -f general/tag/int_float.sim
./test.sh -f general/tag/int.sim ./test.sh -f general/tag/int.sim
#./test.sh -f general/tag/set.sim #unsupport ./test.sh -f general/tag/set.sim
./test.sh -f general/tag/smallint.sim ./test.sh -f general/tag/smallint.sim
./test.sh -f general/tag/tinyint.sim ./test.sh -f general/tag/tinyint.sim
...@@ -224,7 +224,7 @@ cd ../../../debug; make ...@@ -224,7 +224,7 @@ cd ../../../debug; make
./test.sh -f general/vector/metrics_query.sim ./test.sh -f general/vector/metrics_query.sim
./test.sh -f general/vector/metrics_tag.sim ./test.sh -f general/vector/metrics_tag.sim
./test.sh -f general/vector/metrics_time.sim ./test.sh -f general/vector/metrics_time.sim
#liao ./test.sh -f general/vector/multi.sim ./test.sh -f general/vector/multi.sim
./test.sh -f general/vector/single.sim ./test.sh -f general/vector/single.sim
./test.sh -f general/vector/table_field.sim ./test.sh -f general/vector/table_field.sim
./test.sh -f general/vector/table_mix.sim ./test.sh -f general/vector/table_mix.sim
......
...@@ -93,7 +93,7 @@ echo "numOfLogLines 100000000" >> $TAOS_CFG ...@@ -93,7 +93,7 @@ echo "numOfLogLines 100000000" >> $TAOS_CFG
echo "dDebugFlag 135" >> $TAOS_CFG echo "dDebugFlag 135" >> $TAOS_CFG
echo "mDebugFlag 135" >> $TAOS_CFG echo "mDebugFlag 135" >> $TAOS_CFG
echo "sdbDebugFlag 135" >> $TAOS_CFG echo "sdbDebugFlag 135" >> $TAOS_CFG
echo "rpcDebugFlag 135" >> $TAOS_CFG echo "rpcDebugFlag 151" >> $TAOS_CFG
echo "tmrDebugFlag 131" >> $TAOS_CFG echo "tmrDebugFlag 131" >> $TAOS_CFG
echo "cDebugFlag 135" >> $TAOS_CFG echo "cDebugFlag 135" >> $TAOS_CFG
echo "httpDebugFlag 135" >> $TAOS_CFG echo "httpDebugFlag 135" >> $TAOS_CFG
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册