From 21564fd6b496bcc0b06e37dbf1f6e53b5d8a4795 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 11 Nov 2024 16:55:26 -0500 Subject: [PATCH] Revert Fields and bindLocations comparison change It failed for some materializations Signed-off-by: Matt Lord --- go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go b/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go index 6cf88a48f75..62d6166b5ca 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go +++ b/go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go @@ -617,10 +617,9 @@ func valsEqual(v1, v2 sqltypes.Value) bool { // on the source: sum/count for aggregation queries, for example. func (tp *TablePlan) appendFromRow(buf *bytes2.Buffer, row *querypb.Row) error { bindLocations := tp.BulkInsertValues.BindLocations() - usedFieldCnt := len(tp.Fields) - len(tp.FieldsToSkip) - if usedFieldCnt != len(bindLocations) { + if len(tp.Fields) < len(bindLocations) { return vterrors.Errorf(vtrpcpb.Code_INTERNAL, "wrong number of fields: got %d fields for %d bind locations", - usedFieldCnt, len(bindLocations)) + len(tp.Fields), len(bindLocations)) } // Bind field values to locations.