fix coredump

This commit is contained in:
Hongze Cheng 2020-06-10 06:05:55 +00:00
parent d83957e37e
commit 2eee59a164
2 changed files with 6 additions and 6 deletions

View File

@ -201,10 +201,10 @@ void dataColInit(SDataCol *pDataCol, STColumn *pCol, void **pBuf, int maxPoints)
pDataCol->len = 0; pDataCol->len = 0;
if (pDataCol->type == TSDB_DATA_TYPE_BINARY || pDataCol->type == TSDB_DATA_TYPE_NCHAR) { 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->dataOff = (VarDataOffsetT *)(*pBuf);
pDataCol->pData = POINTER_SHIFT(*pBuf, TYPE_BYTES[pDataCol->type] * maxPoints); pDataCol->pData = POINTER_SHIFT(*pBuf, sizeof(VarDataOffsetT) * maxPoints);
*pBuf = POINTER_SHIFT(*pBuf, pDataCol->spaceSize + TYPE_BYTES[pDataCol->type] * maxPoints); pDataCol->spaceSize = pDataCol->bytes * maxPoints;
*pBuf = POINTER_SHIFT(*pBuf, pDataCol->spaceSize + sizeof(VarDataOffsetT) * maxPoints);
} else { } else {
pDataCol->spaceSize = pDataCol->bytes * maxPoints; pDataCol->spaceSize = pDataCol->bytes * maxPoints;
pDataCol->dataOff = NULL; pDataCol->dataOff = NULL;

View File

@ -105,7 +105,7 @@ int32_t tsdbInsertMetaRecord(SMetaFile *mfh, uint64_t uid, void *cont, int32_t c
return -1; return -1;
} }
fsync(mfh->fd); // fsync(mfh->fd);
mfh->tombSize++; mfh->tombSize++;
@ -132,7 +132,7 @@ int32_t tsdbDeleteMetaRecord(SMetaFile *mfh, uint64_t uid) {
return -1; return -1;
} }
fsync(mfh->fd); // fsync(mfh->fd);
mfh->nDel++; mfh->nDel++;
@ -167,7 +167,7 @@ int32_t tsdbUpdateMetaRecord(SMetaFile *mfh, uint64_t uid, void *cont, int32_t c
return -1; return -1;
} }
fsync(mfh->fd); // fsync(mfh->fd);
return 0; return 0;
} }