A vice-squad officer and a suspect were shot Wednesday evening outside the Cracker Barrel restaurant at 3703 Hillsborough Road, off Interstate 85, in Durham, authorities said.