From da6f7be724e03a2c82413538c364d625c1569693 Mon Sep 17 00:00:00 2001 From: nauta Date: Mon, 29 Nov 2021 18:05:12 +0800 Subject: [PATCH] Remove redundant checks on ret (#613) --- src/sql/resolver/ddl/ob_ddl_resolver.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/sql/resolver/ddl/ob_ddl_resolver.cpp b/src/sql/resolver/ddl/ob_ddl_resolver.cpp index 31c43700ce..3e66c8776a 100644 --- a/src/sql/resolver/ddl/ob_ddl_resolver.cpp +++ b/src/sql/resolver/ddl/ob_ddl_resolver.cpp @@ -3136,15 +3136,13 @@ int ObDDLResolver::resolve_part_func(ObResolverParams& params, const ParseNode* } if (OB_SUCC(ret)) { // check duplicate of PARTITION_FUNC_TYPE_RANGE_COLUMNS - if (OB_SUCC(ret)) { - if (partition_func_type == PARTITION_FUNC_TYPE_RANGE_COLUMNS) { - for (int64_t idx = 0; OB_SUCC(ret) && idx < partition_keys.count(); ++idx) { - const ObString& key_name = partition_keys.at(idx); - for (int64_t b_idx = 0; OB_SUCC(ret) && b_idx < idx; ++b_idx) { - if (ObCharset::case_insensitive_equal(key_name, partition_keys.at(b_idx))) { - ret = OB_ERR_SAME_NAME_PARTITION_FIELD; - LOG_USER_ERROR(OB_ERR_SAME_NAME_PARTITION_FIELD, key_name.length(), key_name.ptr()); - } + if (partition_func_type == PARTITION_FUNC_TYPE_RANGE_COLUMNS) { + for (int64_t idx = 0; OB_SUCC(ret) && idx < partition_keys.count(); ++idx) { + const ObString& key_name = partition_keys.at(idx); + for (int64_t b_idx = 0; OB_SUCC(ret) && b_idx < idx; ++b_idx) { + if (ObCharset::case_insensitive_equal(key_name, partition_keys.at(b_idx))) { + ret = OB_ERR_SAME_NAME_PARTITION_FIELD; + LOG_USER_ERROR(OB_ERR_SAME_NAME_PARTITION_FIELD, key_name.length(), key_name.ptr()); } } } -- GitLab