avoid get_select_item crash

This commit is contained in:
obdev
2023-05-23 11:11:29 +00:00
committed by ob-robot
parent d38916c6f0
commit 9276e8cb93

View File

@ -198,6 +198,14 @@ int ObSqlParameterization::transform_syntax_tree(ObIAllocator &allocator,
"paramlized_questionmask_count", ctx.paramlized_questionmask_count_, K(ret));
} else if (OB_NOT_NULL(raw_params)
&& OB_NOT_NULL(select_item_param_infos)) {
if (sql_info.total_ != raw_params->count()) {
ret = OB_NOT_SUPPORTED;
SQL_PC_LOG(TRACE, "const number of fast parse and normal parse is different",
"fast_parse_const_num", raw_params->count(),
"normal_parse_const_num", sql_info.total_,
K(session.get_current_query_string()),
"result_tree_", SJ(ObParserResultPrintWrapper(*ctx.top_node_)));
} else {
select_item_param_infos->set_capacity(ctx.project_list_.count());
for (int64_t i = 0; OB_SUCC(ret) && i < ctx.project_list_.count(); i++) {
ParseNode *tmp_root = static_cast<ParseNode *>(ctx.project_list_.at(i));
@ -214,6 +222,7 @@ int ObSqlParameterization::transform_syntax_tree(ObIAllocator &allocator,
}
} // for end
}
}
SQL_PC_LOG(DEBUG, "after transform_tree",
"result_tree_", SJ(ObParserResultPrintWrapper(*tree)));
}