Skip to content

Commit cdbab82

Browse files
committed
fixing vreplication bug leading to panic
Signed-off-by: Andres Taylor <andres@planetscale.com>
1 parent e24d767 commit cdbab82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/vt/vttablet/tabletmanager/vreplication/table_plan_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func buildTablePlan(tableName string, rule *binlogdatapb.Rule, colInfos []*Colum
309309

310310
// if there are no columns being selected the select expression can be empty, so we "select 1" so we have a valid
311311
// select to get a row back
312-
if len(tpb.sendSelect.SelectExprs.Exprs) == 0 {
312+
if tpb.sendSelect.SelectExprs == nil || len(tpb.sendSelect.SelectExprs.Exprs) == 0 {
313313
tpb.sendSelect.AddSelectExpr(&sqlparser.AliasedExpr{
314314
Expr: sqlparser.NewIntLiteral("1"),
315315
})

0 commit comments

Comments
 (0)