From eeee919382635a52e50c7990d85695446705afbb Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Mon, 22 Aug 2022 19:08:35 +0000 Subject: [PATCH] colexec: make sure to init child op chains in AND and OR operators Previously, we forgot to call `Init` on the side operator chains of AND and OR projection operators, and this is now fixed. The impact of the bug is minor though (like a nil context when the tracing is enabled). Release justification: bug fix. Release note: None --- pkg/sql/colexec/and_or_projection.eg.go | 12 ++++++++++++ pkg/sql/colexec/and_or_projection_tmpl.go | 2 ++ 2 files changed, 14 insertions(+) diff --git a/pkg/sql/colexec/and_or_projection.eg.go b/pkg/sql/colexec/and_or_projection.eg.go index e172f191635f..c897cdbfc615 100644 --- a/pkg/sql/colexec/and_or_projection.eg.go +++ b/pkg/sql/colexec/and_or_projection.eg.go @@ -174,6 +174,8 @@ func (o *andProjOp) Init(ctx context.Context) { return } o.input.Init(o.Ctx) + o.leftProjOpChain.Init(o.Ctx) + o.rightProjOpChain.Init(o.Ctx) } // Next is part of the colexecop.Operator interface. @@ -612,6 +614,8 @@ func (o *andRightNullProjOp) Init(ctx context.Context) { return } o.input.Init(o.Ctx) + o.leftProjOpChain.Init(o.Ctx) + o.rightProjOpChain.Init(o.Ctx) } // Next is part of the colexecop.Operator interface. @@ -1017,6 +1021,8 @@ func (o *andLeftNullProjOp) Init(ctx context.Context) { return } o.input.Init(o.Ctx) + o.leftProjOpChain.Init(o.Ctx) + o.rightProjOpChain.Init(o.Ctx) } // Next is part of the colexecop.Operator interface. @@ -1403,6 +1409,8 @@ func (o *orProjOp) Init(ctx context.Context) { return } o.input.Init(o.Ctx) + o.leftProjOpChain.Init(o.Ctx) + o.rightProjOpChain.Init(o.Ctx) } // Next is part of the colexecop.Operator interface. @@ -1842,6 +1850,8 @@ func (o *orRightNullProjOp) Init(ctx context.Context) { return } o.input.Init(o.Ctx) + o.leftProjOpChain.Init(o.Ctx) + o.rightProjOpChain.Init(o.Ctx) } // Next is part of the colexecop.Operator interface. @@ -2248,6 +2258,8 @@ func (o *orLeftNullProjOp) Init(ctx context.Context) { return } o.input.Init(o.Ctx) + o.leftProjOpChain.Init(o.Ctx) + o.rightProjOpChain.Init(o.Ctx) } // Next is part of the colexecop.Operator interface. diff --git a/pkg/sql/colexec/and_or_projection_tmpl.go b/pkg/sql/colexec/and_or_projection_tmpl.go index e37dcf06a32e..f544ee27ba9c 100644 --- a/pkg/sql/colexec/and_or_projection_tmpl.go +++ b/pkg/sql/colexec/and_or_projection_tmpl.go @@ -149,6 +149,8 @@ func (o *_OP_LOWERProjOp) Init(ctx context.Context) { return } o.input.Init(o.Ctx) + o.leftProjOpChain.Init(o.Ctx) + o.rightProjOpChain.Init(o.Ctx) } // Next is part of the colexecop.Operator interface.