add inner_same_as for udf func and remove useless GET_MIN_CLUSTER_VERSION

This commit is contained in:
Larry955
2022-11-16 07:35:39 +00:00
committed by wangzelin.wzl
parent 99d34dc07b
commit 8aee7d972f
34 changed files with 279 additions and 527 deletions

View File

@ -82,27 +82,16 @@ int ObDatabaseResolver<T>::resolve_primary_zone(T *stmt, ParseNode *node)
ret = common::OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "invalid primary_zone argument", K(ret), K(node));
} else if (node->type_ == T_DEFAULT) {
if (GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_2000) {
ret = OB_OP_NOT_ALLOW;
SQL_RESV_LOG(WARN, "set primary_zone DEFAULT is not allowed now", K(ret));
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "set primary_zone DEFAULT");
}
// do nothing
} else if (T_RANDOM == node->type_) {
if (GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_2000) {
ret = OB_OP_NOT_ALLOW;
SQL_RESV_LOG(WARN, "set primary_zone RANDOM is not allowed now", K(ret));
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "set primary_zone RANDOM");
} else {
if (OB_FAIL(stmt->set_primary_zone(common::ObString(common::OB_RANDOM_PRIMARY_ZONE)))) {
SQL_RESV_LOG(WARN, "fail to set primary zone", K(ret));
}
if (OB_FAIL(stmt->set_primary_zone(common::ObString(common::OB_RANDOM_PRIMARY_ZONE)))) {
SQL_RESV_LOG(WARN, "fail to set primary zone", K(ret));
}
} else {
common::ObString primary_zone;
primary_zone.assign_ptr(const_cast<char *>(node->str_value_),
static_cast<int32_t>(node->str_len_));
if (GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_2000
&& primary_zone.empty()) {
if (OB_UNLIKELY(primary_zone.empty())) {
ret = OB_OP_NOT_ALLOW;
SQL_RESV_LOG(WARN, "set primary_zone empty is not allowed now", K(ret));
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "set primary_zone empty");