fix: fix asan issues
This commit is contained in:
parent
fc19382a15
commit
d985cb714f
|
@ -336,6 +336,10 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) {
|
|||
__compar_fn_t filterGetCompFunc(int32_t type, int32_t optr) { return gDataCompare[filterGetCompFuncIdx(type, optr)]; }
|
||||
|
||||
__compar_fn_t filterGetCompFuncEx(int32_t lType, int32_t rType, int32_t optr) {
|
||||
if (TSDB_DATA_TYPE_NULL == rType) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (lType) {
|
||||
case TSDB_DATA_TYPE_TINYINT: {
|
||||
if (IS_SIGNED_NUMERIC_TYPE(rType) || IS_FLOAT_TYPE(rType)) {
|
||||
|
|
|
@ -599,7 +599,9 @@ int32_t sclWalkCaseWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell*
|
|||
|
||||
bool *equal = (bool*)colDataGetData(pComp->columnData, rowIdx);
|
||||
if (*equal) {
|
||||
colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)));
|
||||
bool isNull = colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0));
|
||||
char *pData = isNull ? NULL : colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0));
|
||||
colDataAppend(output->columnData, rowIdx, pData, isNull);
|
||||
|
||||
if (0 == rowIdx && 1 == pCase->numOfRows && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && totalRows > 1) {
|
||||
SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList));
|
||||
|
@ -611,7 +613,9 @@ int32_t sclWalkCaseWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell*
|
|||
}
|
||||
|
||||
if (pElse) {
|
||||
colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)));
|
||||
bool isNull = colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0));
|
||||
char *pData = isNull ? NULL : colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0));
|
||||
colDataAppend(output->columnData, rowIdx, pData, isNull);
|
||||
|
||||
if (0 == rowIdx && 1 == pCase->numOfRows && 1 == pElse->numOfRows && totalRows > 1) {
|
||||
SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList));
|
||||
|
@ -657,7 +661,9 @@ int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCe
|
|||
bool *whenValue = (bool*)colDataGetData(pWhen->columnData, (pWhen->numOfRows > 1 ? rowIdx : 0));
|
||||
|
||||
if (*whenValue) {
|
||||
colDataAppend(output->columnData, rowIdx, colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0)));
|
||||
bool isNull = colDataIsNull_s(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0));
|
||||
char *pData = isNull ? NULL : colDataGetData(pThen->columnData, (pThen->numOfRows > 1 ? rowIdx : 0));
|
||||
colDataAppend(output->columnData, rowIdx, pData, isNull);
|
||||
|
||||
if (preSingle && 0 == rowIdx && 1 == pWhen->numOfRows && 1 == pThen->numOfRows && totalRows > 1) {
|
||||
SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList));
|
||||
|
@ -674,7 +680,9 @@ int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCe
|
|||
}
|
||||
|
||||
if (pElse) {
|
||||
colDataAppend(output->columnData, rowIdx, colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)), colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0)));
|
||||
bool isNull = colDataIsNull_s(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0));
|
||||
char *pData = isNull ? NULL : colDataGetData(pElse->columnData, (pElse->numOfRows > 1 ? rowIdx : 0));
|
||||
colDataAppend(output->columnData, rowIdx, pData, isNull);
|
||||
|
||||
if (preSingle && 0 == rowIdx && 1 == pElse->numOfRows && totalRows > 1) {
|
||||
SCL_ERR_JRET(sclExtendResRows(output, output, ctx->pBlockList));
|
||||
|
|
Loading…
Reference in New Issue