From 65ec29e510db547e00d47cc967869fee076ef218 Mon Sep 17 00:00:00 2001 From: richardjcai Date: Fri, 19 Feb 2021 16:35:47 -0500 Subject: [PATCH] sql: fix error message for virtual schema creation Previously, if mutDesc returned from NewTableDesc was nil, the error message would not correctly be shown because of a nil pointer exception. Release note: None --- pkg/sql/virtual_schema.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sql/virtual_schema.go b/pkg/sql/virtual_schema.go index b2c47ffb5dee..01552b00b11f 100644 --- a/pkg/sql/virtual_schema.go +++ b/pkg/sql/virtual_schema.go @@ -176,7 +176,7 @@ func (t virtualSchemaTable) initVirtualTableDesc( tree.PersistencePermanent, ) if err != nil { - return mutDesc.TableDescriptor, err + return descpb.TableDescriptor{}, err } for _, index := range mutDesc.PublicNonPrimaryIndexes() { if index.NumColumns() > 1 {