Remove warnings
This commit is contained in:
parent
8cdd7023c6
commit
2e14f63453
|
@ -633,3 +633,5 @@ TEST(testCase, astTest) {
|
||||||
// exprSerializeTest2();
|
// exprSerializeTest2();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -5,6 +5,7 @@
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
#include "qExtbuffer.h"
|
#include "qExtbuffer.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
@ -122,3 +123,5 @@ TEST(testCase, columnsort_test) {
|
||||||
|
|
||||||
destroyColumnModel(pModel);
|
destroyColumnModel(pModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -6,6 +6,7 @@
|
||||||
#include "taos.h"
|
#include "taos.h"
|
||||||
#include "qHistogram.h"
|
#include "qHistogram.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
|
||||||
|
@ -140,3 +141,5 @@ TEST(testCase, heapsort) {
|
||||||
//
|
//
|
||||||
// free(pEntry);
|
// free(pEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -6,6 +6,7 @@
|
||||||
#include "qAggMain.h"
|
#include "qAggMain.h"
|
||||||
#include "tcompare.h"
|
#include "tcompare.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
|
||||||
|
@ -84,3 +85,5 @@ TEST(testCase, patternMatchTest) {
|
||||||
ret = patternMatch("%9", str, 2, &info);
|
ret = patternMatch("%9", str, 2, &info);
|
||||||
EXPECT_EQ(ret, TSDB_PATTERN_MATCH);
|
EXPECT_EQ(ret, TSDB_PATTERN_MATCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "qPercentile.h"
|
#include "qPercentile.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
|
||||||
|
@ -255,3 +256,5 @@ TEST(testCase, percentileTest) {
|
||||||
unsignedDataTest();
|
unsignedDataTest();
|
||||||
largeDataTest();
|
largeDataTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "qFilter.h"
|
#include "qFilter.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
|
||||||
|
@ -365,3 +366,5 @@ TEST(testCase, rangeMergeTest) {
|
||||||
intDataTest();
|
intDataTest();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -6,6 +6,7 @@
|
||||||
#include "taos.h"
|
#include "taos.h"
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
|
||||||
|
@ -161,3 +162,5 @@ TEST(testCase, resultBufferTest) {
|
||||||
writeDownTest();
|
writeDownTest();
|
||||||
recyclePageTest();
|
recyclePageTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -9,6 +9,7 @@
|
||||||
#include "ttoken.h"
|
#include "ttoken.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||||
|
@ -513,3 +514,5 @@ TEST(testCase, tsBufTest) {
|
||||||
mergeDiffVnodeBufferTest();
|
mergeDiffVnodeBufferTest();
|
||||||
mergeIdenticalVnodeBufferTest();
|
mergeIdenticalVnodeBufferTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -4,6 +4,7 @@
|
||||||
#include "taos.h"
|
#include "taos.h"
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
@ -910,3 +911,4 @@ TEST(testCase, getTempFilePath_test) {
|
||||||
printf("%s\n", path);
|
printf("%s\n", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -10,8 +10,8 @@ set(CMAKE_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
set(CMAKE_CONTRIB_DIR "${CMAKE_SOURCE_DIR}/contrib")
|
set(CMAKE_CONTRIB_DIR "${CMAKE_SOURCE_DIR}/contrib")
|
||||||
include(${CMAKE_SUPPORT_DIR}/cmake.options)
|
include(${CMAKE_SUPPORT_DIR}/cmake.options)
|
||||||
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -gdwarf-2 -msse4.2 -mfma -g3")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -fPIC -gdwarf-2 -msse4.2 -mfma -g3")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -gdwarf-2 -msse4.2 -mfma -g3")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -fPIC -gdwarf-2 -msse4.2 -mfma -g3")
|
||||||
|
|
||||||
# contrib
|
# contrib
|
||||||
add_subdirectory(contrib)
|
add_subdirectory(contrib)
|
||||||
|
|
|
@ -17,8 +17,9 @@
|
||||||
#include <taoserror.h>
|
#include <taoserror.h>
|
||||||
#include <tglobal.h>
|
#include <tglobal.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-compare"
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
|
@ -679,3 +680,5 @@ TEST(testCase, create_topic_Test) {
|
||||||
// taos_free_result(pRes);
|
// taos_free_result(pRes);
|
||||||
// taos_close(pConn);
|
// taos_close(pConn);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -1,7 +1,8 @@
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||||
|
@ -94,3 +95,5 @@ TEST(testCase, toInteger_test) {
|
||||||
ret = toInteger(s, strlen(s), 10, &val, &sign);
|
ret = toInteger(s, strlen(s), 10, &val, &sign);
|
||||||
ASSERT_EQ(ret, -1);
|
ASSERT_EQ(ret, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
|
@ -320,6 +320,8 @@ void tqClose(STQ*);
|
||||||
int tqPushMsg(STQ*, void* msg, int64_t version);
|
int tqPushMsg(STQ*, void* msg, int64_t version);
|
||||||
int tqCommit(STQ*);
|
int tqCommit(STQ*);
|
||||||
|
|
||||||
|
int tqSetCursor(STQ*, STqSetCurReq* pMsg);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
int tqConsume(STQ*, SRpcMsg* pReq, SRpcMsg** pRsp);
|
int tqConsume(STQ*, SRpcMsg* pReq, SRpcMsg** pRsp);
|
||||||
int tqSetCursor(STQ*, STqSetCurReq* pMsg);
|
int tqSetCursor(STQ*, STqSetCurReq* pMsg);
|
||||||
|
|
|
@ -32,7 +32,7 @@ size_t metaEncodeTbObjFromTbOptions(const STbCfg *pTbOptions, void *pBuf, size_t
|
||||||
switch (pTbOptions->type) {
|
switch (pTbOptions->type) {
|
||||||
case META_SUPER_TABLE:
|
case META_SUPER_TABLE:
|
||||||
tlen += taosEncodeFixedU64(ppBuf, pTbOptions->stbCfg.suid);
|
tlen += taosEncodeFixedU64(ppBuf, pTbOptions->stbCfg.suid);
|
||||||
tlen += tdEncodeSchema(ppBuf, pTbOptions->stbCfg.pTagSchema);
|
tlen += tdEncodeSchema(ppBuf, (STSchema *)pTbOptions->stbCfg.pTagSchema);
|
||||||
// TODO: encode schema version array
|
// TODO: encode schema version array
|
||||||
break;
|
break;
|
||||||
case META_CHILD_TABLE:
|
case META_CHILD_TABLE:
|
||||||
|
|
|
@ -19,7 +19,10 @@
|
||||||
static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg);
|
static int32_t vnodeGetTableList(SVnode *pVnode, SRpcMsg *pMsg);
|
||||||
static int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
|
static int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp);
|
||||||
|
|
||||||
int vnodeQueryOpen(SVnode *pVnode) { return qWorkerInit(NODE_TYPE_VNODE, pVnode->vgId, NULL, &pVnode->pQuery, pVnode, vnodePutReqToVQueryQ); }
|
int vnodeQueryOpen(SVnode *pVnode) {
|
||||||
|
return qWorkerInit(NODE_TYPE_VNODE, pVnode->vgId, NULL, (void **)&pVnode->pQuery, pVnode,
|
||||||
|
(putReqToQueryQFp)vnodePutReqToVQueryQ);
|
||||||
|
}
|
||||||
|
|
||||||
int vnodeProcessQueryReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
int vnodeProcessQueryReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
|
||||||
vTrace("query message is processing");
|
vTrace("query message is processing");
|
||||||
|
|
|
@ -16,27 +16,28 @@
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <tglobal.h>
|
#include <tglobal.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
#include "os.h"
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wwrite-strings"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-compare"
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
#include "os.h"
|
#pragma GCC diagnostic ignored "-Wformat"
|
||||||
|
|
||||||
|
#include "addr_any.h"
|
||||||
|
#include "catalog.h"
|
||||||
|
#include "stub.h"
|
||||||
#include "taos.h"
|
#include "taos.h"
|
||||||
#include "tdef.h"
|
#include "tdef.h"
|
||||||
#include "tvariant.h"
|
|
||||||
#include "catalog.h"
|
|
||||||
#include "tep.h"
|
#include "tep.h"
|
||||||
#include "trpc.h"
|
#include "trpc.h"
|
||||||
#include "stub.h"
|
#include "tvariant.h"
|
||||||
#include "addr_any.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
extern "C" int32_t ctgGetTableMetaFromCache(struct SCatalog* pCatalog, const SName* pTableName, STableMeta** pTableMeta, int32_t *exist);
|
extern "C" int32_t ctgGetTableMetaFromCache(struct SCatalog *pCatalog, const SName *pTableName, STableMeta **pTableMeta,
|
||||||
|
int32_t *exist);
|
||||||
extern "C" int32_t ctgUpdateTableMetaCache(struct SCatalog *pCatalog, STableMetaOutput *output);
|
extern "C" int32_t ctgUpdateTableMetaCache(struct SCatalog *pCatalog, STableMetaOutput *output);
|
||||||
|
|
||||||
void ctgTestSetPrepareTableMeta();
|
void ctgTestSetPrepareTableMeta();
|
||||||
|
@ -66,9 +67,8 @@ char *ctgTestTablename = "table1";
|
||||||
char *ctgTestCTablename = "ctable1";
|
char *ctgTestCTablename = "ctable1";
|
||||||
char *ctgTestSTablename = "stable1";
|
char *ctgTestSTablename = "stable1";
|
||||||
|
|
||||||
|
|
||||||
void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
|
void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
|
||||||
SCreateDbReq* pReq = (SCreateDbReq*)rpcMallocCont(sizeof(SCreateDbReq));
|
SCreateDbReq *pReq = (SCreateDbReq *)rpcMallocCont(sizeof(SCreateDbReq));
|
||||||
strcpy(pReq->db, "1.db1");
|
strcpy(pReq->db, "1.db1");
|
||||||
pReq->numOfVgroups = htonl(2);
|
pReq->numOfVgroups = htonl(2);
|
||||||
pReq->cacheBlockSize = htonl(16);
|
pReq->cacheBlockSize = htonl(16);
|
||||||
|
@ -113,7 +113,6 @@ void ctgTestInitLogFile() {
|
||||||
if (taosInitLog(temp, tsNumOfLogLines, maxLogFileNum) < 0) {
|
if (taosInitLog(temp, tsNumOfLogLines, maxLogFileNum) < 0) {
|
||||||
printf("failed to open log file in directory:%s\n", tsLogDir);
|
printf("failed to open log file in directory:%s\n", tsLogDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ctgTestGetVgNumFromVgVersion(int32_t vgVersion) {
|
int32_t ctgTestGetVgNumFromVgVersion(int32_t vgVersion) {
|
||||||
|
@ -174,7 +173,6 @@ void ctgTestBuildCTableMetaOutput(STableMetaOutput *output) {
|
||||||
s->colId = 3;
|
s->colId = 3;
|
||||||
s->bytes = 12;
|
s->bytes = 12;
|
||||||
strcpy(s->name, "tag1s");
|
strcpy(s->name, "tag1s");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctgTestBuildDBVgroup(SDBVgroupInfo *dbVgroup) {
|
void ctgTestBuildDBVgroup(SDBVgroupInfo *dbVgroup) {
|
||||||
|
@ -210,9 +208,9 @@ void ctgTestBuildDBVgroup(SDBVgroupInfo *dbVgroup) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctgTestPrepareDbVgroups(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareDbVgroups(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
SUseDbRsp *rspMsg = NULL; //todo
|
SUseDbRsp *rspMsg = NULL; // todo
|
||||||
|
|
||||||
pRsp->code =0;
|
pRsp->code = 0;
|
||||||
pRsp->contLen = sizeof(SUseDbRsp) + ctgTestVgNum * sizeof(SVgroupInfo);
|
pRsp->contLen = sizeof(SUseDbRsp) + ctgTestVgNum * sizeof(SVgroupInfo);
|
||||||
pRsp->pCont = calloc(1, pRsp->contLen);
|
pRsp->pCont = calloc(1, pRsp->contLen);
|
||||||
rspMsg = (SUseDbRsp *)pRsp->pCont;
|
rspMsg = (SUseDbRsp *)pRsp->pCont;
|
||||||
|
@ -245,13 +243,10 @@ void ctgTestPrepareDbVgroups(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcM
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ctgTestPrepareTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
STableMetaRsp *rspMsg = NULL; //todo
|
STableMetaRsp *rspMsg = NULL; // todo
|
||||||
|
|
||||||
pRsp->code =0;
|
pRsp->code = 0;
|
||||||
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
||||||
pRsp->pCont = calloc(1, pRsp->contLen);
|
pRsp->pCont = calloc(1, pRsp->contLen);
|
||||||
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
||||||
|
@ -283,11 +278,10 @@ void ctgTestPrepareTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcM
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ctgTestPrepareCTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareCTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
STableMetaRsp *rspMsg = NULL; //todo
|
STableMetaRsp *rspMsg = NULL; // todo
|
||||||
|
|
||||||
pRsp->code =0;
|
pRsp->code = 0;
|
||||||
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
||||||
pRsp->pCont = calloc(1, pRsp->contLen);
|
pRsp->pCont = calloc(1, pRsp->contLen);
|
||||||
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
||||||
|
@ -323,15 +317,13 @@ void ctgTestPrepareCTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpc
|
||||||
s->bytes = htonl(12);
|
s->bytes = htonl(12);
|
||||||
strcpy(s->name, "tag1s");
|
strcpy(s->name, "tag1s");
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ctgTestPrepareSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
STableMetaRsp *rspMsg = NULL; //todo
|
STableMetaRsp *rspMsg = NULL; // todo
|
||||||
|
|
||||||
pRsp->code =0;
|
pRsp->code = 0;
|
||||||
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
||||||
pRsp->pCont = calloc(1, pRsp->contLen);
|
pRsp->pCont = calloc(1, pRsp->contLen);
|
||||||
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
||||||
|
@ -367,15 +359,14 @@ void ctgTestPrepareSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpc
|
||||||
s->bytes = htonl(12);
|
s->bytes = htonl(12);
|
||||||
strcpy(s->name, "tag1s");
|
strcpy(s->name, "tag1s");
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctgTestPrepareMultiSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareMultiSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
STableMetaRsp *rspMsg = NULL; //todo
|
STableMetaRsp *rspMsg = NULL; // todo
|
||||||
static int32_t idx = 1;
|
static int32_t idx = 1;
|
||||||
|
|
||||||
pRsp->code =0;
|
pRsp->code = 0;
|
||||||
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
pRsp->contLen = sizeof(STableMetaRsp) + (ctgTestColNum + ctgTestTagNum) * sizeof(SSchema);
|
||||||
pRsp->pCont = calloc(1, pRsp->contLen);
|
pRsp->pCont = calloc(1, pRsp->contLen);
|
||||||
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
rspMsg = (STableMetaRsp *)pRsp->pCont;
|
||||||
|
@ -416,8 +407,6 @@ void ctgTestPrepareMultiSTableMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ctgTestPrepareDbVgroupsAndNormalMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareDbVgroupsAndNormalMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
ctgTestPrepareDbVgroups(shandle, pEpSet, pMsg, pRsp);
|
ctgTestPrepareDbVgroups(shandle, pEpSet, pMsg, pRsp);
|
||||||
|
|
||||||
|
@ -426,7 +415,6 @@ void ctgTestPrepareDbVgroupsAndNormalMeta(void *shandle, SEpSet *pEpSet, SRpcMsg
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ctgTestPrepareDbVgroupsAndChildMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
void ctgTestPrepareDbVgroupsAndChildMeta(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pRsp) {
|
||||||
ctgTestPrepareDbVgroups(shandle, pEpSet, pMsg, pRsp);
|
ctgTestPrepareDbVgroups(shandle, pEpSet, pMsg, pRsp);
|
||||||
|
|
||||||
|
@ -451,16 +439,14 @@ void ctgTestPrepareDbVgroupsAndMultiSuperMeta(void *shandle, SEpSet *pEpSet, SRp
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ctgTestSetPrepareDbVgroups() {
|
void ctgTestSetPrepareDbVgroups() {
|
||||||
static Stub stub;
|
static Stub stub;
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareDbVgroups);
|
stub.set(rpcSendRecv, ctgTestPrepareDbVgroups);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareDbVgroups);
|
stub.set(f.second, ctgTestPrepareDbVgroups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -471,9 +457,9 @@ void ctgTestSetPrepareTableMeta() {
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareTableMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareTableMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareTableMeta);
|
stub.set(f.second, ctgTestPrepareTableMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -484,9 +470,9 @@ void ctgTestSetPrepareCTableMeta() {
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareCTableMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareCTableMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareCTableMeta);
|
stub.set(f.second, ctgTestPrepareCTableMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -497,9 +483,9 @@ void ctgTestSetPrepareSTableMeta() {
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareSTableMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareSTableMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareSTableMeta);
|
stub.set(f.second, ctgTestPrepareSTableMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -510,37 +496,35 @@ void ctgTestSetPrepareMultiSTableMeta() {
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareMultiSTableMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareMultiSTableMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareMultiSTableMeta);
|
stub.set(f.second, ctgTestPrepareMultiSTableMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ctgTestSetPrepareDbVgroupsAndNormalMeta() {
|
void ctgTestSetPrepareDbVgroupsAndNormalMeta() {
|
||||||
static Stub stub;
|
static Stub stub;
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndNormalMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndNormalMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareDbVgroupsAndNormalMeta);
|
stub.set(f.second, ctgTestPrepareDbVgroupsAndNormalMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ctgTestSetPrepareDbVgroupsAndChildMeta() {
|
void ctgTestSetPrepareDbVgroupsAndChildMeta() {
|
||||||
static Stub stub;
|
static Stub stub;
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndChildMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndChildMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareDbVgroupsAndChildMeta);
|
stub.set(f.second, ctgTestPrepareDbVgroupsAndChildMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -551,9 +535,9 @@ void ctgTestSetPrepareDbVgroupsAndSuperMeta() {
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndSuperMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndSuperMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareDbVgroupsAndSuperMeta);
|
stub.set(f.second, ctgTestPrepareDbVgroupsAndSuperMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -564,19 +548,18 @@ void ctgTestSetPrepareDbVgroupsAndMultiSuperMeta() {
|
||||||
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndMultiSuperMeta);
|
stub.set(rpcSendRecv, ctgTestPrepareDbVgroupsAndMultiSuperMeta);
|
||||||
{
|
{
|
||||||
AddrAny any("libtransport.so");
|
AddrAny any("libtransport.so");
|
||||||
std::map<std::string,void*> result;
|
std::map<std::string, void *> result;
|
||||||
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
any.get_global_func_addr_dynsym("^rpcSendRecv$", result);
|
||||||
for (const auto& f : result) {
|
for (const auto &f : result) {
|
||||||
stub.set(f.second, ctgTestPrepareDbVgroupsAndMultiSuperMeta);
|
stub.set(f.second, ctgTestPrepareDbVgroupsAndMultiSuperMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
}
|
|
||||||
|
|
||||||
void *ctgTestGetDbVgroupThread(void *param) {
|
void *ctgTestGetDbVgroupThread(void *param) {
|
||||||
struct SCatalog* pCtg = (struct SCatalog*)param;
|
struct SCatalog *pCtg = (struct SCatalog *)param;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SArray *vgList = NULL;
|
SArray *vgList = NULL;
|
||||||
|
@ -593,7 +576,7 @@ void *ctgTestGetDbVgroupThread(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctgTestEnableSleep) {
|
if (ctgTestEnableSleep) {
|
||||||
usleep(rand()%5);
|
usleep(rand() % 5);
|
||||||
}
|
}
|
||||||
if (++n % ctgTestPrintNum == 0) {
|
if (++n % ctgTestPrintNum == 0) {
|
||||||
printf("Get:%d\n", n);
|
printf("Get:%d\n", n);
|
||||||
|
@ -604,7 +587,7 @@ void *ctgTestGetDbVgroupThread(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void *ctgTestSetDbVgroupThread(void *param) {
|
void *ctgTestSetDbVgroupThread(void *param) {
|
||||||
struct SCatalog* pCtg = (struct SCatalog*)param;
|
struct SCatalog *pCtg = (struct SCatalog *)param;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
SDBVgroupInfo dbVgroup = {0};
|
SDBVgroupInfo dbVgroup = {0};
|
||||||
int32_t n = 0;
|
int32_t n = 0;
|
||||||
|
@ -617,7 +600,7 @@ void *ctgTestSetDbVgroupThread(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctgTestEnableSleep) {
|
if (ctgTestEnableSleep) {
|
||||||
usleep(rand()%5);
|
usleep(rand() % 5);
|
||||||
}
|
}
|
||||||
if (++n % ctgTestPrintNum == 0) {
|
if (++n % ctgTestPrintNum == 0) {
|
||||||
printf("Set:%d\n", n);
|
printf("Set:%d\n", n);
|
||||||
|
@ -625,14 +608,13 @@ void *ctgTestSetDbVgroupThread(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *ctgTestGetCtableMetaThread(void *param) {
|
void *ctgTestGetCtableMetaThread(void *param) {
|
||||||
struct SCatalog* pCtg = (struct SCatalog*)param;
|
struct SCatalog *pCtg = (struct SCatalog *)param;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t n = 0;
|
int32_t n = 0;
|
||||||
STableMeta* tbMeta = NULL;
|
STableMeta *tbMeta = NULL;
|
||||||
int32_t exist = 0;
|
int32_t exist = 0;
|
||||||
|
|
||||||
SName cn = {.type = TSDB_TABLE_NAME_T, .acctId = 1};
|
SName cn = {.type = TSDB_TABLE_NAME_T, .acctId = 1};
|
||||||
|
@ -648,7 +630,7 @@ void *ctgTestGetCtableMetaThread(void *param) {
|
||||||
tfree(tbMeta);
|
tfree(tbMeta);
|
||||||
|
|
||||||
if (ctgTestEnableSleep) {
|
if (ctgTestEnableSleep) {
|
||||||
usleep(rand()%5);
|
usleep(rand() % 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++n % ctgTestPrintNum == 0) {
|
if (++n % ctgTestPrintNum == 0) {
|
||||||
|
@ -660,7 +642,7 @@ void *ctgTestGetCtableMetaThread(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void *ctgTestSetCtableMetaThread(void *param) {
|
void *ctgTestSetCtableMetaThread(void *param) {
|
||||||
struct SCatalog* pCtg = (struct SCatalog*)param;
|
struct SCatalog *pCtg = (struct SCatalog *)param;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
SDBVgroupInfo dbVgroup = {0};
|
SDBVgroupInfo dbVgroup = {0};
|
||||||
int32_t n = 0;
|
int32_t n = 0;
|
||||||
|
@ -675,7 +657,7 @@ void *ctgTestSetCtableMetaThread(void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctgTestEnableSleep) {
|
if (ctgTestEnableSleep) {
|
||||||
usleep(rand()%5);
|
usleep(rand() % 5);
|
||||||
}
|
}
|
||||||
if (++n % ctgTestPrintNum == 0) {
|
if (++n % ctgTestPrintNum == 0) {
|
||||||
printf("Set:%d\n", n);
|
printf("Set:%d\n", n);
|
||||||
|
@ -685,12 +667,10 @@ void *ctgTestSetCtableMetaThread(void *param) {
|
||||||
tfree(output.tbMeta);
|
tfree(output.tbMeta);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST(tableMeta, normalTable) {
|
TEST(tableMeta, normalTable) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo vgInfo = {0};
|
SVgroupInfo vgInfo = {0};
|
||||||
|
|
||||||
|
@ -698,7 +678,7 @@ TEST(tableMeta, normalTable) {
|
||||||
|
|
||||||
initQueryModuleMsgHandle();
|
initQueryModuleMsgHandle();
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
|
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
@ -715,7 +695,6 @@ TEST(tableMeta, normalTable) {
|
||||||
ASSERT_EQ(vgInfo.vgId, 8);
|
ASSERT_EQ(vgInfo.vgId, 8);
|
||||||
ASSERT_EQ(vgInfo.numOfEps, 3);
|
ASSERT_EQ(vgInfo.numOfEps, 3);
|
||||||
|
|
||||||
|
|
||||||
ctgTestSetPrepareTableMeta();
|
ctgTestSetPrepareTableMeta();
|
||||||
|
|
||||||
STableMeta *tableMeta = NULL;
|
STableMeta *tableMeta = NULL;
|
||||||
|
@ -754,7 +733,7 @@ TEST(tableMeta, normalTable) {
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
if (dbNum) {
|
if (dbNum) {
|
||||||
printf("got expired db,dbId:%"PRId64"\n", dbs->dbId);
|
printf("got expired db,dbId:%" PRId64 "\n", dbs->dbId);
|
||||||
free(dbs);
|
free(dbs);
|
||||||
dbs = NULL;
|
dbs = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -762,7 +741,7 @@ TEST(tableMeta, normalTable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stbNum) {
|
if (stbNum) {
|
||||||
printf("got expired stb,suid:%"PRId64"\n", stb->suid);
|
printf("got expired stb,suid:%" PRId64 "\n", stb->suid);
|
||||||
free(stb);
|
free(stb);
|
||||||
stb = NULL;
|
stb = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -781,7 +760,7 @@ TEST(tableMeta, normalTable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(tableMeta, childTableCase) {
|
TEST(tableMeta, childTableCase) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo vgInfo = {0};
|
SVgroupInfo vgInfo = {0};
|
||||||
|
|
||||||
|
@ -789,7 +768,7 @@ TEST(tableMeta, childTableCase) {
|
||||||
|
|
||||||
initQueryModuleMsgHandle();
|
initQueryModuleMsgHandle();
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
|
@ -850,7 +829,7 @@ TEST(tableMeta, childTableCase) {
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
if (dbNum) {
|
if (dbNum) {
|
||||||
printf("got expired db,dbId:%"PRId64"\n", dbs->dbId);
|
printf("got expired db,dbId:%" PRId64 "\n", dbs->dbId);
|
||||||
free(dbs);
|
free(dbs);
|
||||||
dbs = NULL;
|
dbs = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -858,7 +837,7 @@ TEST(tableMeta, childTableCase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stbNum) {
|
if (stbNum) {
|
||||||
printf("got expired stb,suid:%"PRId64"\n", stb->suid);
|
printf("got expired stb,suid:%" PRId64 "\n", stb->suid);
|
||||||
free(stb);
|
free(stb);
|
||||||
stb = NULL;
|
stb = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -873,12 +852,11 @@ TEST(tableMeta, childTableCase) {
|
||||||
ASSERT_EQ(allDbNum, 1);
|
ASSERT_EQ(allDbNum, 1);
|
||||||
ASSERT_EQ(allStbNum, 1);
|
ASSERT_EQ(allStbNum, 1);
|
||||||
|
|
||||||
|
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(tableMeta, superTableCase) {
|
TEST(tableMeta, superTableCase) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo vgInfo = {0};
|
SVgroupInfo vgInfo = {0};
|
||||||
|
|
||||||
|
@ -889,7 +867,7 @@ TEST(tableMeta, superTableCase) {
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
|
@ -952,7 +930,7 @@ TEST(tableMeta, superTableCase) {
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
if (dbNum) {
|
if (dbNum) {
|
||||||
printf("got expired db,dbId:%"PRId64"\n", dbs->dbId);
|
printf("got expired db,dbId:%" PRId64 "\n", dbs->dbId);
|
||||||
free(dbs);
|
free(dbs);
|
||||||
dbs = NULL;
|
dbs = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -960,7 +938,7 @@ TEST(tableMeta, superTableCase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stbNum) {
|
if (stbNum) {
|
||||||
printf("got expired stb,suid:%"PRId64"\n", stb->suid);
|
printf("got expired stb,suid:%" PRId64 "\n", stb->suid);
|
||||||
free(stb);
|
free(stb);
|
||||||
stb = NULL;
|
stb = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -975,12 +953,11 @@ TEST(tableMeta, superTableCase) {
|
||||||
ASSERT_EQ(allDbNum, 1);
|
ASSERT_EQ(allDbNum, 1);
|
||||||
ASSERT_EQ(allStbNum, 1);
|
ASSERT_EQ(allStbNum, 1);
|
||||||
|
|
||||||
|
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(tableDistVgroup, normalTable) {
|
TEST(tableDistVgroup, normalTable) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo *vgInfo = NULL;
|
SVgroupInfo *vgInfo = NULL;
|
||||||
SArray *vgList = NULL;
|
SArray *vgList = NULL;
|
||||||
|
@ -992,7 +969,7 @@ TEST(tableDistVgroup, normalTable) {
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
|
|
||||||
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
@ -1012,7 +989,7 @@ TEST(tableDistVgroup, normalTable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(tableDistVgroup, childTableCase) {
|
TEST(tableDistVgroup, childTableCase) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo *vgInfo = NULL;
|
SVgroupInfo *vgInfo = NULL;
|
||||||
SArray *vgList = NULL;
|
SArray *vgList = NULL;
|
||||||
|
@ -1021,7 +998,7 @@ TEST(tableDistVgroup, childTableCase) {
|
||||||
|
|
||||||
initQueryModuleMsgHandle();
|
initQueryModuleMsgHandle();
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
|
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
@ -1040,12 +1017,11 @@ TEST(tableDistVgroup, childTableCase) {
|
||||||
ASSERT_EQ(vgInfo->vgId, 9);
|
ASSERT_EQ(vgInfo->vgId, 9);
|
||||||
ASSERT_EQ(vgInfo->numOfEps, 4);
|
ASSERT_EQ(vgInfo->numOfEps, 4);
|
||||||
|
|
||||||
|
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(tableDistVgroup, superTableCase) {
|
TEST(tableDistVgroup, superTableCase) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo *vgInfo = NULL;
|
SVgroupInfo *vgInfo = NULL;
|
||||||
SArray *vgList = NULL;
|
SArray *vgList = NULL;
|
||||||
|
@ -1057,7 +1033,7 @@ TEST(tableDistVgroup, superTableCase) {
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
|
@ -1078,12 +1054,11 @@ TEST(tableDistVgroup, superTableCase) {
|
||||||
ASSERT_EQ(vgInfo->vgId, 3);
|
ASSERT_EQ(vgInfo->vgId, 3);
|
||||||
ASSERT_EQ(vgInfo->numOfEps, 3);
|
ASSERT_EQ(vgInfo->numOfEps, 3);
|
||||||
|
|
||||||
|
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(dbVgroup, getSetDbVgroupCase) {
|
TEST(dbVgroup, getSetDbVgroupCase) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo vgInfo = {0};
|
SVgroupInfo vgInfo = {0};
|
||||||
SVgroupInfo *pvgInfo = NULL;
|
SVgroupInfo *pvgInfo = NULL;
|
||||||
|
@ -1094,7 +1069,7 @@ TEST(dbVgroup, getSetDbVgroupCase) {
|
||||||
|
|
||||||
initQueryModuleMsgHandle();
|
initQueryModuleMsgHandle();
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
|
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
@ -1144,7 +1119,7 @@ TEST(dbVgroup, getSetDbVgroupCase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(multiThread, getSetDbVgroupCase) {
|
TEST(multiThread, getSetDbVgroupCase) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo vgInfo = {0};
|
SVgroupInfo vgInfo = {0};
|
||||||
SVgroupInfo *pvgInfo = NULL;
|
SVgroupInfo *pvgInfo = NULL;
|
||||||
|
@ -1158,7 +1133,7 @@ TEST(multiThread, getSetDbVgroupCase) {
|
||||||
|
|
||||||
initQueryModuleMsgHandle();
|
initQueryModuleMsgHandle();
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
|
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
@ -1195,7 +1170,7 @@ TEST(multiThread, getSetDbVgroupCase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(multiThread, ctableMeta) {
|
TEST(multiThread, ctableMeta) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo vgInfo = {0};
|
SVgroupInfo vgInfo = {0};
|
||||||
SVgroupInfo *pvgInfo = NULL;
|
SVgroupInfo *pvgInfo = NULL;
|
||||||
|
@ -1207,7 +1182,7 @@ TEST(multiThread, ctableMeta) {
|
||||||
|
|
||||||
initQueryModuleMsgHandle();
|
initQueryModuleMsgHandle();
|
||||||
|
|
||||||
//sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
// sendCreateDbMsg(pConn->pTransporter, &pConn->pAppInfo->mgmtEp.epSet);
|
||||||
|
|
||||||
int32_t code = catalogInit(NULL);
|
int32_t code = catalogInit(NULL);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
@ -1242,9 +1217,8 @@ TEST(multiThread, ctableMeta) {
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST(rentTest, allRent) {
|
TEST(rentTest, allRent) {
|
||||||
struct SCatalog* pCtg = NULL;
|
struct SCatalog *pCtg = NULL;
|
||||||
void *mockPointer = (void *)0x1;
|
void *mockPointer = (void *)0x1;
|
||||||
SVgroupInfo vgInfo = {0};
|
SVgroupInfo vgInfo = {0};
|
||||||
SVgroupInfo *pvgInfo = NULL;
|
SVgroupInfo *pvgInfo = NULL;
|
||||||
|
@ -1265,7 +1239,6 @@ TEST(rentTest, allRent) {
|
||||||
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
code = catalogGetHandle(ctgTestClusterId, &pCtg);
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
|
|
||||||
|
|
||||||
SName n = {.type = TSDB_TABLE_NAME_T, .acctId = 1};
|
SName n = {.type = TSDB_TABLE_NAME_T, .acctId = 1};
|
||||||
strcpy(n.dbname, "db1");
|
strcpy(n.dbname, "db1");
|
||||||
|
|
||||||
|
@ -1290,7 +1263,7 @@ TEST(rentTest, allRent) {
|
||||||
ASSERT_EQ(code, 0);
|
ASSERT_EQ(code, 0);
|
||||||
printf("%d - expired dbNum:%d\n", i, num);
|
printf("%d - expired dbNum:%d\n", i, num);
|
||||||
if (dbs) {
|
if (dbs) {
|
||||||
printf("%d - expired dbId:%"PRId64", vgVersion:%d\n", i, dbs->dbId, dbs->vgVersion);
|
printf("%d - expired dbId:%" PRId64 ", vgVersion:%d\n", i, dbs->dbId, dbs->vgVersion);
|
||||||
free(dbs);
|
free(dbs);
|
||||||
dbs = NULL;
|
dbs = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1300,7 +1273,7 @@ TEST(rentTest, allRent) {
|
||||||
printf("%d - expired stableNum:%d\n", i, num);
|
printf("%d - expired stableNum:%d\n", i, num);
|
||||||
if (stable) {
|
if (stable) {
|
||||||
for (int32_t n = 0; n < num; ++n) {
|
for (int32_t n = 0; n < num; ++n) {
|
||||||
printf("suid:%"PRId64", sversion:%d, tversion:%d\n", stable[n].suid, stable[n].sversion, stable[n].tversion);
|
printf("suid:%" PRId64 ", sversion:%d, tversion:%d\n", stable[n].suid, stable[n].sversion, stable[n].tversion);
|
||||||
}
|
}
|
||||||
free(stable);
|
free(stable);
|
||||||
stable = NULL;
|
stable = NULL;
|
||||||
|
@ -1313,13 +1286,9 @@ TEST(rentTest, allRent) {
|
||||||
catalogDestroy();
|
catalogDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
|
||||||
testing::InitGoogleTest(&argc, argv);
|
testing::InitGoogleTest(&argc, argv);
|
||||||
return RUN_ALL_TESTS();
|
return RUN_ALL_TESTS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
|