diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c index 69a35b3d7832a31528657df71d5c169f4a524974..8969f61596b33f37cabe934fdd56819b71575315 100644 --- a/src/tsdb/src/tsdbMain.c +++ b/src/tsdb/src/tsdbMain.c @@ -597,7 +597,7 @@ int tsdbRestoreInfo(STsdbRepo *pRepo) { // Get the data in row ASSERT(pTable->lastRow == NULL); STSchema *pSchema = tsdbGetTableSchema(pTable); - pTable->lastRow = taosTMalloc(schemaTLen(pSchema)); + pTable->lastRow = taosTMalloc(dataRowMaxBytesFromSchema(pSchema)); if (pTable->lastRow == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; tsdbDestroyReadH(&readh);