Merge pull request #18450 from taosdata/fix/liao_cov
fix(query): check for null ptr before extracting info
This commit is contained in:
commit
397a92ee56
|
@ -732,12 +732,13 @@ void destroyMultiwayMergeOperatorInfo(void* param) {
|
|||
|
||||
int32_t getMultiwayMergeExplainExecInfo(SOperatorInfo* pOptr, void** pOptrExplain, uint32_t* len) {
|
||||
ASSERT(pOptr != NULL);
|
||||
SSortExecInfo* pInfo = taosMemoryCalloc(1, sizeof(SSortExecInfo));
|
||||
SSortExecInfo* pSortExecInfo = taosMemoryCalloc(1, sizeof(SSortExecInfo));
|
||||
|
||||
SMultiwayMergeOperatorInfo* pOperatorInfo = (SMultiwayMergeOperatorInfo*)pOptr->info;
|
||||
SMultiwayMergeOperatorInfo* pInfo = (SMultiwayMergeOperatorInfo*)pOptr->info;
|
||||
|
||||
*pSortExecInfo = tsortGetSortExecInfo(pInfo->pSortHandle);
|
||||
*pOptrExplain = pSortExecInfo;
|
||||
|
||||
*pInfo = tsortGetSortExecInfo(pOperatorInfo->pSortHandle);
|
||||
*pOptrExplain = pInfo;
|
||||
*len = sizeof(SSortExecInfo);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -831,14 +831,19 @@ uint64_t tsortGetGroupId(STupleHandle* pVHandle) { return pVHandle->pBlock->info
|
|||
SSortExecInfo tsortGetSortExecInfo(SSortHandle* pHandle) {
|
||||
SSortExecInfo info = {0};
|
||||
|
||||
info.sortBuffer = pHandle->pageSize * pHandle->numOfPages;
|
||||
info.sortMethod = pHandle->inMemSort ? SORT_QSORT_T : SORT_SPILLED_MERGE_SORT_T;
|
||||
info.loops = pHandle->loops;
|
||||
if (pHandle == NULL) {
|
||||
info.sortMethod = SORT_QSORT_T; // by default
|
||||
info.sortBuffer = 2 * 1048576; // 2mb by default
|
||||
} else {
|
||||
info.sortBuffer = pHandle->pageSize * pHandle->numOfPages;
|
||||
info.sortMethod = pHandle->inMemSort ? SORT_QSORT_T : SORT_SPILLED_MERGE_SORT_T;
|
||||
info.loops = pHandle->loops;
|
||||
|
||||
if (pHandle->pBuf != NULL) {
|
||||
SDiskbasedBufStatis st = getDBufStatis(pHandle->pBuf);
|
||||
info.writeBytes = st.flushBytes;
|
||||
info.readBytes = st.loadBytes;
|
||||
if (pHandle->pBuf != NULL) {
|
||||
SDiskbasedBufStatis st = getDBufStatis(pHandle->pBuf);
|
||||
info.writeBytes = st.flushBytes;
|
||||
info.readBytes = st.loadBytes;
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
|
|
Loading…
Reference in New Issue