bug 10496 DISTINCT option logic incorrect in Database::makeSelectOptions