提交 259b7e8a 编写于 作者: H Hongze Cheng

fix compile issue

上级 899d7b0b
...@@ -537,7 +537,7 @@ static int32_t tRowMergeImpl(SArray *aRowP, STSchema *pTSchema, int32_t iStart, ...@@ -537,7 +537,7 @@ static int32_t tRowMergeImpl(SArray *aRowP, STSchema *pTSchema, int32_t iStart,
aIter = taosMemoryCalloc(nRow, sizeof(SRowIter *)); aIter = taosMemoryCalloc(nRow, sizeof(SRowIter *));
if (aIter == NULL) { if (aIter == NULL) {
code = TSDB_CODE_TDB_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit; goto _exit;
} }
...@@ -551,7 +551,7 @@ static int32_t tRowMergeImpl(SArray *aRowP, STSchema *pTSchema, int32_t iStart, ...@@ -551,7 +551,7 @@ static int32_t tRowMergeImpl(SArray *aRowP, STSchema *pTSchema, int32_t iStart,
// merge // merge
aColVal = taosArrayInit(pTSchema->numOfCols, sizeof(SColVal)); aColVal = taosArrayInit(pTSchema->numOfCols, sizeof(SColVal));
if (aColVal == NULL) { if (aColVal == NULL) {
code = TSDB_CODE_TDB_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit; goto _exit;
} }
......
...@@ -3551,10 +3551,11 @@ int32_t tsdbGetNextRowInMem(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pR ...@@ -3551,10 +3551,11 @@ int32_t tsdbGetNextRowInMem(STableBlockScanInfo* pBlockScanInfo, STsdbReader* pR
} }
int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, SRow* pTSRow, STableBlockScanInfo* pScanInfo) { int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, SRow* pTSRow, STableBlockScanInfo* pScanInfo) {
int32_t numOfRows = pBlock->info.rows; int32_t outputRowIndex = pBlock->info.rows;
int32_t numOfCols = (int32_t)taosArrayGetSize(pBlock->pDataBlock);
int64_t uid = pScanInfo->uid; int64_t uid = pScanInfo->uid;
int32_t numOfCols = (int32_t)taosArrayGetSize(pBlock->pDataBlock);
SBlockLoadSuppInfo* pSupInfo = &pReader->suppInfo; SBlockLoadSuppInfo* pSupInfo = &pReader->suppInfo;
STSchema* pSchema = doGetSchemaForTSRow(pTSRow->sver, pReader, uid); STSchema* pSchema = doGetSchemaForTSRow(pTSRow->sver, pReader, uid);
...@@ -3571,8 +3572,10 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, SRow* pT ...@@ -3571,8 +3572,10 @@ int32_t doAppendRowFromTSRow(SSDataBlock* pBlock, STsdbReader* pReader, SRow* pT
col_id_t colId = pSupInfo->colId[i]; col_id_t colId = pSupInfo->colId[i];
if (colId == pSchema->columns[j].colId) { if (colId == pSchema->columns[j].colId) {
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pSupInfo->slotId[i]);
tRowGet(pTSRow, pSchema, j, &colVal); tRowGet(pTSRow, pSchema, j, &colVal);
doCopyColVal(pColInfoData, numOfRows, i, &colVal, pSupInfo); doCopyColVal(pColInfoData, outputRowIndex, i, &colVal, pSupInfo);
i += 1; i += 1;
j += 1; j += 1;
} else if (colId < pSchema->columns[j].colId) { } else if (colId < pSchema->columns[j].colId) {
...@@ -3911,7 +3914,7 @@ void tsdbReaderClose(STsdbReader* pReader) { ...@@ -3911,7 +3914,7 @@ void tsdbReaderClose(STsdbReader* pReader) {
tBlockDataDestroy(&pReader->status.fileBlockData); tBlockDataDestroy(&pReader->status.fileBlockData);
taosMemoryFree(pSupInfo->colId); taosMemoryFree(pSupInfo->colId);
tBlockDataDestroy(&pReader->status.fileBlockData, true); tBlockDataDestroy(&pReader->status.fileBlockData);
cleanupDataBlockIterator(&pReader->status.blockIter); cleanupDataBlockIterator(&pReader->status.blockIter);
size_t numOfTables = taosHashGetSize(pReader->status.pTableMap); size_t numOfTables = taosHashGetSize(pReader->status.pTableMap);
......
...@@ -956,7 +956,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq ...@@ -956,7 +956,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
if (pSubmitRsp->aCreateTbRsp == NULL && if (pSubmitRsp->aCreateTbRsp == NULL &&
(pSubmitRsp->aCreateTbRsp = taosArrayInit(TARRAY_SIZE(pSubmitReq->aSubmitTbData), sizeof(SVCreateTbRsp))) == (pSubmitRsp->aCreateTbRsp = taosArrayInit(TARRAY_SIZE(pSubmitReq->aSubmitTbData), sizeof(SVCreateTbRsp))) ==
NULL) { NULL) {
code = TSDB_CODE_TDB_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit; goto _exit;
} }
...@@ -968,7 +968,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq ...@@ -968,7 +968,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
if (newTbUids == NULL && if (newTbUids == NULL &&
(newTbUids = taosArrayInit(TARRAY_SIZE(pSubmitReq->aSubmitTbData), sizeof(int64_t))) == NULL) { (newTbUids = taosArrayInit(TARRAY_SIZE(pSubmitReq->aSubmitTbData), sizeof(int64_t))) == NULL) {
code = TSDB_CODE_TDB_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
goto _exit; goto _exit;
} }
...@@ -1029,13 +1029,13 @@ _exit: ...@@ -1029,13 +1029,13 @@ _exit:
#else #else
SSubmitReq *pSubmitReq = (SSubmitReq *)pReq; SSubmitReq *pSubmitReq = (SSubmitReq *)pReq;
SSubmitRsp submitRsp = {0}; SSubmitRsp submitRsp = {0};
int32_t nRows = 0; int32_t nRows = 0;
int32_t tsize, ret; int32_t tsize, ret;
SEncoder encoder = {0}; SEncoder encoder = {0};
SArray *newTbUids = NULL; SArray *newTbUids = NULL;
SVStatis statis = {0}; SVStatis statis = {0};
bool tbCreated = false; bool tbCreated = false;
terrno = TSDB_CODE_SUCCESS; terrno = TSDB_CODE_SUCCESS;
pRsp->code = 0; pRsp->code = 0;
......
...@@ -204,7 +204,6 @@ void qDestroyBoundColInfo(void* pInfo) { ...@@ -204,7 +204,6 @@ void qDestroyBoundColInfo(void* pInfo) {
taosMemoryFreeClear(pBoundInfo->pColIndex); taosMemoryFreeClear(pBoundInfo->pColIndex);
} }
static int32_t createDataBlock(size_t defaultSize, int32_t rowSize, int32_t startOffset, STableMeta* pTableMeta, static int32_t createDataBlock(size_t defaultSize, int32_t rowSize, int32_t startOffset, STableMeta* pTableMeta,
STableDataBlocks** dataBlocks) { STableDataBlocks** dataBlocks) {
STableDataBlocks* dataBuf = (STableDataBlocks*)taosMemoryCalloc(1, sizeof(STableDataBlocks)); STableDataBlocks* dataBuf = (STableDataBlocks*)taosMemoryCalloc(1, sizeof(STableDataBlocks));
...@@ -1012,7 +1011,8 @@ void insCheckTableDataOrder(STableDataCxt* pTableCxt, TSKEY tsKey) { ...@@ -1012,7 +1011,8 @@ void insCheckTableDataOrder(STableDataCxt* pTableCxt, TSKEY tsKey) {
void destroyBoundColInfo(SBoundColInfo* pInfo) { taosMemoryFreeClear(pInfo->pColIndex); } void destroyBoundColInfo(SBoundColInfo* pInfo) { taosMemoryFreeClear(pInfo->pColIndex); }
static int32_t createTableDataCxt(STableMeta* pTableMeta, SVCreateTbReq** pCreateTbReq, STableDataCxt** pOutput, bool colMode) { static int32_t createTableDataCxt(STableMeta* pTableMeta, SVCreateTbReq** pCreateTbReq, STableDataCxt** pOutput,
bool colMode) {
STableDataCxt* pTableCxt = taosMemoryCalloc(1, sizeof(STableDataCxt)); STableDataCxt* pTableCxt = taosMemoryCalloc(1, sizeof(STableDataCxt));
if (NULL == pTableCxt) { if (NULL == pTableCxt) {
return TSDB_CODE_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY;
...@@ -1229,33 +1229,33 @@ int32_t insMergeTableDataCxt(SHashObj* pTableHash, SArray** pVgDataBlocks) { ...@@ -1229,33 +1229,33 @@ int32_t insMergeTableDataCxt(SHashObj* pTableHash, SArray** pVgDataBlocks) {
if (NULL == pVgroupHash || NULL == pVgroupList) { if (NULL == pVgroupHash || NULL == pVgroupList) {
taosHashCleanup(pVgroupHash); taosHashCleanup(pVgroupHash);
taosArrayDestroy(pVgroupList); taosArrayDestroy(pVgroupList);
return TSDB_CODE_TSC_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY;
} }
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
bool colFormat = false; bool colFormat = false;
void* p = taosHashIterate(pTableHash, NULL); void* p = taosHashIterate(pTableHash, NULL);
if (p) { if (p) {
STableDataCxt* pTableCxt = *(STableDataCxt**)p; STableDataCxt* pTableCxt = *(STableDataCxt**)p;
colFormat = (0 != (pTableCxt->pData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT)); colFormat = (0 != (pTableCxt->pData->flags & SUBMIT_REQ_COLUMN_DATA_FORMAT));
} }
while (TSDB_CODE_SUCCESS == code && NULL != p) { while (TSDB_CODE_SUCCESS == code && NULL != p) {
STableDataCxt* pTableCxt = *(STableDataCxt**)p; STableDataCxt* pTableCxt = *(STableDataCxt**)p;
if (colFormat) { if (colFormat) {
SColData *pCol = taosArrayGet(pTableCxt->pData->aCol, 0); SColData* pCol = taosArrayGet(pTableCxt->pData->aCol, 0);
if (pCol->nVal <= 0) { if (pCol->nVal <= 0) {
p = taosHashIterate(pTableHash, p); p = taosHashIterate(pTableHash, p);
continue; continue;
} }
if (pTableCxt->pData->pCreateTbReq) { if (pTableCxt->pData->pCreateTbReq) {
pTableCxt->pData->flags |= SUBMIT_REQ_AUTO_CREATE_TABLE; pTableCxt->pData->flags |= SUBMIT_REQ_AUTO_CREATE_TABLE;
} }
taosArraySort(pTableCxt->pData->aCol, insColDataComp); taosArraySort(pTableCxt->pData->aCol, insColDataComp);
tColDataSortMerge(pTableCxt->pData->aCol); tColDataSortMerge(pTableCxt->pData->aCol);
} else { } else {
if (!pTableCxt->ordered) { if (!pTableCxt->ordered) {
...@@ -1265,7 +1265,7 @@ int32_t insMergeTableDataCxt(SHashObj* pTableHash, SArray** pVgDataBlocks) { ...@@ -1265,7 +1265,7 @@ int32_t insMergeTableDataCxt(SHashObj* pTableHash, SArray** pVgDataBlocks) {
code = tRowMerge(pTableCxt->pData->aRowP, pTableCxt->pSchema, 0); code = tRowMerge(pTableCxt->pData->aRowP, pTableCxt->pSchema, 0);
} }
} }
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
SVgroupDataCxt* pVgCxt = NULL; SVgroupDataCxt* pVgCxt = NULL;
int32_t vgId = pTableCxt->pMeta->vgId; int32_t vgId = pTableCxt->pMeta->vgId;
...@@ -1304,7 +1304,7 @@ static int32_t buildSubmitReq(int32_t vgId, SSubmitReq2* pReq, void** pData, uin ...@@ -1304,7 +1304,7 @@ static int32_t buildSubmitReq(int32_t vgId, SSubmitReq2* pReq, void** pData, uin
len += sizeof(SMsgHead); len += sizeof(SMsgHead);
pBuf = taosMemoryMalloc(len); pBuf = taosMemoryMalloc(len);
if (NULL == pBuf) { if (NULL == pBuf) {
return TSDB_CODE_TSC_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY;
} }
((SMsgHead*)pBuf)->vgId = htonl(vgId); ((SMsgHead*)pBuf)->vgId = htonl(vgId);
((SMsgHead*)pBuf)->contLen = htonl(len); ((SMsgHead*)pBuf)->contLen = htonl(len);
...@@ -1332,7 +1332,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList, ...@@ -1332,7 +1332,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList,
size_t numOfVg = taosArrayGetSize(pVgDataCxtList); size_t numOfVg = taosArrayGetSize(pVgDataCxtList);
SArray* pDataBlocks = taosArrayInit(numOfVg, POINTER_BYTES); SArray* pDataBlocks = taosArrayInit(numOfVg, POINTER_BYTES);
if (NULL == pDataBlocks) { if (NULL == pDataBlocks) {
return TSDB_CODE_TSC_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY;
} }
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
...@@ -1340,7 +1340,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList, ...@@ -1340,7 +1340,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList,
SVgroupDataCxt* src = taosArrayGetP(pVgDataCxtList, i); SVgroupDataCxt* src = taosArrayGetP(pVgDataCxtList, i);
SVgDataBlocks* dst = taosMemoryCalloc(1, sizeof(SVgDataBlocks)); SVgDataBlocks* dst = taosMemoryCalloc(1, sizeof(SVgDataBlocks));
if (NULL == dst) { if (NULL == dst) {
code = TSDB_CODE_TSC_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
} }
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
dst->numOfTables = taosArrayGetSize(src->pData->aSubmitTbData); dst->numOfTables = taosArrayGetSize(src->pData->aSubmitTbData);
...@@ -1350,7 +1350,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList, ...@@ -1350,7 +1350,7 @@ int32_t insBuildVgDataBlocks(SHashObj* pVgroupsHashObj, SArray* pVgDataCxtList,
code = buildSubmitReq(src->vgId, src->pData, &dst->pData, &dst->size); code = buildSubmitReq(src->vgId, src->pData, &dst->pData, &dst->size);
} }
if (TSDB_CODE_SUCCESS == code) { if (TSDB_CODE_SUCCESS == code) {
code = (NULL == taosArrayPush(pDataBlocks, &dst) ? TSDB_CODE_TSC_OUT_OF_MEMORY : TSDB_CODE_SUCCESS); code = (NULL == taosArrayPush(pDataBlocks, &dst) ? TSDB_CODE_OUT_OF_MEMORY : TSDB_CODE_SUCCESS);
} }
} }
......
...@@ -448,7 +448,6 @@ int32_t cloneTableMeta(STableMeta* pSrc, STableMeta** pDst) { ...@@ -448,7 +448,6 @@ int32_t cloneTableMeta(STableMeta* pSrc, STableMeta** pDst) {
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
void freeVgInfo(SDBVgInfo* vgInfo) { void freeVgInfo(SDBVgInfo* vgInfo) {
if (NULL == vgInfo) { if (NULL == vgInfo) {
return; return;
...@@ -460,7 +459,6 @@ void freeVgInfo(SDBVgInfo* vgInfo) { ...@@ -460,7 +459,6 @@ void freeVgInfo(SDBVgInfo* vgInfo) {
taosMemoryFreeClear(vgInfo); taosMemoryFreeClear(vgInfo);
} }
int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst) { int32_t cloneDbVgInfo(SDBVgInfo* pSrc, SDBVgInfo** pDst) {
if (NULL == pSrc) { if (NULL == pSrc) {
*pDst = NULL; *pDst = NULL;
...@@ -508,7 +506,7 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) { ...@@ -508,7 +506,7 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) {
*pDst = taosMemoryCalloc(1, sizeof(SVCreateTbReq)); *pDst = taosMemoryCalloc(1, sizeof(SVCreateTbReq));
if (NULL == *pDst) { if (NULL == *pDst) {
return TSDB_CODE_TSC_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY;
} }
(*pDst)->flags = pSrc->flags; (*pDst)->flags = pSrc->flags;
...@@ -533,7 +531,7 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) { ...@@ -533,7 +531,7 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) {
if (pSrc->ctb.tagName) { if (pSrc->ctb.tagName) {
(*pDst)->ctb.tagName = taosArrayDup(pSrc->ctb.tagName, NULL); (*pDst)->ctb.tagName = taosArrayDup(pSrc->ctb.tagName, NULL);
} }
STag* pTag = (STag *)pSrc->ctb.pTag; STag* pTag = (STag*)pSrc->ctb.pTag;
if (pTag) { if (pTag) {
(*pDst)->ctb.pTag = taosMemoryMalloc(pTag->len); (*pDst)->ctb.pTag = taosMemoryMalloc(pTag->len);
memcpy((*pDst)->ctb.pTag, pTag, pTag->len); memcpy((*pDst)->ctb.pTag, pTag, pTag->len);
...@@ -549,5 +547,3 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) { ...@@ -549,5 +547,3 @@ int32_t cloneSVreateTbReq(SVCreateTbReq* pSrc, SVCreateTbReq** pDst) {
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -270,7 +270,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa ...@@ -270,7 +270,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
SCH_ERR_JRET(code); SCH_ERR_JRET(code);
} }
atomic_add_fetch_32(&pJob->resNumOfRows, rsp->affectedRows); atomic_add_fetch_64(&pJob->resNumOfRows, rsp->affectedRows);
int32_t createTbRspNum = taosArrayGetSize(rsp->aCreateTbRsp); int32_t createTbRspNum = taosArrayGetSize(rsp->aCreateTbRsp);
SCH_TASK_DLOG("submit succeed, affectedRows:%d, createTbRspNum:%d", rsp->affectedRows, createTbRspNum); SCH_TASK_DLOG("submit succeed, affectedRows:%d, createTbRspNum:%d", rsp->affectedRows, createTbRspNum);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册