Merge pull request #22664 from taosdata/fix/TD-26046
fix: remove constant partition
This commit is contained in:
commit
20a9ab16e0
|
@ -3750,10 +3750,6 @@ static int32_t translatePartitionBy(STranslateContext* pCxt, SSelectStmt* pSelec
|
||||||
pCxt->currClause = SQL_CLAUSE_PARTITION_BY;
|
pCxt->currClause = SQL_CLAUSE_PARTITION_BY;
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
|
|
||||||
if (pSelect->pPartitionByList) {
|
|
||||||
code = removeConstantValueFromList(&pSelect->pPartitionByList);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TSDB_CODE_SUCCESS == code && pSelect->pPartitionByList) {
|
if (TSDB_CODE_SUCCESS == code && pSelect->pPartitionByList) {
|
||||||
int8_t typeType = getTableTypeFromTableNode(pSelect->pFromTable);
|
int8_t typeType = getTableTypeFromTableNode(pSelect->pFromTable);
|
||||||
SNode* pPar = nodesListGetNode(pSelect->pPartitionByList, 0);
|
SNode* pPar = nodesListGetNode(pSelect->pPartitionByList, 0);
|
||||||
|
@ -3964,6 +3960,11 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = replaceTbName(pCxt, pSelect);
|
code = replaceTbName(pCxt, pSelect);
|
||||||
}
|
}
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
if (pSelect->pPartitionByList) {
|
||||||
|
code = removeConstantValueFromList(&pSelect->pPartitionByList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue