diff --git a/src/tsdb/tests/tsdbTests.cpp b/src/tsdb/tests/tsdbTests.cpp index 8628d816c43b91546a49d15214bf9de50ace0097..88bd524c20b4be2adb847325cc8967f613ed09bd 100644 --- a/src/tsdb/tests/tsdbTests.cpp +++ b/src/tsdb/tests/tsdbTests.cpp @@ -39,7 +39,9 @@ static int insertData(SInsertInfo *pInfo) { pBlock->uid = pInfo->uid; pBlock->tid = pInfo->tid; pBlock->sversion = pInfo->sversion; - pBlock->len = 0; + pBlock->dataLen = 0; + pBlock->schemaLen = 0; + pBlock->numOfRows = 0; for (int i = 0; i < pInfo->rowsPerSubmit; i++) { // start_time += 1000; if (pInfo->isAscend) { @@ -47,7 +49,7 @@ static int insertData(SInsertInfo *pInfo) { } else { start_time -= pInfo->interval; } - SDataRow row = (SDataRow)(pBlock->data + pBlock->len); + SDataRow row = (SDataRow)(pBlock->data + pBlock->dataLen); tdInitDataRow(row, pInfo->pSchema); for (int j = 0; j < schemaNCols(pInfo->pSchema); j++) { @@ -59,13 +61,15 @@ static int insertData(SInsertInfo *pInfo) { tdAppendColVal(row, (void *)(&val), pTCol->type, pTCol->bytes, pTCol->offset); } } - pBlock->len += dataRowLen(row); + pBlock->dataLen += dataRowLen(row); + pBlock->numOfRows++; } - pMsg->length = pMsg->length + sizeof(SSubmitBlk) + pBlock->len; + pMsg->length = sizeof(SSubmitMsg) + sizeof(SSubmitBlk) + pBlock->dataLen; pMsg->numOfBlocks = 1; - pBlock->len = htonl(pBlock->len); + pBlock->dataLen = htonl(pBlock->dataLen); pBlock->numOfRows = htonl(pBlock->numOfRows); + pBlock->schemaLen = htonl(pBlock->schemaLen); pBlock->uid = htobe64(pBlock->uid); pBlock->tid = htonl(pBlock->tid); @@ -74,7 +78,6 @@ static int insertData(SInsertInfo *pInfo) { pMsg->length = htonl(pMsg->length); pMsg->numOfBlocks = htonl(pMsg->numOfBlocks); - pMsg->compressed = htonl(pMsg->numOfBlocks); if (tsdbInsertData(pInfo->pRepo, pMsg, NULL) < 0) { tfree(pMsg);