[UPGRADE] Remove unused compatible code
This commit is contained in:
@ -1125,10 +1125,8 @@ int ObRecordType::get_serialize_size(
|
||||
int ret = OB_SUCCESS;
|
||||
ObPLRecord *record = reinterpret_cast<ObPLRecord *>(src);
|
||||
CK (OB_NOT_NULL(record));
|
||||
if (GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_0_0_0) {
|
||||
OX (size += record->get_serialize_size());
|
||||
OX (size += serialization::encoded_length(record->get_count()));
|
||||
}
|
||||
OX (size += record->get_serialize_size());
|
||||
OX (size += serialization::encoded_length(record->get_count()));
|
||||
|
||||
char *data = reinterpret_cast<char*>(record->get_element());
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < record_members_.count(); ++i) {
|
||||
@ -1146,10 +1144,8 @@ int ObRecordType::serialize(
|
||||
int ret = OB_SUCCESS;
|
||||
ObPLRecord *record = reinterpret_cast<ObPLRecord *>(src);
|
||||
CK (OB_NOT_NULL(record));
|
||||
if (GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_0_0_0) {
|
||||
OX (record->serialize(dst, dst_len, dst_pos));
|
||||
OZ (serialization::encode(dst, dst_len, dst_pos, record->get_count()));
|
||||
}
|
||||
OX (record->serialize(dst, dst_len, dst_pos));
|
||||
OZ (serialization::encode(dst, dst_len, dst_pos, record->get_count()));
|
||||
|
||||
char *data = reinterpret_cast<char*>(record->get_element());
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < record_members_.count(); ++i) {
|
||||
@ -1168,12 +1164,10 @@ int ObRecordType::deserialize(
|
||||
int ret = OB_SUCCESS;
|
||||
ObPLRecord *record = reinterpret_cast<ObPLRecord *>(dst);
|
||||
CK (OB_NOT_NULL(record));
|
||||
if (GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_0_0_0) {
|
||||
int64_t count = OB_INVALID_COUNT;
|
||||
OX (record->deserialize(src, src_len, src_pos));
|
||||
OZ (serialization::decode(src, src_len, src_pos, count));
|
||||
OX (record->set_count(count));
|
||||
}
|
||||
int64_t count = OB_INVALID_COUNT;
|
||||
OX (record->deserialize(src, src_len, src_pos));
|
||||
OZ (serialization::decode(src, src_len, src_pos, count));
|
||||
OX (record->set_count(count));
|
||||
|
||||
dst = reinterpret_cast<char*>(record->get_element());
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < record_members_.count(); ++i) {
|
||||
|
||||
@ -30,16 +30,11 @@ int ObDBMSAppInfo::read_client_info(sql::ObExecContext &ctx, sql::ParamStore &pa
|
||||
int ret = OB_SUCCESS;
|
||||
ObString client_info;
|
||||
UNUSED(result);
|
||||
if (OB_UNLIKELY(GET_MIN_CLUSTER_VERSION() <= CLUSTER_VERSION_3_2_3_0)) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "cluster is not ready, and dbms_application_info not support");
|
||||
} else {
|
||||
CK (OB_NOT_NULL(ctx.get_my_session()));
|
||||
CK (OB_LIKELY(1 == params.count()));
|
||||
OV (params.at(0).get_param_meta().is_varchar(), OB_INVALID_ARGUMENT);
|
||||
client_info = ctx.get_my_session()->get_client_info();
|
||||
params.at(0).set_varchar(client_info);
|
||||
}
|
||||
CK (OB_NOT_NULL(ctx.get_my_session()));
|
||||
CK (OB_LIKELY(1 == params.count()));
|
||||
OV (params.at(0).get_param_meta().is_varchar(), OB_INVALID_ARGUMENT);
|
||||
client_info = ctx.get_my_session()->get_client_info();
|
||||
params.at(0).set_varchar(client_info);
|
||||
return ret;
|
||||
}
|
||||
// this is a procedure, and not need to return result
|
||||
@ -49,19 +44,14 @@ int ObDBMSAppInfo::read_module(sql::ObExecContext &ctx, sql::ParamStore ¶ms,
|
||||
ObString module_name;
|
||||
ObString action_name;
|
||||
UNUSED(result);
|
||||
if (OB_UNLIKELY(GET_MIN_CLUSTER_VERSION() <= CLUSTER_VERSION_3_2_3_0)) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "cluster is not ready, and dbms_application_info not support");
|
||||
} else {
|
||||
CK (OB_NOT_NULL(ctx.get_my_session()));
|
||||
CK (OB_LIKELY(2 == params.count()));
|
||||
OV (params.at(0).get_param_meta().is_varchar(), OB_INVALID_ARGUMENT);
|
||||
OV (params.at(1).get_param_meta().is_varchar(), OB_INVALID_ARGUMENT);
|
||||
module_name = ctx.get_my_session()->get_module_name();
|
||||
action_name = ctx.get_my_session()->get_action_name();
|
||||
params.at(0).set_varchar(module_name);
|
||||
params.at(1).set_varchar(action_name);
|
||||
}
|
||||
CK (OB_NOT_NULL(ctx.get_my_session()));
|
||||
CK (OB_LIKELY(2 == params.count()));
|
||||
OV (params.at(0).get_param_meta().is_varchar(), OB_INVALID_ARGUMENT);
|
||||
OV (params.at(1).get_param_meta().is_varchar(), OB_INVALID_ARGUMENT);
|
||||
module_name = ctx.get_my_session()->get_module_name();
|
||||
action_name = ctx.get_my_session()->get_action_name();
|
||||
params.at(0).set_varchar(module_name);
|
||||
params.at(1).set_varchar(action_name);
|
||||
return ret;
|
||||
}
|
||||
// this is a procedure, and not need to return result
|
||||
@ -74,9 +64,6 @@ int ObDBMSAppInfo::set_action(sql::ObExecContext &ctx, sql::ParamStore ¶ms,
|
||||
ObSQLSessionInfo* sess = const_cast<ObSQLSessionInfo*>(ctx.get_my_session());
|
||||
if (OB_FAIL(ret)) {
|
||||
// do nothing
|
||||
} else if (OB_UNLIKELY(GET_MIN_CLUSTER_VERSION() <= CLUSTER_VERSION_3_2_3_0)) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "cluster is not ready, and dbms_application_info not support");
|
||||
} else if (sess->is_obproxy_mode() && !sess->is_ob20_protocol()) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "oceanbase 2.0 protocol is not ready, and dbms_application_info not support");
|
||||
@ -110,9 +97,6 @@ int ObDBMSAppInfo::set_client_info(sql::ObExecContext &ctx, sql::ParamStore &par
|
||||
ObSQLSessionInfo* sess = const_cast<ObSQLSessionInfo*>(ctx.get_my_session());
|
||||
if (OB_FAIL(ret)) {
|
||||
// do nothing
|
||||
} else if (OB_UNLIKELY(GET_MIN_CLUSTER_VERSION() <= CLUSTER_VERSION_3_2_3_0)) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "cluster is not ready, and dbms_application_info not support");
|
||||
} else if (sess->is_obproxy_mode() && !sess->is_ob20_protocol()) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "oceanbase 2.0 protocol is not ready, and dbms_application_info not support");
|
||||
@ -151,9 +135,6 @@ int ObDBMSAppInfo::set_module(sql::ObExecContext &ctx, sql::ParamStore ¶ms,
|
||||
ObSQLSessionInfo* sess = const_cast<ObSQLSessionInfo*>(ctx.get_my_session());
|
||||
if (OB_FAIL(ret)) {
|
||||
// do nothing
|
||||
} else if (OB_UNLIKELY(GET_MIN_CLUSTER_VERSION() <= CLUSTER_VERSION_3_2_3_0)) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "cluster is not ready, and dbms_application_info not support");
|
||||
} else if (sess->is_obproxy_mode() && !sess->is_ob20_protocol()) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "oceanbase 2.0 protocol is not ready, and dbms_application_info not support");
|
||||
|
||||
@ -4890,8 +4890,7 @@ int ObDbmsStats::check_statistic_table_writeable(sql::ObExecContext &ctx)
|
||||
in_restore))) {
|
||||
LOG_WARN("failed to check tenant is restore", K(ret));
|
||||
} else if (OB_UNLIKELY(in_restore) ||
|
||||
GCTX.is_standby_cluster() ||
|
||||
GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_321) {
|
||||
GCTX.is_standby_cluster()) {
|
||||
ret = OB_NOT_SUPPORTED;
|
||||
LOG_USER_ERROR(OB_NOT_SUPPORTED, "use dbms_stats during restore or standby cluster");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user