diff --git a/src/query/inc/qFilter.h b/src/query/inc/qFilter.h index dcfbe7f0952bffe49caa2b7869d994935c47ac3f..e1b81f264813ea719dd0f21ce1d6aaa8e4bcab00 100644 --- a/src/query/inc/qFilter.h +++ b/src/query/inc/qFilter.h @@ -181,6 +181,7 @@ typedef struct SFilterColInfo { uint8_t type; int32_t dataType; uint8_t optr; // for equal operation in the relation of RELATION_IN + int64_t value; // for equal operation in the relation of RELATION_IN void *info; } SFilterColInfo; diff --git a/src/query/src/qFilter.c b/src/query/src/qFilter.c index d3d96fae337c34a272447868f5d10cda5f19e888..0a8a613c6e70ddd70b9ad20ce5a3def91702541d 100644 --- a/src/query/src/qFilter.c +++ b/src/query/src/qFilter.c @@ -1988,8 +1988,9 @@ int32_t filterMergeUnits(SFilterInfo *info, SFilterGroupCtx* gRes, uint16_t colI filterAddUnitRange(info, u, ctx, TSDB_RELATION_AND); CHK_JMP(MR_EMPTY_RES(ctx)); } - if(FILTER_UNIT_OPTR(u) == TSDB_RELATION_EQUAL){ + if(FILTER_UNIT_OPTR(u) == TSDB_RELATION_EQUAL && !FILTER_NO_MERGE_DATA_TYPE(FILTER_UNIT_DATA_TYPE(u))){ gRes->colInfo[colIdx].optr = TSDB_RELATION_EQUAL; + SIMPLE_COPY_VALUES(&gRes->colInfo[colIdx].value, FILTER_UNIT_VAL_DATA(info, u)); } } @@ -2102,15 +2103,18 @@ void filterCheckColConflict(SFilterGroupCtx* gRes1, SFilterGroupCtx* gRes2, bool continue; } - // for long in operation - if (gRes1->colInfo[idx1].optr == TSDB_RELATION_EQUAL && gRes2->colInfo[idx2].optr == TSDB_RELATION_EQUAL) { + if (FILTER_NO_MERGE_DATA_TYPE(gRes1->colInfo[idx1].dataType)) { *conflict = true; return; } - if (FILTER_NO_MERGE_DATA_TYPE(gRes1->colInfo[idx1].dataType)) { - *conflict = true; - return; + // for long in operation + if (gRes1->colInfo[idx1].optr == TSDB_RELATION_EQUAL && gRes2->colInfo[idx2].optr == TSDB_RELATION_EQUAL) { + SFilterRangeCtx* ctx = gRes1->colInfo[idx1].info; + if (ctx->pCompareFunc(&gRes1->colInfo[idx1].value, &gRes2->colInfo[idx2].value)){ + *conflict = true; + return; + } } ++n;