The characteristics of the fruit is determined by the mother plant and is not affected by cross-pollination. However, there will be a problem if seed is saved for the next year from a flower that was cross-pollinated. All bets are off on what you will get if that happens.
So, how do we end up with this weird fruit? Though it could be that the gardener had forgotten exactly what he planted, more likely is that the seed he planted had been cross-pollinated before packaging. Another possibility is that it came from seed that came from fruit that had rotted in the garden the previous year. Regardless, don’t worry about planting different cultivars of squash or cucumbers or melons close to one another. Though cross-pollination may occur in some cases, the fruit will not be affected. (Ward Upham)