Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
[vexec] Backport fix for typechange in sqlparser
Browse files Browse the repository at this point in the history
In upstream (where the previous commit was cherry-picked from), all of
the `New<columntype>` functions take a `string` argument, but previously
(and therefore in our vtctld branch) they took a `[]byte`.

Signed-off-by: Andrew Mason <amason@slack-corp.com>
  • Loading branch information
ajm188 committed Jun 15, 2021
1 parent f7be4b4 commit a4a5594
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/vt/vtctl/workflow/vexec/query_planner.go
Expand Up @@ -320,7 +320,7 @@ func (planner *VReplicationLogQueryPlanner) planSelect(sel *sqlparser.Select) (Q
var expr sqlparser.Expr
switch len(streamIDs) {
case 0: // WHERE vreplication_log.vrepl_id IN () => WHERE 1 != 1
one := sqlparser.NewIntLiteral("1")
one := sqlparser.NewIntLiteral([]byte("1"))
expr = &sqlparser.ComparisonExpr{
Operator: sqlparser.NotEqualOp,
Left: one,
Expand All @@ -332,12 +332,12 @@ func (planner *VReplicationLogQueryPlanner) planSelect(sel *sqlparser.Select) (Q
Left: &sqlparser.ColName{
Name: sqlparser.NewColIdent("vrepl_id"),
},
Right: sqlparser.NewIntLiteral(fmt.Sprintf("%d", streamIDs[0])),
Right: sqlparser.NewIntLiteral([]byte(fmt.Sprintf("%d", streamIDs[0]))),
}
default: // WHERE vreplication_log.vrepl_id IN (?)
vals := []sqlparser.Expr{}
for _, streamID := range streamIDs {
vals = append(vals, sqlparser.NewIntLiteral(fmt.Sprintf("%d", streamID)))
vals = append(vals, sqlparser.NewIntLiteral([]byte(fmt.Sprintf("%d", streamID))))
}

var tuple sqlparser.ValTuple = vals
Expand Down

0 comments on commit a4a5594

Please sign in to comment.