Skip to content

Commit

Permalink
Minor changes after self review of new code
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Mar 10, 2024
1 parent 35492ed commit 60f7d05
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions go/vt/vttablet/tabletmanager/rpc_vreplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ func (tm *TabletManager) buildReadVReplicationWorkflowsQuery(req *tabletmanagerd
bindVars := map[string]*querypb.BindVariable{
"db": sqltypes.StringBindVariable(tm.DBConfigs.DBName),
}

additionalPredicates := strings.Builder{}
if req.GetExcludeFrozen() {
additionalPredicates.WriteString(fmt.Sprintf(" and message != '%s'", workflow.Frozen))
Expand Down Expand Up @@ -581,12 +582,9 @@ func (tm *TabletManager) buildReadVReplicationWorkflowsQuery(req *tabletmanagerd
}
additionalPredicates.WriteByte(')')
}

parsed := sqlparser.BuildParsedQuery(sqlReadVReplicationWorkflows, sidecar.GetIdentifier(), ":db", additionalPredicates.String())
query, err := parsed.GenerateQuery(bindVars, nil)
if err != nil {
return "", err
}
return query, nil
return parsed.GenerateQuery(bindVars, nil)
}

// buildUpdateVReplicationWorkflowsQuery builds the SQL query used to update
Expand Down Expand Up @@ -647,6 +645,6 @@ func (tm *TabletManager) buildUpdateVReplicationWorkflowsQuery(req *tabletmanage
}
predicates.WriteByte(')')
}
query := sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflows, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query
return query, nil

return sqlparser.BuildParsedQuery(sqlUpdateVReplicationWorkflows, sidecar.GetIdentifier(), sets.String(), tm.DBConfigs.DBName, predicates.String()).Query, nil
}

0 comments on commit 60f7d05

Please sign in to comment.