diff --git a/go/vt/vtgate/grpcvtgateservice/server.go b/go/vt/vtgate/grpcvtgateservice/server.go index a439fa0aae9..115936bface 100644 --- a/go/vt/vtgate/grpcvtgateservice/server.go +++ b/go/vt/vtgate/grpcvtgateservice/server.go @@ -228,8 +228,15 @@ func (vtg *VTGate) ResolveTransaction(ctx context.Context, request *vtgatepb.Res func (vtg *VTGate) VStream(request *vtgatepb.VStreamRequest, stream vtgateservicepb.Vitess_VStreamServer) (err error) { defer vtg.server.HandlePanic(&err) ctx := withCallerIDContext(stream.Context(), request.CallerId) + + // For backward compatibility. + // The mysql query equivalent has logic to use topodatapb.TabletType_PRIMARY if tablet_type is not set. + tabletType := request.TabletType + if tabletType == topodatapb.TabletType_UNKNOWN { + tabletType = topodatapb.TabletType_PRIMARY + } vtgErr := vtg.server.VStream(ctx, - request.TabletType, + tabletType, request.Vgtid, request.Filter, request.Flags,