fix: skip empty result optimization when partition

This commit is contained in:
factosea 2024-01-15 15:51:18 +08:00
parent c710718f9e
commit 52aa6f280e
1 changed files with 2 additions and 1 deletions

View File

@ -4405,7 +4405,8 @@ static int32_t translateWhere(STranslateContext* pCxt, SSelectStmt* pSelect) {
if (TSDB_CODE_SUCCESS == code) {
code = getQueryTimeRange(pCxt, pSelect->pWhere, &pSelect->timeRange);
}
if (TSDB_CODE_SUCCESS == code && pSelect->timeRange.skey > pSelect->timeRange.ekey) {
if (TSDB_CODE_SUCCESS == code && pSelect->timeRange.skey > pSelect->timeRange.ekey
&& (pSelect->pGroupByList == NULL || pSelect->pGroupByList->length == 0)) {
pSelect->isEmptyResult = true;
}
if (pSelect->pWhere != NULL) {