Reaction involving markovnikov's rule
Indeed the second carbocation is formed.  It's favored by the chlorine atom being able to delocalize the charge through resonance, draw resonance hybrids for the second cation and you should see it.  In a sense you might say that the carbon bonded to chlorine is more effectively substituted for stabilizing the cation and so the Markovnikov rule is "bent" accordingly.

The usual version of the Markovnikov rule is for hydrocarbon substrates.