patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -16,36 +16,40 @@
#include "sql/engine/expr/ob_expr_lower.h"
#include "share/object/ob_obj_cast.h"
#include "sql/parser/ob_item_type.h"
#include "objit/common/ob_item_type.h"
//#include "sql/engine/expr/ob_expr_promotion_util.h"
#include "sql/session/ob_sql_session_info.h"
namespace oceanbase {
using namespace common;
namespace sql {
ObExprLowerUpper::ObExprLowerUpper(ObIAllocator& alloc, ObExprOperatorType type, const char* name, int32_t param_num)
ObExprLowerUpper::ObExprLowerUpper(ObIAllocator &alloc, ObExprOperatorType type, const char *name, int32_t param_num)
: ObStringExprOperator(alloc, type, name, param_num)
{}
ObExprLower::ObExprLower(ObIAllocator& alloc) : ObExprLowerUpper(alloc, T_FUN_SYS_LOWER, N_LOWER, 1)
ObExprLower::ObExprLower(ObIAllocator &alloc)
: ObExprLowerUpper(alloc, T_FUN_SYS_LOWER, N_LOWER, 1)
{}
ObExprUpper::ObExprUpper(ObIAllocator& alloc) : ObExprLowerUpper(alloc, T_FUN_SYS_UPPER, N_UPPER, 1)
ObExprUpper::ObExprUpper(ObIAllocator &alloc)
: ObExprLowerUpper(alloc, T_FUN_SYS_UPPER, N_UPPER, 1)
{}
ObExprNlsLower::ObExprNlsLower(ObIAllocator& alloc)
ObExprNlsLower::ObExprNlsLower(ObIAllocator &alloc)
: ObExprLowerUpper(alloc, T_FUN_SYS_NLS_LOWER, N_NLS_LOWER, PARAM_NUM_UNKNOWN)
{}
ObExprNlsUpper::ObExprNlsUpper(ObIAllocator& alloc)
ObExprNlsUpper::ObExprNlsUpper(ObIAllocator &alloc)
: ObExprLowerUpper(alloc, T_FUN_SYS_NLS_UPPER, N_NLS_UPPER, PARAM_NUM_UNKNOWN)
{}
int ObExprLowerUpper::calc_result_type1(ObExprResType& type, ObExprResType& text, common::ObExprTypeCtx& type_ctx) const
int ObExprLowerUpper::calc_result_type1(ObExprResType &type, ObExprResType &text,
common::ObExprTypeCtx &type_ctx) const
{
int ret = OB_SUCCESS;
const ObSQLSessionInfo* session = type_ctx.get_session();
const ObSQLSessionInfo *session = type_ctx.get_session();
if (OB_ISNULL(session)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("session is NULL", K(ret));
@ -55,6 +59,7 @@ int ObExprLowerUpper::calc_result_type1(ObExprResType& type, ObExprResType& text
OZ(param.push_back(&text));
OZ(aggregate_string_type_and_charset_oracle(*session, param, type));
OZ(deduce_string_param_calc_type_and_charset(*session, type, param));
OX(type.set_length(text.get_calc_length() * get_case_mutiply(type.get_collation_type())));
} else {
if (ObTinyTextType == text.get_type()) {
type.set_type(ObVarcharType);
@ -64,56 +69,26 @@ int ObExprLowerUpper::calc_result_type1(ObExprResType& type, ObExprResType& text
type.set_varchar();
}
text.set_calc_type(type.get_type());
const common::ObLengthSemantics default_length_semantics =
(OB_NOT_NULL(type_ctx.get_session()) ? type_ctx.get_session()->get_actual_nls_length_semantics()
: common::LS_BYTE);
if (ObTinyTextType == text.get_type()) {
type.set_length_semantics(255);
} else {
type.set_length_semantics(text.is_varchar_or_char() ? text.get_length_semantics() : default_length_semantics);
}
const common::ObLengthSemantics default_length_semantics = (OB_NOT_NULL(type_ctx.get_session())
? type_ctx.get_session()->get_actual_nls_length_semantics()
: common::LS_BYTE);
ret = aggregate_charsets_for_string_result(type, &text, 1, type_ctx.get_coll_type());
OX(text.set_calc_collation_type(type.get_collation_type()));
}
OX(type.set_calc_accuracy(text.get_accuracy()));
OX(type.set_length(text.get_length()));
}
return ret;
}
int ObExprLowerUpper::calc_result1(ObObj& result, const ObObj& text, ObExprCtx& expr_ctx) const
{
int ret = OB_SUCCESS;
if (OB_ISNULL(expr_ctx.calc_buf_)) {
ret = OB_NOT_INIT;
LOG_WARN("varchar buffer not init", K(ret));
} else if (text.is_null()) {
result.set_null();
} else if ((lib::is_oracle_mode() && ObVarcharType != text.get_type() && ObCharType != text.get_type() &&
!ob_is_nstring_type(text.get_type()) && !ob_is_text_tc(text.get_type())) ||
(!lib::is_oracle_mode() && ObVarcharType != text.get_type() && !text.is_lob())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(text.get_type()), K(ret));
} else {
ObString m_text = text.get_string();
if (OB_FAIL(calc(result, m_text, result_type_.get_collation_type(), *expr_ctx.calc_buf_))) {
LOG_WARN("failed to calc lower", K(ret), K(text));
} else {
if (!result.is_null()) {
result.set_collation(result_type_);
}
OX(type.set_length(text.get_length()));
}
}
return ret;
}
// For oracle only functions nls_lower/nls_upper
int ObExprLowerUpper::calc_result_typeN(
ObExprResType& type, ObExprResType* texts, int64_t param_num, ObExprTypeCtx& type_ctx) const
int ObExprLowerUpper::calc_result_typeN(ObExprResType &type,
ObExprResType *texts,
int64_t param_num,
ObExprTypeCtx &type_ctx) const
{
int ret = OB_SUCCESS;
const ObSQLSessionInfo* session = type_ctx.get_session();
const ObSQLSessionInfo *session = type_ctx.get_session();
if (OB_ISNULL(session)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("session is NULL", K(ret));
@ -127,76 +102,19 @@ int ObExprLowerUpper::calc_result_typeN(
ret = OB_INVALID_ARGUMENT;
LOG_WARN("Invalid argument", K(ret), K(param_num), K(texts));
} else {
// 根据第一个参数计算即可
ObSEArray<ObExprResType*, 1, ObNullAllocator> param;
OZ(param.push_back(&texts[0]));
OZ(aggregate_string_type_and_charset_oracle(*session, param, type));
OZ(deduce_string_param_calc_type_and_charset(*session, type, param));
OX(type.set_calc_accuracy(texts[0].get_accuracy()));
OX(type.set_length(texts[0].get_length()));
OX(type.set_length(texts[0].get_calc_length() * ObCharset::MAX_CASE_MULTIPLY));
}
return ret;
}
int ObExprLowerUpper::calc_resultN(ObObj& result, const ObObj* objs, int64_t param_num, ObExprCtx& expr_ctx) const
{
int ret = OB_SUCCESS;
if (OB_ISNULL(expr_ctx.calc_buf_) || OB_ISNULL(objs)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected error", K(ret), K(expr_ctx.calc_buf_), K(objs));
} else if (param_num <= 0) {
ret = OB_ERR_NOT_ENOUGH_ARGS_FOR_FUN;
LOG_WARN("nls_lower/nls_upper require at least one parameter", K(ret), K(param_num));
} else if (param_num > 2) {
ret = OB_ERR_TOO_MANY_ARGS_FOR_FUN;
LOG_WARN("nls_lower/nls_upper require at most two parameters", K(ret), K(param_num));
} else if (!share::is_oracle_mode()) {
ret = OB_NOT_SUPPORTED;
LOG_WARN("this function is only available in oracle mode", K(ret));
} else {
const ObObj& first_text = objs[0];
if (first_text.is_null()) {
result.set_null();
} else if (!ob_is_string_type(first_text.get_type())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(first_text.get_type()), K(ret));
} else {
const ObString& m_text = first_text.get_string();
// Set the collation according to nls_parameter
ObCollationType cs_type = result_type_.get_collation_type();
if (param_num == 2) {
const ObObj& second_text_obj = objs[1];
if (second_text_obj.is_null()) {
result.set_null();
} else {
const ObString& second_text = second_text_obj.get_string();
if (false == ObExprOperator::is_valid_nls_param(second_text)) {
ret = OB_ERR_INVALID_NLS_PARAMETER_STRING;
LOG_WARN("invalid nls parameter", K(ret), K(second_text));
} else {
// Do nothing, we only support BINARY for now
}
}
}
if (OB_FAIL(ret)) {
LOG_WARN("failed to calc_resultN", K(ret));
} else if (OB_FAIL(calc(result, m_text, cs_type, *expr_ctx.calc_buf_))) {
LOG_WARN("failed to calc nls_lower/nls_upper", K(ret), K(m_text));
} else {
if (!result.is_null()) {
result.set_collation(result_type_);
result.set_collation_type(cs_type);
}
}
}
}
return ret;
}
int ObExprLowerUpper::calc(ObObj& result, const ObString& text, ObCollationType cs_type, ObIAllocator& string_buf) const
int ObExprLowerUpper::calc(ObObj &result, const ObString &text,
ObCollationType cs_type, ObIAllocator &string_buf) const
{
int ret = OB_SUCCESS;
ObString str_result;
@ -204,14 +122,16 @@ int ObExprLowerUpper::calc(ObObj& result, const ObString& text, ObCollationType
str_result.reset();
} else {
int64_t buf_len = text.length() * get_case_mutiply(cs_type);
char* buf = reinterpret_cast<char*>(string_buf.alloc(buf_len));
char *buf = reinterpret_cast<char *>(string_buf.alloc(buf_len));
if (OB_ISNULL(buf)) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("alloc memory failed", "size", buf_len);
} else {
} else {
// binary collation的casedn什么都没做,所以需要copy
MEMCPY(buf, text.ptr(), text.length());
int32_t out_len = 0;
char* src_str = (get_case_mutiply(cs_type) > 1) ? const_cast<char*>(text.ptr()) : buf;
//gb18030 可能会膨胀,src和dst不同,其他字符集相同
char *src_str = (get_case_mutiply(cs_type) > 1) ? const_cast<char*>(text.ptr()) : buf;
if (OB_FAIL(calc(cs_type, src_str, text.length(), buf, buf_len, out_len))) {
LOG_WARN("failed to calc", K(ret));
}
@ -227,8 +147,8 @@ int ObExprLowerUpper::calc(ObObj& result, const ObString& text, ObCollationType
return ret;
}
int ObExprLower::calc(
const ObCollationType cs_type, char* src, int32_t src_len, char* dst, int32_t dst_len, int32_t& out_len) const
int ObExprLower::calc(const ObCollationType cs_type, char *src, int32_t src_len,
char *dst, int32_t dst_len, int32_t &out_len) const
{
int ret = OB_SUCCESS;
if (OB_ISNULL(src) || OB_ISNULL(dst)) {
@ -240,6 +160,7 @@ int ObExprLower::calc(
return ret;
}
int32_t ObExprLower::get_case_mutiply(const ObCollationType cs_type) const
{
int32_t mutiply_num = 0;
@ -251,8 +172,8 @@ int32_t ObExprLower::get_case_mutiply(const ObCollationType cs_type) const
return mutiply_num;
}
int ObExprUpper::calc(
const ObCollationType cs_type, char* src, int32_t src_len, char* dst, int32_t dst_len, int32_t& out_len) const
int ObExprUpper::calc(const ObCollationType cs_type, char *src, int32_t src_len,
char *dst, int32_t dst_len, int32_t &out_len) const
{
int ret = OB_SUCCESS;
if (OB_ISNULL(src) || OB_ISNULL(dst)) {
@ -264,6 +185,7 @@ int ObExprUpper::calc(
return ret;
}
int32_t ObExprUpper::get_case_mutiply(const ObCollationType cs_type) const
{
int32_t mutiply_num = 0;
@ -275,7 +197,9 @@ int32_t ObExprUpper::get_case_mutiply(const ObCollationType cs_type) const
return mutiply_num;
}
int ObExprLowerUpper::cg_expr_common(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
int ObExprLowerUpper::cg_expr_common(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const
{
UNUSED(op_cg_ctx);
UNUSED(raw_expr);
@ -288,22 +212,26 @@ int ObExprLowerUpper::cg_expr_common(ObExprCGCtx& op_cg_ctx, const ObRawExpr& ra
ret = OB_ERR_UNEXPECTED;
LOG_WARN("children of lower/upper expr is null", K(ret), K(rt_expr.args_));
} else if (FALSE_IT(text_type = rt_expr.args_[0]->datum_meta_.type_)) {
} else if ((is_oracle_mode() && ObVarcharType != text_type && ObCharType != text_type &&
!ob_is_nstring_type(text_type) && !ob_is_text_tc(text_type)) ||
(!is_oracle_mode() && ObVarcharType != text_type && ObLongTextType != text_type)) {
} else if ((is_oracle_mode() && ObVarcharType != text_type
&& ObCharType != text_type && !ob_is_nstring_type(text_type)
&& !ob_is_text_tc(text_type))
|| (!is_oracle_mode() && ObVarcharType != text_type && ObLongTextType != text_type)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(text_type), K(ret));
}
return ret;
}
int ObExprLowerUpper::cg_expr_nls_common(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
int ObExprLowerUpper::cg_expr_nls_common(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const
{
UNUSED(op_cg_ctx);
UNUSED(raw_expr);
int ret = OB_SUCCESS;
if (!is_oracle_mode()) {
ret = OB_NOT_SUPPORTED;
LOG_USER_ERROR(OB_NOT_SUPPORTED, "this function in MySql mode");
LOG_WARN("this function is only supported in Oracle mode", K(ret));
} else if (rt_expr.arg_cnt_ <= 0) {
ret = OB_ERR_NOT_ENOUGH_ARGS_FOR_FUN;
@ -311,8 +239,10 @@ int ObExprLowerUpper::cg_expr_nls_common(ObExprCGCtx& op_cg_ctx, const ObRawExpr
} else if (rt_expr.arg_cnt_ > 2) {
ret = OB_ERR_TOO_MANY_ARGS_FOR_FUN;
LOG_WARN("nls_lower/nls_upper require at most two parameters", K(ret), K(rt_expr.arg_cnt_));
} else if (OB_ISNULL(rt_expr.args_) || OB_ISNULL(rt_expr.args_[0]) ||
(rt_expr.arg_cnt_ == 2 && OB_ISNULL(rt_expr.args_[1]))) {
}
else if (OB_ISNULL(rt_expr.args_)
|| OB_ISNULL(rt_expr.args_[0])
|| (rt_expr.arg_cnt_ == 2 && OB_ISNULL(rt_expr.args_[1]))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("children of lower/upper expr is null", K(ret), K(rt_expr.args_));
}
@ -326,7 +256,9 @@ int ObExprLowerUpper::cg_expr_nls_common(ObExprCGCtx& op_cg_ctx, const ObRawExpr
return ret;
}
int ObExprLower::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
int ObExprLower::cg_expr(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const
{
int ret = OB_SUCCESS;
if (OB_FAIL(cg_expr_common(op_cg_ctx, raw_expr, rt_expr))) {
@ -337,7 +269,9 @@ int ObExprLower::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObEx
return ret;
}
int ObExprUpper::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
int ObExprUpper::cg_expr(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const
{
int ret = OB_SUCCESS;
if (OB_FAIL(cg_expr_common(op_cg_ctx, raw_expr, rt_expr))) {
@ -348,11 +282,11 @@ int ObExprUpper::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObEx
return ret;
}
int ObExprLowerUpper::calc_common(
const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, bool lower, ObCollationType cs_type)
int ObExprLowerUpper::calc_common(const ObExpr &expr, ObEvalCtx &ctx,
ObDatum &expr_datum, bool lower, ObCollationType cs_type)
{
int ret = OB_SUCCESS;
ObDatum* text_datum = NULL;
ObDatum *text_datum = NULL;
if (OB_FAIL(expr.args_[0]->eval(ctx, text_datum))) {
LOG_WARN("eval param value failed", K(ret));
} else if (text_datum->is_null()) {
@ -375,18 +309,21 @@ int ObExprLowerUpper::calc_common(
: ObCharset::get_charset(cs_type)->caseup_multiply);
}
if (OB_SUCC(ret)) {
char* buf = expr.get_str_res_mem(ctx, buf_len);
char *buf = expr.get_str_res_mem(ctx, buf_len);
if (OB_ISNULL(buf)) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("alloc memory failed", "size", buf_len);
} else {
MEMCPY(buf, m_text.ptr(), m_text.length());
int32_t out_len = 0;
char* src_str = (buf_len != m_text.length()) ? const_cast<char*>(m_text.ptr()) : buf;
//gb18030 可能会膨胀,src_str和dst_str要转入不同的buf,其他字符集可以传相同的
char *src_str = (buf_len != m_text.length()) ? const_cast<char*>(m_text.ptr()) : buf;
if (lower) {
out_len = static_cast<int32_t>(ObCharset::casedn(cs_type, src_str, m_text.length(), buf, buf_len));
out_len = static_cast<int32_t>(ObCharset::casedn(cs_type,
src_str, m_text.length(), buf, buf_len));
} else {
out_len = static_cast<int32_t>(ObCharset::caseup(cs_type, src_str, m_text.length(), buf, buf_len));
out_len = static_cast<int32_t>(ObCharset::caseup(cs_type,
src_str, m_text.length(), buf, buf_len));
}
str_result.assign(buf, static_cast<int32_t>(out_len));
}
@ -399,7 +336,8 @@ int ObExprLowerUpper::calc_common(
return ret;
}
int ObExprLowerUpper::calc_nls_common(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum, bool lower)
int ObExprLowerUpper::calc_nls_common(const ObExpr &expr, ObEvalCtx &ctx,
ObDatum &expr_datum, bool lower)
{
int ret = OB_SUCCESS;
if (OB_UNLIKELY(expr.arg_cnt_ <= 0)) {
@ -412,9 +350,9 @@ int ObExprLowerUpper::calc_nls_common(const ObExpr& expr, ObEvalCtx& ctx, ObDatu
if (OB_FAIL(calc_common(expr, ctx, expr_datum, lower, CS_TYPE_INVALID))) {
LOG_WARN("failed to call calc_common", K(ret));
}
} else { // expr.arg_cnt_ == 2
} else { // expr.arg_cnt_ == 2
ObCollationType cs_type = expr.datum_meta_.cs_type_;
ObDatum* param_datum = NULL;
ObDatum *param_datum = NULL;
if (OB_ISNULL(expr.args_[1])) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("failed to get nls parameter", K(ret));
@ -423,13 +361,14 @@ int ObExprLowerUpper::calc_nls_common(const ObExpr& expr, ObEvalCtx& ctx, ObDatu
} else if (param_datum->is_null()) {
// Second param_datum is null, set result null as well.
expr_datum.set_null();
} else {
const ObString& m_param = param_datum->get_string();
}
else {
const ObString &m_param = param_datum->get_string();
if (OB_UNLIKELY(!ObExprOperator::is_valid_nls_param(m_param))) {
ret = OB_ERR_INVALID_NLS_PARAMETER_STRING;
LOG_WARN("invalid nls parameter", K(ret), K(m_param));
} else {
// Should set cs_type here, but for now, we do nothing
// Should set cs_type here, but for now, we do nothing
// since nls parameter only support BINARY
if (OB_FAIL(ret)) {
} else if (OB_FAIL(calc_common(expr, ctx, expr_datum, lower, cs_type))) {
@ -442,18 +381,18 @@ int ObExprLowerUpper::calc_nls_common(const ObExpr& expr, ObEvalCtx& ctx, ObDatu
return ret;
}
int ObExprLower::calc_lower(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum)
int ObExprLower::calc_lower(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum)
{
return calc_common(expr, ctx, expr_datum, true, CS_TYPE_INVALID);
}
int ObExprUpper::calc_upper(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum)
int ObExprUpper::calc_upper(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum)
{
return calc_common(expr, ctx, expr_datum, false, CS_TYPE_INVALID);
}
int ObExprNlsLower::calc(
const ObCollationType cs_type, char* src, int32_t src_len, char* dst, int32_t dst_len, int32_t& out_len) const
int ObExprNlsLower::calc(const ObCollationType cs_type, char *src, int32_t src_len,
char *dst, int32_t dst_len, int32_t &out_len) const
{
int ret = OB_SUCCESS;
if (OB_ISNULL(src) || OB_ISNULL(dst)) {
@ -476,7 +415,9 @@ int32_t ObExprNlsLower::get_case_mutiply(const ObCollationType cs_type) const
return mutiply_num;
}
int ObExprNlsLower::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
int ObExprNlsLower::cg_expr(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const
{
int ret = OB_SUCCESS;
if (OB_FAIL(cg_expr_nls_common(op_cg_ctx, raw_expr, rt_expr))) {
@ -487,13 +428,13 @@ int ObExprNlsLower::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, O
return ret;
}
int ObExprNlsLower::calc_lower(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum)
int ObExprNlsLower::calc_lower(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum)
{
return calc_nls_common(expr, ctx, expr_datum, true);
}
int ObExprNlsUpper::calc(
const ObCollationType cs_type, char* src, int32_t src_len, char* dst, int32_t dst_len, int32_t& out_len) const
int ObExprNlsUpper::calc(const ObCollationType cs_type, char *src, int32_t src_len,
char *dst, int32_t dst_len, int32_t &out_len) const
{
int ret = OB_SUCCESS;
if (OB_ISNULL(src) || OB_ISNULL(dst)) {
@ -516,7 +457,9 @@ int32_t ObExprNlsUpper::get_case_mutiply(const ObCollationType cs_type) const
return mutiply_num;
}
int ObExprNlsUpper::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, ObExpr& rt_expr) const
int ObExprNlsUpper::cg_expr(ObExprCGCtx &op_cg_ctx,
const ObRawExpr &raw_expr,
ObExpr &rt_expr) const
{
int ret = OB_SUCCESS;
if (OB_FAIL(cg_expr_nls_common(op_cg_ctx, raw_expr, rt_expr))) {
@ -527,10 +470,10 @@ int ObExprNlsUpper::cg_expr(ObExprCGCtx& op_cg_ctx, const ObRawExpr& raw_expr, O
return ret;
}
int ObExprNlsUpper::calc_upper(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& expr_datum)
int ObExprNlsUpper::calc_upper(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum)
{
return calc_nls_common(expr, ctx, expr_datum, false);
}
} // namespace sql
} // namespace oceanbase
}
}