[CP] Fix: affected row sync
This commit is contained in:
@ -604,7 +604,7 @@ OB_INLINE void ObResultSet::store_affected_rows(ObPhysicalPlanCtx &plan_ctx)
|
|||||||
affected_row = get_affected_rows();
|
affected_row = get_affected_rows();
|
||||||
}
|
}
|
||||||
NG_TRACE_EXT(affected_rows, OB_ID(affected_rows), affected_row);
|
NG_TRACE_EXT(affected_rows, OB_ID(affected_rows), affected_row);
|
||||||
my_session_.set_affected_rows(affected_row);
|
my_session_.update_sys_variable(SYS_VAR__AFFECTED_ROWS, affected_row);
|
||||||
}
|
}
|
||||||
|
|
||||||
OB_INLINE void ObResultSet::store_found_rows(ObPhysicalPlanCtx &plan_ctx)
|
OB_INLINE void ObResultSet::store_found_rows(ObPhysicalPlanCtx &plan_ctx)
|
||||||
@ -620,7 +620,7 @@ OB_INLINE void ObResultSet::store_found_rows(ObPhysicalPlanCtx &plan_ctx)
|
|||||||
int64_t found_rows = -1;
|
int64_t found_rows = -1;
|
||||||
found_rows = plan_ctx.get_found_rows();
|
found_rows = plan_ctx.get_found_rows();
|
||||||
rows = found_rows == 0 ? return_rows_ : found_rows;
|
rows = found_rows == 0 ? return_rows_ : found_rows;
|
||||||
my_session_.set_found_rows(rows);
|
my_session_.update_sys_variable(SYS_VAR__FOUND_ROWS, rows);
|
||||||
NG_TRACE_EXT(store_found_rows,
|
NG_TRACE_EXT(store_found_rows,
|
||||||
OB_ID(found_rows), found_rows,
|
OB_ID(found_rows), found_rows,
|
||||||
OB_ID(return_rows), return_rows_);
|
OB_ID(return_rows), return_rows_);
|
||||||
|
|||||||
@ -2673,6 +2673,18 @@ OB_INLINE int ObBasicSessionInfo::process_session_variable(ObSysVarClassType var
|
|||||||
OX (sys_vars_cache_.set_default_lob_inrow_threshold(int_val));
|
OX (sys_vars_cache_.set_default_lob_inrow_threshold(int_val));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case SYS_VAR__AFFECTED_ROWS: {
|
||||||
|
int64_t affect_rows = 0;
|
||||||
|
OZ (val.get_int(affect_rows), val);
|
||||||
|
set_affected_rows(affect_rows);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SYS_VAR__FOUND_ROWS: {
|
||||||
|
int64_t found_rows = 0;
|
||||||
|
OZ (val.get_int(found_rows), val);
|
||||||
|
set_found_rows(found_rows);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
|||||||
@ -586,6 +586,13 @@ public:
|
|||||||
sql_select_limit = sys_vars_cache_.get_sql_select_limit();
|
sql_select_limit = sys_vars_cache_.get_sql_select_limit();
|
||||||
return common::OB_SUCCESS;
|
return common::OB_SUCCESS;
|
||||||
}
|
}
|
||||||
|
void set_found_rows(const int64_t count) { found_rows_ = count; }
|
||||||
|
int64_t get_found_rows() const { return found_rows_; }
|
||||||
|
void set_affected_rows(const int64_t count)
|
||||||
|
{
|
||||||
|
affected_rows_ = count;
|
||||||
|
}
|
||||||
|
int64_t get_affected_rows() const { return affected_rows_; }
|
||||||
// session保留compatible mode,主要用于传递mode,方便后续进行guard切换,如inner sql connection等
|
// session保留compatible mode,主要用于传递mode,方便后续进行guard切换,如inner sql connection等
|
||||||
// 其他需要用mode地方请尽量使用线程上的is_oracle|mysql_mode
|
// 其他需要用mode地方请尽量使用线程上的is_oracle|mysql_mode
|
||||||
// 同时可以使用check_compatibility_mode来检查线程与session上的mode是否一致
|
// 同时可以使用check_compatibility_mode来检查线程与session上的mode是否一致
|
||||||
|
|||||||
@ -846,10 +846,6 @@ public:
|
|||||||
transaction::ObTxClass get_trans_type() const { return trans_type_; }
|
transaction::ObTxClass get_trans_type() const { return trans_type_; }
|
||||||
|
|
||||||
void get_session_priv_info(share::schema::ObSessionPrivInfo &session_priv) const;
|
void get_session_priv_info(share::schema::ObSessionPrivInfo &session_priv) const;
|
||||||
void set_found_rows(const int64_t count) { found_rows_ = count; }
|
|
||||||
int64_t get_found_rows() const { return found_rows_; }
|
|
||||||
void set_affected_rows(const int64_t count) { affected_rows_ = count; }
|
|
||||||
int64_t get_affected_rows() const { return affected_rows_; }
|
|
||||||
bool has_user_super_privilege() const;
|
bool has_user_super_privilege() const;
|
||||||
bool has_user_process_privilege() const;
|
bool has_user_process_privilege() const;
|
||||||
int check_read_only_privilege(const bool read_only,
|
int check_read_only_privilege(const bool read_only,
|
||||||
|
|||||||
Reference in New Issue
Block a user