[FEAT MERGE] [CP] query_interface 422

This commit is contained in:
obdev
2024-04-15 16:23:22 +00:00
committed by ob-robot
parent 6423e587c1
commit dd7737c7ab
28 changed files with 687 additions and 133 deletions

View File

@ -108,19 +108,12 @@ int ObOutlineExecutor::generate_outline_info1(ObExecContext &ctx,
has_questionmark_in_outline_sql))) {
LOG_WARN("fail to get outline key", "outline_sql", outline_sql, K(ret));
} else if (FALSE_IT(max_concurrent = query_hint->get_global_hint().max_concurrent_)) {
} else if (OB_UNLIKELY(has_questionmark_in_outline_sql && max_concurrent < 0)) {
} else if (OB_UNLIKELY(has_questionmark_in_outline_sql && query_hint->has_hint_exclude_concurrent())) {
ret = OB_INVALID_OUTLINE;
LOG_USER_ERROR(OB_INVALID_OUTLINE, "sql text should have no ? when there is no concurrent limit");
LOG_WARN("outline should have no ? when there is no concurrent limit",
K(outline_sql), K(ret));
} else if (OB_UNLIKELY(max_concurrent > ObGlobalHint::UNSET_MAX_CONCURRENT
&& query_hint->has_hint_exclude_concurrent())) {
ret = OB_INVALID_OUTLINE;
LOG_USER_ERROR(OB_INVALID_OUTLINE, "outline and sql concurrent limit can not be mixed");
LOG_WARN("outline and sql concurrent limit can not be mixed",
"outline_sql_text", outline_info.get_sql_text_str(), K(ret));
} else if (ObGlobalHint::UNSET_MAX_CONCURRENT == max_concurrent
&& OB_FAIL(get_outline(ctx, outline_stmt, outline))) {
} else if (OB_FAIL(get_outline(ctx, outline_stmt, outline))) {
LOG_WARN("fail to get outline", K(ret));
} else {
//to check whether ok

View File

@ -73,14 +73,7 @@ int ObCreateOutlineResolver::resolve_hint(const ParseNode *node, ObCreateOutline
continue;
}
if (hint_node->type_ == T_MAX_CONCURRENT) {
if (node->num_child_ > 1) {
ret = OB_INVALID_OUTLINE;
LOG_USER_ERROR(OB_INVALID_OUTLINE, "outline and sql concurrent limit can not be mixed");
LOG_WARN("outline and sql concurrent limit can not be mixed");
} else if (1 != hint_node->num_child_) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("max concurrent node should have 1 child", K(ret));
} else if (OB_ISNULL(hint_node->children_[0])) {
if (OB_ISNULL(hint_node->children_[0])) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("child of max concurrent node should not be NULL", K(ret));
} else if (hint_node->children_[0]->value_ >= 0) {

View File

@ -329,8 +329,14 @@ bool ObGlobalHint::has_hint_exclude_concurrent() const
|| ObParamOption::NOT_SPECIFIED != param_option_
|| !alloc_op_hints_.empty()
|| !dops_.empty()
|| false != disable_transform_
|| false != disable_cost_based_transform_
|| false != enable_append_
|| !opt_params_.empty()
|| !ob_ddl_schema_versions_.empty()
|| has_gather_opt_stat_hint()
|| false != has_dbms_stats_hint_
|| -1 != dynamic_sampling_
|| flashback_read_tx_uncommitted_;
}

View File

@ -14,6 +14,7 @@
#define OCEANBASE_SQL_OB_SESS_INFO_VERI_H_
#include "share/ob_define.h"
#include "share/system_variable/ob_sys_var_class_type.h"
#include "lib/string/ob_string.h"
#include "lib/atomic/ob_atomic.h"
#include "rpc/obrpc/ob_rpc_proxy.h"
@ -32,6 +33,10 @@ namespace obrpc
{
class ObSrvRpcProxy;
}
namespace share {
class ObBasicSysVar;
enum ObSysVarClassType;
}
namespace sql
{

View File

@ -2919,7 +2919,7 @@ int ObSQLSessionInfo::ps_use_stream_result_set(bool &use_stream) {
return ret;
}
ObPieceCache* ObSQLSessionInfo::get_piece_cache(bool need_init) {
::oceanbase::observer::ObPieceCache* ObSQLSessionInfo::get_piece_cache(bool need_init) {
if (NULL == piece_cache_ && need_init) {
void *buf = get_session_allocator().alloc(sizeof(ObPieceCache));
if (NULL != buf) {
@ -2936,6 +2936,23 @@ ObPieceCache* ObSQLSessionInfo::get_piece_cache(bool need_init) {
return piece_cache_;
}
int ObSQLSessionInfo::set_login_info(const share::schema::ObUserLoginInfo &login_info)
{
int ret = OB_SUCCESS;
OZ (ob_write_string(get_session_allocator(), login_info.tenant_name_, login_info_.tenant_name_));
OZ (ob_write_string(get_session_allocator(), login_info.user_name_, login_info_.user_name_));
OZ (ob_write_string(get_session_allocator(), login_info.client_ip_, login_info_.client_ip_));
OZ (ob_write_string(get_session_allocator(), login_info.passwd_, login_info_.passwd_));
OZ (ob_write_string(get_session_allocator(), login_info.db_, login_info_.db_));
OZ (ob_write_string(get_session_allocator(), login_info.scramble_str_, login_info_.scramble_str_));
return ret;
}
int ObSQLSessionInfo::set_login_auth_data(const ObString &auth_data) {
int ret = OB_SUCCESS;
OZ (ob_write_string(get_session_allocator(), auth_data, login_info_.passwd_));
return ret;
}

View File

@ -1333,6 +1333,9 @@ public:
// piece
observer::ObPieceCache *get_piece_cache(bool need_init = false);
share::schema::ObUserLoginInfo get_login_info () { return login_info_; }
int set_login_info(const share::schema::ObUserLoginInfo &login_info);
int set_login_auth_data(const ObString &auth_data);
void set_load_data_exec_session(bool v) { is_load_data_exec_session_ = v; }
bool is_load_data_exec_session() const { return is_load_data_exec_session_; }
inline ObSqlString &get_pl_exact_err_msg() { return pl_exact_err_msg_; }
@ -1596,6 +1599,7 @@ private:
common::ObSEArray<ObSequenceSchema*, 2> dblink_sequence_schemas_;
bool client_non_standard_;
bool is_session_sync_support_; // session_sync_support flag.
share::schema::ObUserLoginInfo login_info_;
};
inline bool ObSQLSessionInfo::is_terminate(int &ret) const