fix(query): fix null ptr access in evaluation block distribution.

This commit is contained in:
Haojun Liao 2022-12-01 22:17:53 +08:00
parent 24614d03bd
commit 1faf616f1d
1 changed files with 20 additions and 17 deletions

View File

@ -1874,27 +1874,30 @@ static void destroyBlockDistScanOperatorInfo(void* param) {
} }
static int32_t initTableblockDistQueryCond(uint64_t uid, SQueryTableDataCond* pCond) { static int32_t initTableblockDistQueryCond(uint64_t uid, SQueryTableDataCond* pCond) {
memset(pCond, 0, sizeof(SQueryTableDataCond)); memset(pCond, 0, sizeof(SQueryTableDataCond));
pCond->order = TSDB_ORDER_ASC; pCond->order = TSDB_ORDER_ASC;
pCond->numOfCols = 1; pCond->numOfCols = 1;
pCond->colList = taosMemoryCalloc(1, sizeof(SColumnInfo)); pCond->colList = taosMemoryCalloc(1, sizeof(SColumnInfo));
if (pCond->colList == NULL) { pCond->pSlotList = taosMemoryMalloc(sizeof(int32_t));
terrno = TSDB_CODE_QRY_OUT_OF_MEMORY; if (pCond->colList == NULL || pCond->pSlotList == NULL) {
return terrno; terrno = TSDB_CODE_QRY_OUT_OF_MEMORY;
} return terrno;
}
pCond->colList->colId = 1; pCond->colList->colId = 1;
pCond->colList->type = TSDB_DATA_TYPE_TIMESTAMP; pCond->colList->type = TSDB_DATA_TYPE_TIMESTAMP;
pCond->colList->bytes = sizeof(TSKEY); pCond->colList->bytes = sizeof(TSKEY);
pCond->twindows = (STimeWindow){.skey = INT64_MIN, .ekey = INT64_MAX}; pCond->pSlotList[0] = 0;
pCond->suid = uid;
pCond->type = TIMEWINDOW_RANGE_CONTAINED;
pCond->startVersion = -1;
pCond->endVersion = -1;
return TSDB_CODE_SUCCESS; pCond->twindows = (STimeWindow){.skey = INT64_MIN, .ekey = INT64_MAX};
pCond->suid = uid;
pCond->type = TIMEWINDOW_RANGE_CONTAINED;
pCond->startVersion = -1;
pCond->endVersion = -1;
return TSDB_CODE_SUCCESS;
} }
SOperatorInfo* createDataBlockInfoScanOperator(SReadHandle* readHandle, SBlockDistScanPhysiNode* pBlockScanNode, SOperatorInfo* createDataBlockInfoScanOperator(SReadHandle* readHandle, SBlockDistScanPhysiNode* pBlockScanNode,