[to #45700625] open_cursor deep copy
This commit is contained in:
parent
82be6c8d8d
commit
3750fc405d
@ -169,6 +169,7 @@ int ObVirtualOpenCursorTable::FillScanner::fill_session_cursor_cell(ObSQLSession
|
||||
const int64_t col_count = output_column_ids_.count();
|
||||
ObCharsetType default_charset = ObCharset::get_default_charset();
|
||||
ObCollationType default_collation = ObCharset::get_default_collation(default_charset);
|
||||
char sql_id[common::OB_MAX_SQL_ID_LENGTH + 1];
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < col_count; ++i) {
|
||||
const uint64_t col_id = output_column_ids_.at(i);
|
||||
switch (col_id) {
|
||||
@ -220,7 +221,6 @@ int ObVirtualOpenCursorTable::FillScanner::fill_session_cursor_cell(ObSQLSession
|
||||
break;
|
||||
}
|
||||
case SQL_ID: {
|
||||
char sql_id[common::OB_MAX_SQL_ID_LENGTH + 1];
|
||||
if (obmysql::COM_QUERY == sess_info.get_mysql_cmd() ||
|
||||
obmysql::COM_STMT_EXECUTE == sess_info.get_mysql_cmd() ||
|
||||
obmysql::COM_STMT_PREPARE == sess_info.get_mysql_cmd() ||
|
||||
@ -303,6 +303,7 @@ int ObVirtualOpenCursorTable::FillScanner::fill_cur_plan_cell(ObSQLSessionInfo &
|
||||
const int64_t col_count = output_column_ids_.count();
|
||||
ObCharsetType default_charset = ObCharset::get_default_charset();
|
||||
ObCollationType default_collation = ObCharset::get_default_collation(default_charset);
|
||||
char sql_id[common::OB_MAX_SQL_ID_LENGTH + 1];
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < col_count; ++i) {
|
||||
const uint64_t col_id = output_column_ids_.at(i);
|
||||
switch (col_id) {
|
||||
@ -354,7 +355,6 @@ int ObVirtualOpenCursorTable::FillScanner::fill_cur_plan_cell(ObSQLSessionInfo &
|
||||
break;
|
||||
}
|
||||
case SQL_ID: {
|
||||
char sql_id[common::OB_MAX_SQL_ID_LENGTH + 1];
|
||||
if (obmysql::COM_QUERY == sess_info.get_mysql_cmd() ||
|
||||
obmysql::COM_STMT_EXECUTE == sess_info.get_mysql_cmd() ||
|
||||
obmysql::COM_STMT_PREPARE == sess_info.get_mysql_cmd() ||
|
||||
|
@ -902,7 +902,7 @@ int ObResultSet::from_plan(const ObPhysicalPlan &phy_plan, const ObIArray<ObPCPa
|
||||
literal_stmt_type_ = phy_plan.get_literal_stmt_type();
|
||||
is_returning_ = phy_plan.is_returning();
|
||||
plan_ctx->set_is_affect_found_row(phy_plan.is_affect_found_row());
|
||||
if (plan_ctx->is_ps_protocol() && ps_param_count != phy_plan.get_param_fields().count()) {
|
||||
if (is_ps_protocol() && ps_param_count != phy_plan.get_param_fields().count()) {
|
||||
if (OB_FAIL(reserve_param_columns(ps_param_count))) {
|
||||
LOG_WARN("reserve param columns failed", K(ret), K(ps_param_count));
|
||||
}
|
||||
@ -912,6 +912,8 @@ int ObResultSet::from_plan(const ObPhysicalPlan &phy_plan, const ObIArray<ObPCPa
|
||||
param_field.cname_ = ObString::make_string("?");
|
||||
OZ (add_param_column(param_field), K(param_field), K(i), K(ps_param_count));
|
||||
}
|
||||
LOG_DEBUG("reset param count ", K(ps_param_count), K(plan_ctx->get_orig_question_mark_cnt()),
|
||||
K(phy_plan.get_returning_param_fields().count()), K(phy_plan.get_param_fields().count()));
|
||||
} else {
|
||||
p_param_columns_ = &phy_plan.get_param_fields();
|
||||
}
|
||||
|
@ -1502,6 +1502,7 @@ int ObSql::handle_ps_execute(const ObPsStmtId client_stmt_id,
|
||||
ObPsStmtInfoGuard guard;
|
||||
ObPsStmtInfo *ps_info = NULL;
|
||||
pctx->set_original_param_cnt(origin_params_count);
|
||||
pctx->set_orig_question_mark_cnt(origin_params_count);
|
||||
if (OB_FAIL(ps_cache->get_stmt_info_guard(inner_stmt_id, guard))) {
|
||||
LOG_WARN("get stmt info guard failed", K(ret), K(inner_stmt_id));
|
||||
} else if (OB_ISNULL(ps_info = guard.get_stmt_info())) {
|
||||
@ -1539,7 +1540,6 @@ int ObSql::handle_ps_execute(const ObPsStmtId client_stmt_id,
|
||||
#endif
|
||||
if (!ps_info->get_fixed_raw_params().empty()) {
|
||||
pctx->set_is_ps_rewrite_sql();
|
||||
pctx->set_orig_question_mark_cnt(origin_params_count);
|
||||
}
|
||||
if (OB_FAIL(session.store_query_string(sql))) {
|
||||
LOG_WARN("store query string fail", K(ret));
|
||||
|
Loading…
x
Reference in New Issue
Block a user