541,542c
    $count_alias = $this->query->add_field(NULL, $field, 'num_records', 
                                           array('count' => true, 'distinct' => $distinct));
.
538c
      $distinct = true;
    } else {
      $distinct = false;
.
