fix: remove constant partition

This commit is contained in:
dapan1121 2023-08-31 13:52:37 +08:00
parent 20552290cd
commit 1709ab4849
1 changed files with 5 additions and 4 deletions

View File

@ -3749,10 +3749,6 @@ static int32_t removeConstantValueFromList(SNodeList** pList) {
static int32_t translatePartitionBy(STranslateContext* pCxt, SSelectStmt* pSelect) {
pCxt->currClause = SQL_CLAUSE_PARTITION_BY;
int32_t code = TSDB_CODE_SUCCESS;
if (pSelect->pPartitionByList) {
code = removeConstantValueFromList(&pSelect->pPartitionByList);
}
if (TSDB_CODE_SUCCESS == code && pSelect->pPartitionByList) {
int8_t typeType = getTableTypeFromTableNode(pSelect->pFromTable);
@ -3964,6 +3960,11 @@ static int32_t translateSelectFrom(STranslateContext* pCxt, SSelectStmt* pSelect
if (TSDB_CODE_SUCCESS == code) {
code = replaceTbName(pCxt, pSelect);
}
if (TSDB_CODE_SUCCESS == code) {
if (pSelect->pPartitionByList) {
code = removeConstantValueFromList(&pSelect->pPartitionByList);
}
}
return code;
}