Skip to content

Commit

Permalink
Avoiding panic in RenameFields.renameFields method
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Aug 31, 2021
1 parent 027d616 commit 6e97c45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/vt/vtgate/engine/rename_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func (r *RenameFields) Execute(vcursor VCursor, bindVars map[string]*querypb.Bin
}

func (r *RenameFields) renameFields(qr *sqltypes.Result) {
if len(r.Indices) != len(qr.Fields) {
return
}
for ind, index := range r.Indices {
colName := r.Cols[ind]
qr.Fields[index].Name = colName
Expand Down

0 comments on commit 6e97c45

Please sign in to comment.