Index: includes/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/Attic/database.inc,v
retrieving revision 1.92.2.9
diff -u -r1.92.2.9 database.inc
--- includes/database.inc	1 Feb 2010 16:32:10 -0000	1.92.2.9
+++ includes/database.inc	15 Jul 2010 00:20:23 -0000
@@ -389,16 +389,20 @@
 }
 
 /**
- * Adds the DISTINCT flag to the supplied query if a DISTINCT doesn't already
- * exist in the query. Returns the altered query.
+ * Adds the DISTINCT flag to the supplied queryand returns the altered query.
  *
- * This will not, and never did guarantee that you will obtain distinct 
- * values of $table.$field.
+ * The supplied query should not contain a DISTINCT flag. This will not, and
+ * never did guarantee that you will obtain distinct values of $table.$field.
  *
- * @param $table Unused. Kept to remain API compatibility.
- * @param $field Unused. Kept to remain API compatibility.
- * @param $query Query to which the DISTINCT flag should be applied.
- * @return SQL query with the DISTINCT flag set.
+ * @param $table
+ *   Unused. Kept to retain API compatibility.
+ * @param $field
+ *   Unused. Kept to retain API compatibility.
+ * @param $query
+ *   Query to which the DISTINCT flag should be applied.
+ *
+ * @return
+ *   SQL query with the DISTINCT flag set.
  */
 function db_distinct_field($table, $field, $query) {
   $matches = array();
@@ -406,6 +410,7 @@
     // Only add distinct to the outer SELECT to avoid messing up subqueries.
     $query = preg_replace('/^SELECT/i', 'SELECT DISTINCT', $query);
   }
+
   return $query;
 }
 
