fix eval questionmark table assign val failed bug

This commit is contained in:
Larry955
2022-11-13 02:33:32 +08:00
committed by wangzelin.wzl
parent f5c4cb2cda
commit 74cb7c51f4
3 changed files with 17 additions and 19 deletions

View File

@ -401,22 +401,18 @@ int ObStaticEngineExprCG::cg_expr_by_operator(const ObIArray<ObRawExpr *> &raw_e
|| OB_ISNULL(rt_expr = get_rt_expr(*raw_expr))) { || OB_ISNULL(rt_expr = get_rt_expr(*raw_expr))) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("arg is null", K(raw_expr), K(rt_expr), K(ret)); LOG_WARN("arg is null", K(raw_expr), K(rt_expr), K(ret));
} else if (T_QUESTIONMARK == rt_expr->type_ && rt_question_mark_eval_) { } else if (T_QUESTIONMARK == rt_expr->type_ &&
(raw_expr->has_flag(IS_TABLE_ASSIGN) || rt_question_mark_eval_)) {
// generate question mark expr for get param from param store directly // generate question mark expr for get param from param store directly
// if the questionmark is from TABLE_ASSIGN, use eval_assign_question_mark_func
ObConstRawExpr *c_expr = static_cast<ObConstRawExpr*>(raw_expr); ObConstRawExpr *c_expr = static_cast<ObConstRawExpr*>(raw_expr);
int64_t param_idx = 0; int64_t param_idx = 0;
OZ(c_expr->get_value().get_unknown(param_idx)); OZ(c_expr->get_value().get_unknown(param_idx));
if (OB_SUCC(ret)) { if (OB_SUCC(ret)) {
rt_expr->extra_ = param_idx; rt_expr->extra_ = param_idx;
rt_expr->eval_func_ = &eval_question_mark_func; rt_expr->eval_func_ = raw_expr->has_flag(IS_TABLE_ASSIGN) ?
} &eval_assign_question_mark_func:
} else if (T_QUESTIONMARK == rt_expr->type_ && raw_expr->has_flag(IS_TABLE_ASSIGN)) { &eval_question_mark_func;
ObConstRawExpr *c_expr = static_cast<ObConstRawExpr*>(raw_expr);
int64_t param_idx = 0;
OZ(c_expr->get_value().get_unknown(param_idx));
if (OB_SUCC(ret)) {
rt_expr->extra_ = param_idx;
rt_expr->eval_func_ = &eval_assign_question_mark_func;
} }
} else if (!IS_EXPR_OP(rt_expr->type_) || IS_AGGR_FUN(rt_expr->type_)) { } else if (!IS_EXPR_OP(rt_expr->type_) || IS_AGGR_FUN(rt_expr->type_)) {
// do nothing // do nothing

View File

@ -1,3 +1,4 @@
--source mysql_test/include/explain_init.inc
--disable_query_log --disable_query_log
set @@session.explicit_defaults_for_timestamp=off; set @@session.explicit_defaults_for_timestamp=off;
--enable_query_log --enable_query_log
@ -346,3 +347,4 @@ drop table t2;
--disable_warnings --disable_warnings
drop table if exists t2, t7, t8, t9, BB, CC; drop table if exists t2, t7, t8, t9, BB, CC;
--enable_warnings --enable_warnings
--source mysql_test/include/explain_end.inc