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 20:01:00 -0000
@@ -1155,19 +1155,19 @@
     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->addExpression('COUNT(*)');
       $count_query
-        ->fields('c', array('cid'))
         ->condition('c.nid', $nid)
         ->addTag('node_access');
 
