未验证 提交 107f97e9 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #19903 from taosdata/fix/TS-2581-2.6

fix(query): fix filterInfo->cunit not allocated caused crash
...@@ -3732,7 +3732,7 @@ int32_t filterGetTimeRange(SFilterInfo *info, STimeWindow *win) { ...@@ -3732,7 +3732,7 @@ int32_t filterGetTimeRange(SFilterInfo *info, STimeWindow *win) {
SFilterRange tra; SFilterRange tra;
filterGetRangeRes(prev, &tra); filterGetRangeRes(prev, &tra);
win->skey = tra.s; win->skey = tra.s;
win->ekey = tra.e; win->ekey = tra.e;
} }
...@@ -3786,7 +3786,7 @@ int32_t filterConverNcharColumns(SFilterInfo* info, int32_t rows, bool *gotNchar ...@@ -3786,7 +3786,7 @@ int32_t filterConverNcharColumns(SFilterInfo* info, int32_t rows, bool *gotNchar
} }
fi->data = nfi.data; fi->data = nfi.data;
*gotNchar = true; *gotNchar = true;
} }
} }
...@@ -3820,22 +3820,27 @@ int32_t filterIsIndexedColumnQuery(SFilterInfo* info, int32_t idxId, bool *res) ...@@ -3820,22 +3820,27 @@ int32_t filterIsIndexedColumnQuery(SFilterInfo* info, int32_t idxId, bool *res)
CHK_JMP(FILTER_GET_COL_FIELD_ID(FILTER_GET_COL_FIELD(info, 0)) != idxId); CHK_JMP(FILTER_GET_COL_FIELD_ID(FILTER_GET_COL_FIELD(info, 0)) != idxId);
int32_t optr = FILTER_UNIT_OPTR(info->units); int32_t optr = FILTER_UNIT_OPTR(info->units);
CHK_JMP(optr == TSDB_RELATION_LIKE || optr == TSDB_RELATION_IN || optr == TSDB_RELATION_MATCH CHK_JMP(optr == TSDB_RELATION_LIKE || optr == TSDB_RELATION_IN || optr == TSDB_RELATION_MATCH
|| optr == TSDB_RELATION_ISNULL || optr == TSDB_RELATION_NOTNULL || optr == TSDB_RELATION_CONTAINS); || optr == TSDB_RELATION_ISNULL || optr == TSDB_RELATION_NOTNULL || optr == TSDB_RELATION_CONTAINS);
*res = true; *res = true;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
_return: _return:
*res = false; *res = false;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
int32_t filterGetIndexedColumnInfo(SFilterInfo* info, char** val, int32_t *order, int32_t *flag) { int32_t filterGetIndexedColumnInfo(SFilterInfo* info, char** val, int32_t *order, int32_t *flag) {
if (FILTER_GET_FLAG(info->status, FI_STATUS_EMPTY)) {
*order = 0;
return TSDB_CODE_SUCCESS;
}
SFilterComUnit *cunit = info->cunits; SFilterComUnit *cunit = info->cunits;
uint8_t optr = cunit->optr; uint8_t optr = cunit->optr;
...@@ -3853,7 +3858,7 @@ int32_t filterGetIndexedColumnInfo(SFilterInfo* info, char** val, int32_t *order ...@@ -3853,7 +3858,7 @@ int32_t filterGetIndexedColumnInfo(SFilterInfo* info, char** val, int32_t *order
if (cunit->valData2 == cunit->valData && optr != TSDB_RELATION_EQUAL) { if (cunit->valData2 == cunit->valData && optr != TSDB_RELATION_EQUAL) {
FILTER_SET_FLAG(*flag, FI_ACTION_NO_NEED); FILTER_SET_FLAG(*flag, FI_ACTION_NO_NEED);
} }
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册