From bd84570b4ce76593361c88af5fb0469a6a3ce679 Mon Sep 17 00:00:00 2001 From: bz0 Date: Thu, 29 Jul 2021 22:12:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug=20that=20is=20not=20check=20whether?= =?UTF-8?q?=C2=A0dimensional=20pointer=20is=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/share/schema/ob_part_mgr_util.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/share/schema/ob_part_mgr_util.h b/src/share/schema/ob_part_mgr_util.h index 5df4b69abc..40400fa929 100644 --- a/src/share/schema/ob_part_mgr_util.h +++ b/src/share/schema/ob_part_mgr_util.h @@ -445,10 +445,17 @@ int ObPartIdsGeneratorForAdd::gen(common::ObIArray& part_ids) max_used_part_id = table_.get_part_option().get_part_num() - 1; } for (int64_t i = 0; OB_SUCC(ret) && i < inc_part_num; ++i) { - ObPartition* part = part_array[i]; if (PARTITION_LEVEL_TWO == part_level) { if (!table_.is_sub_part_template()) { - if (OB_ISNULL(part)) { + ObPartition* part = NULL; + if (OB_ISNULL(part_array)) { + ret = common::OB_ERR_UNEXPECTED; + SHARE_LOG(WARN, "Empty partition", KR(ret), K(table_)); + } else { + part = part_array[i]; + } + if (OB_FAIL(ret)) { + } else if (OB_ISNULL(part)) { ret = common::OB_ERR_UNEXPECTED; SHARE_LOG(WARN, "part_array[i] is null", KR(ret), K(i)); } else {