From 2b3ff4d88897c40ee65a72e384e0deff3ee538ea Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 4 Jun 2022 14:22:30 +0800 Subject: [PATCH] fix: update the column type in show. --- source/common/src/systable.c | 2 +- source/dnode/mnode/impl/src/mndDb.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/common/src/systable.c b/source/common/src/systable.c index da42a955ba..2b59354d60 100644 --- a/source/common/src/systable.c +++ b/source/common/src/systable.c @@ -87,7 +87,7 @@ static const SSysDbTableSchema userDBSchema[] = { {.name = "wal", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, {.name = "fsync", .bytes = 4, .type = TSDB_DATA_TYPE_INT}, {.name = "comp", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, - {.name = "cache_model", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, + {.name = "cache_model", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT}, {.name = "precision", .bytes = 2 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, {.name = "single_stable_model", .bytes = 1, .type = TSDB_DATA_TYPE_BOOL}, {.name = "status", .bytes = 10 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR}, diff --git a/source/dnode/mnode/impl/src/mndDb.c b/source/dnode/mnode/impl/src/mndDb.c index 41f8d741a6..c0460ee8bf 100644 --- a/source/dnode/mnode/impl/src/mndDb.c +++ b/source/dnode/mnode/impl/src/mndDb.c @@ -1571,14 +1571,19 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); STR_WITH_SIZE_TO_VARSTR(strict, src, strlen(src)); - +#if 0 char cacheModel[24] = {0}; + bool null = false; if (pDb->cfg.cacheLastRow == 0) { STR_TO_VARSTR(cacheModel, "no_cache"); + } else if (pDb->cfg.cacheLastRow == 1) { + STR_TO_VARSTR(cacheModel, "last_row_cache") } else { - // + null = true; } - colDataAppend(pColInfo, rows, cacheModel, false); + colDataAppend(pColInfo, rows, cacheModel, null); +#endif + colDataAppend(pColInfo, rows, (const char*) &pDb->cfg.cacheLastRow, false); char *prec = NULL; switch (pDb->cfg.precision) {