@@ -19,9 +19,9 @@ import (
1919 "strings"
2020
2121 "github.com/cockroachdb/errors"
22- "github.com/dolthub/doltgresql/core/id"
2322 vitess "github.com/dolthub/vitess/go/vt/sqlparser"
2423
24+ "github.com/dolthub/doltgresql/core/id"
2525 "github.com/dolthub/doltgresql/postgres/parser/parser"
2626 "github.com/dolthub/doltgresql/postgres/parser/sem/tree"
2727 "github.com/dolthub/doltgresql/postgres/parser/types"
@@ -131,9 +131,12 @@ func nodeCreateFunction(ctx *Context, node *tree.CreateFunction) (vitess.Stateme
131131 }, nil
132132}
133133
134- func createAnonymousCompositeType (returnTypes []tree.SimpleColumnDef ) * pgtypes.DoltgresType {
135- attrs := make ([]pgtypes.CompositeAttribute , len (returnTypes ))
136- for i , fieldType := range returnTypes {
134+ // createAnonymousCompositeType creates a new DoltgresType for the anonymous composite return
135+ // type for a function, as represented by the |fieldTypes| that were specified in the function
136+ // definition.
137+ func createAnonymousCompositeType (fieldTypes []tree.SimpleColumnDef ) * pgtypes.DoltgresType {
138+ attrs := make ([]pgtypes.CompositeAttribute , len (fieldTypes ))
139+ for i , fieldType := range fieldTypes {
137140 attrs [i ] = pgtypes .NewCompositeAttribute (nil , id .Null , fieldType .Name .String (),
138141 id .NewType ("" , fieldType .Type .SQLString ()), int16 (i ), "" )
139142 }
0 commit comments