fix expr in short path result wrong in oracle mode
This commit is contained in:
parent
34b77b6f1e
commit
abd9427b1c
@ -1078,6 +1078,11 @@ int ObExprInOrNotIn::eval_batch_in_without_row_fallback(const ObExpr &expr,
|
|||||||
*/
|
*/
|
||||||
bool can_cmp_mem = expr.args_[0]->obj_meta_.is_string_type()
|
bool can_cmp_mem = expr.args_[0]->obj_meta_.is_string_type()
|
||||||
&& CS_TYPE_UTF8MB4_BIN == expr.args_[0]->obj_meta_.get_collation_type();
|
&& CS_TYPE_UTF8MB4_BIN == expr.args_[0]->obj_meta_.get_collation_type();
|
||||||
|
bool is_calc_with_end_space = expr.inner_func_cnt_ <= 0 ? true : common::is_calc_with_end_space(expr.args_[0]->obj_meta_.get_type(),
|
||||||
|
expr.args_[1]->args_[0]->obj_meta_.get_type(),
|
||||||
|
lib::is_oracle_mode(),
|
||||||
|
expr.args_[0]->obj_meta_.get_collation_type(),
|
||||||
|
expr.args_[1]->args_[0]->obj_meta_.get_collation_type());
|
||||||
//eval all right params
|
//eval all right params
|
||||||
for (int64_t j = 0; OB_SUCC(ret) && j < expr.inner_func_cnt_; ++j) {
|
for (int64_t j = 0; OB_SUCC(ret) && j < expr.inner_func_cnt_; ++j) {
|
||||||
if (OB_FAIL(expr.args_[1]->args_[j]->eval(ctx, right_store[j]))) {
|
if (OB_FAIL(expr.args_[1]->args_[j]->eval(ctx, right_store[j]))) {
|
||||||
@ -1100,12 +1105,10 @@ int ObExprInOrNotIn::eval_batch_in_without_row_fallback(const ObExpr &expr,
|
|||||||
} else {
|
} else {
|
||||||
bool is_equal = false;
|
bool is_equal = false;
|
||||||
left = &input_left[i];
|
left = &input_left[i];
|
||||||
is_equal = (left->len_ >= len0
|
is_equal = ((left->len_ == len0 && 0 == MEMCMP(ptr0, left->ptr_, len0))
|
||||||
&& 0 == MEMCMP(ptr0, left->ptr_, len0)
|
|| (!is_calc_with_end_space && left->len_ > len0 && is_all_space(left->ptr_ + len0, left->len_ - len0)));
|
||||||
&& is_all_space(left->ptr_ + len0, left->len_ - len0));
|
is_equal = is_equal || ((left->len_ == len1 && 0 == MEMCMP(ptr0, left->ptr_, len1))
|
||||||
is_equal = is_equal || (left->len_ >= len1
|
|| (!is_calc_with_end_space && left->len_ > len1 && is_all_space(left->ptr_ + len1, left->len_ - len1)));
|
||||||
&& 0 == MEMCMP(ptr1, left->ptr_, len1)
|
|
||||||
&& is_all_space(left->ptr_ + len1, left->len_ - len1));
|
|
||||||
results[i].set_int(is_equal);
|
results[i].set_int(is_equal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user