Getting All Solutions of Constraint Satisfaction Problems in Polynomial Time