From f99074c01c06c6da65e69236c67a9a1a26b54644 Mon Sep 17 00:00:00 2001 From: hzcheng Date: Sat, 2 May 2020 22:05:12 +0800 Subject: [PATCH 1/2] fix a little bug --- src/tsdb/src/tsdbMeta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index 0fd6bc8ae6..509de6a921 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -283,7 +283,7 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) { super->superUid = TSDB_INVALID_SUPER_TABLE_ID; super->schema = tdDupSchema(pCfg->schema); super->tagSchema = tdDupSchema(pCfg->tagSchema); - super->tagVal = tdDataRowDup(pCfg->tagValues); + super->tagVal = NULL; super->name = strdup(pCfg->sname); // index the first tag column From c1e8581d422fe44c25a441c000465a73e79619a4 Mon Sep 17 00:00:00 2001 From: hzcheng Date: Sat, 2 May 2020 15:46:13 +0000 Subject: [PATCH 2/2] Fix decompress bug --- src/tsdb/src/tsdbRWHelper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index 170decc13e..653379e03b 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -619,7 +619,11 @@ static int tsdbLoadBlockDataImpl(SRWHelper *pHelper, SCompBlock *pCompBlock, SDa if (pCompCol->colId == pDataCol->colId) { if (pCompBlock->algorithm == TWO_STAGE_COMP) { - pHelper->compBuffer = trealloc(pHelper->compBuffer, pCompCol->len + COMP_OVERFLOW_BYTES); + int zsize = pDataCol->bytes * pCompBlock->numOfPoints + COMP_OVERFLOW_BYTES; + if (pCompCol->type == TSDB_DATA_TYPE_BINARY || pCompCol->type == TSDB_DATA_TYPE_NCHAR) { + zsize += (sizeof(VarDataLenT) * pCompBlock->numOfPoints); + } + pHelper->compBuffer = trealloc(pHelper->compBuffer, zsize); if (pHelper->compBuffer == NULL) goto _err; } if (tsdbCheckAndDecodeColumnData(pDataCol, (char *)pCompData + tsize + pCompCol->offset, pCompCol->len,