From 35635ea68c76727a8d0628a1b9c95875a19af291 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 31 May 2022 10:42:18 +0800 Subject: [PATCH] feat:add schemaless db paras --- include/common/tmsg.h | 1 - source/common/src/systable.c | 2 ++ source/dnode/mnode/impl/src/mndDb.c | 4 ++++ source/dnode/mnode/impl/src/mndVgroup.c | 1 - 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 68480e4ffd..dbfbfcf0f2 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1010,7 +1010,6 @@ typedef struct { SReplica replicas[TSDB_MAX_REPLICA]; int32_t numOfRetensions; SArray* pRetensions; // SRetention - int8_t schemaless; // for tsma int8_t isTsma; diff --git a/source/common/src/systable.c b/source/common/src/systable.c index 38a6bafe9a..4e2f9b074a 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -89,7 +89,9 @@ static const SSysDbTableSchema userDBSchema[] = { {.name = "cachelast", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, {.name = "precision", .bytes = 2 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, {.name = "single_stable", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, + {.name = "schemaless", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, + // {.name = "update", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, // disable update }; diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index cc884fb18b..35dc24dd9b 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -1540,8 +1540,12 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.numOfStables, false); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); + colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.schemaless, false); + pColInfo = taosArrayGet(pBlock->pDataBlock, cols); colDataAppend(pColInfo, rows, (const char *)statusB, false); + } } diff --git a/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index a00841f911..e05b38a7c0 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -218,7 +218,6 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg createReq.hashMethod = pDb->cfg.hashMethod; createReq.numOfRetensions = pDb->cfg.numOfRetensions; createReq.pRetensions = pDb->cfg.pRetensions; - createReq.schemaless = pDb->cfg.schemaless; for (int32_t v = 0; v < pVgroup->replica; ++v) { SReplica *pReplica = &createReq.replicas[v];