diff --git a/go/vt/vtgate/engine/rename_fields.go b/go/vt/vtgate/engine/rename_fields.go index 9983c5036e1..b45ea04071c 100644 --- a/go/vt/vtgate/engine/rename_fields.go +++ b/go/vt/vtgate/engine/rename_fields.go @@ -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