[FEAT MERGE] OB Support XMLType

Co-authored-by: simonjoylet <simonjoylet@gmail.com>
This commit is contained in:
obdev
2023-04-28 03:45:10 +00:00
committed by ob-robot
parent 58bb3d34b7
commit 17abf2818a
405 changed files with 18839 additions and 1573 deletions

View File

@ -322,8 +322,17 @@ int ObExprNullif::eval_nullif(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res)
} else if (ObNullType == cast_info->cmp_meta_.type_) {
// can compare directly.
DatumCmpFunc cmp_func = reinterpret_cast<DatumCmpFunc>(expr.inner_functions_[0]);
bool equal = cmp_e1->is_null() ? false : (0 == cmp_func(*cmp_e0, *cmp_e1));
if (equal) {
int cmp_ret = 0;
bool equal = false;
if (!cmp_e1->is_null()) {
if (OB_FAIL(cmp_func(*cmp_e0, *cmp_e1, cmp_ret))) {
LOG_WARN("cmp failed", K(ret));
} else {
equal = (0 == cmp_ret);
}
}
if (OB_FAIL(ret)) {
} else if (equal) {
res.set_null();
} else if (OB_FAIL(cast_result(*expr.args_[0], expr, ctx, cast_info->cm_, res))) {
LOG_WARN("cast result failed", K(ret));
@ -345,8 +354,10 @@ int ObExprNullif::eval_nullif(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res)
tmp_alloc_guard.get_allocator(), datum2))) {
LOG_WARN("cast param failed", K(ret));
} else {
bool equal = (0 == cmp_func(datum1, datum2));
if (equal) {
int cmp_ret = 0;
if (OB_FAIL(cmp_func(datum1, datum2, cmp_ret))) {
LOG_WARN("cmp failed", K(ret));
} else if (cmp_ret == 0) {
res.set_null();
} else if (OB_FAIL(cast_result(*expr.args_[0], expr, ctx, cast_info->cm_, res))) {
LOG_WARN("cast result failed", K(ret));