From 6976baa21e4fa5f095a361234ce2867e516279c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Taylor?= Date: Tue, 26 Mar 2024 15:54:07 +0100 Subject: [PATCH] cleanup: make sure we use the right Offset (#15576) --- go/vt/vtgate/planbuilder/operators/projection.go | 5 ++++- go/vt/vtgate/planbuilder/operators/projection_pushing.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go/vt/vtgate/planbuilder/operators/projection.go b/go/vt/vtgate/planbuilder/operators/projection.go index f3604a30620..787d3a3b1de 100644 --- a/go/vt/vtgate/planbuilder/operators/projection.go +++ b/go/vt/vtgate/planbuilder/operators/projection.go @@ -553,7 +553,10 @@ func (p *Projection) planOffsets(ctx *plancontext.PlanningContext) Operator { for _, pe := range ap { switch pe.Info.(type) { - case *Offset, *EvalEngine: + case Offset: + pe.EvalExpr = useOffsets(ctx, pe.EvalExpr, p) + continue + case *EvalEngine: continue } diff --git a/go/vt/vtgate/planbuilder/operators/projection_pushing.go b/go/vt/vtgate/planbuilder/operators/projection_pushing.go index 6df1caee5de..c1118184e06 100644 --- a/go/vt/vtgate/planbuilder/operators/projection_pushing.go +++ b/go/vt/vtgate/planbuilder/operators/projection_pushing.go @@ -144,7 +144,7 @@ func pushProjectionToOuter(ctx *plancontext.PlanningContext, p *Projection, sq * outer := TableID(sq.Outer) for _, pe := range ap { - _, isOffset := pe.Info.(*Offset) + _, isOffset := pe.Info.(Offset) if isOffset { continue } @@ -186,7 +186,7 @@ func pushProjectionToOuterContainer(ctx *plancontext.PlanningContext, p *Project outer := TableID(src.Outer) for _, pe := range ap { - _, isOffset := pe.Info.(*Offset) + _, isOffset := pe.Info.(Offset) if isOffset { continue }