Skip to content

Commit

Permalink
refactor: remove unneeded functions
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Mar 13, 2024
1 parent 83d3f62 commit 1a19f89
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions go/vt/vtgate/planbuilder/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ func buildDDLPlans(ctx context.Context, sql string, ddlStatement sqlparser.DDLSt
}
err = checkFKError(vschema, ddlStatement, keyspace)
case *sqlparser.CreateView:
destination, keyspace, err = buildCreateView(ctx, vschema, ddl, reservedVars, enableOnlineDDL, enableDirectDDL)
destination, keyspace, err = buildCreateViewCommon(ctx, vschema, reservedVars, enableOnlineDDL, enableDirectDDL, ddl.Select, ddl)
case *sqlparser.AlterView:
destination, keyspace, err = buildAlterView(ctx, vschema, ddl, reservedVars, enableOnlineDDL, enableDirectDDL)
destination, keyspace, err = buildCreateViewCommon(ctx, vschema, reservedVars, enableOnlineDDL, enableDirectDDL, ddl.Select, ddl)
case *sqlparser.DropView:
destination, keyspace, err = buildDropView(vschema, ddlStatement)
case *sqlparser.DropTable:
Expand Down Expand Up @@ -192,26 +192,6 @@ func findTableDestinationAndKeyspace(vschema plancontext.VSchema, ddlStatement s
return destination, keyspace, nil
}

func buildAlterView(
ctx context.Context,
vschema plancontext.VSchema,
ddl *sqlparser.AlterView,
reservedVars *sqlparser.ReservedVars,
enableOnlineDDL, enableDirectDDL bool,
) (key.Destination, *vindexes.Keyspace, error) {
return buildCreateViewCommon(ctx, vschema, reservedVars, enableOnlineDDL, enableDirectDDL, ddl.Select, ddl)
}

func buildCreateView(
ctx context.Context,
vschema plancontext.VSchema,
ddl *sqlparser.CreateView,
reservedVars *sqlparser.ReservedVars,
enableOnlineDDL, enableDirectDDL bool,
) (key.Destination, *vindexes.Keyspace, error) {
return buildCreateViewCommon(ctx, vschema, reservedVars, enableOnlineDDL, enableDirectDDL, ddl.Select, ddl)
}

func buildCreateViewCommon(
ctx context.Context,
vschema plancontext.VSchema,
Expand Down

0 comments on commit 1a19f89

Please sign in to comment.