From 85a0551762f963f0964e6f3f38bb161f9f7a429f Mon Sep 17 00:00:00 2001 From: Rohan Yadav Date: Wed, 31 Jul 2019 16:40:07 -0400 Subject: [PATCH] sql: Fix bug where dropped table zone configurations would be visible. Fixes #38392. Release note: None --- pkg/sql/crdb_internal.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/sql/crdb_internal.go b/pkg/sql/crdb_internal.go index defbe2d6f376..1c03283598e7 100644 --- a/pkg/sql/crdb_internal.go +++ b/pkg/sql/crdb_internal.go @@ -1901,10 +1901,11 @@ CREATE TABLE crdb_internal.zones ( var zoneSpecifier *tree.ZoneSpecifier zs, err := config.ZoneSpecifierFromID(id, resolveID) if err != nil { - // The database or table has been deleted so there is no way - // to refer to it anymore. We are still going to show - // something but the CLI specifier part will become NULL. - zoneSpecifier = nil + // We can have valid zoneSpecifiers whose table/database has been + // deleted because zoneSpecifiers are collected asynchronously. + // In this case, just don't show the zoneSpecifier in the + // output of the table. + continue } else { zoneSpecifier = &zs }