[FEAT MERGE] OB Support XMLType
Co-authored-by: simonjoylet <simonjoylet@gmail.com>
This commit is contained in:
@ -49,17 +49,24 @@ int calc_between_expr(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res_datum)
|
||||
} else {
|
||||
bool left_cmp_succ = true; // is left <= val true or not
|
||||
bool right_cmp_succ = true; // is val <= right true or not
|
||||
int cmp_ret = 0;
|
||||
if (!left->is_null()) {
|
||||
left_cmp_succ =
|
||||
(reinterpret_cast<DatumCmpFunc>(expr.inner_functions_[0]))(*left, *val) <= 0 ?
|
||||
true : false;
|
||||
if (OB_FAIL((reinterpret_cast<DatumCmpFunc>(expr.inner_functions_[0]))(*left, *val, cmp_ret))) {
|
||||
LOG_WARN("compare left failed", K(ret));
|
||||
} else {
|
||||
left_cmp_succ = cmp_ret <= 0 ? true : false;
|
||||
}
|
||||
}
|
||||
if (left->is_null() || (left_cmp_succ && !right->is_null())) {
|
||||
right_cmp_succ =
|
||||
(reinterpret_cast<DatumCmpFunc>(expr.inner_functions_[1]))(*val, *right) <= 0 ?
|
||||
true : false;
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (left->is_null() || (left_cmp_succ && !right->is_null())) {
|
||||
if (OB_FAIL((reinterpret_cast<DatumCmpFunc>(expr.inner_functions_[1]))(*val, *right, cmp_ret))) {
|
||||
LOG_WARN("compare left failed", K(ret));
|
||||
} else {
|
||||
right_cmp_succ = cmp_ret <= 0 ? true : false;
|
||||
}
|
||||
}
|
||||
if ((left->is_null() && right_cmp_succ) || (right->is_null() && left_cmp_succ)) {
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if ((left->is_null() && right_cmp_succ) || (right->is_null() && left_cmp_succ)) {
|
||||
res_datum.set_null();
|
||||
} else if (left_cmp_succ && right_cmp_succ) {
|
||||
res_datum.set_int32(1);
|
||||
|
||||
Reference in New Issue
Block a user