Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.721
diff -u -r1.721 comment.module
--- modules/comment/comment.module	8 Jun 2009 05:12:15 -0000	1.721
+++ modules/comment/comment.module	8 Jun 2009 19:44:08 -0000
@@ -1155,15 +1155,15 @@
     elseif ($node->comment_count || user_access('administer comments')) {
 
       // Multiple comment view.
-      $query = db_select('comment', 'c')->extend('PagerDefault');
+      $query = db_select('comment', 'c');
+      $query = $query->extend('PagerDefault')->limit($comments_per_page);
       $query->join('users', 'u', 'c.uid = u.uid');
       $query->addField('u', 'name', 'registered_name');
       $query
         ->fields('c', array('cid', 'pid', 'nid', 'subject', 'comment', 'format', 'timestamp', 'name', 'mail', 'homepage', 'thread', 'status'))
         ->fields('u', array('uid', 'signature', 'picture', 'data'))
         ->condition('c.nid', $nid)
-        ->addTag('node_access')
-        ->limit($comments_per_page);
+        ->addTag('node_access');
 
       $count_query = db_select('comment', 'c');
       $count_query
@@ -1185,7 +1185,6 @@
         $query->orderBy('SUBSTRING(c.thread, 1, (LENGTH(c.thread) - 1))', 'ASC');
       }
 
-      $query->setCountQuery($count_query);
       $result = $query->execute();
 
       $divs = 0;
