Skip to content

Commit

Permalink
clean-up: remove unneeded table type uses
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <andres@planetscale.com>
  • Loading branch information
systay committed Feb 14, 2025
1 parent f571e10 commit 149f8f8
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 644 deletions.
10 changes: 4 additions & 6 deletions go/vt/vtgate/engine/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"

topodatapb "vitess.io/vitess/go/vt/proto/topodata"
"vitess.io/vitess/go/vt/sqlparser"

"vitess.io/vitess/go/sqltypes"
Expand Down Expand Up @@ -136,11 +135,10 @@ func (del *Delete) description() PrimitiveDescription {
}

return PrimitiveDescription{
OperatorType: "Delete",
Keyspace: del.Keyspace,
Variant: del.Opcode.String(),
TargetTabletType: topodatapb.TabletType_PRIMARY,
Other: other,
OperatorType: "Delete",
Keyspace: del.Keyspace,
Variant: del.Opcode.String(),
Other: other,
}
}

Expand Down
6 changes: 2 additions & 4 deletions go/vt/vtgate/engine/dml_with_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"context"
"fmt"

topodatapb "vitess.io/vitess/go/vt/proto/topodata"
"vitess.io/vitess/go/vt/vterrors"

"vitess.io/vitess/go/sqltypes"
Expand Down Expand Up @@ -185,8 +184,7 @@ func (dml *DMLWithInput) description() PrimitiveDescription {
other["BindVars"] = bvList
}
return PrimitiveDescription{
OperatorType: "DMLWithInput",
TargetTabletType: topodatapb.TabletType_PRIMARY,
Other: other,
OperatorType: "DMLWithInput",
Other: other,
}
}
10 changes: 4 additions & 6 deletions go/vt/vtgate/engine/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/key"
querypb "vitess.io/vitess/go/vt/proto/query"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc"
"vitess.io/vitess/go/vt/sqlparser"
"vitess.io/vitess/go/vt/srvtopo"
Expand Down Expand Up @@ -389,11 +388,10 @@ func (ins *Insert) description() PrimitiveDescription {
}

return PrimitiveDescription{
OperatorType: "Insert",
Keyspace: ins.Keyspace,
Variant: ins.Opcode.String(),
TargetTabletType: topodatapb.TabletType_PRIMARY,
Other: other,
OperatorType: "Insert",
Keyspace: ins.Keyspace,
Variant: ins.Opcode.String(),
Other: other,
}
}

Expand Down
10 changes: 4 additions & 6 deletions go/vt/vtgate/engine/insert_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/key"
querypb "vitess.io/vitess/go/vt/proto/query"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc"
"vitess.io/vitess/go/vt/sqlparser"
"vitess.io/vitess/go/vt/srvtopo"
Expand Down Expand Up @@ -336,11 +335,10 @@ func (ins *InsertSelect) description() PrimitiveDescription {
}

return PrimitiveDescription{
OperatorType: "Insert",
Keyspace: ins.Keyspace,
Variant: "Select",
TargetTabletType: topodatapb.TabletType_PRIMARY,
Other: other,
OperatorType: "Insert",
Keyspace: ins.Keyspace,
Variant: "Select",
Other: other,
}
}

Expand Down
5 changes: 0 additions & 5 deletions go/vt/vtgate/engine/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"vitess.io/vitess/go/vt/vtgate/vindexes"

querypb "vitess.io/vitess/go/vt/proto/query"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
)

var _ Primitive = (*Route)(nil)
Expand All @@ -58,10 +57,6 @@ type Route struct {
// Route does not need transaction handling
noTxNeeded

// TargetTabletType specifies an explicit target destination tablet type
// this is only used in conjunction with TargetDestination
TargetTabletType topodatapb.TabletType

// Query specifies the query to be executed.
Query string

Expand Down
11 changes: 4 additions & 7 deletions go/vt/vtgate/engine/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import (

"vitess.io/vitess/go/vt/vtgate/evalengine"

topodatapb "vitess.io/vitess/go/vt/proto/topodata"

"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/srvtopo"
"vitess.io/vitess/go/vt/vtgate/vindexes"
Expand Down Expand Up @@ -219,10 +217,9 @@ func (upd *Update) description() PrimitiveDescription {
}

return PrimitiveDescription{
OperatorType: "Update",
Keyspace: upd.Keyspace,
Variant: upd.Opcode.String(),
TargetTabletType: topodatapb.TabletType_PRIMARY,
Other: other,
OperatorType: "Update",
Keyspace: upd.Keyspace,
Variant: upd.Opcode.String(),
Other: other,
}
}
4 changes: 1 addition & 3 deletions go/vt/vtgate/engine/upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"vitess.io/vitess/go/sqltypes"
querypb "vitess.io/vitess/go/vt/proto/query"
topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc"
"vitess.io/vitess/go/vt/vterrors"
)
Expand Down Expand Up @@ -131,7 +130,6 @@ func (u *Upsert) Inputs() ([]Primitive, []map[string]any) {

func (u *Upsert) description() PrimitiveDescription {
return PrimitiveDescription{
OperatorType: "Upsert",
TargetTabletType: topodatapb.TabletType_PRIMARY,
OperatorType: "Upsert",
}
}
Loading

0 comments on commit 149f8f8

Please sign in to comment.