From 3fc86a4b8958df23e53826b9df2e3f06f7a93786 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Mon, 26 Aug 2024 07:15:01 +0200 Subject: [PATCH] comment Signed-off-by: Andres Taylor --- go/vt/vtgate/planbuilder/operators/SQL_builder.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/vt/vtgate/planbuilder/operators/SQL_builder.go b/go/vt/vtgate/planbuilder/operators/SQL_builder.go index 1f6ce10b99e..3972ac8290a 100644 --- a/go/vt/vtgate/planbuilder/operators/SQL_builder.go +++ b/go/vt/vtgate/planbuilder/operators/SQL_builder.go @@ -135,6 +135,8 @@ func (qb *queryBuilder) addPredicate(expr sqlparser.Expr) { case *sqlparser.Delete: addPred = stmt.AddWhere case nil: + // this would happen if we are adding a predicate on a dual query. + // we use this when building recursive CTE queries sel := &sqlparser.Select{} addPred = sel.AddWhere qb.stmt = sel