code: func (e *InsertExec) updateDupRow(row toBeCheckedRow, handle int64, onDuplicate []*expression.Assignment) error {
  	oldRow, err := e.getOldRow(e.ctx, e.Table, handle)
  	if err != nil {
  		logutil.Logger(context.Background()).Error("get old row failed when insert on dup", zap.Int64("handle", handle), zap.String("toBeInsertedRow", types.DatumsToStrNoErr(row.row)))
  		return err
  	}
  	// Do update row.
  	updatedRow, handleChanged, newHandle, err := e.doDupRowUpdate(handle, oldRow, row.row, onDuplicate)
  	if e.ctx.GetSessionVars().StmtCtx.DupKeyAsWarning && kv.ErrKeyExists.Equal(err) {
  		e.ctx.GetSessionVars().StmtCtx.AppendWarning(err)
  		return nil
  	}
  	if err != nil {
  		return err
  	}
  	return e.updateDupKeyValues(handle, newHandle, handleChanged, oldRow, updatedRow)
  }
docs: // updateDupRow updates a duplicate row to a new row.