Skip to content

Commit

Permalink
Merge #60819
Browse files Browse the repository at this point in the history
60819: sql: fix error message for virtual schema creation r=rafiss a=RichardJCai

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

Co-authored-by: richardjcai <[email protected]>
  • Loading branch information
craig[bot] and RichardJCai committed Feb 20, 2021
2 parents 3851e17 + 65ec29e commit ea784c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/virtual_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ea784c3

Please sign in to comment.