[FEAT MERGE] Lob SQL refactoring (Mem-LobLocator, expressions and dbms_lob adaptions)

Co-authored-by: chaser-ch <chaser.ch@antgroup.com>
This commit is contained in:
obdev
2023-01-28 20:40:15 +08:00
committed by ob-robot
parent 4bb1033505
commit 3d4f554258
350 changed files with 19091 additions and 3918 deletions

View File

@ -19,6 +19,7 @@
#include "sql/engine/ob_physical_plan_ctx.h"
#include "sql/engine/ob_physical_plan.h"
#include "sql/engine/expr/ob_expr_regexp_count.h"
#include "sql/engine/expr/ob_expr_lob_utils.h"
using namespace oceanbase::common;
@ -227,6 +228,7 @@ int ObExprRegexpInstr::eval_regexp_instr(
bool is_case_sensitive = ObCharset::is_bin_sort(expr.args_[0]->datum_meta_.cs_type_);
uint32_t flags = 0;
ObString text_utf16;
ObString text_str;
bool is_null = true;
if (reusable) {
if (NULL == (regexp_ctx = static_cast<ObExprRegexContext *>(
@ -239,6 +241,7 @@ int ObExprRegexpInstr::eval_regexp_instr(
}
}
}
if (OB_FAIL(ret)) {
} else if (OB_FAIL(ObExprRegexContext::get_regexp_flags(match_param, is_case_sensitive, flags))) {
LOG_WARN("fail to get regexp flags", K(ret), K(match_param));
@ -247,6 +250,15 @@ int ObExprRegexpInstr::eval_regexp_instr(
ctx.exec_ctx_.get_my_session(),
pattern->get_string(), flags, reusable, expr.args_[1]->datum_meta_.cs_type_))) {
LOG_WARN("fail to init regexp", K(pattern), K(flags), K(ret));
} else if (ob_is_text_tc(expr.args_[0]->datum_meta_.type_)) {
if (OB_FAIL(ObTextStringHelper::get_string(expr, tmp_alloc, 0, text, text_str))) {
LOG_WARN("get text string failed", K(ret));
}
} else {
text_str = text->get_string();
}
if (OB_FAIL(ret)) {
} else if (text->is_null() || pattern->is_null() || null_result ||
(NULL != position && position->is_null()) ||
(NULL != occurrence && occurrence->is_null()) ||
@ -258,13 +270,13 @@ int ObExprRegexpInstr::eval_regexp_instr(
is_null = false;
if (expr.args_[0]->datum_meta_.cs_type_ == CS_TYPE_UTF8MB4_BIN ||
expr.args_[0]->datum_meta_.cs_type_ == CS_TYPE_UTF8MB4_GENERAL_CI) {
if (OB_FAIL(ObExprUtil::convert_string_collation(text->get_string(), expr.args_[0]->datum_meta_.cs_type_, text_utf16,
if (OB_FAIL(ObExprUtil::convert_string_collation(text_str, expr.args_[0]->datum_meta_.cs_type_, text_utf16,
ObCharset::is_bin_sort(expr.args_[0]->datum_meta_.cs_type_) ? CS_TYPE_UTF16_BIN : CS_TYPE_UTF16_GENERAL_CI,
tmp_alloc))) {
LOG_WARN("convert charset failed", K(ret));
}
} else {
text_utf16 = text->get_string();
text_utf16 = text_str;
}
}
if (OB_FAIL(ret) || is_null) {