Skip to content

Commit

Permalink
Correct rowInfo cache updates with skipped cols
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Nov 7, 2024
1 parent a5472f4 commit ab65f0c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,17 @@ func (tp *TablePlan) appendFromRow(buf *bytes2.Buffer, row *querypb.Row) error {
}
}
} else {
for i, ri := range tp.rowInfo {
// i is the index of the field in the plan and row while n is the index of the
// field in the column info list, which is a subset of the others when there
// are fields we need to skip such as generated columns.
n := 0
for i := range tp.Fields {
length := row.Lengths[i]
ri.length = length
ri.offset = offset
if !tp.FieldsToSkip[strings.ToLower(tp.Fields[i].Name)] {
tp.rowInfo[n].length = length
tp.rowInfo[n].offset = offset
n++
}
if length > 0 {
offset += row.Lengths[i]
}
Expand Down

0 comments on commit ab65f0c

Please sign in to comment.