Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
systay committed Feb 25, 2025
1 parent 950edc4 commit eed7ff6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go/vt/vtgate/planbuilder/operators/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func breakValuesJoinExpressionInLHS(ctx *plancontext.PlanningContext,
result.Original = sqlparser.Clone(expr)
result.PureLHS = true
result.RHS = expr
_ = sqlparser.Rewrite(expr, func(cursor *sqlparser.Cursor) bool {
_ = sqlparser.Rewrite(expr, func(cursor *sqlparser.Cursor) bool { // TODO: rewrite to use Walk instead (no pun intended, promise!)
node := cursor.Node()
col, ok := node.(*sqlparser.ColName)
if !ok {
Expand Down
6 changes: 4 additions & 2 deletions go/vt/vtgate/planbuilder/operators/phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ func rewriteApplyToValues(ctx *plancontext.PlanningContext, op Operator) Operato
return true
}

cursor.Replace(&sqlparser.ColName{
newCol := &sqlparser.ColName{
Name: sqlparser.NewIdentifierCI(getValuesJoinColName(ctx, vj.ValuesDestination, valuesTableID, col)),
Qualifier: sqlparser.NewTableName(vj.ValuesDestination),
})
}
ctx.SemTable.CopyExprInfo(pred.Original, newCol)
cursor.Replace(newCol)
return true
})

Expand Down

0 comments on commit eed7ff6

Please sign in to comment.