[BUGFIX] fix nullsafe cmp func serialize

This commit is contained in:
obdev
2023-02-09 14:34:23 +00:00
committed by ob-robot
parent ead52c09f3
commit c372e5d736
3 changed files with 37 additions and 1 deletions

View File

@ -1139,6 +1139,37 @@ REG_SER_FUNC_ARRAY(OB_SFA_DATUM_NULLSAFE_STR_CMP,
NULLSAFE_STR_CMP_FUNCS,
sizeof(NULLSAFE_STR_CMP_FUNCS) / sizeof(void*));
static_assert(CS_TYPE_MAX * 2 * 2 == sizeof(NULLSAFE_TEXT_CMP_FUNCS) / sizeof(void *),
"unexpected size");
REG_SER_FUNC_ARRAY(OB_SFA_DATUM_NULLSAFE_TEXT_CMP,
NULLSAFE_TEXT_CMP_FUNCS,
sizeof(NULLSAFE_TEXT_CMP_FUNCS) / sizeof(void*));
static_assert(CS_TYPE_MAX * 2 * 2 == sizeof(NULLSAFE_TEXT_STR_CMP_FUNCS) / sizeof(void *),
"unexpected size");
REG_SER_FUNC_ARRAY(OB_SFA_DATUM_NULLSAFE_TEXT_STR_CMP,
NULLSAFE_TEXT_STR_CMP_FUNCS,
sizeof(NULLSAFE_TEXT_STR_CMP_FUNCS) / sizeof(void*));
static_assert(CS_TYPE_MAX * 2 * 2 == sizeof(NULLSAFE_STR_TEXT_CMP_FUNCS) / sizeof(void *),
"unexpected size");
REG_SER_FUNC_ARRAY(OB_SFA_DATUM_NULLSAFE_STR_TEXT_CMP,
NULLSAFE_STR_TEXT_CMP_FUNCS,
sizeof(NULLSAFE_STR_TEXT_CMP_FUNCS) / sizeof(void*));
static_assert(2 * 2 == sizeof(NULLSAFE_JSON_CMP_FUNCS) / sizeof(void *),
"unexpected size");
REG_SER_FUNC_ARRAY(OB_SFA_DATUM_NULLSAFE_JSON_CMP,
NULLSAFE_JSON_CMP_FUNCS,
sizeof(NULLSAFE_JSON_CMP_FUNCS) / sizeof(void*));
static_assert(2 * 2 == sizeof(NULLSAFE_GEO_CMP_FUNCS) / sizeof(void *),
"unexpected size");
REG_SER_FUNC_ARRAY(OB_SFA_DATUM_NULLSAFE_GEO_CMP,
NULLSAFE_GEO_CMP_FUNCS,
sizeof(NULLSAFE_GEO_CMP_FUNCS) / sizeof(void*));
static_assert(OB_NOT_FIXED_SCALE * 2 == sizeof(FIXED_DOUBLE_CMP_FUNCS) / sizeof(void *),
"unexpected size");
REG_SER_FUNC_ARRAY(OB_SFA_FIXED_DOUBLE_NULLSAFE_CMP,

View File

@ -67,7 +67,7 @@ int ObExprUnhex::eval_unhex(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res_dat
expr.args_[0]->datum_meta_, expr.args_[0]->obj_meta_.has_lob_header(), str))) {
LOG_WARN("failed to get real string data", K(ret));
} else {
ret = OB_FAIL(ObDatumHexUtils::unhex(expr, str, ctx, res_datum, has_set_res));
ret = ObDatumHexUtils::unhex(expr, str, ctx, res_datum, has_set_res);
}
}
if (OB_FAIL(ret)) {

View File

@ -90,6 +90,11 @@ typedef void (*ser_eval_batch_function)(ObBatchEvalFuncTag &);
OB_SFA_RELATION_EXPR_EVAL_GEO, \
OB_SFA_RELATION_EXPR_GEO_EVAL_BATCH, \
OB_SFA_DATUM_CMP_GEO, \
OB_SFA_DATUM_NULLSAFE_TEXT_CMP, \
OB_SFA_DATUM_NULLSAFE_TEXT_STR_CMP, \
OB_SFA_DATUM_NULLSAFE_STR_TEXT_CMP, \
OB_SFA_DATUM_NULLSAFE_JSON_CMP, \
OB_SFA_DATUM_NULLSAFE_GEO_CMP, \
OB_SFA_MAX
enum ObSerFuncArrayID {