From c322a723e66ed648d4e60a2aaac7b1494869c3b7 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 31 Oct 2022 03:38:01 +0000 Subject: [PATCH] Fix get table schema report -4016 --- src/sql/optimizer/ob_table_location.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sql/optimizer/ob_table_location.cpp b/src/sql/optimizer/ob_table_location.cpp index 42f33fb42..51db3498e 100644 --- a/src/sql/optimizer/ob_table_location.cpp +++ b/src/sql/optimizer/ob_table_location.cpp @@ -5139,9 +5139,13 @@ int ObTableLocation::get_full_leader_table_loc(ObIAllocator &allocator, ObSchemaGetterGuard schema_guard; OZ(GCTX.schema_service_->get_tenant_schema_guard(tenant_id, schema_guard)); OZ(schema_guard.get_table_schema(tenant_id, ref_table_id, table_schema)); - CK(OB_NOT_NULL(table_schema)); - OZ(table_schema->get_all_tablet_and_object_ids(tablet_ids, partition_ids)); - CK(table_schema->has_tablet()); + if (OB_ISNULL(table_schema)) { + ret = OB_SCHEMA_ERROR; + LOG_WARN("table schema is null", K(ret), K(table_id), K(tenant_id), K(ref_table_id)); + } else { + OZ(table_schema->get_all_tablet_and_object_ids(tablet_ids, partition_ids)); + CK(table_schema->has_tablet()); + } if (OB_SUCC(ret)) { ObDASTableLocMeta *loc_meta = NULL; char *table_buf = static_cast(allocator.alloc(sizeof(ObDASTableLoc) -- GitLab