From 2eee59a16463868f39819af3bc5ce1f6e8cec9cc Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 10 Jun 2020 06:05:55 +0000 Subject: [PATCH] fix coredump --- src/common/src/tdataformat.c | 6 +++--- src/tsdb/src/tsdbMetaFile.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index c01141f0d6..77e91acc14 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -201,10 +201,10 @@ void dataColInit(SDataCol *pDataCol, STColumn *pCol, void **pBuf, int maxPoints) pDataCol->len = 0; if (pDataCol->type == TSDB_DATA_TYPE_BINARY || pDataCol->type == TSDB_DATA_TYPE_NCHAR) { - pDataCol->spaceSize = (sizeof(VarDataLenT) + pDataCol->bytes) * maxPoints; pDataCol->dataOff = (VarDataOffsetT *)(*pBuf); - pDataCol->pData = POINTER_SHIFT(*pBuf, TYPE_BYTES[pDataCol->type] * maxPoints); - *pBuf = POINTER_SHIFT(*pBuf, pDataCol->spaceSize + TYPE_BYTES[pDataCol->type] * maxPoints); + pDataCol->pData = POINTER_SHIFT(*pBuf, sizeof(VarDataOffsetT) * maxPoints); + pDataCol->spaceSize = pDataCol->bytes * maxPoints; + *pBuf = POINTER_SHIFT(*pBuf, pDataCol->spaceSize + sizeof(VarDataOffsetT) * maxPoints); } else { pDataCol->spaceSize = pDataCol->bytes * maxPoints; pDataCol->dataOff = NULL; diff --git a/src/tsdb/src/tsdbMetaFile.c b/src/tsdb/src/tsdbMetaFile.c index 19fcae94e3..921db8674a 100644 --- a/src/tsdb/src/tsdbMetaFile.c +++ b/src/tsdb/src/tsdbMetaFile.c @@ -105,7 +105,7 @@ int32_t tsdbInsertMetaRecord(SMetaFile *mfh, uint64_t uid, void *cont, int32_t c return -1; } - fsync(mfh->fd); + // fsync(mfh->fd); mfh->tombSize++; @@ -132,7 +132,7 @@ int32_t tsdbDeleteMetaRecord(SMetaFile *mfh, uint64_t uid) { return -1; } - fsync(mfh->fd); + // fsync(mfh->fd); mfh->nDel++; @@ -167,7 +167,7 @@ int32_t tsdbUpdateMetaRecord(SMetaFile *mfh, uint64_t uid, void *cont, int32_t c return -1; } - fsync(mfh->fd); + // fsync(mfh->fd); return 0; } -- GitLab