--- modules/dblog/dblog.admin.inc.1.6.2.1	2009-04-03 18:14:47.000000000 +0100
+++ modules/dblog/dblog.admin.inc	2009-05-29 22:25:38.000000000 +0100
@@ -108,7 +108,7 @@ function dblog_top($type) {
     array('data' => t('Message'), 'field' => 'message')
   );
 
-  $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables ". tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type);
+  $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables ". tablesort_sql($header), 30, 0, "SELECT COUNT(*) FROM (SELECT COUNT(*) FROM {watchdog} WHERE type = '%s' GROUP BY message, variables) AS w", $type);
 
   $rows = array();
   while ($dblog = db_fetch_object($result)) {
