From cdbab82ffcb33d39cdca5b44535f2a804a3ff1a2 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Tue, 4 Feb 2025 08:35:25 +0100 Subject: [PATCH] fixing vreplication bug leading to panic Signed-off-by: Andres Taylor --- go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go b/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go index 4c9da688169..5c2b0f21dc5 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go +++ b/go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go @@ -309,7 +309,7 @@ func buildTablePlan(tableName string, rule *binlogdatapb.Rule, colInfos []*Colum // if there are no columns being selected the select expression can be empty, so we "select 1" so we have a valid // select to get a row back - if len(tpb.sendSelect.SelectExprs.Exprs) == 0 { + if tpb.sendSelect.SelectExprs == nil || len(tpb.sendSelect.SelectExprs.Exprs) == 0 { tpb.sendSelect.AddSelectExpr(&sqlparser.AliasedExpr{ Expr: sqlparser.NewIntLiteral("1"), })