fix: stream and columns in targets issue

This commit is contained in:
dapan1121 2025-02-18 11:10:11 +08:00
parent f19f790131
commit cbfc52427e
2 changed files with 11 additions and 1 deletions

View File

@ -407,7 +407,7 @@ static int32_t makeScanLogicNode(SLogicPlanContext* pCxt, SRealTableNode* pRealT
static bool needScanDefaultCol(EScanType scanType) { return SCAN_TYPE_TABLE_COUNT != scanType; }
static int32_t updateScanNoPseudoRefAfterGrp(SSelectStmt* pSelect, SScanLogicNode* pScan, SRealTableNode* pRealTable) {
if (NULL == pScan->pScanPseudoCols || pScan->pScanPseudoCols->length <= 0) {
if (NULL == pScan->pScanPseudoCols || pScan->pScanPseudoCols->length <= 0 || NULL != pSelect->pTags) {
return TSDB_CODE_SUCCESS;
}

View File

@ -3307,6 +3307,16 @@ static int32_t partTagsOptRemovePseudoCols(SScanLogicNode* pScan) {
return TSDB_CODE_SUCCESS;
}
SNode* pNode = NULL, *pTarget = NULL;
FOREACH(pNode, pScan->pScanPseudoCols) {
FOREACH(pTarget, pScan->node.pTargets) {
if (0 == strcmp(((SExprNode*)pNode)->aliasName, ((SColumnNode*)pTarget)->colName)) {
ERASE_NODE(pScan->node.pTargets);
break;
}
}
}
nodesDestroyList(pScan->pScanPseudoCols);
pScan->pScanPseudoCols = NULL;