bugfix : null in json expr clause has core dump in fast parser
This commit is contained in:
@ -791,6 +791,7 @@ typedef enum ObItemType
|
|||||||
T_FUN_ORA_JSON_OBJECTAGG = 1685,
|
T_FUN_ORA_JSON_OBJECTAGG = 1685,
|
||||||
T_FUN_SYS_JSON_EXISTS = 1686,
|
T_FUN_SYS_JSON_EXISTS = 1686,
|
||||||
T_FUN_SYS_TREAT = 1687,
|
T_FUN_SYS_TREAT = 1687,
|
||||||
|
T_NULLX_CLAUSE = 1688, // null clause on json expr
|
||||||
|
|
||||||
///< @note add new oracle only function type before this line
|
///< @note add new oracle only function type before this line
|
||||||
|
|
||||||
|
|||||||
@ -253,6 +253,7 @@ int ObSqlParameterization::is_fast_parse_const(TransformTreeCtx &ctx)
|
|||||||
|| T_QUESTIONMARK == ctx.tree_->type_
|
|| T_QUESTIONMARK == ctx.tree_->type_
|
||||||
|| T_COLLATION == ctx.tree_->type_
|
|| T_COLLATION == ctx.tree_->type_
|
||||||
|| T_CAST_ARGUMENT == ctx.tree_->type_
|
|| T_CAST_ARGUMENT == ctx.tree_->type_
|
||||||
|
|| T_NULLX_CLAUSE == ctx.tree_->type_
|
||||||
|| (T_SFU_INT == ctx.tree_->type_ && -1 != ctx.tree_->value_)
|
|| (T_SFU_INT == ctx.tree_->type_ && -1 != ctx.tree_->value_)
|
||||||
|| T_SFU_DECIMAL == ctx.tree_->type_);
|
|| T_SFU_DECIMAL == ctx.tree_->type_);
|
||||||
}
|
}
|
||||||
@ -1459,8 +1460,9 @@ int ObSqlParameterization::add_not_param_flag(const ParseNode *node, SqlInfo &sq
|
|||||||
} else if (OB_FAIL(sql_info.not_param_index_.add_member(node->value_))) {
|
} else if (OB_FAIL(sql_info.not_param_index_.add_member(node->value_))) {
|
||||||
SQL_PC_LOG(WARN, "failed to add member", K(node->value_));
|
SQL_PC_LOG(WARN, "failed to add member", K(node->value_));
|
||||||
}
|
}
|
||||||
} else if (T_CAST_ARGUMENT == node->type_
|
} else if (T_CAST_ARGUMENT == node->type_ //如果是cast类型,则需要添加N个cast节点对应的常数, 因为正常parse不识别为常量, 但fast parse时会识别为常量
|
||||||
|| T_COLLATION == node->type_) { //如果是cast类型,则需要添加N个cast节点对应的常数, 因为正常parse不识别为常量, 但fast parse时会识别为常量
|
|| T_COLLATION == node->type_
|
||||||
|
|| T_NULLX_CLAUSE == node->type_) { // deal null clause on json expr
|
||||||
for (int i = 0; OB_SUCC(ret) && i < node->param_num_; ++i) {
|
for (int i = 0; OB_SUCC(ret) && i < node->param_num_; ++i) {
|
||||||
if (OB_FAIL(sql_info.not_param_index_.add_member(sql_info.total_++))) {
|
if (OB_FAIL(sql_info.not_param_index_.add_member(sql_info.total_++))) {
|
||||||
SQL_PC_LOG(WARN, "failed to add member", K(sql_info.total_));
|
SQL_PC_LOG(WARN, "failed to add member", K(sql_info.total_));
|
||||||
|
|||||||
@ -931,6 +931,15 @@ int ObRawExprResolverImpl::do_recursive_resolve(const ParseNode *node, ObRawExpr
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case T_NULLX_CLAUSE: {
|
||||||
|
modification_type_to_int(const_cast<ParseNode&>(*node));
|
||||||
|
// deal node
|
||||||
|
if (OB_FAIL(SMART_CALL(recursive_resolve(node, expr)))) {
|
||||||
|
LOG_WARN("fail to process node with children only", K(ret),
|
||||||
|
K(node->type_), K(node));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case T_FUN_SYS_REGEXP_LIKE:
|
case T_FUN_SYS_REGEXP_LIKE:
|
||||||
case T_FUN_SYS: {
|
case T_FUN_SYS: {
|
||||||
if (OB_FAIL(process_fun_sys_node(node, expr))) {
|
if (OB_FAIL(process_fun_sys_node(node, expr))) {
|
||||||
@ -5350,6 +5359,12 @@ int ObRawExprResolverImpl::pre_check_json_path_valid(const ParseNode *node)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// json expr change T_NULLX_CLAUSE to T_INT
|
||||||
|
void ObRawExprResolverImpl::modification_type_to_int(ParseNode &node)
|
||||||
|
{
|
||||||
|
node.type_ = T_INT;
|
||||||
|
}
|
||||||
|
|
||||||
int ObRawExprResolverImpl::process_json_value_node(const ParseNode *node, ObRawExpr *&expr)
|
int ObRawExprResolverImpl::process_json_value_node(const ParseNode *node, ObRawExpr *&expr)
|
||||||
{
|
{
|
||||||
INIT_SUCC(ret);
|
INIT_SUCC(ret);
|
||||||
|
|||||||
@ -122,6 +122,7 @@ private:
|
|||||||
int process_json_exists_node(const ParseNode *node, ObRawExpr *&expr);
|
int process_json_exists_node(const ParseNode *node, ObRawExpr *&expr);
|
||||||
int process_json_array_node(const ParseNode *node, ObRawExpr *&expr);
|
int process_json_array_node(const ParseNode *node, ObRawExpr *&expr);
|
||||||
int process_json_mergepatch_node(const ParseNode *node, ObRawExpr *&expr);
|
int process_json_mergepatch_node(const ParseNode *node, ObRawExpr *&expr);
|
||||||
|
static void modification_type_to_int(ParseNode &node);
|
||||||
int process_fun_sys_node(const ParseNode *node, ObRawExpr *&expr);
|
int process_fun_sys_node(const ParseNode *node, ObRawExpr *&expr);
|
||||||
int process_dll_udf_node(const ParseNode *node, ObRawExpr *&expr);
|
int process_dll_udf_node(const ParseNode *node, ObRawExpr *&expr);
|
||||||
int process_agg_udf_node(const ParseNode *node,
|
int process_agg_udf_node(const ParseNode *node,
|
||||||
|
|||||||
Reference in New Issue
Block a user