avoid get_select_item crash
This commit is contained in:
@ -198,6 +198,14 @@ int ObSqlParameterization::transform_syntax_tree(ObIAllocator &allocator,
|
|||||||
"paramlized_questionmask_count", ctx.paramlized_questionmask_count_, K(ret));
|
"paramlized_questionmask_count", ctx.paramlized_questionmask_count_, K(ret));
|
||||||
} else if (OB_NOT_NULL(raw_params)
|
} else if (OB_NOT_NULL(raw_params)
|
||||||
&& OB_NOT_NULL(select_item_param_infos)) {
|
&& 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());
|
select_item_param_infos->set_capacity(ctx.project_list_.count());
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && i < ctx.project_list_.count(); i++) {
|
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));
|
ParseNode *tmp_root = static_cast<ParseNode *>(ctx.project_list_.at(i));
|
||||||
@ -214,6 +222,7 @@ int ObSqlParameterization::transform_syntax_tree(ObIAllocator &allocator,
|
|||||||
}
|
}
|
||||||
} // for end
|
} // for end
|
||||||
}
|
}
|
||||||
|
}
|
||||||
SQL_PC_LOG(DEBUG, "after transform_tree",
|
SQL_PC_LOG(DEBUG, "after transform_tree",
|
||||||
"result_tree_", SJ(ObParserResultPrintWrapper(*tree)));
|
"result_tree_", SJ(ObParserResultPrintWrapper(*tree)));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user