[CP] fix nullif replace var expr report 4016 bug
This commit is contained in:
@ -230,10 +230,10 @@ int ObExprNullif::cg_expr(ObExprCGCtx& expr_cg_ctx, const ObRawExpr& raw_expr, O
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < real_param_num; i++) {
|
||||
if (OB_FAIL(ObStaticEngineExprCG::replace_var_rt_expr(
|
||||
rt_expr.args_[i], rt_expr.args_[i + real_param_num], &rt_expr, i + real_param_num))) {
|
||||
LOG_WARN("replace var rt expr failed", K(ret));
|
||||
LOG_WARN("replace var rt expr failed", K(ret), K(i), K(raw_expr));
|
||||
} else if (OB_FAIL(ObStaticEngineExprCG::replace_var_rt_expr(
|
||||
rt_expr.args_[i], rt_expr.args_[i + 2 * real_param_num], &rt_expr, i + 2 * real_param_num))) {
|
||||
LOG_WARN("replace var rt expr failed", K(ret));
|
||||
LOG_WARN("replace var rt_expr failed", K(ret), K(i), K(raw_expr));
|
||||
}
|
||||
}
|
||||
if (OB_FAIL(ret)) {
|
||||
|
||||
@ -78,7 +78,13 @@ int ObExprQuote::calc_result1(ObObj& result, const ObObj& obj, ObExprCtx& expr_c
|
||||
ObString str = obj.get_string();
|
||||
ObString res_str;
|
||||
if (OB_FAIL(calc(res_str, str, obj.get_collation_type(), expr_ctx.calc_buf_))) {
|
||||
LOG_WARN("calc quote expr failed", K(ret), K(str));
|
||||
result.set_null();
|
||||
// ret = OB_ERR_INCORRECT_STRING_VALUE means input string is not invalid, then output NULL.
|
||||
if (OB_ERR_INCORRECT_STRING_VALUE == ret) {
|
||||
ret = OB_SUCCESS;
|
||||
} else {
|
||||
LOG_WARN("calc quote expr failed", K(ret), K(str));
|
||||
}
|
||||
} else {
|
||||
result.set_varchar(res_str);
|
||||
result.set_collation(result_type_);
|
||||
@ -180,7 +186,13 @@ int ObExprQuote::calc_quote_expr(const ObExpr& expr, ObEvalCtx& ctx, ObDatum& re
|
||||
ObString res_str;
|
||||
ObExprStrResAlloc res_alloc(expr, ctx);
|
||||
if (OB_FAIL(calc(res_str, str, expr.datum_meta_.cs_type_, &res_alloc))) {
|
||||
LOG_WARN("calc quote expr failed", K(ret), K(str));
|
||||
res_datum.set_null();
|
||||
// ret = OB_ERR_INCORRECT_STRING_VALUE means input string is not invalid, then output NULL.
|
||||
if (OB_ERR_INCORRECT_STRING_VALUE == ret) {
|
||||
ret = OB_SUCCESS;
|
||||
} else {
|
||||
LOG_WARN("calc quote expr failed", K(ret), K(str));
|
||||
}
|
||||
} else {
|
||||
res_datum.set_string(res_str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user