Skip to content

Commit 3b4bcc6

Browse files
committed
fixup: minor cleanup
1 parent b4209fe commit 3b4bcc6

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

server/ast/create_function.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

server/functions/framework/provider.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ import (
1919

2020
"github.com/dolthub/go-mysql-server/sql"
2121

22-
"github.com/dolthub/doltgresql/core/extensions"
23-
2422
"github.com/dolthub/doltgresql/core"
23+
"github.com/dolthub/doltgresql/core/extensions"
2524
"github.com/dolthub/doltgresql/core/id"
2625
pgtypes "github.com/dolthub/doltgresql/server/types"
2726
)

testing/go/create_function_plpgsql_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ $$ LANGUAGE plpgsql;`},
649649
},
650650
},
651651
},
652-
653652
{
654653
Name: "RETURNS TABLE with param",
655654
SetUpScript: []string{

0 commit comments

Comments
 (0)